feat(tvix/compiler): implement parens precedence

Change-Id: I8944354b3690d7504e4fe4254f14be5b849b9bcf
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6076
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
This commit is contained in:
Vincent Ambo 2022-08-08 02:38:19 +03:00 committed by tazjin
parent 72be759e1e
commit 18fe188c3e

View file

@ -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(())