File tree 8 files changed +80
-5
lines changed 8 files changed +80
-5
lines changed Original file line number Diff line number Diff line change @@ -102,8 +102,9 @@ any_char ::= [\\u{9}\\u{20}-\\u{D7FF}\\u{E000}-\\u{FFFD}]
102
102
* new line.
103
103
*/
104
104
special_text_char ::= " {"
105
+ | " }"
105
106
text_char ::= any_char - special_text_char
106
- indented_char ::= text_char - " } " - " [" - " *" - " ."
107
+ indented_char ::= text_char - " [" - " *" - " ."
107
108
108
109
/* String literals
109
110
*
Original file line number Diff line number Diff line change @@ -397,7 +397,9 @@ let any_char =
397
397
*/
398
398
399
399
let special_text_char =
400
- string ( "{" ) ;
400
+ either (
401
+ string ( "{" ) ,
402
+ string ( "}" ) ) ;
401
403
402
404
let text_char =
403
405
and (
@@ -409,7 +411,6 @@ let indented_char =
409
411
not ( string ( "." ) ) ,
410
412
not ( string ( "*" ) ) ,
411
413
not ( string ( "[" ) ) ,
412
- not ( string ( "}" ) ) ,
413
414
text_char ) ;
414
415
415
416
/* -------------------------------------------------------------------------- */
Original file line number Diff line number Diff line change @@ -19,4 +19,4 @@ string-escaped-unicode = {"\\u0041"}
19
19
20
20
## Literal braces
21
21
brace-open = An opening { " { " } brace.
22
- brace-close = A closing } brace.
22
+ brace-close = A closing { " } " } brace.
Original file line number Diff line number Diff line change 259
259
"elements" : [
260
260
{
261
261
"type" : " TextElement" ,
262
- "value" : " A closing } brace."
262
+ "value" : " A closing "
263
+ },
264
+ {
265
+ "type" : " Placeable" ,
266
+ "expression" : {
267
+ "type" : " StringLiteral" ,
268
+ "value" : " }"
269
+ }
270
+ },
271
+ {
272
+ "type" : " TextElement" ,
273
+ "value" : " brace."
263
274
}
264
275
]
265
276
},
Original file line number Diff line number Diff line change 1
1
nested-placeable = { {{1 } }}
2
2
padded-placeable = { 1 }
3
3
sparse-placeable = { { 1 } }
4
+
5
+ # ERROR Unmatched opening brace
6
+ unmatched-open1 = { 1
7
+
8
+ # ERROR Unmatched opening brace
9
+ unmatched-open2 = {{ 1 }
10
+
11
+ # ERROR Unmatched closing brace
12
+ unmatched-close1 = 1 }
13
+
14
+ # ERROR Unmatched closing brace
15
+ unmatched-close2 = { 1 } }
Original file line number Diff line number Diff line change 72
72
},
73
73
"attributes" : [],
74
74
"comment" : null
75
+ },
76
+ {
77
+ "type" : " Comment" ,
78
+ "content" : " ERROR Unmatched opening brace"
79
+ },
80
+ {
81
+ "type" : " Junk" ,
82
+ "annotations" : [],
83
+ "content" : " unmatched-open1 = { 1\n "
84
+ },
85
+ {
86
+ "type" : " Comment" ,
87
+ "content" : " ERROR Unmatched opening brace"
88
+ },
89
+ {
90
+ "type" : " Junk" ,
91
+ "annotations" : [],
92
+ "content" : " unmatched-open2 = {{ 1 }\n "
93
+ },
94
+ {
95
+ "type" : " Comment" ,
96
+ "content" : " ERROR Unmatched closing brace"
97
+ },
98
+ {
99
+ "type" : " Junk" ,
100
+ "annotations" : [],
101
+ "content" : " unmatched-close1 = 1 }\n "
102
+ },
103
+ {
104
+ "type" : " Comment" ,
105
+ "content" : " ERROR Unmatched closing brace"
106
+ },
107
+ {
108
+ "type" : " Junk" ,
109
+ "annotations" : [],
110
+ "content" : " unmatched-close2 = { 1 }}\n "
75
111
}
76
112
]
77
113
}
Original file line number Diff line number Diff line change @@ -34,3 +34,8 @@ nested-variant-list =
34
34
*[two ] Value
35
35
}
36
36
}
37
+
38
+ # ERROR Missing line end after variant list
39
+ missing-line-end =
40
+ { 1 ->
41
+ *[ one ] One}
Original file line number Diff line number Diff line change 257
257
"type" : " Junk" ,
258
258
"annotations" : [],
259
259
"content" : " nested-variant-list =\n { 1 ->\n *[one] {\n *[two] Value\n }\n }\n "
260
+ },
261
+ {
262
+ "type" : " Comment" ,
263
+ "content" : " ERROR Missing line end after variant list"
264
+ },
265
+ {
266
+ "type" : " Junk" ,
267
+ "annotations" : [],
268
+ "content" : " missing-line-end =\n { 1 ->\n *[one] One}\n "
260
269
}
261
270
]
262
271
}
You can’t perform that action at this time.
0 commit comments