Add positional_count field to Lambda
This field is used for static optimization, determining if parameters are purely positional.
This commit is contained in:
@@ -75,15 +75,16 @@ impl TCO {
|
||||
}
|
||||
},
|
||||
|
||||
BoundKind::Lambda { params, upvalues, body } => {
|
||||
BoundKind::Lambda { params, upvalues, body, positional_count } => {
|
||||
// The body of a lambda is implicitly in tail position when the lambda is called.
|
||||
let new_body = Rc::new(Self::transform((*body).clone(), true));
|
||||
|
||||
Node {
|
||||
kind: BoundKind::Lambda {
|
||||
params,
|
||||
params: params.clone(),
|
||||
upvalues,
|
||||
body: new_body,
|
||||
positional_count,
|
||||
},
|
||||
..node
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user