Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Source/SimpleParser/SimpleParser.Lexer.pas
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,7 @@ procedure TmwBasePasLex.InitIdent;
141: FIdentFuncTable[I] := Func141;
142: FIdentFuncTable[I] := Func142;
143: FIdentFuncTable[I] := Func143;
158: FIdentFuncTable[I] := Func158;
166: FIdentFuncTable[I] := Func166;
167: FIdentFuncTable[I] := Func167;
168: FIdentFuncTable[I] := Func168;
Expand Down
18 changes: 18 additions & 0 deletions Test/UnitTests/DelphiAST.Tests.pas
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,23 @@ procedure TestRepeatedCallingConvention;
end;
end;

procedure TestUnicodeStringTypecast;
var
Root, CallNode, Callee: TSyntaxNode;
begin
Root := ParseSource('unit Example; interface implementation ' +
'procedure Run(p: Pointer); var s: UnicodeString; begin s := UnicodeString(p^); end; end.');
try
CallNode := FindDescendant(Root, ntCall);
AssertNotNil(CallNode, 'Missing call');
Callee := CallNode.ChildNodes[0];
AssertTrue(Callee.Typ = ntType, 'A UnicodeString typecast has a type as its callee.');
AssertEquals('UnicodeString', Callee.GetAttribute(anName), 'Typecast type name.');
finally
Root.Free;
end;
end;

procedure TestInvalidSyntax;
var
Root: TSyntaxNode;
Expand Down Expand Up @@ -379,6 +396,7 @@ procedure RunAllTests;
RunTest('Node.AttributeOverwrite', TestAttributeOverwrite);
RunTest('Node.AttributeRemove', TestAttributeRemove);
RunTest('AST.RepeatedCallingConvention', TestRepeatedCallingConvention);
RunTest('AST.UnicodeStringTypecast', TestUnicodeStringTypecast);
RunTest('Parser.InvalidSyntax', TestInvalidSyntax);
RunTest('Parser.UnexpectedEndOfFilePosition', TestUnexpectedEndOfFilePosition);
{$IFNDEF FPC}
Expand Down
Loading