@@ -14,7 +14,7 @@ module.exports = grammar({
14
14
$ . mustache_statement ,
15
15
$ . block_statement ,
16
16
$ . element_node ,
17
- $ . text_node
17
+ $ . text_node ,
18
18
) ,
19
19
20
20
//
@@ -61,11 +61,11 @@ module.exports = grammar({
61
61
choice (
62
62
$ . attribute_node ,
63
63
$ . mustache_statement ,
64
- alias ( $ . comment , $ . comment_statement )
65
- )
64
+ alias ( $ . comment , $ . comment_statement ) ,
65
+ ) ,
66
66
) ,
67
67
optional ( $ . block_params ) ,
68
- ">"
68
+ ">" ,
69
69
) ,
70
70
element_node_end : ( $ ) => seq ( "</" , $ . tag_name , ">" ) ,
71
71
@@ -78,17 +78,17 @@ module.exports = grammar({
78
78
choice (
79
79
$ . attribute_node ,
80
80
$ . mustache_statement ,
81
- alias ( $ . comment , $ . comment_statement )
82
- )
81
+ alias ( $ . comment , $ . comment_statement ) ,
82
+ ) ,
83
83
) ,
84
- "/>"
84
+ "/>" ,
85
85
) ,
86
86
87
87
// An "Element" is either a "normal" or "void" element
88
88
element_node : ( $ ) =>
89
89
choice (
90
90
seq ( $ . element_node_start , repeat ( $ . _declaration ) , $ . element_node_end ) ,
91
- $ . element_node_void
91
+ $ . element_node_void ,
92
92
) ,
93
93
94
94
attribute_name : ( ) => / [ ^ < > " ' / = { } ( ) \s \. , ! ? | ] + / ,
@@ -102,18 +102,22 @@ module.exports = grammar({
102
102
optional (
103
103
seq (
104
104
"=" ,
105
- choice ( $ . concat_statement , $ . number_literal , $ . mustache_statement )
106
- )
107
- )
105
+ choice (
106
+ $ . concat_statement ,
107
+ $ . number_literal ,
108
+ $ . mustache_statement ,
109
+ ) ,
110
+ ) ,
111
+ ) ,
108
112
) ,
109
- alias ( $ . _splattributes , $ . attribute_name )
113
+ alias ( $ . _splattributes , $ . attribute_name ) ,
110
114
) ,
111
115
112
116
// Special attribute-value strings that can embed a mustache statement
113
117
concat_statement : ( $ ) =>
114
118
choice (
115
119
$ . _single_quote_concat_statement ,
116
- $ . _double_quote_concat_statement
120
+ $ . _double_quote_concat_statement ,
117
121
) ,
118
122
119
123
_single_quote_concat_statement : ( $ ) =>
@@ -122,27 +126,27 @@ module.exports = grammar({
122
126
repeat (
123
127
choice (
124
128
$ . _mustache_safe_single_quote_string_literal_content ,
125
- $ . mustache_statement
126
- )
129
+ $ . mustache_statement ,
130
+ ) ,
127
131
) ,
128
- "'"
132
+ "'" ,
129
133
) ,
130
134
_double_quote_concat_statement : ( $ ) =>
131
135
seq (
132
136
'"' ,
133
137
repeat (
134
138
choice (
135
139
$ . _mustache_safe_double_quote_string_literal_content ,
136
- $ . mustache_statement
137
- )
140
+ $ . mustache_statement ,
141
+ ) ,
138
142
) ,
139
- '"'
143
+ '"' ,
140
144
) ,
141
145
142
146
_mustache_safe_string_literal : ( $ ) =>
143
147
choice (
144
148
$ . _mustache_safe_single_quote_string_literal ,
145
- $ . _mustache_safe_double_quote_string_literal
149
+ $ . _mustache_safe_double_quote_string_literal ,
146
150
) ,
147
151
_mustache_safe_single_quote_string_literal_content : ( ) => / [ ^ ' \\ { ] + / ,
148
152
_mustache_safe_single_quote_string_literal : ( $ ) =>
@@ -168,7 +172,7 @@ module.exports = grammar({
168
172
$ . boolean_literal ,
169
173
$ . sub_expression ,
170
174
$ . path_expression ,
171
- $ . identifier
175
+ $ . identifier ,
172
176
) ,
173
177
174
178
hash_pair : ( $ ) =>
@@ -178,7 +182,7 @@ module.exports = grammar({
178
182
seq (
179
183
choice ( "{{" , "{{~" ) ,
180
184
choice ( $ . _expression , $ . helper_invocation ) ,
181
- choice ( "}}" , "~}}" )
185
+ choice ( "}}" , "~}}" ) ,
182
186
) ,
183
187
184
188
sub_expression : ( $ ) =>
@@ -190,13 +194,13 @@ module.exports = grammar({
190
194
_arguments : ( $ ) =>
191
195
choice (
192
196
seq ( repeat1 ( field ( "argument" , $ . _expression ) ) , repeat ( $ . hash_pair ) ) ,
193
- seq ( repeat ( field ( "argument" , $ . _expression ) ) , repeat1 ( $ . hash_pair ) )
197
+ seq ( repeat ( field ( "argument" , $ . _expression ) ) , repeat1 ( $ . hash_pair ) ) ,
194
198
) ,
195
199
196
200
helper_invocation : ( $ ) =>
197
201
seq (
198
202
field ( "helper" , choice ( $ . identifier , $ . path_expression ) ) ,
199
- $ . _arguments
203
+ $ . _arguments ,
200
204
) ,
201
205
202
206
//
@@ -209,21 +213,21 @@ module.exports = grammar({
209
213
field ( "path" , $ . identifier ) ,
210
214
$ . _arguments ,
211
215
optional ( $ . block_params ) ,
212
- choice ( "}}" , "~}}" )
216
+ choice ( "}}" , "~}}" ) ,
213
217
) ,
214
218
215
219
block_statement_end : ( $ ) =>
216
220
seq (
217
221
choice ( "{{/" , "{{~/" ) ,
218
222
field ( "path" , $ . identifier ) ,
219
- choice ( "}}" , "~}}" )
223
+ choice ( "}}" , "~}}" ) ,
220
224
) ,
221
225
222
226
block_statement : ( $ ) =>
223
227
seq (
224
228
$ . block_statement_start ,
225
229
field ( "program" , repeat ( $ . _declaration ) ) ,
226
- $ . block_statement_end
230
+ $ . block_statement_end ,
227
231
) ,
228
232
} ,
229
233
} ) ;
0 commit comments