You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update the specification section about metadata (#3787)
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.
0 commit comments