@@ -90,7 +90,7 @@ Attempting to parse a _message_ that is not _well-formed_ will result in a _Synt
90
90
A _ message_ is ** _ <dfn >valid</dfn >_ ** if it is _ well-formed_ and
91
91
** also** meets the additional content restrictions
92
92
and semantic requirements about its structure defined below for
93
- _ declarations_ , _ matcher_ and _ options _ .
93
+ _ declarations_ , _ matcher_ , _ options _ , and _ attributes _ .
94
94
Attempting to parse a _ message_ that is not _ valid_ will result in a _ Data Model Error_ .
95
95
96
96
## The Message
@@ -154,7 +154,7 @@ message = simple-message / complex-message
154
154
155
155
A ** _ <dfn >simple message</dfn >_ ** contains a single _ pattern_ ,
156
156
with restrictions on its first non-whitespace character.
157
- An empty string is a valid _ simple message_ .
157
+ An empty string is a _ valid _ _ simple message_ .
158
158
159
159
Whitespace at the start or end of a _ simple message_ is significant,
160
160
and a part of the _ text_ of the _ message_ .
@@ -445,7 +445,7 @@ There MAY be any number of additional _selectors_.
445
445
446
446
A **_<dfn>variant</dfn>_** is a _quoted pattern_ associated with a list of _keys_ in a _matcher_.
447
447
Each _variant_ MUST begin with a sequence of _keys_,
448
- and terminate with a valid _quoted pattern_.
448
+ and terminate with a _valid_ _quoted pattern_.
449
449
The number of _keys_ in each _variant_ MUST match the number of _selectors_ in the _matcher_.
450
450
451
451
Each _key_ is separated from each other by whitespace.
@@ -555,7 +555,7 @@ A _function_'s entry in the _function registry_ will define
555
555
whether the _ function_ is a _ selector_ or formatter (or both),
556
556
whether an _ operand_ is required,
557
557
what form the values of an _ operand_ can take,
558
- what _ options_ and _ option_ values are valid ,
558
+ what _ options_ and _ option_ values are acceptable ,
559
559
and what outputs might result.
560
560
See [ function registry] ( ./registry.md ) for more information.
561
561
@@ -587,7 +587,7 @@ Multiple _options_ are permitted in an _annotation_.
587
587
_Options_ are separated from the preceding _function_ _identifier_
588
588
and from each other by whitespace.
589
589
Each _option_'s _identifier_ MUST be unique within the _annotation_:
590
- an _annotation_ with duplicate _option_ _identifiers_ is not valid .
590
+ an _annotation_ with duplicate _option_ _identifiers_ is not _valid_ .
591
591
592
592
The order of _options_ is not significant.
593
593
@@ -723,7 +723,8 @@ markup = "{" [s] "#" identifier *(s option) *(s attribute) [s] ["/"] "}" ; open
723
723
> {#button}Submit{/button} or {#img alt=|Cancel| /}.
724
724
> ```
725
725
726
- > A _message_ with attributes in the closing tag:
726
+ > A _message_ containing _markup_ that uses _options_ to pair
727
+ > two closing markup _placeholders_ to the one open markup _placeholder_:
727
728
>
728
729
> ```
729
730
> {#ansi attr=|bold,italic|}Bold and italic{/ansi attr=|bold|} italic only {/ansi attr=|italic|} no formatting.}
@@ -737,66 +738,25 @@ on the pairing, ordering, or contents of _markup_ during _formatting_.
737
738
738
739
## Attributes
739
740
740
- **_Attributes_ are reserved for standardization by future versions of this specification._**
741
- Examples in this section are meant to be illustrative and
742
- might not match future requirements or usage.
743
-
744
- > [!NOTE]
745
- > The Tech Preview does not provide a built-in mechanism for overriding
746
- > values in the _formatting context_ (most notably the locale)
747
- > Nor does it provide a mechanism for identifying specific expressions
748
- > such as by assigning a name or id.
749
- > The utility of these types of mechanisms has been debated.
750
- > There are at least two proposed mechanisms for implementing support for
751
- > these.
752
- > Specifically, one mechanism would be to reserve specifically-named options,
753
- > possibly using a Unicode namespace (i.e. `locale=xxx` or `u:locale=xxx`).
754
- > Such options would be reserved for use in any and all functions or markup.
755
- > The other mechanism would be to use the reserved "expression attribute" syntax
756
- > for this purpose (i.e. `@locale=xxx` or `@id=foo`)
757
- > Neither mechanism was included in this Tech Preview.
758
- > Feedback on the preferred mechanism for managing these features
759
- > is strongly desired.
760
- >
761
- > In the meantime, function authors and other implementers are cautioned to avoid creating
762
- > function-specific or implementation-specific option values for this purpose.
763
- > One workaround would be to use the implementation's namespace for these
764
- > features to insure later interoperability when such a mechanism is finalized
765
- > during the Tech Preview period.
766
- > Specifically:
767
- > - Avoid specifying an option for setting the locale of an expression as different from
768
- > that of the overall _message_ locale, or use a namespace that later maps to the final
769
- > mechanism.
770
- > - Avoid specifying options for the purpose of linking placeholders
771
- > (such as to pair opening markup to closing markup).
772
- > If such an option is created, the implementer should use an
773
- > implementation-specific namespace.
774
- > Users and implementers are cautioned that such options might be
775
- > replaced with a standard mechanism in a future version.
776
- > - Avoid specifying generic options to communicate with translators and
777
- > translation tooling (i.e. implementation-specific options that apply to all
778
- > functions.
779
- > The above are all desirable features.
780
- > We welcome contributions to and proposals for such features during the
781
- > Technical Preview.
782
-
783
741
An **_<dfn>attribute</dfn>_** is an _identifier_ with an optional value
784
742
that appears in an _expression_ or in _markup_.
743
+ During formatting, _attributes_ have no effect,
744
+ and they can be treated as code comments.
785
745
786
746
_Attributes_ are prefixed by a U+0040 COMMERCIAL AT `@` sign,
787
747
followed by an _identifier_.
788
- An _attribute_ MAY have a _value_ which is separated from the _identifier_
748
+ An _attribute_ MAY have a _literal_ _value_ which is separated from the _identifier_
789
749
by an U+003D EQUALS SIGN `=` along with optional whitespace.
790
- The _value_ of an _attribute_ can be either a _literal_ or a _variable_.
791
750
792
751
Multiple _attributes_ are permitted in an _expression_ or _markup_.
793
752
Each _attribute_ is separated by whitespace.
753
+ Each _attribute_'s _identifier_ MUST be unique within the _expression_ or _markup_:
754
+ an _expression_ or _markup_ with duplicate _attribute_ _identifiers_ is not _valid_.
794
755
795
756
The order of _attributes_ is not significant.
796
757
797
-
798
758
```abnf
799
- attribute = "@" identifier [[s] "=" [s] ( literal / variable) ]
759
+ attribute = "@" identifier [[s] "=" [s] literal]
800
760
```
801
761
802
762
> Examples of _ expressions_ and _ markup_ with _ attributes_ :
0 commit comments