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:
Michael Schimmel
2026-03-13 19:51:56 +01:00
parent e5d82ee2b6
commit 0dfcfac7b3
3 changed files with 41 additions and 17 deletions
+1 -2
View File
@@ -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, .. } => {