about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-08-12T13·34+0300
committertazjin <tazjin@tvl.su>2022-08-26T17·19+0000
commit5512108ca797184560c75bb2f356b699e88ee0ee (patch)
tree6f10b0b1a2ebf33b8f471e3bfb529e63fc102bd5
parent7c803a7e72564807cd9029a829109d795b9beb6d (diff)
fix(tvix/compiler): handle literal URL values r/4506
The parser creates this node type from literal URL values. Technically
these are deprecated and have been removed from nixpkgs.

Change-Id: I4d05034dd9b4d8348e4ed8a2bbb37c1b6ccef8bc
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6173
Reviewed-by: grfn <grfn@gws.fyi>
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
-rw-r--r--tvix/eval/src/compiler.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/tvix/eval/src/compiler.rs b/tvix/eval/src/compiler.rs
index 7685e2f08c22..1a4e8df1da4d 100644
--- a/tvix/eval/src/compiler.rs
+++ b/tvix/eval/src/compiler.rs
@@ -132,7 +132,14 @@ impl Compiler {
                 Ok(())
             }
 
-            rnix::NixValue::String(_) => todo!(),
+            // These nodes are yielded by literal URL values.
+            rnix::NixValue::String(s) => {
+                // TODO(tazjin): emit deprecation warning
+                let idx = self.chunk.add_constant(Value::String(s.into()));
+                self.chunk.add_op(OpCode::OpConstant(idx));
+                Ok(())
+            }
+
             rnix::NixValue::Path(_, _) => todo!(),
         }
     }