Introduce closure AST node

The `Closure` struct has been moved from `ast/vm.rs` to a new module
`ast/closure.rs`. This improves the organization of the AST nodes. The
`Closure` struct represents a compiled function body along with its
captured upvalues, which is a key feature for Myc Script.
This commit is contained in:
2026-03-22 19:37:04 +01:00
parent 37d7ed3e75
commit 6c37b0c64f
7 changed files with 68 additions and 53 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ use crate::ast::nodes::{
IdentifierBinding, LambdaBinding, Node, NodeKind, UpvalueIdx, VirtualId,
};
use crate::ast::types::{Purity, Value};
use crate::ast::vm::Closure;
use crate::ast::closure::Closure;
use std::cell::RefCell;
use std::rc::Rc;
+1 -1
View File
@@ -2,7 +2,7 @@ use crate::ast::nodes::{
Address, AnalyzedNode, IdentifierBinding, NodeKind, VirtualId,
};
use crate::ast::types::{Purity, Value};
use crate::ast::vm::Closure;
use crate::ast::closure::Closure;
use std::cell::RefCell;
use std::collections::HashSet;
use std::rc::Rc;
+1 -1
View File
@@ -3,7 +3,7 @@ use crate::ast::nodes::{
NodeKind, VirtualId,
};
use crate::ast::types::{Identity, Value};
use crate::ast::vm::Closure;
use crate::ast::closure::Closure;
use std::collections::HashSet;
// --- PathTracker ---