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, {
138138 '}' ,
139139 ) ,
140140
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' ) ,
146142 else_if_start : $ => seq (
147143 '{' ,
148- alias ( $ . else_if_tag , $ . block_tag ) ,
144+ alias ( $ . _else_if_tag , $ . block_tag ) ,
149145 field ( 'condition' , $ . svelte_raw_text ) ,
150146 '}' ,
151147 ) ,
@@ -312,11 +308,13 @@ module.exports = grammar(HTML, {
312308/**
313309 * @param {string } sym
314310 * @param {string } text
311+ * @rest param {string} ...other
315312 * @return {SeqRule }
316313 */
317- function tag ( sym , text ) {
314+ function tag ( sym , text , ... other ) {
318315 return seq (
319316 sym ,
320317 field ( 'tag' , token . immediate ( text ) ) ,
318+ ...other . map ( rule => field ( 'tag' , rule ) ) ,
321319 ) ;
322320}
You can’t perform that action at this time.
0 commit comments