@@ -90,7 +90,7 @@ Attempting to parse a _message_ that is not _well-formed_ will result in a _Synt
9090A _ message_ is ** _ <dfn >valid</dfn >_ ** if it is _ well-formed_ and
9191** also** meets the additional content restrictions
9292and semantic requirements about its structure defined below for
93- _ declarations_ , _ matcher_ and _ options _ .
93+ _ declarations_ , _ matcher_ , _ options _ , and _ attributes _ .
9494Attempting to parse a _ message_ that is not _ valid_ will result in a _ Data Model Error_ .
9595
9696## The Message
@@ -154,7 +154,7 @@ message = simple-message / complex-message
154154
155155A ** _ <dfn >simple message</dfn >_ ** contains a single _ pattern_ ,
156156with 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_ .
158158
159159Whitespace at the start or end of a _ simple message_ is significant,
160160and a part of the _ text_ of the _ message_ .
@@ -445,7 +445,7 @@ There MAY be any number of additional _selectors_.
445445
446446A **_<dfn>variant</dfn>_** is a _quoted pattern_ associated with a list of _keys_ in a _matcher_.
447447Each _variant_ MUST begin with a sequence of _keys_,
448- and terminate with a valid _quoted pattern_.
448+ and terminate with a _valid_ _quoted pattern_.
449449The number of _keys_ in each _variant_ MUST match the number of _selectors_ in the _matcher_.
450450
451451Each _key_ is separated from each other by whitespace.
@@ -555,7 +555,7 @@ A _function_'s entry in the _function registry_ will define
555555whether the _ function_ is a _ selector_ or formatter (or both),
556556whether an _ operand_ is required,
557557what form the values of an _ operand_ can take,
558- what _ options_ and _ option_ values are valid ,
558+ what _ options_ and _ option_ values are acceptable ,
559559and what outputs might result.
560560See [ function registry] ( ./registry.md ) for more information.
561561
@@ -587,7 +587,7 @@ Multiple _options_ are permitted in an _annotation_.
587587_Options_ are separated from the preceding _function_ _identifier_
588588and from each other by whitespace.
589589Each _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_ .
591591
592592The order of _options_ is not significant.
593593
@@ -723,7 +723,8 @@ markup = "{" [s] "#" identifier *(s option) *(s attribute) [s] ["/"] "}" ; open
723723> {#button}Submit{/button} or {#img alt=|Cancel| /}.
724724> ```
725725
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_:
727728>
728729> ```
729730> {#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_.
737738
738739## Attributes
739740
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-
783741An **_<dfn>attribute</dfn>_** is an _identifier_ with an optional value
784742that appears in an _expression_ or in _markup_.
743+ During formatting, _attributes_ have no effect,
744+ and they can be treated as code comments.
785745
786746_Attributes_ are prefixed by a U+0040 COMMERCIAL AT `@` sign,
787747followed 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_
789749by an U+003D EQUALS SIGN `=` along with optional whitespace.
790- The _value_ of an _attribute_ can be either a _literal_ or a _variable_.
791750
792751Multiple _attributes_ are permitted in an _expression_ or _markup_.
793752Each _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_.
794755
795756The order of _attributes_ is not significant.
796757
797-
798758```abnf
799- attribute = "@" identifier [[s] "=" [s] ( literal / variable) ]
759+ attribute = "@" identifier [[s] "=" [s] literal]
800760```
801761
802762> Examples of _ expressions_ and _ markup_ with _ attributes_ :
0 commit comments