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
@@ -131,7 +131,7 @@ end;
function TBlockExpressionNodeHandler.ReconstructAst(OwnerNode: TAstViewNode): IAstNode;
begin
Result := TAst.Block(FNode.Identity, FExpressionsNode.CreateAst.AsExpressionList, FNode.StaticType);
Result := TAst.Block(FNode.Identity, FExpressionsNode.CreateAst.AsTuple, FNode.StaticType);
end;
{ TIfExpressionNodeHandler }
@@ -263,7 +263,7 @@ begin
Result :=
TAst.LambdaExpr(
FNode.Identity,
FParamsNode.CreateAst.AsParameterList,
FParamsNode.CreateAst.AsTuple,
FBodyNode.CreateAst,
FNode.Layout,
FNode.Descriptor,
@@ -300,7 +300,7 @@ begin
TAst.FunctionCall(
FNode.Identity,
FCalleeNode.CreateAst,
FArgumentsNode.CreateAst.AsArgumentList,
FArgumentsNode.CreateAst.AsTuple,
FNode.StaticType,
FNode.IsTailCall,
FNode.StaticTarget,
@@ -349,7 +349,7 @@ begin
opLabel.Color := TAlphaColors.Darkorange;
opLabel.Margins := TMarginRect.Create(2, 0, 2, 0);
argView := visu.CallAccept(FNode.Arguments[0]);
argView := visu.CallAccept(FNode.Arguments.Items[0]);
FArgumentNodes.Add(argView);
end
else
@@ -365,7 +365,7 @@ begin
opLabel.Margins := TMarginRect.Create(0, 0, 0, 0);
end;
argView := visu.CallAccept(FNode.Arguments[i]);
argView := visu.CallAccept(FNode.Arguments.Items[i]);
FArgumentNodes.Add(argView);
end;
end;
@@ -390,7 +390,7 @@ begin
TAst.FunctionCall(
FNode.Identity,
FNode.Callee,
TArgumentList.Create(newArgs, FNode.Arguments.Identity),
TAst.Tuple(FNode.Arguments.Identity, newArgs),
FNode.StaticType,
FNode.IsTailCall,
FNode.StaticTarget,
@@ -439,7 +439,7 @@ end;
function TRecurNodeHandler.ReconstructAst(OwnerNode: TAstViewNode): IAstNode;
begin
Result := TAst.Recur(FNode.Identity, FArgumentsNode.CreateAst.AsArgumentList, FNode.StaticType);
Result := TAst.Recur(FNode.Identity, FArgumentsNode.CreateAst.AsTuple, FNode.StaticType);
end;
{ TMacroDefinitionNodeHandler }
@@ -468,7 +468,7 @@ end;
function TMacroDefinitionNodeHandler.ReconstructAst(OwnerNode: TAstViewNode): IAstNode;
begin
Result := TAst.MacroDef(FNode.Identity, FNode.Name, FParamsNode.CreateAst.AsParameterList, FBodyNode.CreateAst);
Result := TAst.MacroDef(FNode.Identity, FNode.Name, FParamsNode.CreateAst.AsTuple, FBodyNode.CreateAst);
end;
end.