diff options
Diffstat (limited to 'users/tazjin/rlox/src/treewalk/interpreter.rs')
-rw-r--r-- | users/tazjin/rlox/src/treewalk/interpreter.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/users/tazjin/rlox/src/treewalk/interpreter.rs b/users/tazjin/rlox/src/treewalk/interpreter.rs index 1263e6cb810b..3285775bbec6 100644 --- a/users/tazjin/rlox/src/treewalk/interpreter.rs +++ b/users/tazjin/rlox/src/treewalk/interpreter.rs @@ -200,7 +200,9 @@ impl Lox for Interpreter { fn interpret(&mut self, code: String) -> Result<Value, Vec<Error>> { let chars: Vec<char> = code.chars().collect(); - let mut program = scanner::scan(&chars).and_then(|tokens| parser::parse(tokens))?; + let mut program = scanner::scan(&chars) + .map_err(|errors| errors.into_iter().map(Into::into).collect()) + .and_then(|tokens| parser::parse(tokens))?; let globals = self .env |