Making AST node inmmutable - WIP

This commit is contained in:
Michael Schimmel
2025-11-04 20:12:12 +01:00
parent 48ccb23060
commit d82a75aba6
6 changed files with 123 additions and 56 deletions
+7 -5
View File
@@ -143,13 +143,15 @@ end;
procedure TAstDumper.VisitIdentifier(const Node: IIdentifierNode);
var
N: TIdentifierNode;
adr: TResolvedAddress;
begin
N := (Node as TIdentifierNode);
if N.Address.Kind <> akUnresolved then
LogFmt('Identifier: %s -> %s', [N.Name, FormatAddress(N.Address)])
if Node.Kind = akBoundIdentifier then
adr := Node.AsBoundIdentifierNode.Address;
if adr.Kind <> akUnresolved then
LogFmt('Identifier: %s -> %s', [Node.Name, FormatAddress(adr)])
else
LogFmt('Identifier: %s (unbound)', [N.Name]);
LogFmt('Identifier: %s (unbound)', [Node.Name]);
end;
procedure TAstDumper.VisitKeyword(const Node: IKeywordNode);