From 57a18a0768191091f3218f003b22983567e29751 Mon Sep 17 00:00:00 2001 From: greg Date: Sun, 29 Apr 2018 22:26:40 -0700 Subject: [PATCH] Make (some) stages configurable This is janky and needs to be more general --- schala-repl/src/language.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/schala-repl/src/language.rs b/schala-repl/src/language.rs index d5e4868..53f6f4d 100644 --- a/schala-repl/src/language.rs +++ b/schala-repl/src/language.rs @@ -209,7 +209,12 @@ macro_rules! pass_chain_helper { let pass_name = stringify!($pass); println!("Running pass {}", pass_name); let output = { - let debug_pointer: Option<&mut UnfinishedComputation> = Some(&mut $comp); + 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"); + if debug_condition { Some(&mut $comp) } else { None } + }; $pass($state, $input, debug_pointer) }; match output {