From 0cf8576a774d2774b5b87c2c26f3c83ff85bc240 Mon Sep 17 00:00:00 2001 From: Erin Date: Sun, 29 Aug 2021 00:16:15 +0200 Subject: [PATCH] Eval errors are now correctly spanned --- ablescript/src/interpret.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ablescript/src/interpret.rs b/ablescript/src/interpret.rs index 656583a..cf85a10 100644 --- a/ablescript/src/interpret.rs +++ b/ablescript/src/interpret.rs @@ -355,7 +355,10 @@ impl ExecEnv { } let stmts = crate::parser::Parser::new(&code).init()?; - self.eval_stmts(&stmts)?; + self.eval_stmts(&stmts).map_err(|x| Error { + span: span.clone(), + ..x + })?; } } Ok(())