File tree Expand file tree Collapse file tree 14 files changed +276
-7
lines changed
fluent.syntax/tests/syntax/fixtures_reference Expand file tree Collapse file tree 14 files changed +276
-7
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,12 @@ foo = Foo
99-term = Term
1010
1111# Another standalone
12- #
12+ #
1313# with indent
1414## Group Comment
1515### Resource Comment
16+
17+ # Errors
18+ #error
19+ ##error
20+ ###error
Original file line number Diff line number Diff line change 5858 {
5959 "type" : " ResourceComment" ,
6060 "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 "
6180 }
6281 ]
6382}
Original file line number Diff line number Diff line change @@ -12,6 +12,9 @@ backslash-in-string = {"\\"}
1212mismatched-quote = { " \\ " "}
1313# ERROR Unknown escape
1414unknown-escape = {" \x " }
15+ # ERROR Multiline literal
16+ invalid-multiline-literal = { "
17+ "}
1518
1619## Unicode escapes
1720string-unicode-4digits = {" \u0041 " }
Original file line number Diff line number Diff line change 168168 {
169169 "type" : " Junk" ,
170170 "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 "
172181 },
173182 {
174183 "type" : " GroupComment" ,
Original file line number Diff line number Diff line change @@ -18,6 +18,12 @@ key04 =
1818key05 =
1919 .attr1 = Attribute 1
2020
21+ no-whitespace= Value
22+ .attr1= Attribute 1
23+
24+ extra-whitespace = Value
25+ .attr1 = Attribute 1
26+
2127key06 = { " " }
2228
2329# JUNK Missing value
Original file line number Diff line number Diff line change 205205 "content" : " < whitespace >"
206206 }
207207 },
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+ },
208278 {
209279 "type" : " Message" ,
210280 "id" : {
Original file line number Diff line number Diff line change @@ -22,13 +22,13 @@ invalid-selector-term-variant =
2222 }
2323
2424# ERROR Nested expressions are not valid selectors
25- invalid-selector-select -expression =
25+ invalid-selector-nested -expression =
2626 { { 3 } ->
2727 *[key] default
2828 }
2929
3030# ERROR Select expressions are not valid selectors
31- invalid-selector-nested -expression =
31+ invalid-selector-select -expression =
3232 { { $sel ->
3333 *[ key ] value
3434 } ->
@@ -40,6 +40,11 @@ empty-variant =
4040 *[ key ] { " " }
4141 }
4242
43+ reduced-whitespace =
44+ { FOO( ) ->
45+ *[ key ] { " " }
46+ }
47+
4348nested-select =
4449 { $sel ->
4550 *[ one ] { $sel ->
Original file line number Diff line number Diff line change 152152 {
153153 "type" : " Junk" ,
154154 "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 "
156156 },
157157 {
158158 "type" : " Comment" ,
161161 {
162162 "type" : " Junk" ,
163163 "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 "
165165 },
166166 {
167167 "type" : " Message" ,
212212 "attributes" : [],
213213 "comment" : null
214214 },
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+ },
215269 {
216270 "type" : " Message" ,
217271 "id" : {
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ select-1tbs-indent = {
1515select-allman-inline =
1616{ $selector ->
1717 *[key] Value
18+ [other] Other
1819}
1920
2021select-allman-newline =
Original file line number Diff line number Diff line change 176176 ]
177177 },
178178 "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
179196 }
180197 ]
181198 }
You can’t perform that action at this time.
0 commit comments