about summary refs log tree commit diff
path: root/tvix/eval/src/eval.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/eval/src/eval.rs')
-rw-r--r--tvix/eval/src/eval.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/tvix/eval/src/eval.rs b/tvix/eval/src/eval.rs
index 370aad494dda..5e6c53cd8bf5 100644
--- a/tvix/eval/src/eval.rs
+++ b/tvix/eval/src/eval.rs
@@ -1,9 +1,9 @@
 use rnix::{self, types::TypedNode};
 
-use crate::errors::EvalResult;
+use crate::{errors::EvalResult, value::Value};
 
-pub fn interpret(code: String) -> EvalResult<String> {
-    let ast = rnix::parse(&code);
+pub fn interpret(code: &str) -> EvalResult<Value> {
+    let ast = rnix::parse(code);
 
     let errors = ast.errors();
     if !errors.is_empty() {
@@ -15,6 +15,5 @@ pub fn interpret(code: String) -> EvalResult<String> {
     let code = crate::compiler::compile(ast)?;
     println!("code: {:?}", code);
 
-    let value = crate::vm::run_chunk(code)?;
-    Ok(format!("value: {} :: {}", value, value.type_of()))
+    crate::vm::run_chunk(code)
 }