codetools: fixed parsing record align, issue

This commit is contained in:
mattias 2024-01-28 20:01:35 +01:00
parent 79825debe4
commit f0652397b9
2 changed files with 18 additions and 0 deletions

View File

@ -4847,6 +4847,11 @@ begin
ReadConstant(true,false,[]);
end;
end;
// read record align.
if (ClassDesc=ctnRecordType) and IsForward and UpAtomIs('ALIGN') then begin
ReadNextAtom;
ReadConstant(true,false,[]);
end;
if CurPos.Flag<>cafSemicolon then
UndoReadNextAtom;
// close class

View File

@ -45,6 +45,7 @@ type
procedure TestAtomRing;
procedure TestRecord_ClassOperators;
procedure TestRecord_Nonkeywords;
procedure TestRecord_Align;
procedure TestDeprecated;
procedure TestMissingGenericKeywordObjFPCFail;
procedure TestParseGenericsDelphi;
@ -403,6 +404,18 @@ begin
ParseModule;
end;
procedure TTestPascalParser.TestRecord_Align;
begin
StartProgram;
Add([
'type',
' t = record',
' pad: word;',
' end align 16;',
'begin']);
ParseModule;
end;
procedure TTestPascalParser.TestDeprecated;
begin
StartProgram;