Fix symbol-table debugging

This commit is contained in:
greg 2019-08-05 03:37:37 -07:00
parent 3b19fc5aa9
commit baf499ee5a
1 changed files with 6 additions and 7 deletions

View File

@ -129,13 +129,12 @@ fn format_parse_error(error: parsing::ParseError, handle: &mut Schala) -> String
}
fn symbol_table(input: ast::AST, handle: &mut Schala, comp: Option<&mut PassDebugArtifact>) -> Result<ast::AST, String> {
handle.symbol_table.borrow_mut().add_top_level_symbols(&input).map(|()| {
comp.map(|comp| {
let debug = handle.symbol_table.borrow().debug_symbol_table();
comp.add_artifact(debug);
});
input
})
let () = handle.symbol_table.borrow_mut().add_top_level_symbols(&input)?;
comp.map(|comp| {
let debug = handle.symbol_table.borrow().debug_symbol_table();
comp.add_artifact(debug);
});
Ok(input)
}
fn typechecking(input: ast::AST, handle: &mut Schala, comp: Option<&mut PassDebugArtifact>) -> Result<ast::AST, String> {