about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-08-22T18·04+0300
committertazjin <tazjin@tvl.su>2022-09-01T17·41+0000
commit3bf487b98b747b5726713bc3abfc6af7a4b7ed33 (patch)
tree633fb9ae6643ce83e1778a9455cc7298841617e3
parent5522ddfbf59dec46c2725d63c350217361cc280c (diff)
chore(tvix/eval): bump rnix-parser to latest master r/4569
In this commit, the string interpolation parsing is identical to
nixpkgs which makes some of the upstream Nix tests for
interpolation-related weirdness pass.

Change-Id: I3a295cfdc404c32228a54846e6efd3c0dcee5842
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6233
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
-rw-r--r--tvix/eval/Cargo.lock2
-rw-r--r--tvix/eval/Cargo.toml4
-rw-r--r--tvix/eval/src/compiler.rs10
3 files changed, 8 insertions, 8 deletions
diff --git a/tvix/eval/Cargo.lock b/tvix/eval/Cargo.lock
index e64e5e8ce0bc..05bcd8ccd2bc 100644
--- a/tvix/eval/Cargo.lock
+++ b/tvix/eval/Cargo.lock
@@ -639,7 +639,7 @@ checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244"
 [[package]]
 name = "rnix"
 version = "0.11.0-dev"
-source = "git+https://github.com/nix-community/rnix-parser.git?rev=ae9fe1344993bb57d292f361c83e0379282e88ed#ae9fe1344993bb57d292f361c83e0379282e88ed"
+source = "git+https://github.com/nix-community/rnix-parser.git?rev=614e7d4641e83ab7eb321d9ac5e3d12985f9f3ba#614e7d4641e83ab7eb321d9ac5e3d12985f9f3ba"
 dependencies = [
  "rowan",
 ]
diff --git a/tvix/eval/Cargo.toml b/tvix/eval/Cargo.toml
index 7a35dedfce86..21c224347309 100644
--- a/tvix/eval/Cargo.toml
+++ b/tvix/eval/Cargo.toml
@@ -13,11 +13,11 @@ path-clean = "0.1"
 tabwriter = { version = "1.2", optional = true }
 rowan = "*" # pinned by rnix
 
-# rnix has not been released in a while (as of 2022-08-16), we will
+# rnix has not been released in a while (as of 2022-08-22), we will
 # use it from git.
 [dependencies.rnix]
 git = "https://github.com/nix-community/rnix-parser.git"
-rev = "ae9fe1344993bb57d292f361c83e0379282e88ed"
+rev = "614e7d4641e83ab7eb321d9ac5e3d12985f9f3ba"
 
 [dev-dependencies]
 criterion = "0.3.6"
diff --git a/tvix/eval/src/compiler.rs b/tvix/eval/src/compiler.rs
index dca4eec9f447..7a27022d96de 100644
--- a/tvix/eval/src/compiler.rs
+++ b/tvix/eval/src/compiler.rs
@@ -188,16 +188,16 @@ impl Compiler {
         // they need to be reversed on the stack in order to
         // efficiently create the real string in case of
         // interpolation.
-        for part in node.parts().into_iter().rev() {
+        for part in node.normalized_parts().into_iter().rev() {
             count += 1;
 
             match part {
                 // Interpolated expressions are compiled as normal and
                 // dealt with by the VM before being assembled into
                 // the final string.
-                ast::StrPart::Interpolation(node) => self.compile(node.expr().unwrap())?,
+                ast::InterpolPart::Interpolation(node) => self.compile(node.expr().unwrap())?,
 
-                ast::StrPart::Literal(lit) => {
+                ast::InterpolPart::Literal(lit) => {
                     let idx = self.chunk.push_constant(Value::String(lit.into()));
                     self.chunk.push_op(OpCode::OpConstant(idx));
                 }
@@ -832,8 +832,8 @@ impl Compiler {
 /// Convert a non-dynamic string expression to a string if possible,
 /// or raise an error.
 fn expr_str_to_string(expr: ast::Str) -> EvalResult<String> {
-    if expr.parts().len() == 1 {
-        if let ast::StrPart::Literal(s) = expr.parts().pop().unwrap() {
+    if expr.normalized_parts().len() == 1 {
+        if let ast::InterpolPart::Literal(s) = expr.normalized_parts().pop().unwrap() {
             return Ok(s);
         }
     }