From 2ad89a00fbabaade066a276cba4f041690f14d74 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 1 Sep 2022 17:14:09 +0300 Subject: feat(tvix/eval): track source spans for `?` operator Change-Id: Idb842fb20fab14150455a81ea6c947e75b314d8a Reviewed-on: https://cl.tvl.fyi/c/depot/+/6385 Tested-by: BuildkiteCI Reviewed-by: sterni --- tvix/eval/src/compiler/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tvix/eval/src/compiler') diff --git a/tvix/eval/src/compiler/mod.rs b/tvix/eval/src/compiler/mod.rs index abfe551c760e..c99415d845b9 100644 --- a/tvix/eval/src/compiler/mod.rs +++ b/tvix/eval/src/compiler/mod.rs @@ -386,7 +386,7 @@ impl Compiler<'_> { // next nested element, for all fragments except the last one. for (count, fragment) in node.attrpath().unwrap().attrs().enumerate() { if count > 0 { - self.push_op_old(OpCode::OpAttrsTrySelect); + self.push_op(OpCode::OpAttrsTrySelect, &fragment); } self.compile_attr(slot, fragment); @@ -394,7 +394,7 @@ impl Compiler<'_> { // After the last fragment, emit the actual instruction that // leaves a boolean on the stack. - self.push_op_old(OpCode::OpAttrsIsSet); + self.push_op(OpCode::OpAttrsIsSet, &node); } fn compile_attr(&mut self, slot: Option, node: ast::Attr) { -- cgit 1.4.1