Refactoring node to be immutable
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user