Kill old DebugOptions struct
This commit is contained in:
parent
890e6bd4c5
commit
d524389f1d
@ -47,7 +47,7 @@ impl<'a> ProgrammingLanguageInterface for Maaru<'a> {
|
||||
|
||||
let tokens = match tokenizer::tokenize(input) {
|
||||
Ok(tokens) => {
|
||||
if options.debug.tokens {
|
||||
if let Some(_) = options.debug_passes.get("tokens") {
|
||||
output.add_artifact(TraceArtifact::new("tokens", format!("{:?}", tokens)));
|
||||
}
|
||||
tokens
|
||||
@ -59,7 +59,7 @@ impl<'a> ProgrammingLanguageInterface for Maaru<'a> {
|
||||
|
||||
let ast = match parser::parse(&tokens, &[]) {
|
||||
Ok(ast) => {
|
||||
if options.debug.ast {
|
||||
if let Some(_) = options.debug_passes.get("ast") {
|
||||
output.add_artifact(TraceArtifact::new("ast", format!("{:?}", ast)));
|
||||
}
|
||||
ast
|
||||
|
@ -6,7 +6,6 @@ pub struct LLVMCodeString(pub String);
|
||||
|
||||
#[derive(Debug, Default, Serialize, Deserialize)]
|
||||
pub struct EvalOptions {
|
||||
pub debug: DebugOptions,
|
||||
pub execution_method: ExecutionMethod,
|
||||
pub debug_passes: HashSet<String>,
|
||||
}
|
||||
@ -21,17 +20,6 @@ impl Default for ExecutionMethod {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Serialize, Deserialize)]
|
||||
pub struct DebugOptions {
|
||||
pub tokens: bool,
|
||||
pub parse_tree: bool,
|
||||
pub ast: bool,
|
||||
pub type_checking: bool,
|
||||
pub symbol_table: bool,
|
||||
pub evaluation: bool,
|
||||
pub llvm_ir: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
pub struct UnfinishedComputation {
|
||||
artifacts: HashMap<String, TraceArtifact>,
|
||||
|
@ -63,11 +63,8 @@ pub fn repl_main(generators: Vec<PLIGenerator>) {
|
||||
}
|
||||
|
||||
let mut options = EvalOptions::default();
|
||||
if let Some(ref ltrs) = option_matches.opt_str("debug") {
|
||||
options.debug.tokens = ltrs.contains("l");
|
||||
options.debug.ast = ltrs.contains("a");
|
||||
options.debug.parse_tree = ltrs.contains("r");
|
||||
options.debug.symbol_table = ltrs.contains("s");
|
||||
if let Some(_) = option_matches.opt_str("debug") {
|
||||
/* TODO - put some debug handling code here */
|
||||
}
|
||||
|
||||
let language_names: Vec<String> = languages.iter().map(|lang| {lang.get_language_name()}).collect();
|
||||
|
Loading…
Reference in New Issue
Block a user