From baf499ee5aab7f60b5a423d306d2bf30b049f813 Mon Sep 17 00:00:00 2001 From: greg Date: Mon, 5 Aug 2019 03:37:37 -0700 Subject: [PATCH] Fix symbol-table debugging --- schala-lang/language/src/schala.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/schala-lang/language/src/schala.rs b/schala-lang/language/src/schala.rs index 6f4f5ff..b479ece 100644 --- a/schala-lang/language/src/schala.rs +++ b/schala-lang/language/src/schala.rs @@ -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 { - 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 {