diff options
author | Vincent Ambo <mail@tazj.in> | 2021-01-17T08·59+0300 |
---|---|---|
committer | tazjin <mail@tazj.in> | 2021-01-17T09·34+0000 |
commit | 06a6aa5dc08ffff2ba82af2254256ea60c6a5bec (patch) | |
tree | 255922aa98b3dda00a2f941159bb71400cac27aa /users/tazjin/rlox/src/interpreter | |
parent | 9ea76fdf1ac08cd9b594ad37f6b963e78f818efc (diff) |
refactor(tazjin/rlox): Call resolver from interpreter r/2118
This makes the interpreter API a bit cleaner and allows for tighter integration between the two parts (e.g. for static globals, which are unhandled in the resolver right now). Change-Id: I363714dc2e13cefa7731b54326573e0b871295d6 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2407 Reviewed-by: tazjin <mail@tazj.in> Tested-by: BuildkiteCI
Diffstat (limited to 'users/tazjin/rlox/src/interpreter')
-rw-r--r-- | users/tazjin/rlox/src/interpreter/tests.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/users/tazjin/rlox/src/interpreter/tests.rs b/users/tazjin/rlox/src/interpreter/tests.rs index 4698583dfc11..34b1df34b0b6 100644 --- a/users/tazjin/rlox/src/interpreter/tests.rs +++ b/users/tazjin/rlox/src/interpreter/tests.rs @@ -1,15 +1,13 @@ use super::*; -use crate::resolver; /// Evaluate a code snippet, returning a value. fn parse_eval(code: &str) -> Value { let chars: Vec<char> = code.chars().collect(); let tokens = scanner::scan(&chars).expect("could not scan code"); - let mut program = parser::parse(tokens).expect("could not parse code"); - program = resolver::resolve(program).expect("could not resolve code"); + let program = parser::parse(tokens).expect("could not parse code"); Interpreter::create() - .interpret(&program) + .interpret(program) .expect("could not eval code") } |