about summary refs log tree commit diff
path: root/tvix
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-09-01T14·48+0300
committertazjin <tazjin@tvl.su>2022-09-07T20·04+0000
commite590b585e780f572bd30cdc4637c69f67f6c7b29 (patch)
tree08afac0214fdbf3b453a792bc3a5335cf2baee42 /tvix
parent20996601ea28071e590ed91147176dfb2db5ceb9 (diff)
feat(tvix/eval): track source spans for lambdas r/4729
Change-Id: I2f420fc915b6bfc5b197e9d0c128b539c4bc7467
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6396
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix')
-rw-r--r--tvix/eval/src/compiler/mod.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/tvix/eval/src/compiler/mod.rs b/tvix/eval/src/compiler/mod.rs
index 4dd8fe4b50af..0e26dbc23b9a 100644
--- a/tvix/eval/src/compiler/mod.rs
+++ b/tvix/eval/src/compiler/mod.rs
@@ -885,7 +885,10 @@ impl Compiler<'_> {
         // If the function is not a closure, just emit it directly and
         // move on.
         if compiled.lambda.upvalue_count == 0 {
-            self.emit_constant_old(Value::Closure(Closure::new(Rc::new(compiled.lambda))));
+            self.emit_constant(
+                Value::Closure(Closure::new(Rc::new(compiled.lambda))),
+                &node,
+            );
             return;
         }
 
@@ -897,7 +900,7 @@ impl Compiler<'_> {
             .chunk()
             .push_constant(Value::Blueprint(Rc::new(compiled.lambda)));
 
-        self.push_op_old(OpCode::OpClosure(blueprint_idx));
+        self.push_op(OpCode::OpClosure(blueprint_idx), &node);
         self.emit_upvalue_data(slot, compiled.scope.upvalues);
     }