Skip to content
Open
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
13 changes: 13 additions & 0 deletions Source/uPSCompiler.pas
Original file line number Diff line number Diff line change
Expand Up @@ -4053,6 +4053,19 @@ function TPSPascalCompiler.ReadType(const Name: tbtString; FParser: TPSPascalPar
Intf: TPSInterface;
{$ENDIF}
begin
{ issue #246: accept Delphi's 'packed' before structured type declarations.
PascalScript records/arrays are always packed, so it only affects parsing }
if (FParser.CurrTokenID = CSTI_Identifier) and (FParser.GetToken = 'PACKED') then
begin
FParser.Next;
if not ((FParser.CurrTokenId = CSTII_Record) or (FParser.CurrTokenId = CSTII_Array) or
(FParser.CurrTokenId = CSTII_Set)) then
begin
MakeError('', ecIdentifierExpected, '');
Result := nil;
Exit;
end;
end;
if (FParser.CurrTokenID = CSTII_Function) or (FParser.CurrTokenID = CSTII_Procedure) then
begin
Result := ReadTypeAddProcedure(Name, FParser);
Expand Down