@@ -17,11 +17,10 @@ Implementations that expose APIs supporting the production, consumption, or tran
1717_ message_ as a data structure are encouraged to use this data model.
1818
1919This data model provides these capabilities:
20- - any MessageFormat 2 message (including future versions)
21- can be parsed into this representation
20+ - any MessageFormat 2.0 message can be parsed into this representation
2221- this data model representation can be serialized as a well-formed
23- MessageFormat 2 message
24- - parsing a MessageFormat 2 message into a data model representation
22+ MessageFormat 2.0 message
23+ - parsing a MessageFormat 2.0 message into a data model representation
2524 and then serializing it results in an equivalently functional message
2625
2726This data model might also be used to:
@@ -98,21 +97,8 @@ The `name` does not include the initial `$` of the _variable_.
9897The ` name ` of an ` InputDeclaration ` MUST be the same
9998as the ` name ` in the ` VariableRef ` of its ` VariableExpression ` ` value ` .
10099
101- An ` UnsupportedStatement ` represents a statement not supported by the implementation.
102- Its ` keyword ` is a non-empty string name (i.e. not including the initial ` . ` ).
103- If not empty, the ` body ` is the "raw" value (i.e. escape sequences are not processed)
104- starting after the keyword and up to the first _ expression_ ,
105- not including leading or trailing whitespace.
106- The non-empty ` expressions ` correspond to the trailing _ expressions_ of the _ reserved statement_ .
107-
108- > [ !NOTE]
109- > Be aware that future versions of this specification
110- > might assign meaning to _ reserved statement_ values.
111- > This would result in new interfaces being added to
112- > this data model.
113-
114100``` ts
115- type Declaration = InputDeclaration | LocalDeclaration | UnsupportedStatement ;
101+ type Declaration = InputDeclaration | LocalDeclaration ;
116102
117103interface InputDeclaration {
118104 type: " input" ;
@@ -125,13 +111,6 @@ interface LocalDeclaration {
125111 name: string ;
126112 value: Expression ;
127113}
128-
129- interface UnsupportedStatement {
130- type: " unsupported-statement" ;
131- keyword: string ;
132- body? : string ;
133- expressions: Expression [];
134- }
135114```
136115
137116In a ` SelectMessage ` ,
@@ -173,34 +152,26 @@ type Pattern = Array<string | Expression | Markup>;
173152type Expression =
174153 | LiteralExpression
175154 | VariableExpression
176- | FunctionExpression
177- | UnsupportedExpression ;
155+ | FunctionExpression ;
178156
179157interface LiteralExpression {
180158 type: " expression" ;
181159 arg: Literal ;
182- annotation ? : FunctionAnnotation | UnsupportedAnnotation ;
160+ function ? : FunctionRef ;
183161 attributes: Attributes ;
184162}
185163
186164interface VariableExpression {
187165 type: " expression" ;
188166 arg: VariableRef ;
189- annotation ? : FunctionAnnotation | UnsupportedAnnotation ;
167+ function ? : FunctionRef ;
190168 attributes: Attributes ;
191169}
192170
193171interface FunctionExpression {
194172 type: " expression" ;
195173 arg? : never ;
196- annotation: FunctionAnnotation ;
197- attributes: Attributes ;
198- }
199-
200- interface UnsupportedExpression {
201- type: " expression" ;
202- arg? : never ;
203- annotation: UnsupportedAnnotation ;
174+ function: FunctionRef ;
204175 attributes: Attributes ;
205176}
206177```
@@ -209,7 +180,7 @@ interface UnsupportedExpression {
209180
210181The ` Literal ` and ` VariableRef ` correspond to the the _ literal_ and _ variable_ syntax rules.
211182When they are used as the ` body ` of an ` Expression ` ,
212- they represent _ expression_ values with no _ annotation _ .
183+ they represent _ expression_ values with no _ function _ .
213184
214185` Literal ` represents all literal values, both _ quoted literal_ and _ unquoted literal_ .
215186The presence or absence of quotes is not preserved by the data model.
@@ -229,14 +200,14 @@ interface VariableRef {
229200}
230201```
231202
232- A ` FunctionAnnotation ` represents a _ function_ _ annotation _ .
203+ A ` FunctionRef ` represents a _ function_ .
233204The ` name ` does not include the ` : ` starting sigil.
234205
235206` Options ` is a key-value mapping containing options,
236- and is used to represent the _ annotation _ and _ markup_ _ options_ .
207+ and is used to represent the _ function _ and _ markup_ _ options_ .
237208
238209``` ts
239- interface FunctionAnnotation {
210+ interface FunctionRef {
240211 type: " function" ;
241212 name: string ;
242213 options: Options ;
@@ -245,31 +216,13 @@ interface FunctionAnnotation {
245216type Options = Map <string , Literal | VariableRef >;
246217```
247218
248- An ` UnsupportedAnnotation ` represents a
249- _ private-use annotation_ not supported by the implementation or a _ reserved annotation_ .
250- The ` source ` is the "raw" value (i.e. escape sequences are not processed),
251- including the starting sigil.
252-
253- When parsing the syntax of a _ message_ that includes a _ private-use annotation_
254- supported by the implementation,
255- the implementation SHOULD represent it in the data model
256- using an interface appropriate for the semantics and meaning
257- that the implementation attaches to that _ annotation_ .
258-
259- ``` ts
260- interface UnsupportedAnnotation {
261- type: " unsupported-annotation" ;
262- source: string ;
263- }
264- ```
265-
266219## Markup
267220
268221A ` Markup ` object has a ` kind ` of either ` "open" ` , ` "standalone" ` , or ` "close" ` ,
269222each corresponding to _ open_ , _ standalone_ , and _ close_ _ markup_ .
270223The ` name ` in these does not include the starting sigils ` # ` and ` / `
271224or the ending sigil ` / ` .
272- The ` options ` for markup use the same key-value mapping as ` FunctionAnnotation ` .
225+ The ` options ` for markup use the same key-value mapping as ` FunctionRef ` .
273226
274227``` ts
275228interface Markup {
0 commit comments