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 <sternenseemann@systemli.org>
This commit is contained in:
Vincent Ambo 2022-09-01 16:58:41 +03:00 committed by tazjin
parent 72adcdf965
commit eaf7af18be

View file

@ -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);
}
}
}