@@ -319,13 +319,13 @@ function open(parser) {
319
319
320
320
/** @param {import('../index.js').Parser } parser */
321
321
function next ( parser ) {
322
- const start = parser . index - 1 ;
322
+ const next_to_bracket = parser . index - 1 ;
323
323
324
324
const block = parser . current ( ) ; // TODO type should not be TemplateNode, that's much too broad
325
325
326
326
if ( block . type === 'IfBlock' ) {
327
- if ( ! parser . eat ( 'else' ) ) e . expected_token ( start , '{:else} or {:else if}' ) ;
328
- if ( parser . eat ( 'if' ) ) e . block_invalid_elseif ( start ) ;
327
+ if ( ! parser . eat ( 'else' ) ) e . expected_token ( next_to_bracket , '{:else} or {:else if}' ) ;
328
+ if ( parser . eat ( 'if' ) ) e . block_invalid_elseif ( next_to_bracket ) ;
329
329
330
330
parser . allow_whitespace ( ) ;
331
331
@@ -345,7 +345,7 @@ function next(parser) {
345
345
346
346
/** @type {ReturnType<typeof parser.append<import('#compiler').IfBlock>> } */
347
347
const child = parser . append ( {
348
- start : parser . index ,
348
+ start : next_to_bracket - 1 ,
349
349
end : - 1 ,
350
350
type : 'IfBlock' ,
351
351
elseif : true ,
@@ -367,7 +367,7 @@ function next(parser) {
367
367
}
368
368
369
369
if ( block . type === 'EachBlock' ) {
370
- if ( ! parser . eat ( 'else' ) ) e . expected_token ( start , '{:else}' ) ;
370
+ if ( ! parser . eat ( 'else' ) ) e . expected_token ( next_to_bracket , '{:else}' ) ;
371
371
372
372
parser . allow_whitespace ( ) ;
373
373
parser . eat ( '}' , true ) ;
@@ -383,7 +383,7 @@ function next(parser) {
383
383
if ( block . type === 'AwaitBlock' ) {
384
384
if ( parser . eat ( 'then' ) ) {
385
385
if ( block . then ) {
386
- e . block_duplicate_clause ( start , '{:then}' ) ;
386
+ e . block_duplicate_clause ( next_to_bracket , '{:then}' ) ;
387
387
}
388
388
389
389
if ( ! parser . eat ( '}' ) ) {
@@ -402,7 +402,7 @@ function next(parser) {
402
402
403
403
if ( parser . eat ( 'catch' ) ) {
404
404
if ( block . catch ) {
405
- e . block_duplicate_clause ( start , '{:catch}' ) ;
405
+ e . block_duplicate_clause ( next_to_bracket , '{:catch}' ) ;
406
406
}
407
407
408
408
if ( ! parser . eat ( '}' ) ) {
@@ -419,10 +419,10 @@ function next(parser) {
419
419
return ;
420
420
}
421
421
422
- e . expected_token ( start , '{:then ...} or {:catch ...}' ) ;
422
+ e . expected_token ( next_to_bracket , '{:then ...} or {:catch ...}' ) ;
423
423
}
424
424
425
- e . block_invalid_continuation_placement ( start ) ;
425
+ e . block_invalid_continuation_placement ( next_to_bracket ) ;
426
426
}
427
427
428
428
/** @param {import('../index.js').Parser } parser */
0 commit comments