@@ -328,13 +328,13 @@ function open(parser) {
328
328
329
329
/** @param {import('../index.js').Parser } parser */
330
330
function next ( parser ) {
331
- const start = parser . index - 1 ;
331
+ const next_to_bracket = parser . index - 1 ;
332
332
333
333
const block = parser . current ( ) ; // TODO type should not be TemplateNode, that's much too broad
334
334
335
335
if ( block . type === 'IfBlock' ) {
336
- if ( ! parser . eat ( 'else' ) ) e . expected_token ( start , '{:else} or {:else if}' ) ;
337
- if ( parser . eat ( 'if' ) ) e . block_invalid_elseif ( start ) ;
336
+ if ( ! parser . eat ( 'else' ) ) e . expected_token ( next_to_bracket , '{:else} or {:else if}' ) ;
337
+ if ( parser . eat ( 'if' ) ) e . block_invalid_elseif ( next_to_bracket ) ;
338
338
339
339
parser . allow_whitespace ( ) ;
340
340
@@ -354,7 +354,7 @@ function next(parser) {
354
354
355
355
/** @type {ReturnType<typeof parser.append<import('#compiler').IfBlock>> } */
356
356
const child = parser . append ( {
357
- start : parser . index ,
357
+ start : next_to_bracket - 1 ,
358
358
end : - 1 ,
359
359
type : 'IfBlock' ,
360
360
elseif : true ,
@@ -376,7 +376,7 @@ function next(parser) {
376
376
}
377
377
378
378
if ( block . type === 'EachBlock' ) {
379
- if ( ! parser . eat ( 'else' ) ) e . expected_token ( start , '{:else}' ) ;
379
+ if ( ! parser . eat ( 'else' ) ) e . expected_token ( next_to_bracket , '{:else}' ) ;
380
380
381
381
parser . allow_whitespace ( ) ;
382
382
parser . eat ( '}' , true ) ;
@@ -392,7 +392,7 @@ function next(parser) {
392
392
if ( block . type === 'AwaitBlock' ) {
393
393
if ( parser . eat ( 'then' ) ) {
394
394
if ( block . then ) {
395
- e . block_duplicate_clause ( start , '{:then}' ) ;
395
+ e . block_duplicate_clause ( next_to_bracket , '{:then}' ) ;
396
396
}
397
397
398
398
if ( ! parser . eat ( '}' ) ) {
@@ -411,7 +411,7 @@ function next(parser) {
411
411
412
412
if ( parser . eat ( 'catch' ) ) {
413
413
if ( block . catch ) {
414
- e . block_duplicate_clause ( start , '{:catch}' ) ;
414
+ e . block_duplicate_clause ( next_to_bracket , '{:catch}' ) ;
415
415
}
416
416
417
417
if ( ! parser . eat ( '}' ) ) {
@@ -428,10 +428,10 @@ function next(parser) {
428
428
return ;
429
429
}
430
430
431
- e . expected_token ( start , '{:then ...} or {:catch ...}' ) ;
431
+ e . expected_token ( next_to_bracket , '{:then ...} or {:catch ...}' ) ;
432
432
}
433
433
434
- e . block_invalid_continuation_placement ( start ) ;
434
+ e . block_invalid_continuation_placement ( next_to_bracket ) ;
435
435
}
436
436
437
437
/** @param {import('../index.js').Parser } parser */
0 commit comments