File tree 14 files changed +276
-7
lines changed
fluent.syntax/tests/syntax/fixtures_reference
14 files changed +276
-7
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,12 @@ foo = Foo
9
9
-term = Term
10
10
11
11
# Another standalone
12
- #
12
+ #
13
13
# with indent
14
14
## Group Comment
15
15
### Resource Comment
16
+
17
+ # Errors
18
+ #error
19
+ ##error
20
+ ###error
Original file line number Diff line number Diff line change 58
58
{
59
59
"type" : " ResourceComment" ,
60
60
"content" : " Resource Comment"
61
+ },
62
+ {
63
+ "type" : " Comment" ,
64
+ "content" : " Errors"
65
+ },
66
+ {
67
+ "type" : " Junk" ,
68
+ "annotations" : [],
69
+ "content" : " #error\n "
70
+ },
71
+ {
72
+ "type" : " Junk" ,
73
+ "annotations" : [],
74
+ "content" : " ##error\n "
75
+ },
76
+ {
77
+ "type" : " Junk" ,
78
+ "annotations" : [],
79
+ "content" : " ###error\n "
61
80
}
62
81
]
63
82
}
Original file line number Diff line number Diff line change @@ -12,6 +12,9 @@ backslash-in-string = {"\\"}
12
12
mismatched-quote = { " \\ " "}
13
13
# ERROR Unknown escape
14
14
unknown-escape = {" \x " }
15
+ # ERROR Multiline literal
16
+ invalid-multiline-literal = { "
17
+ "}
15
18
16
19
## Unicode escapes
17
20
string-unicode-4digits = {" \u0041 " }
Original file line number Diff line number Diff line change 168
168
{
169
169
"type" : " Junk" ,
170
170
"annotations" : [],
171
- "content" : " unknown-escape = {\"\\ x\" }\n\n "
171
+ "content" : " unknown-escape = {\"\\ x\" }\n "
172
+ },
173
+ {
174
+ "type" : " Comment" ,
175
+ "content" : " ERROR Multiline literal"
176
+ },
177
+ {
178
+ "type" : " Junk" ,
179
+ "annotations" : [],
180
+ "content" : " invalid-multiline-literal = {\"\n \" }\n\n "
172
181
},
173
182
{
174
183
"type" : " GroupComment" ,
Original file line number Diff line number Diff line change @@ -18,6 +18,12 @@ key04 =
18
18
key05 =
19
19
.attr1 = Attribute 1
20
20
21
+ no-whitespace= Value
22
+ .attr1= Attribute 1
23
+
24
+ extra-whitespace = Value
25
+ .attr1 = Attribute 1
26
+
21
27
key06 = { " " }
22
28
23
29
# JUNK Missing value
Original file line number Diff line number Diff line change 205
205
"content" : " < whitespace >"
206
206
}
207
207
},
208
+ {
209
+ "type" : " Message" ,
210
+ "id" : {
211
+ "type" : " Identifier" ,
212
+ "name" : " no-whitespace"
213
+ },
214
+ "value" : {
215
+ "type" : " Pattern" ,
216
+ "elements" : [
217
+ {
218
+ "type" : " TextElement" ,
219
+ "value" : " Value"
220
+ }
221
+ ]
222
+ },
223
+ "attributes" : [
224
+ {
225
+ "type" : " Attribute" ,
226
+ "id" : {
227
+ "type" : " Identifier" ,
228
+ "name" : " attr1"
229
+ },
230
+ "value" : {
231
+ "type" : " Pattern" ,
232
+ "elements" : [
233
+ {
234
+ "type" : " TextElement" ,
235
+ "value" : " Attribute 1"
236
+ }
237
+ ]
238
+ }
239
+ }
240
+ ],
241
+ "comment" : null
242
+ },
243
+ {
244
+ "type" : " Message" ,
245
+ "id" : {
246
+ "type" : " Identifier" ,
247
+ "name" : " extra-whitespace"
248
+ },
249
+ "value" : {
250
+ "type" : " Pattern" ,
251
+ "elements" : [
252
+ {
253
+ "type" : " TextElement" ,
254
+ "value" : " Value"
255
+ }
256
+ ]
257
+ },
258
+ "attributes" : [
259
+ {
260
+ "type" : " Attribute" ,
261
+ "id" : {
262
+ "type" : " Identifier" ,
263
+ "name" : " attr1"
264
+ },
265
+ "value" : {
266
+ "type" : " Pattern" ,
267
+ "elements" : [
268
+ {
269
+ "type" : " TextElement" ,
270
+ "value" : " Attribute 1"
271
+ }
272
+ ]
273
+ }
274
+ }
275
+ ],
276
+ "comment" : null
277
+ },
208
278
{
209
279
"type" : " Message" ,
210
280
"id" : {
Original file line number Diff line number Diff line change @@ -22,13 +22,13 @@ invalid-selector-term-variant =
22
22
}
23
23
24
24
# ERROR Nested expressions are not valid selectors
25
- invalid-selector-select -expression =
25
+ invalid-selector-nested -expression =
26
26
{ { 3 } ->
27
27
*[key] default
28
28
}
29
29
30
30
# ERROR Select expressions are not valid selectors
31
- invalid-selector-nested -expression =
31
+ invalid-selector-select -expression =
32
32
{ { $sel ->
33
33
*[ key ] value
34
34
} ->
@@ -40,6 +40,11 @@ empty-variant =
40
40
*[ key ] { " " }
41
41
}
42
42
43
+ reduced-whitespace =
44
+ { FOO( ) ->
45
+ *[ key ] { " " }
46
+ }
47
+
43
48
nested-select =
44
49
{ $sel ->
45
50
*[ one ] { $sel ->
Original file line number Diff line number Diff line change 152
152
{
153
153
"type" : " Junk" ,
154
154
"annotations" : [],
155
- "content" : " invalid-selector-select -expression =\n { { 3 } ->\n *[key] default\n }\n\n "
155
+ "content" : " invalid-selector-nested -expression =\n { { 3 } ->\n *[key] default\n }\n\n "
156
156
},
157
157
{
158
158
"type" : " Comment" ,
161
161
{
162
162
"type" : " Junk" ,
163
163
"annotations" : [],
164
- "content" : " invalid-selector-nested -expression =\n { { $sel ->\n *[key] value\n } ->\n *[key] default\n }\n\n "
164
+ "content" : " invalid-selector-select -expression =\n { { $sel ->\n *[key] value\n } ->\n *[key] default\n }\n\n "
165
165
},
166
166
{
167
167
"type" : " Message" ,
212
212
"attributes" : [],
213
213
"comment" : null
214
214
},
215
+ {
216
+ "type" : " Message" ,
217
+ "id" : {
218
+ "type" : " Identifier" ,
219
+ "name" : " reduced-whitespace"
220
+ },
221
+ "value" : {
222
+ "type" : " Pattern" ,
223
+ "elements" : [
224
+ {
225
+ "type" : " Placeable" ,
226
+ "expression" : {
227
+ "type" : " SelectExpression" ,
228
+ "selector" : {
229
+ "type" : " FunctionReference" ,
230
+ "id" : {
231
+ "type" : " Identifier" ,
232
+ "name" : " FOO"
233
+ },
234
+ "arguments" : {
235
+ "type" : " CallArguments" ,
236
+ "positional" : [],
237
+ "named" : []
238
+ }
239
+ },
240
+ "variants" : [
241
+ {
242
+ "type" : " Variant" ,
243
+ "key" : {
244
+ "type" : " Identifier" ,
245
+ "name" : " key"
246
+ },
247
+ "value" : {
248
+ "type" : " Pattern" ,
249
+ "elements" : [
250
+ {
251
+ "type" : " Placeable" ,
252
+ "expression" : {
253
+ "value" : " " ,
254
+ "type" : " StringLiteral"
255
+ }
256
+ }
257
+ ]
258
+ },
259
+ "default" : true
260
+ }
261
+ ]
262
+ }
263
+ }
264
+ ]
265
+ },
266
+ "attributes" : [],
267
+ "comment" : null
268
+ },
215
269
{
216
270
"type" : " Message" ,
217
271
"id" : {
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ select-1tbs-indent = {
15
15
select-allman-inline =
16
16
{ $selector ->
17
17
*[key] Value
18
+ [other] Other
18
19
}
19
20
20
21
select-allman-newline =
Original file line number Diff line number Diff line change 176
176
]
177
177
},
178
178
"default" : true
179
+ },
180
+ {
181
+ "type" : " Variant" ,
182
+ "key" : {
183
+ "type" : " Identifier" ,
184
+ "name" : " other"
185
+ },
186
+ "value" : {
187
+ "type" : " Pattern" ,
188
+ "elements" : [
189
+ {
190
+ "type" : " TextElement" ,
191
+ "value" : " Other"
192
+ }
193
+ ]
194
+ },
195
+ "default" : false
179
196
}
180
197
]
181
198
}
Original file line number Diff line number Diff line change 21
21
22
22
# JUNK Missing =
23
23
-term07
24
+
25
+ -term08= Value
26
+ .attr= Attribute
27
+
28
+ -term09 = Value
29
+ .attr = Attribute
Original file line number Diff line number Diff line change 100
100
{
101
101
"type" : " Junk" ,
102
102
"annotations" : [],
103
- "content" : " -term07\n "
103
+ "content" : " -term07\n\n "
104
+ },
105
+ {
106
+ "type" : " Term" ,
107
+ "id" : {
108
+ "type" : " Identifier" ,
109
+ "name" : " term08"
110
+ },
111
+ "value" : {
112
+ "type" : " Pattern" ,
113
+ "elements" : [
114
+ {
115
+ "type" : " TextElement" ,
116
+ "value" : " Value"
117
+ }
118
+ ]
119
+ },
120
+ "attributes" : [
121
+ {
122
+ "type" : " Attribute" ,
123
+ "id" : {
124
+ "type" : " Identifier" ,
125
+ "name" : " attr"
126
+ },
127
+ "value" : {
128
+ "type" : " Pattern" ,
129
+ "elements" : [
130
+ {
131
+ "type" : " TextElement" ,
132
+ "value" : " Attribute"
133
+ }
134
+ ]
135
+ }
136
+ }
137
+ ],
138
+ "comment" : null
139
+ },
140
+ {
141
+ "type" : " Term" ,
142
+ "id" : {
143
+ "type" : " Identifier" ,
144
+ "name" : " term09"
145
+ },
146
+ "value" : {
147
+ "type" : " Pattern" ,
148
+ "elements" : [
149
+ {
150
+ "type" : " TextElement" ,
151
+ "value" : " Value"
152
+ }
153
+ ]
154
+ },
155
+ "attributes" : [
156
+ {
157
+ "type" : " Attribute" ,
158
+ "id" : {
159
+ "type" : " Identifier" ,
160
+ "name" : " attr"
161
+ },
162
+ "value" : {
163
+ "type" : " Pattern" ,
164
+ "elements" : [
165
+ {
166
+ "type" : " TextElement" ,
167
+ "value" : " Attribute"
168
+ }
169
+ ]
170
+ }
171
+ }
172
+ ],
173
+ "comment" : null
104
174
}
105
175
]
106
176
}
Original file line number Diff line number Diff line change
1
+ {
2
+ "type" : " Resource" ,
3
+ "body" : []
4
+ }
You can’t perform that action at this time.
0 commit comments