Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the specification section about metadata #3787

Merged
merged 2 commits into from
May 8, 2024

Conversation

eernstg
Copy link
Member

@eernstg eernstg commented May 8, 2024

The association that binds each metadatum in a Dart program to a language construct is specified in a way that is somewhat inconsistent with the grammar. For example, it associates the metadata declared in front of a <libraryName> with the keyword library, not with the library name directive as a whole.

This PR changes the wording such that metadata which occurs at the beginning of a grammar rule is associated with the construct as a whole. If the metadata occurs in any other location in the rule then we continue to use the rule which is specified prior to this PR: The metadata is associated with the program construct which is derived from the following non-terminal. The latter rule works well with cases like <classDeclaration> ::= ... (<metadata> <classMemberDeclaration>)* ....

This PR also adds a small amount of rationale text, saying that this whole topic has an implementation specific element, and the normative rules are intentionally somewhat flexible. We trust all tool maintainers to maintain a reasonable amount of consistency, and provide just a few normative rules in order to make it easier to be consistent, insofar as this is possible with the given program representation.

Fixes #3773.

@eernstg eernstg requested a review from lrhn May 8, 2024 14:16
@eernstg eernstg merged commit a1bf79d into main May 8, 2024
4 checks passed
@eernstg eernstg deleted the specify_metadata_by_grammar_may24 branch May 8, 2024 15:50
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.

Minor omission in metadata section of spec
2 participants