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:
Michael Schimmel
2026-03-01 21:52:10 +01:00
parent a98e51c762
commit 50f33b2c30
14 changed files with 169 additions and 4 deletions
+10 -1
View File
@@ -89,7 +89,16 @@ impl CapturePass {
args: Box::new(Self::transform(*args, capture_map)),
};
}
BoundKind::Pipe { inputs, lambda } => {
let mut t_inputs = Vec::with_capacity(inputs.len());
for input in inputs {
t_inputs.push(Self::transform(input, capture_map));
}
node.kind = BoundKind::Pipe {
inputs: t_inputs,
lambda: Box::new(Self::transform(*lambda, capture_map)),
};
}
BoundKind::Block { exprs } => {
node.kind = BoundKind::Block {
exprs: exprs