From e590b585e780f572bd30cdc4637c69f67f6c7b29 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 1 Sep 2022 17:48:51 +0300 Subject: feat(tvix/eval): track source spans for lambdas Change-Id: I2f420fc915b6bfc5b197e9d0c128b539c4bc7467 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6396 Reviewed-by: sterni Tested-by: BuildkiteCI --- tvix/eval/src/compiler/mod.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tvix/eval/src/compiler/mod.rs') 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); } -- cgit 1.4.1