From 3ce85a11ee786b8135f3cb7feb99d98f8abbd8da 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(())