Fix symbol-table debugging

This commit is contained in:
greg 2019-08-05 03:37:37 -07:00
parent 3b19fc5aa9
commit baf499ee5a

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> { 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(|()| { let () = handle.symbol_table.borrow_mut().add_top_level_symbols(&input)?;
comp.map(|comp| { comp.map(|comp| {
let debug = handle.symbol_table.borrow().debug_symbol_table(); let debug = handle.symbol_table.borrow().debug_symbol_table();
comp.add_artifact(debug); comp.add_artifact(debug);
}); });
input Ok(input)
})
} }
fn typechecking(input: ast::AST, handle: &mut Schala, comp: Option<&mut PassDebugArtifact>) -> Result<ast::AST, String> { fn typechecking(input: ast::AST, handle: &mut Schala, comp: Option<&mut PassDebugArtifact>) -> Result<ast::AST, String> {