Symbol table debug needs to happen before type check
This commit is contained in:
parent
bb57da564d
commit
74d3828c71
@ -62,8 +62,13 @@ impl ProgrammingLanguageInterface for Schala {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if options.debug_symbol_table {
|
||||||
|
let text = self.type_context.debug_symbol_table();
|
||||||
|
output.add_artifact(TraceArtifact::new("symbol_table", text));
|
||||||
|
}
|
||||||
|
|
||||||
match self.type_context.type_check(&ast) {
|
match self.type_context.type_check(&ast) {
|
||||||
Ok(t) => (),
|
Ok(_) => (),
|
||||||
Err(msg) => {
|
Err(msg) => {
|
||||||
output.add_artifact(TraceArtifact::new("type_check", msg));
|
output.add_artifact(TraceArtifact::new("type_check", msg));
|
||||||
output.add_output(format!("Type error"));
|
output.add_output(format!("Type error"));
|
||||||
@ -71,11 +76,6 @@ impl ProgrammingLanguageInterface for Schala {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if options.debug_symbol_table {
|
|
||||||
let text = self.type_context.debug_symbol_table();
|
|
||||||
output.add_artifact(TraceArtifact::new("symbol_table", text));
|
|
||||||
}
|
|
||||||
|
|
||||||
let evaluation_output = self.state.evaluate(ast);
|
let evaluation_output = self.state.evaluate(ast);
|
||||||
let mut acc = String::new();
|
let mut acc = String::new();
|
||||||
let mut iter = evaluation_output.iter().peekable();
|
let mut iter = evaluation_output.iter().peekable();
|
||||||
|
Loading…
Reference in New Issue
Block a user