File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -138,14 +138,10 @@ module.exports = grammar(HTML, {
138
138
'}' ,
139
139
) ,
140
140
141
- // Since 'else' and 'if' are separated by space, we cannot put them in a simple tag() like $._else_tag or $._if_start_tag
142
- else_if_tag : $ => seq (
143
- tag ( ':' , 'else' ) ,
144
- field ( 'tag' , 'if' ) ,
145
- ) ,
141
+ _else_if_tag : _ => tag ( ':' , 'else' , 'if' ) ,
146
142
else_if_start : $ => seq (
147
143
'{' ,
148
- alias ( $ . else_if_tag , $ . block_tag ) ,
144
+ alias ( $ . _else_if_tag , $ . block_tag ) ,
149
145
field ( 'condition' , $ . svelte_raw_text ) ,
150
146
'}' ,
151
147
) ,
@@ -312,11 +308,13 @@ module.exports = grammar(HTML, {
312
308
/**
313
309
* @param {string } sym
314
310
* @param {string } text
311
+ * @rest param {string} ...other
315
312
* @return {SeqRule }
316
313
*/
317
- function tag ( sym , text ) {
314
+ function tag ( sym , text , ... other ) {
318
315
return seq (
319
316
sym ,
320
317
field ( 'tag' , token . immediate ( text ) ) ,
318
+ ...other . map ( rule => field ( 'tag' , rule ) ) ,
321
319
) ;
322
320
}
You can’t perform that action at this time.
0 commit comments