Skip to content

Commit 21aec3c

Browse files
bhaibleaphillips
andauthored
A few proposed tweaks to syntax.md. (#745)
* A few proposed tweaks to syntax.md. This assumes that PR #731 is applied. In detail: * Since the reserved keywords start with a `.`, we need to talk about the keyword `.match`, not `match`. * Saying that "A _reserved annotation_ starts with a reserved character" and "A _reserved annotation_ MAY be empty" is a contradiction. Therefore, we need to distinguish a _reserved annotation_ from a _reserved body_. This distinction is also useful because the _reserved body_ occurs in two other places as well. * The statement that a _reserved body_ contains "arbitrary text" is not true, since we have now decided that (unless empty) it must start and end with a non-whitespace character. * A nonterminal `reserved-start` does not exist. What is meant is `reserved-annotation-start`. * The statement "Implementations MUST NOT remove or alter the contents of a _reserved annotation_." needs to be constrained, because now implementations are SUPPOSED to trim whitespace around the _reserved body_. * Subtle wording regarding whitespace around a reserved-body. Co-authored-by: Addison Phillips <[email protected]> --------- Co-authored-by: Addison Phillips <[email protected]>
1 parent 45140a4 commit 21aec3c

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

spec/syntax.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ of the _pattern_ to use for formatting.
347347
This allows the form or content of a _message_ to vary based on values
348348
determined at runtime.
349349

350-
A _matcher_ consists of the keyword `match` followed by at least one _selector_
350+
A _matcher_ consists of the keyword `.match` followed by at least one _selector_
351351
and at least one _variant_.
352352

353353
When the _matcher_ is processed, the result will be a single _pattern_ that serves
@@ -637,17 +637,21 @@ A **_<dfn>reserved annotation</dfn>_** is an _annotation_ whose syntax is reserv
637637
for future standardization.
638638
639639
A _reserved annotation_ starts with a reserved character.
640-
A _reserved annotation_ MAY be empty or contain arbitrary text after its first character.
640+
The remaining part of a _reserved annotation_, called a _reserved body_,
641+
MAY be empty or contain arbitrary text that starts and ends with
642+
a non-whitespace character.
641643
642644
This allows maximum flexibility in future standardization,
643645
as future definitions MAY define additional semantics and constraints
644646
on the contents of these _annotations_.
645-
A _reserved annotation_ does not include trailing whitespace.
646647
647648
Implementations MUST NOT assign meaning or semantics to
648-
an _annotation_ starting with `reserved-start`:
649+
an _annotation_ starting with `reserved-annotation-start`:
649650
these are reserved for future standardization.
650-
Implementations MUST NOT remove or alter the contents of a _reserved annotation_.
651+
Whitespace before or after a _reserved body_ is not part of the _reserved body_.
652+
Implementations MUST NOT remove or alter the contents of a _reserved body_,
653+
including any interior whitespace,
654+
but MAY remove or alter whitespace before or after the _reserved body_.
651655
652656
While a reserved sequence is technically "well-formed",
653657
unrecognized _reserved-annotations_ or _private-use-annotations_ have no meaning.

0 commit comments

Comments
 (0)