Semicolon
This commit is contained in:
parent
12c7cebb38
commit
ac44df8d1e
@ -195,19 +195,19 @@ pub trait ProgrammingLanguageInterface {
|
|||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! pass_chain {
|
macro_rules! pass_chain {
|
||||||
($state:expr, $($pass:path), *) => {
|
($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_export]
|
||||||
macro_rules! pass_chain_helper {
|
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);
|
let pass_name = stringify!($pass);
|
||||||
println!("Running pass {}", pass_name);
|
println!("Running pass {}", pass_name);
|
||||||
let output = $pass($state, $input);
|
let output = $pass($state, $input);
|
||||||
match output {
|
match output {
|
||||||
Ok(result) => pass_chain_helper! { $state, result $(, $rest)* },
|
Ok(result) => pass_chain_helper! { $state; result $(, $rest)* },
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
let comp = UnfinishedComputation::default();
|
let comp = UnfinishedComputation::default();
|
||||||
comp.output(Err(format!("Pass {} failed with {:?}", pass_name, err)))
|
comp.output(Err(format!("Pass {} failed with {:?}", pass_name, err)))
|
||||||
@ -216,7 +216,7 @@ macro_rules! pass_chain_helper {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
// Done
|
// Done
|
||||||
($state:expr, $final_output:expr) => {
|
($state:expr; $final_output:expr) => {
|
||||||
{
|
{
|
||||||
let comp = UnfinishedComputation::default();
|
let comp = UnfinishedComputation::default();
|
||||||
let final_output: FinishedComputation = comp.finish(Ok($final_output));
|
let final_output: FinishedComputation = comp.finish(Ok($final_output));
|
||||||
|
Loading…
Reference in New Issue
Block a user