File tree 4 files changed +16
-8
lines changed
4 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -142,10 +142,10 @@ export class AttributeExpression extends Expression {
142
142
}
143
143
144
144
export class VariantExpression extends Expression {
145
- constructor ( id , key ) {
145
+ constructor ( ref , key ) {
146
146
super ( ) ;
147
147
this . type = "VariantExpression" ;
148
- this . id = id ;
148
+ this . ref = ref ;
149
149
this . key = key ;
150
150
}
151
151
}
Original file line number Diff line number Diff line change @@ -619,7 +619,7 @@ export default class FluentParser {
619
619
620
620
ps . expectChar ( "]" ) ;
621
621
622
- return new AST . VariantExpression ( literal . id , key ) ;
622
+ return new AST . VariantExpression ( literal , key ) ;
623
623
}
624
624
625
625
if ( ch === "(" ) {
Original file line number Diff line number Diff line change @@ -269,9 +269,9 @@ function serializeAttributeExpression(expr) {
269
269
270
270
271
271
function serializeVariantExpression ( expr ) {
272
- const id = serializeIdentifier ( expr . id ) ;
272
+ const ref = serializeExpression ( expr . ref ) ;
273
273
const key = serializeVariantKey ( expr . key ) ;
274
- return `${ id } [${ key } ]` ;
274
+ return `${ ref } [${ key } ]` ;
275
275
}
276
276
277
277
Original file line number Diff line number Diff line change 189
189
"type" : " Placeable" ,
190
190
"expression" : {
191
191
"type" : " VariantExpression" ,
192
- "id" : {
193
- "type" : " Identifier" ,
194
- "name" : " -brand-name" ,
192
+ "ref" : {
193
+ "type" : " MessageReference" ,
194
+ "id" : {
195
+ "type" : " Identifier" ,
196
+ "name" : " -brand-name" ,
197
+ "span" : {
198
+ "type" : " Span" ,
199
+ "start" : 145 ,
200
+ "end" : 156
201
+ }
202
+ },
195
203
"span" : {
196
204
"type" : " Span" ,
197
205
"start" : 145 ,
You can’t perform that action at this time.
0 commit comments