Refactoring for immutable nodes

This commit is contained in:
Michael Schimmel
2025-11-05 13:21:17 +01:00
parent 9bd2d6f7ab
commit c0a689d2bc
13 changed files with 217 additions and 190 deletions
+2 -2
View File
@@ -511,7 +511,7 @@ begin
raise Exception.Create('Syntax Error: Missing value for key ' + fieldName + ' in record literal.');
fieldValue := ParseExpression.Node;
fields.Add(TRecordFieldLiteral.Create(TKeywordNode.Create(TKeywordRegistry.Intern(fieldName)), fieldValue));
fields.Add(TRecordFieldLiteral.Create(TAst.Keyword(fieldName), fieldValue));
end;
Result := TAst.RecordLiteral(fields.ToArray);
@@ -945,7 +945,7 @@ var
arg: IAstNode;
begin
// Special case for (quote ...) to print it as '...
if (Node.Callee is TIdentifierNode) and (TIdentifierNode(Node.Callee).Name = 'quote') and (Length(Node.Arguments) = 1) then
if (Node.Callee.Kind = akIdentifier) and (Node.Callee.AsIdentifier.Name = 'quote') and (Length(Node.Arguments) = 1) then
begin
Append('''');
Node.Arguments[0].Accept(Self);