@@ -17,11 +17,10 @@ Implementations that expose APIs supporting the production, consumption, or tran
17
17
_ message_ as a data structure are encouraged to use this data model.
18
18
19
19
This 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
22
21
- 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
25
24
and then serializing it results in an equivalently functional message
26
25
27
26
This data model might also be used to:
@@ -98,21 +97,8 @@ The `name` does not include the initial `$` of the _variable_.
98
97
The ` name ` of an ` InputDeclaration ` MUST be the same
99
98
as the ` name ` in the ` VariableRef ` of its ` VariableExpression ` ` value ` .
100
99
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
-
114
100
``` ts
115
- type Declaration = InputDeclaration | LocalDeclaration | UnsupportedStatement ;
101
+ type Declaration = InputDeclaration | LocalDeclaration ;
116
102
117
103
interface InputDeclaration {
118
104
type: " input" ;
@@ -125,13 +111,6 @@ interface LocalDeclaration {
125
111
name: string ;
126
112
value: Expression ;
127
113
}
128
-
129
- interface UnsupportedStatement {
130
- type: " unsupported-statement" ;
131
- keyword: string ;
132
- body? : string ;
133
- expressions: Expression [];
134
- }
135
114
```
136
115
137
116
In a ` SelectMessage ` ,
@@ -173,34 +152,26 @@ type Pattern = Array<string | Expression | Markup>;
173
152
type Expression =
174
153
| LiteralExpression
175
154
| VariableExpression
176
- | FunctionExpression
177
- | UnsupportedExpression ;
155
+ | FunctionExpression ;
178
156
179
157
interface LiteralExpression {
180
158
type: " expression" ;
181
159
arg: Literal ;
182
- annotation ? : FunctionAnnotation | UnsupportedAnnotation ;
160
+ function ? : FunctionRef ;
183
161
attributes: Attributes ;
184
162
}
185
163
186
164
interface VariableExpression {
187
165
type: " expression" ;
188
166
arg: VariableRef ;
189
- annotation ? : FunctionAnnotation | UnsupportedAnnotation ;
167
+ function ? : FunctionRef ;
190
168
attributes: Attributes ;
191
169
}
192
170
193
171
interface FunctionExpression {
194
172
type: " expression" ;
195
173
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 ;
204
175
attributes: Attributes ;
205
176
}
206
177
```
@@ -209,7 +180,7 @@ interface UnsupportedExpression {
209
180
210
181
The ` Literal ` and ` VariableRef ` correspond to the the _ literal_ and _ variable_ syntax rules.
211
182
When 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 _ .
213
184
214
185
` Literal ` represents all literal values, both _ quoted literal_ and _ unquoted literal_ .
215
186
The presence or absence of quotes is not preserved by the data model.
@@ -229,14 +200,14 @@ interface VariableRef {
229
200
}
230
201
```
231
202
232
- A ` FunctionAnnotation ` represents a _ function_ _ annotation _ .
203
+ A ` FunctionRef ` represents a _ function_ .
233
204
The ` name ` does not include the ` : ` starting sigil.
234
205
235
206
` 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_ .
237
208
238
209
``` ts
239
- interface FunctionAnnotation {
210
+ interface FunctionRef {
240
211
type: " function" ;
241
212
name: string ;
242
213
options: Options ;
@@ -245,31 +216,13 @@ interface FunctionAnnotation {
245
216
type Options = Map <string , Literal | VariableRef >;
246
217
```
247
218
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
-
266
219
## Markup
267
220
268
221
A ` Markup ` object has a ` kind ` of either ` "open" ` , ` "standalone" ` , or ` "close" ` ,
269
222
each corresponding to _ open_ , _ standalone_ , and _ close_ _ markup_ .
270
223
The ` name ` in these does not include the starting sigils ` # ` and ` / `
271
224
or 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 ` .
273
226
274
227
``` ts
275
228
interface Markup {
0 commit comments