Refactoring node to be immutable

This commit is contained in:
Michael Schimmel
2025-11-05 15:24:54 +01:00
parent 25984fe61a
commit b98e7d98e6
6 changed files with 50 additions and 94 deletions
+3 -3
View File
@@ -256,7 +256,7 @@ begin
// --- Replace Node ---
// Create a new TBoundIdentifierNode (implementation is in Myc.Ast)
var boundParamNode := TAst.BoundIdentifier(paramNode.Name, adr);
var boundParamNode := TAst.Identifier(paramNode.Name, adr);
// Replace it in the parameter array
N.Parameters[i] := boundParamNode;
end;
@@ -345,7 +345,7 @@ begin
// --- Replace Node ---
// Create the new TBoundIdentifierNode (implementation is in Myc.Ast)
Result := TAst.BoundIdentifier(Node.Name, adr);
Result := TAst.Identifier(Node.Name, adr);
end
else
begin
@@ -375,7 +375,7 @@ begin
// 3. --- Replace Node ---
// Replace the TIdentifierNode with a new TBoundIdentifierNode
N.Identifier := TAst.BoundIdentifier(N.Identifier.Name, address);
N.Identifier := TAst.Identifier(N.Identifier.Name, address);
// 4. Mutate this declaration node
N.IsBoxed := (FBoxedDeclarations <> nil) and FBoxedDeclarations.Contains(Node);