Support parenthesized record alignment value (end align(N))#342
Open
civilian7 wants to merge 1 commit into
Open
Support parenthesized record alignment value (end align(N))#342civilian7 wants to merge 1 commit into
civilian7 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TmwSimplePasPar.RecordAlignValueonly 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
RecordAlignValuenow acceptsalign(<integer>)andalign(<identifier>)in addition to the existing bare-integer form.Test
Added
Test/Snippets/recordalignparens.pasexercising bothalign(16)andalign(IDENT).Verified by parsing the full Delphi 13.1 RTL/VCL source:
Winapi.WindowsandWinapi.Winsock2now parse cleanly (no new regressions across the 2455-unit corpus).