Keywords
This commit is contained in:
@@ -376,7 +376,7 @@ begin
|
||||
raise Exception.Create('Syntax Error: Missing value for key ' + fieldName + ' in record literal.');
|
||||
fieldValue := ParseExpression.Node;
|
||||
|
||||
fields.Add(TRecordFieldLiteral.Create(fieldName, fieldValue));
|
||||
fields.Add(TRecordFieldLiteral.Create(TKeywordNode.Create(TKeywordRegistry.Intern(fieldName)), fieldValue));
|
||||
end;
|
||||
|
||||
Result := TAst.RecordLiteral(fields.ToArray);
|
||||
@@ -490,7 +490,7 @@ begin
|
||||
else if SameText(head.Token.Text, 'get') then
|
||||
Result := TAst.Indexer(tailNodes[0], tailNodes[1])
|
||||
else if (Length(head.Token.Text) > 1) and (head.Token.Text.StartsWith('.')) then
|
||||
Result := TAst.MemberAccess(tailNodes[0], TAst.Identifier(head.Token.Text.Substring(1)));
|
||||
Result := TAst.MemberAccess(tailNodes[0], TAst.Keyword(head.Token.Text.Substring(1)));
|
||||
end;
|
||||
|
||||
// If no special form matched, treat it as a generic function call.
|
||||
@@ -916,7 +916,7 @@ begin
|
||||
for field in Node.Fields do
|
||||
begin
|
||||
NewLine;
|
||||
Append(':' + field.Name);
|
||||
Append(':' + field.Key.Value.Name);
|
||||
Append(' ');
|
||||
field.Value.Accept(Self);
|
||||
end;
|
||||
|
||||
Reference in New Issue
Block a user