From eaf7af18be44234a682e201b721dfb90c8d9fcca Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 1 Sep 2022 16:58:41 +0300 Subject: feat(tvix/eval): track source spans for literals Change-Id: Icfe77f85c4f65b6bf28b8752c2795419e8e396ce Reviewed-on: https://cl.tvl.fyi/c/depot/+/6380 Tested-by: BuildkiteCI Reviewed-by: sterni --- tvix/eval/src/compiler/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tvix') diff --git a/tvix/eval/src/compiler/mod.rs b/tvix/eval/src/compiler/mod.rs index e8eb14ed15..f80a23935b 100644 --- a/tvix/eval/src/compiler/mod.rs +++ b/tvix/eval/src/compiler/mod.rs @@ -171,15 +171,15 @@ impl Compiler<'_> { fn compile_literal(&mut self, node: ast::Literal) { match node.kind() { ast::LiteralKind::Float(f) => { - self.emit_constant_old(Value::Float(f.value().unwrap())); + self.emit_constant(Value::Float(f.value().unwrap()), &node); } ast::LiteralKind::Integer(i) => { - self.emit_constant_old(Value::Integer(i.value().unwrap())); + self.emit_constant(Value::Integer(i.value().unwrap()), &node); } ast::LiteralKind::Uri(u) => { self.emit_warning(node.syntax().clone(), WarningKind::DeprecatedLiteralURL); - self.emit_constant_old(Value::String(u.syntax().text().into())); + self.emit_constant(Value::String(u.syntax().text().into()), &node); } } } -- cgit 1.4.1