Skip to content

Support parenthesized record alignment value (end align(N))#342

Open
civilian7 wants to merge 1 commit into
RomanYankovsky:masterfrom
civilian7:pr-record-align-parens
Open

Support parenthesized record alignment value (end align(N))#342
civilian7 wants to merge 1 commit into
RomanYankovsky:masterfrom
civilian7:pr-record-align-parens

Conversation

@civilian7

Copy link
Copy Markdown

Summary

TmwSimplePasPar.RecordAlignValue only accepted a bare integer (record ... end align 8). The Delphi RTL also uses the parenthesized form, with an integer or an identifier:

  • Winapi.Windows.pas: ... end align(16);
  • Winapi.Winsock2.pas: ... end align (_SS_ALIGNSIZE);

These currently fail with IntegerConst expected found (.

Change

RecordAlignValue now accepts align(<integer>) and align(<identifier>) in addition to the existing bare-integer form.

Test

Added Test/Snippets/recordalignparens.pas exercising both align(16) and align(IDENT).

Verified by parsing the full Delphi 13.1 RTL/VCL source: Winapi.Windows and Winapi.Winsock2 now parse cleanly (no new regressions across the 2455-unit corpus).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant