diff --git a/schala-lang/src/lib.rs b/schala-lang/src/lib.rs index 535ac34..4ccb115 100644 --- a/schala-lang/src/lib.rs +++ b/schala-lang/src/lib.rs @@ -114,11 +114,11 @@ impl ProgrammingLanguageInterface for Schala { fn get_stages(&self) -> Vec { vec![ - format!("tokenizing"), - format!("parsing"), //TODO handle both types of this - format!("symbol_table"), - format!("typechecking"), - format!("eval") + format!("tokenizing_stage"), + format!("parsing_stage"), //TODO handle both types of this + format!("symbol_table_stage"), + format!("typechecking_stage"), + format!("eval_stage") ] } } diff --git a/schala-repl/src/language.rs b/schala-repl/src/language.rs index 4187160..2975be8 100644 --- a/schala-repl/src/language.rs +++ b/schala-repl/src/language.rs @@ -203,15 +203,13 @@ macro_rules! pass_chain_helper { { let pass_name = stringify!($pass); let output = { - let debug_pointer: Option<&mut UnfinishedComputation> = { - //TODO this is janky fix it - let debug_condition = ($options.debug.tokens && pass_name == "tokenizing_stage") - || ($options.debug.parse_tree && pass_name == "parsing_stage") - || ($options.debug.symbol_table && pass_name == "symbol_table_stage") - || (pass_name == "typechecking_stage"); - if debug_condition { Some(&mut $comp) } else { None } + let ref debug_set = $options.debug_stages; + let debug_handle: Option<&mut UnfinishedComputation> = if debug_set.contains(pass_name) { + Some(&mut $comp) + } else { + None }; - $pass($state, $input, debug_pointer) + $pass($state, $input, debug_handle) }; match output { Ok(result) => pass_chain_helper! { ($state, $comp, $options); result $(, $rest)* },