Skip to content

Accept Delphi's 'packed' keyword in type declarations (fixes #246)#314

Open
TetzkatLipHoka wants to merge 1 commit into
remobjects:masterfrom
TetzkatLipHoka:fix/packed-records
Open

Accept Delphi's 'packed' keyword in type declarations (fixes #246)#314
TetzkatLipHoka wants to merge 1 commit into
remobjects:masterfrom
TetzkatLipHoka:fix/packed-records

Conversation

@TetzkatLipHoka

Copy link
Copy Markdown

The parser rejected 'packed record', 'packed array' and 'packed set' in
script type sections and AddTypeS declarations, although PascalScript
records and arrays are always packed anyway - Delphi type declarations
could not be pasted into scripts unchanged.

ReadType now skips a leading 'packed' when a structured type
(record/array/set) follows; anything else after 'packed' is still an
error, and the memory layout is unaffected.

Repro (fails on master, passes with this change, DCC32+DCC64):
type TP = packed record x, y: Integer; end; // script type section
Sender.AddTypeS('THostPacked', 'packed record a: Byte; b: Integer; end');

Fixes #246.

🤖 Generated with Claude Code

…ts#246)

The parser rejected 'packed record', 'packed array' and 'packed set' in
script type sections and AddTypeS declarations, although PascalScript
records and arrays are always packed anyway - Delphi type declarations
could not be pasted into scripts unchanged.

ReadType now skips a leading 'packed' when a structured type
(record/array/set) follows; anything else after 'packed' is still an
error, and the memory layout is unaffected.

Repro (fails on master, passes with this change, DCC32+DCC64):
  type TP = packed record x, y: Integer; end;   // script type section
  Sender.AddTypeS('THostPacked', 'packed record a: Byte; b: Integer; end');

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

packed and bitpacked records

1 participant