about summary refs log tree commit diff
path: root/tvix/eval/src/eval.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-08-23T19·54+0300
committertazjin <tazjin@tvl.su>2022-09-01T21·56+0000
commit6f31c895ffe2dc5dd8281d812252d5db0644ec77 (patch)
tree9e45e371bc7d066b8666a3df532c6d241ee1165b /tvix/eval/src/eval.rs
parent4715f9a3a0135e1b6bc1f24fbafc9b1ce1a9bc20 (diff)
refactor(tvix/eval): return a lambda from the compiler r/4576
Changes the internal compiler plumbing to not just return a chunk of
code, but the same chunk wrapped inside of a lambda value.

This is one more step towards compiling runtime lambdas.

Change-Id: If0035f8e65a2970c5ae123fc068a2396e1d8fd72
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6240
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
Diffstat (limited to 'tvix/eval/src/eval.rs')
-rw-r--r--tvix/eval/src/eval.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/tvix/eval/src/eval.rs b/tvix/eval/src/eval.rs
index 10d36904e4..d817442205 100644
--- a/tvix/eval/src/eval.rs
+++ b/tvix/eval/src/eval.rs
@@ -31,7 +31,7 @@ pub fn interpret(code: &str, location: Option<PathBuf>) -> EvalResult<Value> {
     let result = crate::compiler::compile(root_expr, location)?;
 
     #[cfg(feature = "disassembler")]
-    crate::disassembler::disassemble_chunk(&result.chunk);
+    crate::disassembler::disassemble_chunk(&result.lambda.chunk);
 
     for warning in result.warnings {
         eprintln!(
@@ -49,5 +49,5 @@ pub fn interpret(code: &str, location: Option<PathBuf>) -> EvalResult<Value> {
         return Err(err.clone());
     }
 
-    crate::vm::run_chunk(result.chunk)
+    crate::vm::run_lambda(result.lambda)
 }