about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-08-07T23·38+0300
committertazjin <tazjin@tvl.su>2022-08-12T13·24+0000
commit18fe188c3e47a7662fa58a4066a9c3f7d9676cac (patch)
treedaa932689b4bcda44ac8b1c83a93c5bc0dcf2273
parent72be759e1e3ec9c84ef3f2f15d54662efa7b0c03 (diff)
feat(tvix/compiler): implement parens precedence r/4412
Change-Id: I8944354b3690d7504e4fe4254f14be5b849b9bcf
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6076
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
-rw-r--r--tvix/eval/src/compiler.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/tvix/eval/src/compiler.rs b/tvix/eval/src/compiler.rs
index d71eda43aa..17fd016375 100644
--- a/tvix/eval/src/compiler.rs
+++ b/tvix/eval/src/compiler.rs
@@ -6,7 +6,7 @@ use crate::errors::EvalResult;
 use crate::opcode::OpCode;
 use crate::value::Value;
 use rnix;
-use rnix::types::TypedNode;
+use rnix::types::{TypedNode, Wrapper};
 
 struct Compiler {
     chunk: Chunk,
@@ -36,6 +36,11 @@ impl Compiler {
                 self.compile_unary_op(op)
             }
 
+            rnix::SyntaxKind::NODE_PAREN => {
+                let op = rnix::types::Paren::cast(node).unwrap();
+                self.compile(op.inner().unwrap())
+            }
+
             kind => {
                 println!("visiting unsupported node: {:?}", kind);
                 Ok(())