Refactor AST substitution logic
This commit refactors the AST substitution logic to correctly handle nested expansions and improve the inlining of lambda expressions. The changes include: - Extracting the core value from potentially expanded AST nodes before checking their kind. - Ensuring that lambda expressions with empty upvalues are correctly substituted. - Adding support for inlining global get expressions as AST substitutions. - Improving the `UsageInfo` collection to correctly track assigned values.
This commit is contained in:
@@ -143,8 +143,7 @@ impl UsageInfo {
|
||||
self.collect(v);
|
||||
}
|
||||
}
|
||||
BoundKind::Define { addr, value, .. } => {
|
||||
self.assigned.insert(*addr);
|
||||
BoundKind::Define { value, .. } => {
|
||||
self.collect(value);
|
||||
}
|
||||
BoundKind::Expansion { bound_expanded, .. } => {
|
||||
|
||||
Reference in New Issue
Block a user