Add positional_count field to Lambda

This field is used for static optimization, determining if parameters
are purely positional.
This commit is contained in:
Michael Schimmel
2026-02-20 14:40:56 +01:00
parent 56d6c3bbde
commit 4e812c1afb
11 changed files with 361 additions and 62 deletions
+3 -1
View File
@@ -72,10 +72,12 @@ pub enum BoundKind<T = ()> {
},
Lambda {
params: Box<BoundNode<T>>,
params: Rc<BoundNode<T>>,
// The list of variables captured from enclosing scopes
upvalues: Vec<Address>,
body: Rc<BoundNode<T>>,
/// Static optimization: number of positional parameters if the pattern is flat.
positional_count: Option<u32>,
},
Call {