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:
@@ -135,7 +135,10 @@ pub enum BoundKind<T = ()> {
|
||||
Again {
|
||||
args: Box<BoundNode<T>>,
|
||||
},
|
||||
|
||||
Pipe {
|
||||
inputs: Vec<BoundNode<T>>,
|
||||
lambda: Box<BoundNode<T>>,
|
||||
},
|
||||
Block {
|
||||
exprs: Vec<BoundNode<T>>,
|
||||
},
|
||||
@@ -304,6 +307,7 @@ impl<T> BoundKind<T> {
|
||||
}
|
||||
BoundKind::Call { .. } => "CALL".to_string(),
|
||||
BoundKind::Again { .. } => "AGAIN".to_string(),
|
||||
BoundKind::Pipe { .. } => "PIPE".to_string(),
|
||||
BoundKind::Block { .. } => "BLOCK".to_string(),
|
||||
BoundKind::Tuple { elements } => format!("TUPLE({})", elements.len()),
|
||||
BoundKind::Record { values, .. } => format!("RECORD({})", values.len()),
|
||||
|
||||
Reference in New Issue
Block a user