Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2eb48cf

Browse files
macchiatiaphillipseemeli
authored
Literal keys contents / values (#1036)
* Literal keys contents / values * Apply suggestions from code review Merge @eemeli's suggestions plus the "forked" suggestion from Mark Co-authored-by: Eemeli Aro <[email protected]> * fix merge fiasco --------- Co-authored-by: Addison Phillips <[email protected]> Co-authored-by: Eemeli Aro <[email protected]>
1 parent 3c82b43 commit 2eb48cf

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

spec/syntax.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ otherwise, a corresponding _Data Model Error_ will be produced during processing
369369
- _Duplicate Variant_:
370370
Each _variant_ MUST use a list of _keys_ that is unique from that
371371
of all other _variants_ in the _message_.
372-
_Literal_ _keys_ are compared by their contents, not their syntactical appearance.
372+
_Literal_ _keys_ are compared by their _string values_, not their syntactical appearance.
373373

374374
```abnf
375375
matcher = match-statement s variant *(o variant)
@@ -470,7 +470,7 @@ that matches all values for a given _selector_.
470470
471471
The value of each _literal_ _key_ MUST be treated as if it were in
472472
[Unicode Normalization Form C](https://unicode.org/reports/tr15/) ("NFC").
473-
Two _literal_ _keys_ are considered equal if they are canonically equivalent strings,
473+
Two _literal_ _keys_ are considered equal if their _string values_ are canonically equivalent strings,
474474
that is, if they consist of the same sequence of Unicode code points after
475475
Unicode Normalization Form C has been applied to both.
476476
@@ -742,8 +742,9 @@ escaped as `\\` and `\|`.
742742
743743
An **_<dfn>unquoted literal</dfn>_** is a _literal_ that does not require the `|`
744744
quotes around it to be distinct from the rest of the _message_ syntax.
745-
An _unquoted literal_ MAY be used when the content of the _literal_
746-
contains no whitespace and otherwise matches the `unquoted-literal` production.
745+
An _unquoted literal_ MAY be used when the _string value_ of the _literal_
746+
matches the `unquoted-literal` production.
747+
It will thus contain no whitespace (nor certain other characters).
747748
Implementations MUST NOT distinguish between _quoted literals_ and _unquoted literals_
748749
that have the same sequence of code points.
749750

@@ -755,6 +756,11 @@ literal = quoted-literal / unquoted-literal
755756
quoted-literal = "|" *(quoted-char / escaped-char) "|"
756757
unquoted-literal = 1*name-char
757758
```
759+
The **_<dfn>string value</dfn>_** of a _literal_
760+
for _unquoted literals_ is the text content of that _literal_;
761+
or for _quoted literals_, the text content of that _literal_
762+
after removing the enclosing `|` characters
763+
then unescaping any escaped characters.
758764

759765
#### Names and Identifiers
760766

0 commit comments

Comments
 (0)