-
-
Notifications
You must be signed in to change notification settings - Fork 36
Clarify error & fallback handling #879
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
389d839
Clarify error & fallback handling
eemeli 7ef3508
Apply suggestions from code review
eemeli 25ba6a2
Select last rather than first attribute
eemeli 4e249fa
Drop mention of "starting with Pattern Selection"
eemeli 022c806
Attributes can't change the formatted output
eemeli 75da938
Use "nor" instead of "or" regarding attribute restrictions
eemeli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,7 +90,7 @@ Attempting to parse a _message_ that is not _well-formed_ will result in a _Synt | |
A _message_ is **_<dfn>valid</dfn>_** if it is _well-formed_ and | ||
**also** meets the additional content restrictions | ||
and semantic requirements about its structure defined below for | ||
_declarations_, _matcher_, _options_, and _attributes_. | ||
_declarations_, _matcher_, and _options_. | ||
Attempting to parse a _message_ that is not _valid_ will result in a _Data Model Error_. | ||
|
||
## The Message | ||
|
@@ -368,14 +368,18 @@ and at least one _variant_. | |
When the _matcher_ is processed, the result will be a single _pattern_ that serves | ||
as the template for the formatting process. | ||
|
||
A _message_ can only be considered _valid_ if the following requirements are | ||
satisfied: | ||
A _message_ can only be considered _valid_ if the following requirements are satisfied; | ||
otherwise, a corresponding _Data Model Error_ will be produced during processing: | ||
|
||
- The number of _keys_ on each _variant_ MUST be equal to the number of _selectors_. | ||
- At least one _variant_ MUST exist whose _keys_ are all equal to the "catch-all" key `*`. | ||
- Each _selector_ MUST have an _annotation_, | ||
- _Variant Key Mismatch_: | ||
The number of _keys_ on each _variant_ MUST be equal to the number of _selectors_. | ||
- _Missing Fallback Variant_: | ||
At least one _variant_ MUST exist whose _keys_ are all equal to the "catch-all" key `*`. | ||
- _Missing Selector Annotation_: | ||
Each _selector_ MUST have an _annotation_, | ||
or contain a _variable_ that directly or indirectly references a _declaration_ with an _annotation_. | ||
Comment on lines
+378
to
380
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This text might change on Monday 😸 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm aware; will resolve conflicts after whichever lands first. |
||
- Each _variant_ MUST use a list of _keys_ that is unique from that | ||
- _Duplicate Variant_: | ||
Each _variant_ MUST use a list of _keys_ that is unique from that | ||
of all other _variants_ in the _message_. | ||
_Literal_ _keys_ are compared by their contents, not their syntactical appearance. | ||
|
||
|
@@ -587,7 +591,8 @@ Multiple _options_ are permitted in an _annotation_. | |
_Options_ are separated from the preceding _function_ _identifier_ | ||
and from each other by whitespace. | ||
Each _option_'s _identifier_ MUST be unique within the _annotation_: | ||
an _annotation_ with duplicate _option_ _identifiers_ is not _valid_. | ||
an _annotation_ with duplicate _option_ _identifiers_ is not _valid_ | ||
and will produce a _Duplicate Option Name_ error during processing. | ||
|
||
The order of _options_ is not significant. | ||
|
||
|
@@ -750,10 +755,10 @@ by an U+003D EQUALS SIGN `=` along with optional whitespace. | |
|
||
Multiple _attributes_ are permitted in an _expression_ or _markup_. | ||
Each _attribute_ is separated by whitespace. | ||
Each _attribute_'s _identifier_ MUST be unique within the _expression_ or _markup_: | ||
an _expression_ or _markup_ with duplicate _attribute_ _identifiers_ is not _valid_. | ||
|
||
The order of _attributes_ is not significant. | ||
Each _attribute_'s _identifier_ SHOULD be unique within the _expression_ or _markup_: | ||
all but the last _attribute_ with the same _identifier_ are ignored. | ||
The order of _attributes_ is not otherwise significant. | ||
|
||
```abnf | ||
attribute = "@" identifier [[s] "=" [s] literal] | ||
|
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.
Uh oh!
There was an error while loading. Please reload this page.