From d1e0c6f680163b11582356f96ec7b5ae419e53f0 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 1 Sep 2022 17:20:34 +0300 Subject: [PATCH] feat(tvix/eval): track source spans for attrsets Change-Id: I0fcb07146b5a38c67bc46ed3f67533b056858390 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6388 Tested-by: BuildkiteCI Reviewed-by: sterni --- tvix/eval/src/compiler/mod.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tvix/eval/src/compiler/mod.rs b/tvix/eval/src/compiler/mod.rs index 688013f43..b72a7c7ed 100644 --- a/tvix/eval/src/compiler/mod.rs +++ b/tvix/eval/src/compiler/mod.rs @@ -469,7 +469,7 @@ impl Compiler<'_> { self.compile(slot, from.expr().unwrap()); self.emit_force(); self.emit_literal_ident(&ident); - self.push_op_old(OpCode::OpAttrsSelect); + self.push_op(OpCode::OpAttrsSelect, &ident); } } @@ -505,7 +505,10 @@ impl Compiler<'_> { // otherwise we need to emit an instruction to construct // the attribute path. if key_count > 1 { - self.push_op_old(OpCode::OpAttrPath(Count(key_count))); + self.push_op( + OpCode::OpAttrPath(Count(key_count)), + &kv.attrpath().unwrap(), + ); } // The value is just compiled as normal so that its @@ -514,7 +517,7 @@ impl Compiler<'_> { self.compile(slot, kv.value().unwrap()); } - self.push_op_old(OpCode::OpAttrs(Count(count))); + self.push_op(OpCode::OpAttrs(Count(count)), &node); } fn compile_select(&mut self, slot: Option, node: ast::Select) {