AST list refactoring

This commit is contained in:
Michael Schimmel
2026-01-04 22:41:44 +01:00
parent 2a7e6626ad
commit 242ec9a56e
27 changed files with 815 additions and 1076 deletions
+5 -2
View File
@@ -195,6 +195,7 @@ function TUpvalueAnalyzer.VisitLambdaExpression(const Node: IAstNode): IAstNode;
var
L: ILambdaExpressionNode;
i: Integer;
paramTuple: ITupleNode;
begin
L := Node.AsLambdaExpression;
@@ -204,9 +205,11 @@ begin
// 2. Register parameters (they mask outer variables)
// We pass 'nil' as the node because we currently don't box parameters,
// but we must ensure Resolve() finds them so we don't accidentally box a shadowed variable.
for i := 0 to L.Parameters.Count - 1 do
paramTuple := L.Parameters;
for i := 0 to paramTuple.Count - 1 do
begin
FCurrentScope.Define(L.Parameters[i].Name, nil);
if paramTuple.Items[i].Kind = akIdentifier then
FCurrentScope.Define(paramTuple.Items[i].AsIdentifier.Name, nil);
end;
// 3. Visit Body