From eb681fbff94d36a1630474da971352587a4d24af Mon Sep 17 00:00:00 2001 From: greg Date: Sun, 13 May 2018 13:40:11 -0700 Subject: [PATCH] Make parse error message nicer --- schala-lang/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/schala-lang/src/lib.rs b/schala-lang/src/lib.rs index d90ff91..1038827 100644 --- a/schala-lang/src/lib.rs +++ b/schala-lang/src/lib.rs @@ -58,7 +58,7 @@ fn tokenizing(_handle: &mut Schala, input: &str, comp: Option<&mut UnfinishedCom } } -fn parsing(_handle: &mut Schala, input: Vec, comp: Option<&mut UnfinishedComputation>) -> Result { +fn parsing(_handle: &mut Schala, input: Vec, comp: Option<&mut UnfinishedComputation>) -> Result { let (ast, trace) = parsing::parse(input); comp.map(|comp| { @@ -66,7 +66,7 @@ fn parsing(_handle: &mut Schala, input: Vec, comp: Option<&mu comp.add_artifact(TraceArtifact::new_parse_trace(trace)); comp.add_artifact(TraceArtifact::new("ast", format!("{:#?}", ast))); }); - ast + ast.map_err(|err| err.msg) } fn symbol_table(handle: &mut Schala, input: parsing::AST, comp: Option<&mut UnfinishedComputation>) -> Result {