Remove unused pipe node definitions
The `Pipe` node and its associated logic have been removed from the AST. This commit cleans up the code by removing all references to this defunct node in the analyzer, binder, captures, dumper, lowering, macros, optimizer, and type checker. The parser no longer recognizes the `pipe` keyword.
This commit is contained in:
+2
-53
@@ -1,8 +1,8 @@
|
||||
use crate::ast::closure::Closure;
|
||||
use crate::ast::nodes::{Address, ExecNode, IdentifierBinding, NodeKind, StackOffset};
|
||||
use crate::ast::rtl::series::{RecordSeries, SeriesView};
|
||||
use crate::ast::rtl::streams::{build_map_stream, build_pipeline_node, StreamNode};
|
||||
use crate::ast::types::{PipeFn, Value};
|
||||
use crate::ast::rtl::streams::{build_map_stream, StreamNode};
|
||||
use crate::ast::types::Value;
|
||||
use std::cell::RefCell;
|
||||
use std::rc::Rc;
|
||||
|
||||
@@ -392,57 +392,6 @@ impl VM {
|
||||
Ok(Value::Void)
|
||||
}
|
||||
}
|
||||
NodeKind::Pipe {
|
||||
inputs,
|
||||
lambda,
|
||||
} => {
|
||||
let mut obs_streams = Vec::new();
|
||||
for input in inputs {
|
||||
let val = self.eval_internal(obs, input)?;
|
||||
if let Value::Object(obj) = val {
|
||||
if let Some(s) = obj.as_any().downcast_ref::<StreamNode>() {
|
||||
obs_streams.push(s.inner.clone());
|
||||
} else {
|
||||
return Err(format!(
|
||||
"Pipe input must be a stream, found {}",
|
||||
obj.type_name()
|
||||
));
|
||||
}
|
||||
} else {
|
||||
return Err("Pipe input must be an object (stream)".to_string());
|
||||
}
|
||||
}
|
||||
|
||||
let lambda_val = self.eval_internal(obs, lambda)?;
|
||||
|
||||
// Create the persistent execution closure for the PipeStream
|
||||
let mut pipe_vm = VM::new(self.globals.clone());
|
||||
|
||||
let executor: Box<PipeFn> = match lambda_val {
|
||||
Value::Closure(rc) => {
|
||||
let my_closure = rc.clone();
|
||||
Box::new(move |args: &[Value]| -> Value {
|
||||
match pipe_vm.run_with_args(my_closure.clone(), args) {
|
||||
Ok(res) => res,
|
||||
Err(e) => panic!("Pipeline lambda execution failed: {}", e),
|
||||
}
|
||||
})
|
||||
}
|
||||
Value::Function(func) => {
|
||||
let my_func = func.clone();
|
||||
Box::new(move |args: &[Value]| -> Value {
|
||||
(my_func.func)(args)
|
||||
})
|
||||
}
|
||||
_ => return Err("Pipe lambda must be a function/closure".to_string()),
|
||||
};
|
||||
|
||||
// Delegate to the RTL Factory for specialized buffer instantiation
|
||||
let node =
|
||||
build_pipeline_node(obs_streams, executor, &node.ty.ty);
|
||||
|
||||
Ok(Value::Object(node))
|
||||
}
|
||||
NodeKind::Block { exprs } => {
|
||||
let mut last = Value::Void;
|
||||
for e in exprs {
|
||||
|
||||
Reference in New Issue
Block a user