Skip to content

Conversation

@tshepang
Copy link
Member

No description provided.


AlignmentDecrease ::=
$$packed$$
$$packed$$ $$($$ DecimalLiteral $$)$$?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately the grammar is not correct. As currently formulated, only the closing parenthesis is optional. You will need to introduce an intermediate production:

$$packed$$ XXX?

XXX ::=
    $$($$ DecimalLiteral $$)$$

Unfortunately I cannot come up with a good name for XXX. PackedValue, AlignmentValue, something else.

I am not sure why attribute repr lacks more legality rules, but I think we should at least consider adding a few rules for this text and this text.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would using a bracket work, like $$packed$$ ($$($$ DecimalLiteral $$)$$)?

Copy link
Contributor

@kirtchev-adacore kirtchev-adacore Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered that, but I found the mix of grouping parentheses and syntactic parentheses a bit confusing. Note that you may also consider the following refactor:

AlignmentDecrease ::=
    packed AlignmentValue?

AlignmentIncrease ::=
   align AlignmentValue

AlignmentValue ::=
    $$($$ DecimalLiteral $$)$$

@tshepang tshepang force-pushed the tshepang/packed-takes-an-arg branch from 73726c6 to a67ffe5 Compare January 29, 2026 12:45
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.

2 participants