Feat: Add Pipe Node
Introduces a new `Pipe` node to the Abstract Syntax Tree (AST). This node represents a functional composition pattern, allowing for chaining of operations. The changes include: - Defining the `Pipe` variant in `BoundKind` and `UntypedKind`. - Implementing parsing logic for the `pipe` keyword. - Adding handling for the `Pipe` node in various compiler passes (analyzer, binder, captures, dumper, macros, optimizer, TCO, type checker). - Including a placeholder implementation for `Pipe` execution in the VM. - Updating integration tests to use the new `pipe` syntax.
This commit is contained in:
@@ -237,6 +237,20 @@ impl<'a> Analyzer<'a> {
|
||||
Purity::Impure,
|
||||
)
|
||||
}
|
||||
BoundKind::Pipe { inputs, lambda } => {
|
||||
let mut analyzed_inputs = Vec::with_capacity(inputs.len());
|
||||
for input in inputs {
|
||||
analyzed_inputs.push(self.visit(Rc::new(input.clone())));
|
||||
}
|
||||
let a_lambda = Box::new(self.visit(Rc::new((**lambda).clone())));
|
||||
(
|
||||
BoundKind::Pipe {
|
||||
inputs: analyzed_inputs,
|
||||
lambda: a_lambda,
|
||||
},
|
||||
Purity::Impure,
|
||||
)
|
||||
}
|
||||
|
||||
BoundKind::Block { exprs } => {
|
||||
let mut new_exprs = Vec::with_capacity(exprs.len());
|
||||
|
||||
Reference in New Issue
Block a user