about summary refs log tree commit diff
path: root/users/tazjin/rlox/src/treewalk/interpreter
diff options
context:
space:
mode:
Diffstat (limited to 'users/tazjin/rlox/src/treewalk/interpreter')
-rw-r--r--users/tazjin/rlox/src/treewalk/interpreter/tests.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/users/tazjin/rlox/src/treewalk/interpreter/tests.rs b/users/tazjin/rlox/src/treewalk/interpreter/tests.rs
index 34b1df34b0b6..2fc6f4fee978 100644
--- a/users/tazjin/rlox/src/treewalk/interpreter/tests.rs
+++ b/users/tazjin/rlox/src/treewalk/interpreter/tests.rs
@@ -2,13 +2,9 @@ use super::*;
 
 /// 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 program = parser::parse(tokens).expect("could not parse code");
-
     Interpreter::create()
-        .interpret(program)
-        .expect("could not eval code")
+        .interpret(code.into())
+        .expect("could not interpret code")
 }
 
 #[test]