diff --git a/Cargo.lock b/Cargo.lock index bcb95b8..4549078 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -193,9 +193,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.12.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" dependencies = [ "either", ] @@ -360,9 +360,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "rnix" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb35cedbeb70e0ccabef2a31bcff0aebd114f19566086300b8f42c725fc2cb5f" +checksum = "6f15e00b0ab43abd70d50b6f8cd021290028f9b7fdd7cdfa6c35997173bc1ba9" dependencies = [ "rowan", ] diff --git a/Cargo.toml b/Cargo.toml index f747b99..54c6be2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,9 +15,9 @@ debug = 1 inherits = "release" [dependencies] -rnix = "0.11" +rnix = "0.12" thiserror = "2.0" -itertools = "0.12" +itertools = "0.14" rpds = "1.1" derive_more = { version = "2.0", features = [ "full" ] } ecow = "0.2" diff --git a/src/compile.rs b/src/compile.rs index e1b88ce..48ec00a 100644 --- a/src/compile.rs +++ b/src/compile.rs @@ -248,6 +248,17 @@ impl Compile for ir::BinOp { comp.push(OpCode::Call { arity: 2 }); comp.push(OpCode::UnOp { op: UnOp::Not }); } + + PipeL => { + self.lhs.compile(comp); + self.rhs.compile(comp); + comp.push(OpCode::Call { arity: 1 }); + } + PipeR => { + self.rhs.compile(comp); + self.lhs.compile(comp); + comp.push(OpCode::Call { arity: 1 }); + } } } } diff --git a/src/ir.rs b/src/ir.rs index 7247f16..71cd254 100644 --- a/src/ir.rs +++ b/src/ir.rs @@ -274,6 +274,9 @@ pub enum BinOpKind { Con, Upd, + + PipeL, + PipeR, } impl From for BinOpKind { @@ -296,6 +299,8 @@ impl From for BinOpKind { astkind::MoreOrEq => Geq, astkind::NotEqual => Neq, astkind::Or => Or, + astkind::PipeLeft => PipeL, + astkind::PipeRight => PipeR, } } }