Semicolon

This commit is contained in:
greg 2018-04-29 20:32:52 -07:00
parent 12c7cebb38
commit ac44df8d1e
1 changed files with 4 additions and 4 deletions

View File

@ -195,19 +195,19 @@ pub trait ProgrammingLanguageInterface {
#[macro_export]
macro_rules! pass_chain {
($state:expr, $($pass:path), *) => {
|text_input| { pass_chain_helper! { $state, text_input $(, $pass)* } }
|text_input| { pass_chain_helper! { $state; text_input $(, $pass)* } }
};
}
#[macro_export]
macro_rules! pass_chain_helper {
($state:expr, $input:expr, $pass:path $(, $rest:path)*) => {
($state:expr; $input:expr, $pass:path $(, $rest:path)*) => {
{
let pass_name = stringify!($pass);
println!("Running pass {}", pass_name);
let output = $pass($state, $input);
match output {
Ok(result) => pass_chain_helper! { $state, result $(, $rest)* },
Ok(result) => pass_chain_helper! { $state; result $(, $rest)* },
Err(err) => {
let comp = UnfinishedComputation::default();
comp.output(Err(format!("Pass {} failed with {:?}", pass_name, err)))
@ -216,7 +216,7 @@ macro_rules! pass_chain_helper {
}
};
// Done
($state:expr, $final_output:expr) => {
($state:expr; $final_output:expr) => {
{
let comp = UnfinishedComputation::default();
let final_output: FinishedComputation = comp.finish(Ok($final_output));