@rohal12/spindle-lsp 0.15.50 → 0.15.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin.js CHANGED
@@ -55,7 +55,7 @@ var VERSION;
55
55
  var init_version = __esm({
56
56
  "src/version.ts"() {
57
57
  "use strict";
58
- VERSION = false ? pkg.version : "0.15.50";
58
+ VERSION = false ? pkg.version : "0.15.52";
59
59
  }
60
60
  });
61
61
 
@@ -11316,28 +11316,6 @@ function peg$parse(input2, options) {
11316
11316
  const peg$c16 = "=";
11317
11317
  const peg$c17 = '"';
11318
11318
  const peg$c18 = "'";
11319
- const peg$r0 = /^[^\\{[<]/;
11320
- const peg$r1 = /^[{}]/;
11321
- const peg$r2 = /^[$_@%(!\/a-zA-Z]/;
11322
- const peg$r3 = /^[.#]/;
11323
- const peg$r4 = /^[a-zA-Z0-9_\-]/;
11324
- const peg$r5 = /^[$_@%]/;
11325
- const peg$r6 = /^[a-zA-Z0-9_.]/;
11326
- const peg$r7 = /^[$_@%(!]/;
11327
- const peg$r8 = /^[a-zA-Z]/;
11328
- const peg$r9 = /^[^ \t\n\r\v\f\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF}]/;
11329
- const peg$r10 = /^[a-zA-Z0-9.!#$%&'*+\/=?\^_`|~\-]/;
11330
- const peg$r11 = /^[a-zA-Z0-9.\-]/;
11331
- const peg$r12 = /^[a-zA-Z0-9+.\-]/;
11332
- const peg$r13 = /^[^\0- \x7F<>{}]/;
11333
- const peg$r14 = /^[\t-\r \/>\xA0\u1680\u2000-\u200A\u2028-\u2029\u202F\u205F\u3000\uFEFF]/;
11334
- const peg$r15 = /^[a-zA-Z0-9\-]/;
11335
- const peg$r16 = /^[\t-\r "'\/<->{}\xA0\u1680\u2000-\u200A\u2028-\u2029\u202F\u205F\u3000\uFEFF]/;
11336
- const peg$r17 = /^[^"]/;
11337
- const peg$r18 = /^[^']/;
11338
- const peg$r19 = /^["']/;
11339
- const peg$r20 = /^[^ \t\n\r\v\f\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF>]/;
11340
- const peg$r21 = /^[ \t\n\r\v\f\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]/;
11341
11319
  const peg$e0 = peg$anyExpectation();
11342
11320
  const peg$e1 = peg$classExpectation([
11343
11321
  "\\",
@@ -11902,6 +11880,7 @@ function peg$parse(input2, options) {
11902
11880
  let peg$maxFailExpected = options.peg$maxFailExpected || [];
11903
11881
  let peg$silentFails = options.peg$silentFails | 0;
11904
11882
  let peg$result;
11883
+ let peg$charCode;
11905
11884
  if (options.startRule) {
11906
11885
  if (!(options.startRule in peg$startRuleFunctions)) throw new Error(`Can't start parsing from rule "` + options.startRule + '".');
11907
11886
  peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
@@ -12009,10 +11988,10 @@ function peg$parse(input2, options) {
12009
11988
  let s0, s1, s2;
12010
11989
  s0 = peg$currPos;
12011
11990
  s1 = [];
12012
- s2 = peg$parseTokenItem();
12013
- while (s2 !== peg$FAILED) {
12014
- s1.push(s2);
11991
+ for (; ; ) {
12015
11992
  s2 = peg$parseTokenItem();
11993
+ if (s2 === peg$FAILED) break;
11994
+ s1.push(s2);
12016
11995
  }
12017
11996
  peg$savedPos = s0;
12018
11997
  s1 = peg$f0(s1);
@@ -12297,15 +12276,7 @@ function peg$parse(input2, options) {
12297
12276
  if (s1 !== peg$FAILED) {
12298
12277
  s2 = peg$currPos;
12299
12278
  s3 = [];
12300
- if (input2.length > peg$currPos) {
12301
- s4 = input2.charAt(peg$currPos);
12302
- peg$currPos++;
12303
- } else {
12304
- s4 = peg$FAILED;
12305
- if (peg$silentFails === 0) peg$fail(peg$e0);
12306
- }
12307
- while (s4 !== peg$FAILED) {
12308
- s3.push(s4);
12279
+ for (; ; ) {
12309
12280
  if (input2.length > peg$currPos) {
12310
12281
  s4 = input2.charAt(peg$currPos);
12311
12282
  peg$currPos++;
@@ -12313,6 +12284,8 @@ function peg$parse(input2, options) {
12313
12284
  s4 = peg$FAILED;
12314
12285
  if (peg$silentFails === 0) peg$fail(peg$e0);
12315
12286
  }
12287
+ if (s4 === peg$FAILED) break;
12288
+ s3.push(s4);
12316
12289
  }
12317
12290
  s2 = input2.substring(s2, peg$currPos);
12318
12291
  peg$savedPos = s0;
@@ -12338,22 +12311,17 @@ function peg$parse(input2, options) {
12338
12311
  s0 = peg$currPos;
12339
12312
  s1 = peg$currPos;
12340
12313
  s2 = [];
12341
- s3 = input2.charAt(peg$currPos);
12342
- if (peg$r0.test(s3)) peg$currPos++;
12343
- else {
12344
- s3 = peg$FAILED;
12345
- if (peg$silentFails === 0) peg$fail(peg$e1);
12346
- }
12347
- if (s3 !== peg$FAILED) while (s3 !== peg$FAILED) {
12348
- s2.push(s3);
12314
+ for (; ; ) {
12349
12315
  s3 = input2.charAt(peg$currPos);
12350
- if (peg$r0.test(s3)) peg$currPos++;
12316
+ if (s3 !== "" && !(peg$charCode = s3.charCodeAt(0), peg$charCode === 92 || peg$charCode === 123 || peg$charCode === 91 || peg$charCode === 60)) peg$currPos++;
12351
12317
  else {
12352
12318
  s3 = peg$FAILED;
12353
12319
  if (peg$silentFails === 0) peg$fail(peg$e1);
12354
12320
  }
12321
+ if (s3 === peg$FAILED) break;
12322
+ s2.push(s3);
12355
12323
  }
12356
- else s2 = peg$FAILED;
12324
+ if (s2.length < 1) s2 = peg$FAILED;
12357
12325
  if (s2 !== peg$FAILED) s1 = input2.substring(s1, peg$currPos);
12358
12326
  else s1 = s2;
12359
12327
  if (s1 !== peg$FAILED) {
@@ -12399,43 +12367,7 @@ function peg$parse(input2, options) {
12399
12367
  else s5 = peg$FAILED;
12400
12368
  if (s5 !== peg$FAILED) {
12401
12369
  s6 = [];
12402
- s7 = peg$currPos;
12403
- s8 = peg$currPos;
12404
- peg$silentFails++;
12405
- if (input2.substr(peg$currPos, 3) === peg$c3) {
12406
- s9 = peg$c3;
12407
- peg$currPos += 3;
12408
- } else {
12409
- s9 = peg$FAILED;
12410
- if (peg$silentFails === 0) peg$fail(peg$e5);
12411
- }
12412
- peg$silentFails--;
12413
- if (s9 === peg$FAILED) s8 = void 0;
12414
- else {
12415
- peg$currPos = s8;
12416
- s8 = peg$FAILED;
12417
- }
12418
- if (s8 !== peg$FAILED) {
12419
- if (input2.length > peg$currPos) {
12420
- s9 = input2.charAt(peg$currPos);
12421
- peg$currPos++;
12422
- } else {
12423
- s9 = peg$FAILED;
12424
- if (peg$silentFails === 0) peg$fail(peg$e0);
12425
- }
12426
- if (s9 !== peg$FAILED) {
12427
- s8 = [s8, s9];
12428
- s7 = s8;
12429
- } else {
12430
- peg$currPos = s7;
12431
- s7 = peg$FAILED;
12432
- }
12433
- } else {
12434
- peg$currPos = s7;
12435
- s7 = peg$FAILED;
12436
- }
12437
- while (s7 !== peg$FAILED) {
12438
- s6.push(s7);
12370
+ for (; ; ) {
12439
12371
  s7 = peg$currPos;
12440
12372
  s8 = peg$currPos;
12441
12373
  peg$silentFails++;
@@ -12471,6 +12403,8 @@ function peg$parse(input2, options) {
12471
12403
  peg$currPos = s7;
12472
12404
  s7 = peg$FAILED;
12473
12405
  }
12406
+ if (s7 === peg$FAILED) break;
12407
+ s6.push(s7);
12474
12408
  }
12475
12409
  if (input2.substr(peg$currPos, 3) === peg$c3) {
12476
12410
  s7 = peg$c3;
@@ -12522,15 +12456,7 @@ function peg$parse(input2, options) {
12522
12456
  s0 = peg$currPos;
12523
12457
  s1 = peg$currPos;
12524
12458
  s2 = [];
12525
- if (input2.charCodeAt(peg$currPos) === 92) {
12526
- s3 = peg$c4;
12527
- peg$currPos++;
12528
- } else {
12529
- s3 = peg$FAILED;
12530
- if (peg$silentFails === 0) peg$fail(peg$e6);
12531
- }
12532
- if (s3 !== peg$FAILED) while (s3 !== peg$FAILED) {
12533
- s2.push(s3);
12459
+ for (; ; ) {
12534
12460
  if (input2.charCodeAt(peg$currPos) === 92) {
12535
12461
  s3 = peg$c4;
12536
12462
  peg$currPos++;
@@ -12538,8 +12464,10 @@ function peg$parse(input2, options) {
12538
12464
  s3 = peg$FAILED;
12539
12465
  if (peg$silentFails === 0) peg$fail(peg$e6);
12540
12466
  }
12467
+ if (s3 === peg$FAILED) break;
12468
+ s2.push(s3);
12541
12469
  }
12542
- else s2 = peg$FAILED;
12470
+ if (s2.length < 1) s2 = peg$FAILED;
12543
12471
  if (s2 !== peg$FAILED) s1 = input2.substring(s1, peg$currPos);
12544
12472
  else s1 = s2;
12545
12473
  if (s1 !== peg$FAILED) {
@@ -12550,7 +12478,7 @@ function peg$parse(input2, options) {
12550
12478
  else s3 = peg$FAILED;
12551
12479
  if (s3 !== peg$FAILED) {
12552
12480
  s4 = input2.charAt(peg$currPos);
12553
- if (peg$r1.test(s4)) peg$currPos++;
12481
+ if (peg$charCode = s4.charCodeAt(0), peg$charCode === 123 || peg$charCode === 125) peg$currPos++;
12554
12482
  else {
12555
12483
  s4 = peg$FAILED;
12556
12484
  if (peg$silentFails === 0) peg$fail(peg$e7);
@@ -12592,7 +12520,7 @@ function peg$parse(input2, options) {
12592
12520
  s4 = peg$parseSelectors();
12593
12521
  if (s4 !== peg$FAILED) {
12594
12522
  s5 = input2.charAt(peg$currPos);
12595
- if (peg$r2.test(s5)) peg$currPos++;
12523
+ if (peg$charCode = s5.charCodeAt(0), peg$charCode === 36 || peg$charCode === 95 || peg$charCode === 64 || peg$charCode === 37 || peg$charCode === 40 || peg$charCode === 33 || peg$charCode === 47 || peg$charCode >= 97 && peg$charCode <= 122 || peg$charCode >= 65 && peg$charCode <= 90) peg$currPos++;
12596
12524
  else {
12597
12525
  s5 = peg$FAILED;
12598
12526
  if (peg$silentFails === 0) peg$fail(peg$e9);
@@ -12771,52 +12699,7 @@ function peg$parse(input2, options) {
12771
12699
  function peg$parseLinkText() {
12772
12700
  let s0, s1, s2, s3;
12773
12701
  s0 = [];
12774
- s1 = peg$currPos;
12775
- s2 = peg$currPos;
12776
- peg$silentFails++;
12777
- if (input2.substr(peg$currPos, 2) === peg$c9) {
12778
- s3 = peg$c9;
12779
- peg$currPos += 2;
12780
- } else {
12781
- s3 = peg$FAILED;
12782
- if (peg$silentFails === 0) peg$fail(peg$e13);
12783
- }
12784
- if (s3 === peg$FAILED) {
12785
- if (input2.substr(peg$currPos, 2) === peg$c8) {
12786
- s3 = peg$c8;
12787
- peg$currPos += 2;
12788
- } else {
12789
- s3 = peg$FAILED;
12790
- if (peg$silentFails === 0) peg$fail(peg$e12);
12791
- }
12792
- }
12793
- peg$silentFails--;
12794
- if (s3 === peg$FAILED) s2 = void 0;
12795
- else {
12796
- peg$currPos = s2;
12797
- s2 = peg$FAILED;
12798
- }
12799
- if (s2 !== peg$FAILED) {
12800
- if (input2.length > peg$currPos) {
12801
- s3 = input2.charAt(peg$currPos);
12802
- peg$currPos++;
12803
- } else {
12804
- s3 = peg$FAILED;
12805
- if (peg$silentFails === 0) peg$fail(peg$e0);
12806
- }
12807
- if (s3 !== peg$FAILED) {
12808
- s2 = [s2, s3];
12809
- s1 = s2;
12810
- } else {
12811
- peg$currPos = s1;
12812
- s1 = peg$FAILED;
12813
- }
12814
- } else {
12815
- peg$currPos = s1;
12816
- s1 = peg$FAILED;
12817
- }
12818
- while (s1 !== peg$FAILED) {
12819
- s0.push(s1);
12702
+ for (; ; ) {
12820
12703
  s1 = peg$currPos;
12821
12704
  s2 = peg$currPos;
12822
12705
  peg$silentFails++;
@@ -12861,6 +12744,8 @@ function peg$parse(input2, options) {
12861
12744
  peg$currPos = s1;
12862
12745
  s1 = peg$FAILED;
12863
12746
  }
12747
+ if (s1 === peg$FAILED) break;
12748
+ s0.push(s1);
12864
12749
  }
12865
12750
  return s0;
12866
12751
  }
@@ -12868,12 +12753,12 @@ function peg$parse(input2, options) {
12868
12753
  let s0, s1, s2;
12869
12754
  s0 = peg$currPos;
12870
12755
  s1 = [];
12871
- s2 = peg$parseSelectorPart();
12872
- if (s2 !== peg$FAILED) while (s2 !== peg$FAILED) {
12873
- s1.push(s2);
12756
+ for (; ; ) {
12874
12757
  s2 = peg$parseSelectorPart();
12758
+ if (s2 === peg$FAILED) break;
12759
+ s1.push(s2);
12875
12760
  }
12876
- else s1 = peg$FAILED;
12761
+ if (s1.length < 1) s1 = peg$FAILED;
12877
12762
  if (s1 !== peg$FAILED) {
12878
12763
  if (input2.charCodeAt(peg$currPos) === 32) {
12879
12764
  s2 = peg$c10;
@@ -12905,15 +12790,7 @@ function peg$parse(input2, options) {
12905
12790
  if (s1 !== peg$FAILED) {
12906
12791
  s2 = peg$parseHere();
12907
12792
  s3 = [];
12908
- if (input2.length > peg$currPos) {
12909
- s4 = input2.charAt(peg$currPos);
12910
- peg$currPos++;
12911
- } else {
12912
- s4 = peg$FAILED;
12913
- if (peg$silentFails === 0) peg$fail(peg$e0);
12914
- }
12915
- while (s4 !== peg$FAILED) {
12916
- s3.push(s4);
12793
+ for (; ; ) {
12917
12794
  if (input2.length > peg$currPos) {
12918
12795
  s4 = input2.charAt(peg$currPos);
12919
12796
  peg$currPos++;
@@ -12921,6 +12798,8 @@ function peg$parse(input2, options) {
12921
12798
  s4 = peg$FAILED;
12922
12799
  if (peg$silentFails === 0) peg$fail(peg$e0);
12923
12800
  }
12801
+ if (s4 === peg$FAILED) break;
12802
+ s3.push(s4);
12924
12803
  }
12925
12804
  peg$savedPos = s0;
12926
12805
  s0 = peg$f39(s1, s2);
@@ -12934,7 +12813,7 @@ function peg$parse(input2, options) {
12934
12813
  let s0, s1, s2, s3, s4;
12935
12814
  s0 = peg$currPos;
12936
12815
  s1 = input2.charAt(peg$currPos);
12937
- if (peg$r3.test(s1)) peg$currPos++;
12816
+ if (peg$charCode = s1.charCodeAt(0), peg$charCode === 46 || peg$charCode === 35) peg$currPos++;
12938
12817
  else {
12939
12818
  s1 = peg$FAILED;
12940
12819
  if (peg$silentFails === 0) peg$fail(peg$e15);
@@ -12942,10 +12821,10 @@ function peg$parse(input2, options) {
12942
12821
  if (s1 !== peg$FAILED) {
12943
12822
  s2 = peg$currPos;
12944
12823
  s3 = [];
12945
- s4 = peg$parseSelectorChar();
12946
- while (s4 !== peg$FAILED) {
12947
- s3.push(s4);
12824
+ for (; ; ) {
12948
12825
  s4 = peg$parseSelectorChar();
12826
+ if (s4 === peg$FAILED) break;
12827
+ s3.push(s4);
12949
12828
  }
12950
12829
  s2 = input2.substring(s2, peg$currPos);
12951
12830
  peg$savedPos = s0;
@@ -12959,7 +12838,7 @@ function peg$parse(input2, options) {
12959
12838
  function peg$parseSelectorChar() {
12960
12839
  let s0, s1, s2, s3, s4;
12961
12840
  s0 = input2.charAt(peg$currPos);
12962
- if (peg$r4.test(s0)) peg$currPos++;
12841
+ if (peg$charCode = s0.charCodeAt(0), peg$charCode >= 97 && peg$charCode <= 122 || peg$charCode >= 65 && peg$charCode <= 90 || peg$charCode >= 48 && peg$charCode <= 57 || peg$charCode === 95 || peg$charCode === 45) peg$currPos++;
12963
12842
  else {
12964
12843
  s0 = peg$FAILED;
12965
12844
  if (peg$silentFails === 0) peg$fail(peg$e16);
@@ -12975,27 +12854,22 @@ function peg$parse(input2, options) {
12975
12854
  }
12976
12855
  if (s1 !== peg$FAILED) {
12977
12856
  s2 = input2.charAt(peg$currPos);
12978
- if (peg$r5.test(s2)) peg$currPos++;
12857
+ if (peg$charCode = s2.charCodeAt(0), peg$charCode === 36 || peg$charCode === 95 || peg$charCode === 64 || peg$charCode === 37) peg$currPos++;
12979
12858
  else {
12980
12859
  s2 = peg$FAILED;
12981
12860
  if (peg$silentFails === 0) peg$fail(peg$e17);
12982
12861
  }
12983
12862
  if (s2 !== peg$FAILED) {
12984
12863
  s3 = [];
12985
- s4 = input2.charAt(peg$currPos);
12986
- if (peg$r6.test(s4)) peg$currPos++;
12987
- else {
12988
- s4 = peg$FAILED;
12989
- if (peg$silentFails === 0) peg$fail(peg$e18);
12990
- }
12991
- while (s4 !== peg$FAILED) {
12992
- s3.push(s4);
12864
+ for (; ; ) {
12993
12865
  s4 = input2.charAt(peg$currPos);
12994
- if (peg$r6.test(s4)) peg$currPos++;
12866
+ if (peg$charCode = s4.charCodeAt(0), peg$charCode >= 97 && peg$charCode <= 122 || peg$charCode >= 65 && peg$charCode <= 90 || peg$charCode >= 48 && peg$charCode <= 57 || peg$charCode === 95 || peg$charCode === 46) peg$currPos++;
12995
12867
  else {
12996
12868
  s4 = peg$FAILED;
12997
12869
  if (peg$silentFails === 0) peg$fail(peg$e18);
12998
12870
  }
12871
+ if (s4 === peg$FAILED) break;
12872
+ s3.push(s4);
12999
12873
  }
13000
12874
  if (input2.charCodeAt(peg$currPos) === 125) {
13001
12875
  s4 = peg$c11;
@@ -13042,7 +12916,7 @@ function peg$parse(input2, options) {
13042
12916
  s3 = peg$parseSelectors();
13043
12917
  if (s3 !== peg$FAILED) {
13044
12918
  s4 = input2.charAt(peg$currPos);
13045
- if (peg$r5.test(s4)) peg$currPos++;
12919
+ if (peg$charCode = s4.charCodeAt(0), peg$charCode === 36 || peg$charCode === 95 || peg$charCode === 64 || peg$charCode === 37) peg$currPos++;
13046
12920
  else {
13047
12921
  s4 = peg$FAILED;
13048
12922
  if (peg$silentFails === 0) peg$fail(peg$e17);
@@ -13051,20 +12925,15 @@ function peg$parse(input2, options) {
13051
12925
  s5 = peg$parseHere();
13052
12926
  s6 = peg$currPos;
13053
12927
  s7 = [];
13054
- s8 = input2.charAt(peg$currPos);
13055
- if (peg$r6.test(s8)) peg$currPos++;
13056
- else {
13057
- s8 = peg$FAILED;
13058
- if (peg$silentFails === 0) peg$fail(peg$e18);
13059
- }
13060
- while (s8 !== peg$FAILED) {
13061
- s7.push(s8);
12928
+ for (; ; ) {
13062
12929
  s8 = input2.charAt(peg$currPos);
13063
- if (peg$r6.test(s8)) peg$currPos++;
12930
+ if (peg$charCode = s8.charCodeAt(0), peg$charCode >= 97 && peg$charCode <= 122 || peg$charCode >= 65 && peg$charCode <= 90 || peg$charCode >= 48 && peg$charCode <= 57 || peg$charCode === 95 || peg$charCode === 46) peg$currPos++;
13064
12931
  else {
13065
12932
  s8 = peg$FAILED;
13066
12933
  if (peg$silentFails === 0) peg$fail(peg$e18);
13067
12934
  }
12935
+ if (s8 === peg$FAILED) break;
12936
+ s7.push(s8);
13068
12937
  }
13069
12938
  s6 = input2.substring(s6, peg$currPos);
13070
12939
  s7 = peg$parseBraceEnd();
@@ -13104,7 +12973,7 @@ function peg$parse(input2, options) {
13104
12973
  s5 = peg$currPos;
13105
12974
  peg$silentFails++;
13106
12975
  s6 = input2.charAt(peg$currPos);
13107
- if (peg$r7.test(s6)) peg$currPos++;
12976
+ if (peg$charCode = s6.charCodeAt(0), peg$charCode === 36 || peg$charCode === 95 || peg$charCode === 64 || peg$charCode === 37 || peg$charCode === 40 || peg$charCode === 33) peg$currPos++;
13108
12977
  else {
13109
12978
  s6 = peg$FAILED;
13110
12979
  if (peg$silentFails === 0) peg$fail(peg$e20);
@@ -13156,7 +13025,7 @@ function peg$parse(input2, options) {
13156
13025
  s3 = peg$currPos;
13157
13026
  peg$silentFails++;
13158
13027
  s4 = input2.charAt(peg$currPos);
13159
- if (peg$r7.test(s4)) peg$currPos++;
13028
+ if (peg$charCode = s4.charCodeAt(0), peg$charCode === 36 || peg$charCode === 95 || peg$charCode === 64 || peg$charCode === 37 || peg$charCode === 40 || peg$charCode === 33) peg$currPos++;
13160
13029
  else {
13161
13030
  s4 = peg$FAILED;
13162
13031
  if (peg$silentFails === 0) peg$fail(peg$e20);
@@ -13421,27 +13290,22 @@ function peg$parse(input2, options) {
13421
13290
  s0 = peg$currPos;
13422
13291
  s1 = peg$currPos;
13423
13292
  s2 = input2.charAt(peg$currPos);
13424
- if (peg$r8.test(s2)) peg$currPos++;
13293
+ if (peg$charCode = s2.charCodeAt(0), peg$charCode >= 97 && peg$charCode <= 122 || peg$charCode >= 65 && peg$charCode <= 90) peg$currPos++;
13425
13294
  else {
13426
13295
  s2 = peg$FAILED;
13427
13296
  if (peg$silentFails === 0) peg$fail(peg$e22);
13428
13297
  }
13429
13298
  if (s2 !== peg$FAILED) {
13430
13299
  s3 = [];
13431
- s4 = input2.charAt(peg$currPos);
13432
- if (peg$r9.test(s4)) peg$currPos++;
13433
- else {
13434
- s4 = peg$FAILED;
13435
- if (peg$silentFails === 0) peg$fail(peg$e23);
13436
- }
13437
- while (s4 !== peg$FAILED) {
13438
- s3.push(s4);
13300
+ for (; ; ) {
13439
13301
  s4 = input2.charAt(peg$currPos);
13440
- if (peg$r9.test(s4)) peg$currPos++;
13302
+ if (s4 !== "" && !(peg$charCode = s4.charCodeAt(0), peg$charCode === 32 || peg$charCode === 9 || peg$charCode === 10 || peg$charCode === 13 || peg$charCode === 11 || peg$charCode === 12 || peg$charCode === 160 || peg$charCode === 5760 || peg$charCode >= 8192 && peg$charCode <= 8202 || peg$charCode === 8232 || peg$charCode === 8233 || peg$charCode === 8239 || peg$charCode === 8287 || peg$charCode === 12288 || peg$charCode === 65279 || peg$charCode === 125)) peg$currPos++;
13441
13303
  else {
13442
13304
  s4 = peg$FAILED;
13443
13305
  if (peg$silentFails === 0) peg$fail(peg$e23);
13444
13306
  }
13307
+ if (s4 === peg$FAILED) break;
13308
+ s3.push(s4);
13445
13309
  }
13446
13310
  s2 = [s2, s3];
13447
13311
  s1 = s2;
@@ -13467,22 +13331,17 @@ function peg$parse(input2, options) {
13467
13331
  }
13468
13332
  if (s3 !== peg$FAILED) {
13469
13333
  s4 = [];
13470
- s5 = input2.charAt(peg$currPos);
13471
- if (peg$r10.test(s5)) peg$currPos++;
13472
- else {
13473
- s5 = peg$FAILED;
13474
- if (peg$silentFails === 0) peg$fail(peg$e24);
13475
- }
13476
- if (s5 !== peg$FAILED) while (s5 !== peg$FAILED) {
13477
- s4.push(s5);
13334
+ for (; ; ) {
13478
13335
  s5 = input2.charAt(peg$currPos);
13479
- if (peg$r10.test(s5)) peg$currPos++;
13336
+ if (peg$charCode = s5.charCodeAt(0), peg$charCode >= 97 && peg$charCode <= 122 || peg$charCode >= 65 && peg$charCode <= 90 || peg$charCode >= 48 && peg$charCode <= 57 || peg$charCode === 46 || peg$charCode === 33 || peg$charCode === 35 || peg$charCode === 36 || peg$charCode === 37 || peg$charCode === 38 || peg$charCode === 39 || peg$charCode === 42 || peg$charCode === 43 || peg$charCode === 47 || peg$charCode === 61 || peg$charCode === 63 || peg$charCode === 94 || peg$charCode === 95 || peg$charCode === 96 || peg$charCode === 124 || peg$charCode === 126 || peg$charCode === 45) peg$currPos++;
13480
13337
  else {
13481
13338
  s5 = peg$FAILED;
13482
13339
  if (peg$silentFails === 0) peg$fail(peg$e24);
13483
13340
  }
13341
+ if (s5 === peg$FAILED) break;
13342
+ s4.push(s5);
13484
13343
  }
13485
- else s4 = peg$FAILED;
13344
+ if (s4.length < 1) s4 = peg$FAILED;
13486
13345
  if (s4 !== peg$FAILED) {
13487
13346
  if (input2.charCodeAt(peg$currPos) === 64) {
13488
13347
  s5 = peg$c13;
@@ -13493,22 +13352,17 @@ function peg$parse(input2, options) {
13493
13352
  }
13494
13353
  if (s5 !== peg$FAILED) {
13495
13354
  s6 = [];
13496
- s7 = input2.charAt(peg$currPos);
13497
- if (peg$r11.test(s7)) peg$currPos++;
13498
- else {
13499
- s7 = peg$FAILED;
13500
- if (peg$silentFails === 0) peg$fail(peg$e26);
13501
- }
13502
- if (s7 !== peg$FAILED) while (s7 !== peg$FAILED) {
13503
- s6.push(s7);
13355
+ for (; ; ) {
13504
13356
  s7 = input2.charAt(peg$currPos);
13505
- if (peg$r11.test(s7)) peg$currPos++;
13357
+ if (peg$charCode = s7.charCodeAt(0), peg$charCode >= 97 && peg$charCode <= 122 || peg$charCode >= 65 && peg$charCode <= 90 || peg$charCode >= 48 && peg$charCode <= 57 || peg$charCode === 46 || peg$charCode === 45) peg$currPos++;
13506
13358
  else {
13507
13359
  s7 = peg$FAILED;
13508
13360
  if (peg$silentFails === 0) peg$fail(peg$e26);
13509
13361
  }
13362
+ if (s7 === peg$FAILED) break;
13363
+ s6.push(s7);
13510
13364
  }
13511
- else s6 = peg$FAILED;
13365
+ if (s6.length < 1) s6 = peg$FAILED;
13512
13366
  if (s6 !== peg$FAILED) {
13513
13367
  if (input2.charCodeAt(peg$currPos) === 62) {
13514
13368
  s7 = peg$c1;
@@ -13580,7 +13434,7 @@ function peg$parse(input2, options) {
13580
13434
  }
13581
13435
  if (s3 !== peg$FAILED) {
13582
13436
  s4 = input2.charAt(peg$currPos);
13583
- if (peg$r8.test(s4)) peg$currPos++;
13437
+ if (peg$charCode = s4.charCodeAt(0), peg$charCode >= 97 && peg$charCode <= 122 || peg$charCode >= 65 && peg$charCode <= 90) peg$currPos++;
13584
13438
  else {
13585
13439
  s4 = peg$FAILED;
13586
13440
  if (peg$silentFails === 0) peg$fail(peg$e22);
@@ -13589,7 +13443,7 @@ function peg$parse(input2, options) {
13589
13443
  s5 = peg$currPos;
13590
13444
  s6 = [];
13591
13445
  s7 = input2.charAt(peg$currPos);
13592
- if (peg$r12.test(s7)) peg$currPos++;
13446
+ if (peg$charCode = s7.charCodeAt(0), peg$charCode >= 97 && peg$charCode <= 122 || peg$charCode >= 65 && peg$charCode <= 90 || peg$charCode >= 48 && peg$charCode <= 57 || peg$charCode === 43 || peg$charCode === 46 || peg$charCode === 45) peg$currPos++;
13593
13447
  else {
13594
13448
  s7 = peg$FAILED;
13595
13449
  if (peg$silentFails === 0) peg$fail(peg$e27);
@@ -13599,7 +13453,7 @@ function peg$parse(input2, options) {
13599
13453
  if (s6.length >= 31) s7 = peg$FAILED;
13600
13454
  else {
13601
13455
  s7 = input2.charAt(peg$currPos);
13602
- if (peg$r12.test(s7)) peg$currPos++;
13456
+ if (peg$charCode = s7.charCodeAt(0), peg$charCode >= 97 && peg$charCode <= 122 || peg$charCode >= 65 && peg$charCode <= 90 || peg$charCode >= 48 && peg$charCode <= 57 || peg$charCode === 43 || peg$charCode === 46 || peg$charCode === 45) peg$currPos++;
13603
13457
  else {
13604
13458
  s7 = peg$FAILED;
13605
13459
  if (peg$silentFails === 0) peg$fail(peg$e27);
@@ -13620,42 +13474,7 @@ function peg$parse(input2, options) {
13620
13474
  }
13621
13475
  if (s6 !== peg$FAILED) {
13622
13476
  s7 = [];
13623
- s8 = peg$currPos;
13624
- s9 = peg$currPos;
13625
- peg$silentFails++;
13626
- if (input2.substr(peg$currPos, 2) === peg$c8) {
13627
- s10 = peg$c8;
13628
- peg$currPos += 2;
13629
- } else {
13630
- s10 = peg$FAILED;
13631
- if (peg$silentFails === 0) peg$fail(peg$e12);
13632
- }
13633
- peg$silentFails--;
13634
- if (s10 === peg$FAILED) s9 = void 0;
13635
- else {
13636
- peg$currPos = s9;
13637
- s9 = peg$FAILED;
13638
- }
13639
- if (s9 !== peg$FAILED) {
13640
- s10 = input2.charAt(peg$currPos);
13641
- if (peg$r13.test(s10)) peg$currPos++;
13642
- else {
13643
- s10 = peg$FAILED;
13644
- if (peg$silentFails === 0) peg$fail(peg$e29);
13645
- }
13646
- if (s10 !== peg$FAILED) {
13647
- s9 = [s9, s10];
13648
- s8 = s9;
13649
- } else {
13650
- peg$currPos = s8;
13651
- s8 = peg$FAILED;
13652
- }
13653
- } else {
13654
- peg$currPos = s8;
13655
- s8 = peg$FAILED;
13656
- }
13657
- while (s8 !== peg$FAILED) {
13658
- s7.push(s8);
13477
+ for (; ; ) {
13659
13478
  s8 = peg$currPos;
13660
13479
  s9 = peg$currPos;
13661
13480
  peg$silentFails++;
@@ -13674,7 +13493,7 @@ function peg$parse(input2, options) {
13674
13493
  }
13675
13494
  if (s9 !== peg$FAILED) {
13676
13495
  s10 = input2.charAt(peg$currPos);
13677
- if (peg$r13.test(s10)) peg$currPos++;
13496
+ if (s10 !== "" && !(peg$charCode = s10.charCodeAt(0), peg$charCode >= 0 && peg$charCode <= 32 || peg$charCode === 127 || peg$charCode === 60 || peg$charCode === 62 || peg$charCode === 123 || peg$charCode === 125)) peg$currPos++;
13678
13497
  else {
13679
13498
  s10 = peg$FAILED;
13680
13499
  if (peg$silentFails === 0) peg$fail(peg$e29);
@@ -13690,6 +13509,8 @@ function peg$parse(input2, options) {
13690
13509
  peg$currPos = s8;
13691
13510
  s8 = peg$FAILED;
13692
13511
  }
13512
+ if (s8 === peg$FAILED) break;
13513
+ s7.push(s8);
13693
13514
  }
13694
13515
  if (input2.charCodeAt(peg$currPos) === 62) {
13695
13516
  s8 = peg$c1;
@@ -13752,10 +13573,10 @@ function peg$parse(input2, options) {
13752
13573
  s3 = peg$parseTagName();
13753
13574
  if (s3 !== peg$FAILED) {
13754
13575
  s4 = [];
13755
- s5 = peg$parseAttribute();
13756
- while (s5 !== peg$FAILED) {
13757
- s4.push(s5);
13576
+ for (; ; ) {
13758
13577
  s5 = peg$parseAttribute();
13578
+ if (s5 === peg$FAILED) break;
13579
+ s4.push(s5);
13759
13580
  }
13760
13581
  s5 = peg$parse_();
13761
13582
  if (input2.charCodeAt(peg$currPos) === 47) {
@@ -13804,7 +13625,7 @@ function peg$parse(input2, options) {
13804
13625
  s3 = peg$currPos;
13805
13626
  peg$silentFails++;
13806
13627
  s4 = input2.charAt(peg$currPos);
13807
- if (peg$r14.test(s4)) peg$currPos++;
13628
+ if (peg$charCode = s4.charCodeAt(0), peg$charCode >= 9 && peg$charCode <= 13 || peg$charCode === 32 || peg$charCode === 47 || peg$charCode === 62 || peg$charCode === 160 || peg$charCode === 5760 || peg$charCode >= 8192 && peg$charCode <= 8202 || peg$charCode >= 8232 && peg$charCode <= 8233 || peg$charCode === 8239 || peg$charCode === 8287 || peg$charCode === 12288 || peg$charCode === 65279) peg$currPos++;
13808
13629
  else {
13809
13630
  s4 = peg$FAILED;
13810
13631
  if (peg$silentFails === 0) peg$fail(peg$e30);
@@ -13833,10 +13654,10 @@ function peg$parse(input2, options) {
13833
13654
  } else s3 = peg$FAILED;
13834
13655
  if (s3 !== peg$FAILED) {
13835
13656
  s4 = [];
13836
- s5 = peg$parseAttribute();
13837
- while (s5 !== peg$FAILED) {
13838
- s4.push(s5);
13657
+ for (; ; ) {
13839
13658
  s5 = peg$parseAttribute();
13659
+ if (s5 === peg$FAILED) break;
13660
+ s4.push(s5);
13840
13661
  }
13841
13662
  s5 = peg$parse_();
13842
13663
  s6 = peg$parseHere();
@@ -13901,27 +13722,22 @@ function peg$parse(input2, options) {
13901
13722
  s0 = peg$currPos;
13902
13723
  s1 = peg$currPos;
13903
13724
  s2 = input2.charAt(peg$currPos);
13904
- if (peg$r8.test(s2)) peg$currPos++;
13725
+ if (peg$charCode = s2.charCodeAt(0), peg$charCode >= 97 && peg$charCode <= 122 || peg$charCode >= 65 && peg$charCode <= 90) peg$currPos++;
13905
13726
  else {
13906
13727
  s2 = peg$FAILED;
13907
13728
  if (peg$silentFails === 0) peg$fail(peg$e22);
13908
13729
  }
13909
13730
  if (s2 !== peg$FAILED) {
13910
13731
  s3 = [];
13911
- s4 = input2.charAt(peg$currPos);
13912
- if (peg$r15.test(s4)) peg$currPos++;
13913
- else {
13914
- s4 = peg$FAILED;
13915
- if (peg$silentFails === 0) peg$fail(peg$e32);
13916
- }
13917
- while (s4 !== peg$FAILED) {
13918
- s3.push(s4);
13732
+ for (; ; ) {
13919
13733
  s4 = input2.charAt(peg$currPos);
13920
- if (peg$r15.test(s4)) peg$currPos++;
13734
+ if (peg$charCode = s4.charCodeAt(0), peg$charCode >= 97 && peg$charCode <= 122 || peg$charCode >= 65 && peg$charCode <= 90 || peg$charCode >= 48 && peg$charCode <= 57 || peg$charCode === 45) peg$currPos++;
13921
13735
  else {
13922
13736
  s4 = peg$FAILED;
13923
13737
  if (peg$silentFails === 0) peg$fail(peg$e32);
13924
13738
  }
13739
+ if (s4 === peg$FAILED) break;
13740
+ s3.push(s4);
13925
13741
  }
13926
13742
  s2 = [s2, s3];
13927
13743
  s1 = s2;
@@ -13940,47 +13756,12 @@ function peg$parse(input2, options) {
13940
13756
  s2 = peg$parseHere();
13941
13757
  s3 = peg$currPos;
13942
13758
  s4 = [];
13943
- s5 = peg$currPos;
13944
- s6 = peg$currPos;
13945
- peg$silentFails++;
13946
- s7 = input2.charAt(peg$currPos);
13947
- if (peg$r16.test(s7)) peg$currPos++;
13948
- else {
13949
- s7 = peg$FAILED;
13950
- if (peg$silentFails === 0) peg$fail(peg$e33);
13951
- }
13952
- peg$silentFails--;
13953
- if (s7 === peg$FAILED) s6 = void 0;
13954
- else {
13955
- peg$currPos = s6;
13956
- s6 = peg$FAILED;
13957
- }
13958
- if (s6 !== peg$FAILED) {
13959
- if (input2.length > peg$currPos) {
13960
- s7 = input2.charAt(peg$currPos);
13961
- peg$currPos++;
13962
- } else {
13963
- s7 = peg$FAILED;
13964
- if (peg$silentFails === 0) peg$fail(peg$e0);
13965
- }
13966
- if (s7 !== peg$FAILED) {
13967
- s6 = [s6, s7];
13968
- s5 = s6;
13969
- } else {
13970
- peg$currPos = s5;
13971
- s5 = peg$FAILED;
13972
- }
13973
- } else {
13974
- peg$currPos = s5;
13975
- s5 = peg$FAILED;
13976
- }
13977
- if (s5 !== peg$FAILED) while (s5 !== peg$FAILED) {
13978
- s4.push(s5);
13759
+ for (; ; ) {
13979
13760
  s5 = peg$currPos;
13980
13761
  s6 = peg$currPos;
13981
13762
  peg$silentFails++;
13982
13763
  s7 = input2.charAt(peg$currPos);
13983
- if (peg$r16.test(s7)) peg$currPos++;
13764
+ if (peg$charCode = s7.charCodeAt(0), peg$charCode >= 9 && peg$charCode <= 13 || peg$charCode === 32 || peg$charCode === 34 || peg$charCode === 39 || peg$charCode === 47 || peg$charCode >= 60 && peg$charCode <= 62 || peg$charCode === 123 || peg$charCode === 125 || peg$charCode === 160 || peg$charCode === 5760 || peg$charCode >= 8192 && peg$charCode <= 8202 || peg$charCode >= 8232 && peg$charCode <= 8233 || peg$charCode === 8239 || peg$charCode === 8287 || peg$charCode === 12288 || peg$charCode === 65279) peg$currPos++;
13984
13765
  else {
13985
13766
  s7 = peg$FAILED;
13986
13767
  if (peg$silentFails === 0) peg$fail(peg$e33);
@@ -14010,8 +13791,10 @@ function peg$parse(input2, options) {
14010
13791
  peg$currPos = s5;
14011
13792
  s5 = peg$FAILED;
14012
13793
  }
13794
+ if (s5 === peg$FAILED) break;
13795
+ s4.push(s5);
14013
13796
  }
14014
- else s4 = peg$FAILED;
13797
+ if (s4.length < 1) s4 = peg$FAILED;
14015
13798
  if (s4 !== peg$FAILED) s3 = input2.substring(s3, peg$currPos);
14016
13799
  else s3 = s4;
14017
13800
  if (s3 !== peg$FAILED) {
@@ -14070,26 +13853,18 @@ function peg$parse(input2, options) {
14070
13853
  s2 = peg$parseHere();
14071
13854
  s3 = peg$currPos;
14072
13855
  s4 = [];
14073
- s5 = peg$parseValuePart();
14074
- if (s5 === peg$FAILED) {
14075
- s5 = input2.charAt(peg$currPos);
14076
- if (peg$r17.test(s5)) peg$currPos++;
14077
- else {
14078
- s5 = peg$FAILED;
14079
- if (peg$silentFails === 0) peg$fail(peg$e36);
14080
- }
14081
- }
14082
- while (s5 !== peg$FAILED) {
14083
- s4.push(s5);
13856
+ for (; ; ) {
14084
13857
  s5 = peg$parseValuePart();
14085
13858
  if (s5 === peg$FAILED) {
14086
13859
  s5 = input2.charAt(peg$currPos);
14087
- if (peg$r17.test(s5)) peg$currPos++;
13860
+ if (s5 !== "" && !(peg$charCode = s5.charCodeAt(0), peg$charCode === 34)) peg$currPos++;
14088
13861
  else {
14089
13862
  s5 = peg$FAILED;
14090
13863
  if (peg$silentFails === 0) peg$fail(peg$e36);
14091
13864
  }
14092
13865
  }
13866
+ if (s5 === peg$FAILED) break;
13867
+ s4.push(s5);
14093
13868
  }
14094
13869
  s3 = input2.substring(s3, peg$currPos);
14095
13870
  s4 = peg$parseHere();
@@ -14125,26 +13900,18 @@ function peg$parse(input2, options) {
14125
13900
  s2 = peg$parseHere();
14126
13901
  s3 = peg$currPos;
14127
13902
  s4 = [];
14128
- s5 = peg$parseValuePart();
14129
- if (s5 === peg$FAILED) {
14130
- s5 = input2.charAt(peg$currPos);
14131
- if (peg$r18.test(s5)) peg$currPos++;
14132
- else {
14133
- s5 = peg$FAILED;
14134
- if (peg$silentFails === 0) peg$fail(peg$e38);
14135
- }
14136
- }
14137
- while (s5 !== peg$FAILED) {
14138
- s4.push(s5);
13903
+ for (; ; ) {
14139
13904
  s5 = peg$parseValuePart();
14140
13905
  if (s5 === peg$FAILED) {
14141
13906
  s5 = input2.charAt(peg$currPos);
14142
- if (peg$r18.test(s5)) peg$currPos++;
13907
+ if (s5 !== "" && !(peg$charCode = s5.charCodeAt(0), peg$charCode === 39)) peg$currPos++;
14143
13908
  else {
14144
13909
  s5 = peg$FAILED;
14145
13910
  if (peg$silentFails === 0) peg$fail(peg$e38);
14146
13911
  }
14147
13912
  }
13913
+ if (s5 === peg$FAILED) break;
13914
+ s4.push(s5);
14148
13915
  }
14149
13916
  s3 = input2.substring(s3, peg$currPos);
14150
13917
  s4 = peg$parseHere();
@@ -14170,7 +13937,7 @@ function peg$parse(input2, options) {
14170
13937
  if (s0 === peg$FAILED) {
14171
13938
  s0 = peg$currPos;
14172
13939
  s1 = input2.charAt(peg$currPos);
14173
- if (peg$r19.test(s1)) peg$currPos++;
13940
+ if (peg$charCode = s1.charCodeAt(0), peg$charCode === 34 || peg$charCode === 39) peg$currPos++;
14174
13941
  else {
14175
13942
  s1 = peg$FAILED;
14176
13943
  if (peg$silentFails === 0) peg$fail(peg$e39);
@@ -14185,20 +13952,15 @@ function peg$parse(input2, options) {
14185
13952
  s1 = peg$parseHere();
14186
13953
  s2 = peg$currPos;
14187
13954
  s3 = [];
14188
- s4 = input2.charAt(peg$currPos);
14189
- if (peg$r20.test(s4)) peg$currPos++;
14190
- else {
14191
- s4 = peg$FAILED;
14192
- if (peg$silentFails === 0) peg$fail(peg$e40);
14193
- }
14194
- while (s4 !== peg$FAILED) {
14195
- s3.push(s4);
13955
+ for (; ; ) {
14196
13956
  s4 = input2.charAt(peg$currPos);
14197
- if (peg$r20.test(s4)) peg$currPos++;
13957
+ if (s4 !== "" && !(peg$charCode = s4.charCodeAt(0), peg$charCode === 32 || peg$charCode === 9 || peg$charCode === 10 || peg$charCode === 13 || peg$charCode === 11 || peg$charCode === 12 || peg$charCode === 160 || peg$charCode === 5760 || peg$charCode >= 8192 && peg$charCode <= 8202 || peg$charCode === 8232 || peg$charCode === 8233 || peg$charCode === 8239 || peg$charCode === 8287 || peg$charCode === 12288 || peg$charCode === 65279 || peg$charCode === 62)) peg$currPos++;
14198
13958
  else {
14199
13959
  s4 = peg$FAILED;
14200
13960
  if (peg$silentFails === 0) peg$fail(peg$e40);
14201
13961
  }
13962
+ if (s4 === peg$FAILED) break;
13963
+ s3.push(s4);
14202
13964
  }
14203
13965
  s2 = input2.substring(s2, peg$currPos);
14204
13966
  s3 = peg$parseHere();
@@ -14219,15 +13981,7 @@ function peg$parse(input2, options) {
14219
13981
  if (s1 !== peg$FAILED) {
14220
13982
  s2 = peg$currPos;
14221
13983
  s3 = [];
14222
- if (input2.charCodeAt(peg$currPos) === 92) {
14223
- s4 = peg$c4;
14224
- peg$currPos++;
14225
- } else {
14226
- s4 = peg$FAILED;
14227
- if (peg$silentFails === 0) peg$fail(peg$e6);
14228
- }
14229
- if (s4 !== peg$FAILED) while (s4 !== peg$FAILED) {
14230
- s3.push(s4);
13984
+ for (; ; ) {
14231
13985
  if (input2.charCodeAt(peg$currPos) === 92) {
14232
13986
  s4 = peg$c4;
14233
13987
  peg$currPos++;
@@ -14235,8 +13989,10 @@ function peg$parse(input2, options) {
14235
13989
  s4 = peg$FAILED;
14236
13990
  if (peg$silentFails === 0) peg$fail(peg$e6);
14237
13991
  }
13992
+ if (s4 === peg$FAILED) break;
13993
+ s3.push(s4);
14238
13994
  }
14239
- else s3 = peg$FAILED;
13995
+ if (s3.length < 1) s3 = peg$FAILED;
14240
13996
  if (s3 !== peg$FAILED) s2 = input2.substring(s2, peg$currPos);
14241
13997
  else s2 = s3;
14242
13998
  if (s2 !== peg$FAILED) {
@@ -14247,7 +14003,7 @@ function peg$parse(input2, options) {
14247
14003
  else s4 = peg$FAILED;
14248
14004
  if (s4 !== peg$FAILED) {
14249
14005
  s5 = input2.charAt(peg$currPos);
14250
- if (peg$r1.test(s5)) peg$currPos++;
14006
+ if (peg$charCode = s5.charCodeAt(0), peg$charCode === 123 || peg$charCode === 125) peg$currPos++;
14251
14007
  else {
14252
14008
  s5 = peg$FAILED;
14253
14009
  if (peg$silentFails === 0) peg$fail(peg$e7);
@@ -14415,7 +14171,7 @@ function peg$parse(input2, options) {
14415
14171
  }
14416
14172
  if (s6 === peg$FAILED) s6 = null;
14417
14173
  s7 = input2.charAt(peg$currPos);
14418
- if (peg$r8.test(s7)) peg$currPos++;
14174
+ if (peg$charCode = s7.charCodeAt(0), peg$charCode >= 97 && peg$charCode <= 122 || peg$charCode >= 65 && peg$charCode <= 90) peg$currPos++;
14419
14175
  else {
14420
14176
  s7 = peg$FAILED;
14421
14177
  if (peg$silentFails === 0) peg$fail(peg$e22);
@@ -14489,7 +14245,7 @@ function peg$parse(input2, options) {
14489
14245
  s3 = peg$currPos;
14490
14246
  peg$silentFails++;
14491
14247
  s4 = input2.charAt(peg$currPos);
14492
- if (peg$r5.test(s4)) peg$currPos++;
14248
+ if (peg$charCode = s4.charCodeAt(0), peg$charCode === 36 || peg$charCode === 95 || peg$charCode === 64 || peg$charCode === 37) peg$currPos++;
14493
14249
  else {
14494
14250
  s4 = peg$FAILED;
14495
14251
  if (peg$silentFails === 0) peg$fail(peg$e17);
@@ -14540,17 +14296,17 @@ function peg$parse(input2, options) {
14540
14296
  function peg$parse_() {
14541
14297
  let s0, s1;
14542
14298
  s0 = [];
14543
- s1 = peg$parse_c();
14544
- while (s1 !== peg$FAILED) {
14545
- s0.push(s1);
14299
+ for (; ; ) {
14546
14300
  s1 = peg$parse_c();
14301
+ if (s1 === peg$FAILED) break;
14302
+ s0.push(s1);
14547
14303
  }
14548
14304
  return s0;
14549
14305
  }
14550
14306
  function peg$parse_c() {
14551
14307
  let s0;
14552
14308
  s0 = input2.charAt(peg$currPos);
14553
- if (peg$r21.test(s0)) peg$currPos++;
14309
+ if (peg$charCode = s0.charCodeAt(0), peg$charCode === 32 || peg$charCode === 9 || peg$charCode === 10 || peg$charCode === 13 || peg$charCode === 11 || peg$charCode === 12 || peg$charCode === 160 || peg$charCode === 5760 || peg$charCode >= 8192 && peg$charCode <= 8202 || peg$charCode === 8232 || peg$charCode === 8233 || peg$charCode === 8239 || peg$charCode === 8287 || peg$charCode === 12288 || peg$charCode === 65279) peg$currPos++;
14554
14310
  else {
14555
14311
  s0 = peg$FAILED;
14556
14312
  if (peg$silentFails === 0) peg$fail(peg$e41);
@@ -15198,10 +14954,14 @@ function isMemberDot(type) {
15198
14954
  return type === types$1.dot || type === types$1.questionDot;
15199
14955
  }
15200
14956
  function tokenizerAt(src, start, goal, { onComment, afterOperand = false } = {}) {
15201
- const p = new SigilParser(onComment ? {
14957
+ const p = new SigilParser({
15202
14958
  ...OPTIONS,
14959
+ startLocation: {
14960
+ line: 1,
14961
+ column: 0
14962
+ },
15203
14963
  onComment
15204
- } : OPTIONS, src, start);
14964
+ }, src, start);
15205
14965
  if (goal === "expression") p.type = types$1.parenL;
15206
14966
  if (afterOperand) p.exprAllowed = false;
15207
14967
  return p;
@@ -15855,36 +15615,6 @@ function completionIdentifier(source, cursor, goal = "expression") {
15855
15615
  previous2 = token;
15856
15616
  }
15857
15617
  }
15858
- function skipLiteral(input2, i2) {
15859
- const quote = input2[i2];
15860
- const template = quote === "`";
15861
- let ranOut = false;
15862
- for (let j2 = i2 + 1; j2 < input2.length; ) {
15863
- const c = input2[j2];
15864
- if (c === "\\") j2 += 2;
15865
- else if (c === quote) return {
15866
- end: j2 + 1,
15867
- ranOut
15868
- };
15869
- else if (!template && c === "\n") return {
15870
- end: -1,
15871
- ranOut
15872
- };
15873
- else if (template && c === "$" && input2[j2 + 1] === "{") {
15874
- const close = lenientRead(input2, j2 + 2);
15875
- ranOut || (ranOut = close.ranOut);
15876
- if (close.end === -1) return {
15877
- end: -1,
15878
- ranOut
15879
- };
15880
- j2 = close.end + 1;
15881
- } else j2++;
15882
- }
15883
- return {
15884
- end: -1,
15885
- ranOut: ranOut || template
15886
- };
15887
- }
15888
15618
  function lenientClose(input2, i2, onRunOut) {
15889
15619
  const { end, ranOut } = lenientRead(input2, i2);
15890
15620
  if (ranOut) onRunOut?.();
@@ -15902,31 +15632,71 @@ function lenientRead(input2, i2) {
15902
15632
  }
15903
15633
  return read;
15904
15634
  }
15905
- function scanLenient(input2, i2) {
15906
- let depth = 0;
15907
- let ranOut = false;
15908
- while (i2 < input2.length) {
15909
- const c = input2[i2];
15910
- if (c === "{") {
15911
- depth++;
15912
- i2++;
15913
- } else if (c === "}") {
15914
- if (depth === 0) return {
15915
- end: i2,
15916
- ranOut
15917
- };
15918
- depth--;
15919
- i2++;
15920
- } else if (c === "`" || (c === '"' || c === "'") && !(i2 > 0 && NON_STRING_QUOTE_PREFIX.test(input2[i2 - 1]))) {
15921
- const close = skipLiteral(input2, i2);
15922
- ranOut || (ranOut = close.ranOut);
15923
- i2 = close.end === -1 ? i2 + 1 : close.end;
15924
- } else i2++;
15925
- }
15926
- return {
15635
+ function scanLenient(input2, start) {
15636
+ const codeFrame = (start2) => ({
15637
+ kind: "code",
15638
+ start: start2,
15639
+ i: start2,
15640
+ depth: 0,
15641
+ ranOut: false
15642
+ });
15643
+ const frames = [codeFrame(start)];
15644
+ let result2 = {
15927
15645
  end: -1,
15928
15646
  ranOut: true
15929
15647
  };
15648
+ const finish = (end, ranOut) => {
15649
+ const frame = frames.pop();
15650
+ result2 = {
15651
+ end,
15652
+ ranOut
15653
+ };
15654
+ if (frame.kind === "code") memo.set(frame.start, result2);
15655
+ const parent = frames[frames.length - 1];
15656
+ if (!parent) return;
15657
+ parent.ranOut || (parent.ranOut = ranOut);
15658
+ if (parent.kind === "code") parent.i = end === -1 ? parent.i + 1 : end;
15659
+ else if (end === -1) parent.i = input2.length;
15660
+ else parent.i = end + 1;
15661
+ };
15662
+ while (frames.length) {
15663
+ const frame = frames[frames.length - 1];
15664
+ const { i: i2, ranOut } = frame;
15665
+ if (i2 >= input2.length) {
15666
+ finish(-1, ranOut || frame.kind === "code" || frame.quote === "`");
15667
+ continue;
15668
+ }
15669
+ const c = input2[i2];
15670
+ if (frame.kind === "literal") {
15671
+ if (c === "\\") frame.i += 2;
15672
+ else if (c === frame.quote) finish(i2 + 1, ranOut);
15673
+ else if (frame.quote !== "`" && c === "\n") finish(-1, ranOut);
15674
+ else if (frame.quote === "`" && c === "$" && input2[i2 + 1] === "{") {
15675
+ const cached2 = memo.get(i2 + 2);
15676
+ if (cached2) {
15677
+ frame.ranOut || (frame.ranOut = cached2.ranOut);
15678
+ frame.i = cached2.end === -1 ? input2.length : cached2.end + 1;
15679
+ } else frames.push(codeFrame(i2 + 2));
15680
+ } else frame.i++;
15681
+ } else if (c === "{") {
15682
+ frame.depth++;
15683
+ frame.i++;
15684
+ } else if (c === "}") {
15685
+ if (frame.depth === 0) finish(i2, ranOut);
15686
+ else {
15687
+ frame.depth--;
15688
+ frame.i++;
15689
+ }
15690
+ } else if (c === "`" || (c === '"' || c === "'") && !(i2 > 0 && NON_STRING_QUOTE_PREFIX.test(input2[i2 - 1]))) frames.push({
15691
+ kind: "literal",
15692
+ start: i2,
15693
+ i: i2 + 1,
15694
+ quote: c,
15695
+ ranOut: false
15696
+ });
15697
+ else frame.i++;
15698
+ }
15699
+ return result2;
15930
15700
  }
15931
15701
  function jsCodeEnd(onOpenEnd) {
15932
15702
  return {
@@ -17321,7 +17091,7 @@ function widgetDefinitions$1(passages, parametersOf2 = registeredParameters) {
17321
17091
  });
17322
17092
  }
17323
17093
  } else if (open2.length > 0 && (token.type === "variable" && token.scope === "local" && token.name === "children" || tokenTextContainsChildren(token, parametersOf2, passage.content, hooks, budget))) open2[open2.length - 1].isBlock = true;
17324
- done.push(...open2);
17094
+ for (const def of open2) done.push(def);
17325
17095
  const defs = [];
17326
17096
  for (const { token, isBlock, closeStart } of done) try {
17327
17097
  const [from, to] = nameSpan(token.rawArgs);
@@ -17337,7 +17107,8 @@ function widgetDefinitions$1(passages, parametersOf2 = registeredParameters) {
17337
17107
  });
17338
17108
  } catch {
17339
17109
  }
17340
- found.push(...defs.sort((a, b) => a.start - b.start));
17110
+ defs.sort((a, b) => a.start - b.start);
17111
+ for (const def of defs) found.push(def);
17341
17112
  }
17342
17113
  return found;
17343
17114
  };
@@ -17997,10 +17768,24 @@ function discoverMacros(source) {
17997
17768
  }
17998
17769
  return found;
17999
17770
  }
17771
+ function sourceLines(source) {
17772
+ const position = sourcePositions(source);
17773
+ return (offset2) => position(offset2).line - 1;
17774
+ }
18000
17775
  function segmentRegions(body) {
18001
17776
  const lines = body.split("\n");
18002
17777
  if (lines.length > 0 && lines[lines.length - 1] === "") lines.pop();
18003
17778
  if (lines.length === 0) return [];
17779
+ const tags = lines.map(() => []);
17780
+ const tagEndLines = lines.map((_2, line) => line);
17781
+ const lineAt = sourceLines(body);
17782
+ for (const token of tokenizeMarkupTolerant$1(body).tokens) {
17783
+ if (token.type !== "html") continue;
17784
+ const line = lineAt(token.start);
17785
+ tags[line].push(token);
17786
+ tagEndLines[line] = Math.max(tagEndLines[line], lineAt(token.end - 1));
17787
+ }
17788
+ const depthOnLine = (line, name) => tags[line].reduce((depth, token) => token.tag.toLowerCase() === name && !token.isSelfClose ? depth + (token.isClose ? -1 : 1) : depth, 0);
18004
17789
  const regions = [];
18005
17790
  let i2 = 0;
18006
17791
  while (i2 < lines.length) {
@@ -18026,24 +17811,19 @@ function segmentRegions(body) {
18026
17811
  }
18027
17812
  if (/^<([a-zA-Z][\w-]*)/.test(trimmed2)) {
18028
17813
  const tagName = trimmed2.match(/^<([a-zA-Z][\w-]*)/)[1].toLowerCase();
18029
- if (VOID_ELEMENTS.has(tagName) && !lines[i2 + 1]?.trim().startsWith("<")) {
18030
- pushSpindleLine(regions, line);
18031
- i2++;
18032
- continue;
18033
- }
18034
- if (new RegExp(`</${tagName}\\s*>`, "i").test(trimmed2)) {
17814
+ let depth = depthOnLine(i2, tagName);
17815
+ let endLine = tagEndLines[i2];
17816
+ if (depth <= 0 && endLine === i2) {
18035
17817
  pushSpindleLine(regions, line);
18036
17818
  i2++;
18037
17819
  continue;
18038
17820
  }
18039
17821
  const htmlLines = [line];
18040
- let depth = 1;
18041
17822
  i2++;
18042
- while (i2 < lines.length && depth > 0) {
17823
+ while (i2 < lines.length && (depth > 0 || i2 <= endLine)) {
18043
17824
  htmlLines.push(lines[i2]);
18044
- const opens = (lines[i2].match(new RegExp(`<${tagName}(?:[\\s>]|$)`, "gi")) ?? []).length;
18045
- const closes2 = (lines[i2].match(new RegExp(`</${tagName}\\s*>`, "gi")) ?? []).length;
18046
- depth += opens - closes2;
17825
+ endLine = Math.max(endLine, tagEndLines[i2]);
17826
+ depth += depthOnLine(i2, tagName);
18047
17827
  i2++;
18048
17828
  }
18049
17829
  regions.push({
@@ -21929,10 +21709,6 @@ function unclosedHtml(text3) {
21929
21709
  }
21930
21710
  } } };
21931
21711
  }
21932
- function sourceLines(source) {
21933
- const position = sourcePositions(source);
21934
- return (offset2) => position(offset2).line - 1;
21935
- }
21936
21712
  function markdownLines(source, isBlock, types2) {
21937
21713
  const found = /* @__PURE__ */ new Set();
21938
21714
  if (types2.size === 1 && types2.has("codeFenced") && !/`{3}|~{3}/.test(source)) return found;
@@ -22261,13 +22037,13 @@ async function formatLf(text3, options) {
22261
22037
  if (region.type !== "spindle") region.lines = region.lines.map((l) => replaceAll(l, sentinel, "\n"));
22262
22038
  if (region.type === "script") {
22263
22039
  if (region.lines.length === 1) {
22264
- lines.push(...region.lines);
22040
+ for (const line of region.lines) lines.push(line);
22265
22041
  continue;
22266
22042
  }
22267
22043
  const innerCode = region.lines.slice(1, -1).join("\n");
22268
22044
  const formatted = await formatJS(innerCode.trim(), prettier2, prettierOptions);
22269
22045
  if (formatted === void 0 || !sameSpindleTokens(innerCode, formatted)) {
22270
- lines.push(...region.lines);
22046
+ for (const line of region.lines) lines.push(line);
22271
22047
  continue;
22272
22048
  }
22273
22049
  lines.push(region.lines[0]);
@@ -22276,25 +22052,25 @@ async function formatLf(text3, options) {
22276
22052
  continue;
22277
22053
  }
22278
22054
  if (region.type === "svg") {
22279
- lines.push(...region.lines);
22055
+ for (const line of region.lines) lines.push(line);
22280
22056
  continue;
22281
22057
  }
22282
22058
  if (region.type === "html") {
22283
22059
  const htmlText2 = region.lines.join("\n");
22284
22060
  if (WHITESPACE_AS_WRITTEN.test(htmlText2) || region.lines.some((line) => literalLines.has(line.trim())) || hasMarkdownBoundaries(htmlText2, isBlock)) {
22285
22061
  for (let i2 = 0; i2 < region.lines.length; i2++) preservedLines.add(lines.length + i2);
22286
- lines.push(...region.lines);
22062
+ for (const line of region.lines) lines.push(line);
22287
22063
  continue;
22288
22064
  }
22289
22065
  const { text: svgPlaceholdered, tokens: svgTokens } = replaceSvgBlocks(htmlText2);
22290
22066
  if (!placeholdersIntact(svgPlaceholdered, svgTokens, SVG_PLACEHOLDERS)) {
22291
- lines.push(...region.lines);
22067
+ for (const line of region.lines) lines.push(line);
22292
22068
  continue;
22293
22069
  }
22294
22070
  const { text: placeholdered, tokens: tokens2 } = replaceSpindleTokens(svgPlaceholdered);
22295
22071
  const formatted = await formatHTML(placeholdered, prettier2, prettierOptions);
22296
22072
  if (formatted === void 0 || !placeholdersIntact(formatted, tokens2, SPINDLE_PLACEHOLDERS) || !placeholdersIntact(formatted, svgTokens, SVG_PLACEHOLDERS)) {
22297
- lines.push(...region.lines);
22073
+ for (const line of region.lines) lines.push(line);
22298
22074
  continue;
22299
22075
  }
22300
22076
  const restored = restoreHtmlTokens(formatted.trim(), tokens2.map((t) => replaceAll(t, "\n", sentinel)), svgTokens);
@@ -22312,6 +22088,11 @@ async function formatLf(text3, options) {
22312
22088
  output2 = output2.replace(/\n*$/, "\n");
22313
22089
  return replaceAll(output2.split("\n").map((line) => literalLines.get(line.trim()) ?? line).join("\n"), sentinel, "\n");
22314
22090
  }
22091
+ function isDataScript(token) {
22092
+ if (token.tag.toLowerCase() !== "script") return false;
22093
+ const type = Object.entries(token.attributes).find(([name]) => name.toLowerCase() === "type")?.[1].trim();
22094
+ return !!type && !JAVASCRIPT_TYPE.test(type);
22095
+ }
22315
22096
  function hasMarkdownBoundaries(source, isBlock) {
22316
22097
  const { tokens: tokens2 } = analyzeMarkup(source, { hooks: { isBlock } });
22317
22098
  let possibleBoundary = false;
@@ -22324,13 +22105,13 @@ function hasMarkdownBoundaries(source, isBlock) {
22324
22105
  }
22325
22106
  function whitespaceSensitiveLines(source, isBlock) {
22326
22107
  const lines = /* @__PURE__ */ new Set();
22327
- if (!WHITESPACE_AS_WRITTEN.test(source)) return lines;
22108
+ if (!WHITESPACE_AS_WRITTEN.test(source) && !/<script[\s>]/i.test(source)) return lines;
22328
22109
  const lineAt = sourceLines(source);
22329
22110
  const { nodes } = analyzeMarkup(source, { hooks: { isBlock } });
22330
22111
  function visit2(nodes2) {
22331
22112
  for (const node2 of nodes2) {
22332
22113
  const { token, body } = node2;
22333
- if (token.type === "html" && ([
22114
+ if (token.type === "html" && (isDataScript(token) || [
22334
22115
  "pre",
22335
22116
  "textarea",
22336
22117
  "svg"
@@ -22483,7 +22264,7 @@ function wrapLines(lines, maxLen, literalLines, isBlock) {
22483
22264
  continue;
22484
22265
  }
22485
22266
  if (line.endsWith(" ")) wrapped[wrapped.length - 1] += " ";
22486
- result2.push(...wrapped);
22267
+ for (const line2 of wrapped) result2.push(line2);
22487
22268
  }
22488
22269
  return result2;
22489
22270
  }
@@ -22719,7 +22500,7 @@ function validateVariableReferences(passages, declarations, macros = []) {
22719
22500
  const list3 = [...passages];
22720
22501
  return checkVariableReferences(list3.filter((p) => !p.tags?.some((t) => NOT_MARKUP_TAGS.includes(t))), declarations, referenceOptions(macros, false, list3));
22721
22502
  }
22722
- var __defProp2, __exportAll, HTML_TEXT_ELEMENTS$1, SIGIL_SCOPES, SIGIL_CHARS, grammar_shared_default, LB, RB, SIGIL_SCOPES$1, withSelectors, HTML_TEXT_ELEMENTS, VOID_TAGS, BRANCH_PARENT$1, LINK_SEPARATORS, NO_SELECTORS, EMAIL_AUTOLINK, peg$SyntaxError, NameMap, NameSet, OPTION_CLAUSE, PARAMETER_TYPES, STRING_HOLDS, metadataRegistry, companionParents, BLOCK_MACROS, BLOCK_WIDGETS, WIDGETS, DEFINED_BLOCK_MACROS, DEFINED_MACROS, REGISTERED_BLOCK_MACROS, RAW_BODY_MACROS, BRANCHING, quoteArg, MAX_MARKUP_DEPTH, last$1, BRANCH_PARENT, lowerName, nameOf, closerOf, closes, astralIdentifierCodes, astralIdentifierStartCodes, nonASCIIidentifierChars, nonASCIIidentifierStartChars, reservedWords, ecma5AndLessKeywords, keywords$1, keywordRelationalOperator, nonASCIIidentifierStart, nonASCIIidentifier, TokenType, beforeExpr, startsExpr, keywords, types$1, lineBreak, lineBreakG, nonASCIIwhitespace, skipWhiteSpace, ref, hasOwnProperty$1, toString, hasOwn$1, isArray, regexpCache, loneSurrogate, Position, SourceLocation, defaultOptions, warnedAboutEcmaVersion, SCOPE_TOP, SCOPE_FUNCTION, SCOPE_ASYNC, SCOPE_GENERATOR, SCOPE_ARROW, SCOPE_SIMPLE_CATCH, SCOPE_SUPER, SCOPE_DIRECT_SUPER, SCOPE_CLASS_STATIC_BLOCK, SCOPE_CLASS_FIELD_INIT, SCOPE_SWITCH, SCOPE_VAR, BIND_NONE, BIND_VAR, BIND_LEXICAL, BIND_FUNCTION, BIND_SIMPLE_CATCH, BIND_OUTSIDE, Parser, prototypeAccessors, pp$9, literal, DestructuringErrors, pp$8, loopLabel, switchLabel, empty$1, FUNC_STATEMENT, FUNC_HANGING_STATEMENT, FUNC_NULLABLE_ID, pp$7, TokContext, types, pp$6, pp$5, empty, pp$4, pp$3, Scope, Node, pp$2, scriptValuesAddedInUnicode, ecma9BinaryProperties, ecma10BinaryProperties, ecma11BinaryProperties, ecma12BinaryProperties, ecma13BinaryProperties, unicodeBinaryProperties, unicodeBinaryPropertiesOfStrings, unicodeGeneralCategoryValues, ecma9ScriptValues, ecma10ScriptValues, ecma11ScriptValues, ecma12ScriptValues, ecma13ScriptValues, unicodeScriptValues, data, ecmaVersion, i, list$2, pp$1, BranchID, RegExpValidationState, CharSetNone, CharSetOk, CharSetString, Token, pp, INVALID_TEMPLATE_ESCAPE_ERROR, OPTIONS, AT_NAME_RE, TRANS_NAME_RE, SIGIL_IDENT_RE, LINE_BREAK_RE, NOT_A_BODY_RE, OPERAND_ENDS, SigilParser, OPENERS, CLOSERS$1, CodeSyntaxError, last, CLOSER, isNode, NAMESPACE_NAME, WORD_RE$2, FLAGS_RE, WORDS_BEFORE_STRING, NON_STRING_QUOTE_PREFIX, memoInput, memo, defaultCodeEnd, defaultHooks, MarkupError, OFFSET_FIELD, listeners, RESERVED_NAME, isArrayIndex, hasOwn, createNamespace, TRAILING_OPERATOR_RE, slice, MacroArgumentError, WORD_RE$1, NUMBER_RE$1, WORD_OR_PUNCT_RE, LEADING_OPERATOR_RE, takesRest, SUB_MACRO_PARAMETERS, _MarkupExpansionBudget, MarkupExpansionBudget, parses, CONDITION_MACROS, PASSAGE_BODIES, holdsByDefault, JS_ESCAPE_RE, textPiece, LITERAL, registeredParameters, WIDGET_PARAMETERS, SPECIAL_PASSAGES, NOT_MARKUP, NOT_MARKUP_TAGS$1, BRANCH_MACROS, didYouMean, PASSAGE_ARGUMENT_HINT, BARE_WORD_RE, NUMBER_RE, IDENT_RE, KEY_RE, ARROW_RE, LINE_END_RE, ARRAY_INDEX_RE, UNSUPPORTED_UNDEFINED, Reader, VALID_VAR_TYPES, PRIMITIVE_SAMPLES, UNSUPPORTED_TYPE, NO_STORE_VAR_MACROS, CLOSERS, BLOCK_WORDS, NOT_PARAMETERS, DECLARATIONS, WRITE_RE, MUTATORS, MUTATING_CALL_RE, BEFORE_BINDING, isWordChar, Bindings, CALL_RE, IDENTIFIER_ARGUMENT_RE, WORD_RE, MODIFIER_RE, KEY_START_RE, CONFIG_KEYS, ConfigReader, stringOf, booleanOf, textOf, stringsOf, VOID_ELEMENTS, characterEntities, own, hasOwnProperty, asciiAlpha, asciiAlphanumeric, asciiAtext, asciiDigit, asciiHexDigit, asciiPunctuation, unicodePunctuation, unicodeWhitespace, content$1, EditMap$1, document$1, containerConstruct, attention, autolink, blankLine, blockQuote, characterEscape, characterReference, nonLazyContinuation, codeFenced, codeIndented, furtherStart, codeText, SpliceBuffer, content, continuationConstruct, definition, titleBefore, hardBreakEscape, headingAtx, htmlBlockNames, htmlRawNames, htmlFlow, blankLineBefore, htmlText, labelEnd, resourceConstruct, referenceFullConstruct, referenceCollapsedConstruct, labelStartImage, labelStartLink, lineEnding, thematicBreak, list, listItemPrefixWhitespaceConstruct, indentConstruct, setextUnderline, flow$1, resolver, string$1, text$1, constructs_exports, document, contentInitial, flowInitial, flow, string, text, insideSpan, attentionMarkers, disable, search, alignment, EditMap, joinData, textData, ATEXT, ALPHANUMERIC, ALPHA, DEFAULT_PRETTIER_OPTIONS, SVG_PLACEHOLDERS, SPINDLE_PLACEHOLDERS, PLACEHOLDER_PATTERN, DEFAULT_DEDENTING, WHITESPACE_AS_WRITTEN, HTML_MARKDOWN_BOUNDARIES, LIST_ITEM_REGEX, CODE_FENCE_REGEX, NO_WRAP, NOT_MARKUP_TAGS;
22503
+ var __defProp2, __exportAll, HTML_TEXT_ELEMENTS$1, SIGIL_SCOPES, SIGIL_CHARS, grammar_shared_default, LB, RB, SIGIL_SCOPES$1, withSelectors, HTML_TEXT_ELEMENTS, VOID_TAGS, BRANCH_PARENT$1, LINK_SEPARATORS, NO_SELECTORS, EMAIL_AUTOLINK, peg$SyntaxError, NameMap, NameSet, OPTION_CLAUSE, PARAMETER_TYPES, STRING_HOLDS, metadataRegistry, companionParents, BLOCK_MACROS, BLOCK_WIDGETS, WIDGETS, DEFINED_BLOCK_MACROS, DEFINED_MACROS, REGISTERED_BLOCK_MACROS, RAW_BODY_MACROS, BRANCHING, quoteArg, MAX_MARKUP_DEPTH, last$1, BRANCH_PARENT, lowerName, nameOf, closerOf, closes, astralIdentifierCodes, astralIdentifierStartCodes, nonASCIIidentifierChars, nonASCIIidentifierStartChars, reservedWords, ecma5AndLessKeywords, keywords$1, keywordRelationalOperator, nonASCIIidentifierStart, nonASCIIidentifier, TokenType, beforeExpr, startsExpr, keywords, types$1, lineBreak, lineBreakG, nonASCIIwhitespace, skipWhiteSpace, ref, hasOwnProperty$1, toString, hasOwn$1, isArray, regexpCache, loneSurrogate, Position, SourceLocation, defaultOptions, warnedAboutEcmaVersion, SCOPE_TOP, SCOPE_FUNCTION, SCOPE_ASYNC, SCOPE_GENERATOR, SCOPE_ARROW, SCOPE_SIMPLE_CATCH, SCOPE_SUPER, SCOPE_DIRECT_SUPER, SCOPE_CLASS_STATIC_BLOCK, SCOPE_CLASS_FIELD_INIT, SCOPE_SWITCH, SCOPE_VAR, BIND_NONE, BIND_VAR, BIND_LEXICAL, BIND_FUNCTION, BIND_SIMPLE_CATCH, BIND_OUTSIDE, Parser, prototypeAccessors, pp$9, literal, DestructuringErrors, pp$8, loopLabel, switchLabel, empty$1, FUNC_STATEMENT, FUNC_HANGING_STATEMENT, FUNC_NULLABLE_ID, pp$7, TokContext, types, pp$6, pp$5, empty, pp$4, pp$3, Scope, Node, pp$2, scriptValuesAddedInUnicode, ecma9BinaryProperties, ecma10BinaryProperties, ecma11BinaryProperties, ecma12BinaryProperties, ecma13BinaryProperties, unicodeBinaryProperties, unicodeBinaryPropertiesOfStrings, unicodeGeneralCategoryValues, ecma9ScriptValues, ecma10ScriptValues, ecma11ScriptValues, ecma12ScriptValues, ecma13ScriptValues, unicodeScriptValues, data, ecmaVersion, i, list$2, pp$1, BranchID, RegExpValidationState, CharSetNone, CharSetOk, CharSetString, Token, pp, INVALID_TEMPLATE_ESCAPE_ERROR, OPTIONS, AT_NAME_RE, TRANS_NAME_RE, SIGIL_IDENT_RE, LINE_BREAK_RE, NOT_A_BODY_RE, OPERAND_ENDS, SigilParser, OPENERS, CLOSERS$1, CodeSyntaxError, last, CLOSER, isNode, NAMESPACE_NAME, WORD_RE$2, FLAGS_RE, WORDS_BEFORE_STRING, NON_STRING_QUOTE_PREFIX, memoInput, memo, defaultCodeEnd, defaultHooks, MarkupError, OFFSET_FIELD, listeners, RESERVED_NAME, isArrayIndex, hasOwn, createNamespace, TRAILING_OPERATOR_RE, slice, MacroArgumentError, WORD_RE$1, NUMBER_RE$1, WORD_OR_PUNCT_RE, LEADING_OPERATOR_RE, takesRest, SUB_MACRO_PARAMETERS, _MarkupExpansionBudget, MarkupExpansionBudget, parses, CONDITION_MACROS, PASSAGE_BODIES, holdsByDefault, JS_ESCAPE_RE, textPiece, LITERAL, registeredParameters, WIDGET_PARAMETERS, SPECIAL_PASSAGES, NOT_MARKUP, NOT_MARKUP_TAGS$1, BRANCH_MACROS, didYouMean, PASSAGE_ARGUMENT_HINT, BARE_WORD_RE, NUMBER_RE, IDENT_RE, KEY_RE, ARROW_RE, LINE_END_RE, ARRAY_INDEX_RE, UNSUPPORTED_UNDEFINED, Reader, VALID_VAR_TYPES, PRIMITIVE_SAMPLES, UNSUPPORTED_TYPE, NO_STORE_VAR_MACROS, CLOSERS, BLOCK_WORDS, NOT_PARAMETERS, DECLARATIONS, WRITE_RE, MUTATORS, MUTATING_CALL_RE, BEFORE_BINDING, isWordChar, Bindings, CALL_RE, IDENTIFIER_ARGUMENT_RE, WORD_RE, MODIFIER_RE, KEY_START_RE, CONFIG_KEYS, ConfigReader, stringOf, booleanOf, textOf, stringsOf, characterEntities, own, hasOwnProperty, asciiAlpha, asciiAlphanumeric, asciiAtext, asciiDigit, asciiHexDigit, asciiPunctuation, unicodePunctuation, unicodeWhitespace, content$1, EditMap$1, document$1, containerConstruct, attention, autolink, blankLine, blockQuote, characterEscape, characterReference, nonLazyContinuation, codeFenced, codeIndented, furtherStart, codeText, SpliceBuffer, content, continuationConstruct, definition, titleBefore, hardBreakEscape, headingAtx, htmlBlockNames, htmlRawNames, htmlFlow, blankLineBefore, htmlText, labelEnd, resourceConstruct, referenceFullConstruct, referenceCollapsedConstruct, labelStartImage, labelStartLink, lineEnding, thematicBreak, list, listItemPrefixWhitespaceConstruct, indentConstruct, setextUnderline, flow$1, resolver, string$1, text$1, constructs_exports, document, contentInitial, flowInitial, flow, string, text, insideSpan, attentionMarkers, disable, search, alignment, EditMap, joinData, textData, ATEXT, ALPHANUMERIC, ALPHA, DEFAULT_PRETTIER_OPTIONS, SVG_PLACEHOLDERS, SPINDLE_PLACEHOLDERS, PLACEHOLDER_PATTERN, DEFAULT_DEDENTING, WHITESPACE_AS_WRITTEN, JAVASCRIPT_TYPE, HTML_MARKDOWN_BOUNDARIES, LIST_ITEM_REGEX, CODE_FENCE_REGEX, NO_WRAP, NOT_MARKUP_TAGS;
22723
22504
  var init_story_variables = __esm({
22724
22505
  "node_modules/@rohal12/spindle/dist/pkg/story-variables.js"() {
22725
22506
  __defProp2 = Object.defineProperty;
@@ -22826,11 +22607,14 @@ var init_story_variables = __esm({
22826
22607
  if (nonPrintable) return s.replace(nonPrintable, (ch) => "\\u{" + hex3(ch) + "}");
22827
22608
  return s;
22828
22609
  }
22610
+ function escape3(s, special) {
22611
+ return unicodeEscape(s.replace(special, "\\$&").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, (ch) => "\\x0" + hex3(ch)).replace(/[\x10-\x1F\x7F-\x9F]/g, (ch) => "\\x" + hex3(ch)));
22612
+ }
22829
22613
  function literalEscape(s) {
22830
- return unicodeEscape(s.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, (ch) => "\\x0" + hex3(ch)).replace(/[\x10-\x1F\x7F-\x9F]/g, (ch) => "\\x" + hex3(ch)));
22614
+ return escape3(s, /[\\"]/g);
22831
22615
  }
22832
22616
  function classEscape(s) {
22833
- return unicodeEscape(s.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, (ch) => "\\x0" + hex3(ch)).replace(/[\x10-\x1F\x7F-\x9F]/g, (ch) => "\\x" + hex3(ch)));
22617
+ return escape3(s, /[\\\]^-]/g);
22834
22618
  }
22835
22619
  const DESCRIBE_EXPECTATION_FNS = {
22836
22620
  literal(expectation) {
@@ -22945,6 +22729,7 @@ var init_story_variables = __esm({
22945
22729
  "do",
22946
22730
  "button",
22947
22731
  "link",
22732
+ "dialog",
22948
22733
  "listbox",
22949
22734
  "cycle",
22950
22735
  "switch",
@@ -28771,7 +28556,7 @@ var init_story_variables = __esm({
28771
28556
  innermostVisible(bindings, at3) {
28772
28557
  const useFunction = this.functionStart(at3);
28773
28558
  const visible = bindings.filter((b) => b.scope.start <= at3 && at3 < b.scope.end && (!b.ordered || b.at < at3 || this.functionStart(b.at) !== useFunction));
28774
- const innermost = Math.max(...visible.map((b) => b.scope.start));
28559
+ const innermost = visible.reduce((start, b) => Math.max(start, b.scope.start), -Infinity);
28775
28560
  return visible.filter((b) => b.scope.start === innermost);
28776
28561
  }
28777
28562
  readGroups() {
@@ -29318,22 +29103,6 @@ var init_story_variables = __esm({
29318
29103
  booleanOf = (d) => d?.type === "boolean" ? d.value : void 0;
29319
29104
  textOf = (d) => stringOf(d)?.value;
29320
29105
  stringsOf = (d) => d?.type === "array" ? d.items.flatMap((item) => stringOf(item)?.value ?? []) : [];
29321
- VOID_ELEMENTS = /* @__PURE__ */ new Set([
29322
- "area",
29323
- "base",
29324
- "br",
29325
- "col",
29326
- "embed",
29327
- "hr",
29328
- "img",
29329
- "input",
29330
- "link",
29331
- "meta",
29332
- "param",
29333
- "source",
29334
- "track",
29335
- "wbr"
29336
- ]);
29337
29106
  characterEntities = {
29338
29107
  AElig: "\xC6",
29339
29108
  AMP: "&",
@@ -32105,6 +31874,7 @@ var init_story_variables = __esm({
32105
31874
  "default"
32106
31875
  ]);
32107
31876
  WHITESPACE_AS_WRITTEN = /<(?:pre|textarea|svg)[\s>]|white-space\s*:/i;
31877
+ JAVASCRIPT_TYPE = /^(?:module|(?:text|application)\/(?:x-)?(?:java|ecma)script|text\/(?:javascript1\.[0-5]|jscript|livescript))$/i;
32108
31878
  HTML_MARKDOWN_BOUNDARIES = /* @__PURE__ */ new Set([
32109
31879
  "hardBreakTrailing",
32110
31880
  "hardBreakEscape",
@@ -32876,7 +32646,7 @@ function trimmedEnd(text3, end = text3.length) {
32876
32646
  function parsePassageHeader(rawLine, lineNumber) {
32877
32647
  const line = withoutCr(rawLine);
32878
32648
  const bomLength = /^\uFEFF*/.exec(line)[0].length;
32879
- const escaped = line.replace(/\\./g, "ec");
32649
+ const escaped = line.replace(/\\./gs, "ec");
32880
32650
  const prefix2 = new RegExp("^::\\p{White_Space}*", "u").exec(escaped.slice(bomLength));
32881
32651
  if (!prefix2) return null;
32882
32652
  const nameStart = bomLength + prefix2[0].length;
@@ -32885,7 +32655,7 @@ function parsePassageHeader(rawLine, lineNumber) {
32885
32655
  const first = delimiter.exec(escaped);
32886
32656
  const boundary = first?.index ?? line.length;
32887
32657
  const nameEnd = trimmedEnd(escaped, boundary);
32888
- const decodedName = line.slice(nameStart, nameEnd).replace(/\\(.|$)/g, "$1").replace(new RegExp("^\\p{White_Space}+", "u"), "");
32658
+ const decodedName = line.slice(nameStart, nameEnd).replace(/\\(.|$)/gs, "$1").replace(new RegExp("^\\p{White_Space}+", "u"), "");
32889
32659
  const name = decodedName.slice(0, trimmedEnd(decodedName));
32890
32660
  if (!name) return null;
32891
32661
  let rest = boundary;
@@ -32893,7 +32663,7 @@ function parsePassageHeader(rawLine, lineNumber) {
32893
32663
  if (escaped[rest] === "[") {
32894
32664
  const end = escaped.indexOf("]", rest + 1);
32895
32665
  if (end === -1 || /[\[{}]/.test(escaped.slice(rest + 1, end))) return null;
32896
- const decoded = line.slice(rest + 1, end).replace(/\\(.)/g, "$1");
32666
+ const decoded = line.slice(rest + 1, end).replace(/\\(.)/gs, "$1");
32897
32667
  tags = decoded.match(/[^\p{White_Space}]+/gu) ?? [];
32898
32668
  rest = end + 1;
32899
32669
  while (rest < line.length && new RegExp("\\p{White_Space}", "u").test(escaped[rest])) rest++;
@@ -34158,7 +33928,8 @@ var init_passage_markup = __esm({
34158
33928
  get invocations() {
34159
33929
  if (!this.cachedInvocations) {
34160
33930
  const macros = this.doc.context.macros;
34161
- const definitions = widgetDefinitions([{ ...this.passage, content: this.content }], macros);
33931
+ const customWidgetMacro = macros.find((macro) => macro.name.toLowerCase() === "widget")?.source === "user";
33932
+ const definitions = customWidgetMacro ? [] : widgetDefinitions([{ ...this.passage, content: this.content }], macros);
34162
33933
  const registration = new Set(definitions.map((definition2) => definition2.start));
34163
33934
  this.cachedInvocations = this.isMarkup ? macroCalls(this.content, macros).filter((call) => call.kind === "invocation" && !registration.has(call.token.start)).map((call) => call.token) : [];
34164
33935
  }
@@ -34521,12 +34292,18 @@ var init_variable_tracker = __esm({
34521
34292
  // src/core/markup/widgets.ts
34522
34293
  function widgetSources(passages, macros) {
34523
34294
  const sources = /* @__PURE__ */ new Map();
34524
- for (const passage of passages) {
34525
- if (!passage.isMarkup) continue;
34526
- const { name, tags } = passage.passage;
34527
- for (const definition2 of widgetDefinitions([{ name, tags, content: passage.content }], macros)) {
34528
- sources.set(definition2, passage);
34529
- }
34295
+ const markups = [...passages].filter((passage) => passage.isMarkup);
34296
+ const inputs = markups.map((passage, index) => ({
34297
+ name: String(index),
34298
+ // Keep StoryInit discoverable under its source key; tooling selects all
34299
+ // other passages using their original tags.
34300
+ tags: passage.passage.name === "StoryInit" ? [...passage.passage.tags ?? [], "widget"] : passage.passage.tags,
34301
+ content: passage.content
34302
+ }));
34303
+ for (const definition2 of widgetDefinitions(inputs, macros)) {
34304
+ const passage = markups[Number(definition2.passage)];
34305
+ definition2.passage = passage.passage.name;
34306
+ sources.set(definition2, passage);
34530
34307
  }
34531
34308
  return sources;
34532
34309
  }
@@ -36475,13 +36252,13 @@ function loopDiagnostics(passage, token, ancestors, workspace) {
36475
36252
  const close = loop?.node.body?.close;
36476
36253
  if (!loop || !close) return [];
36477
36254
  const targets = macro === "computed" ? computedTemporaryTarget(token.rawArgs) : setTemporaryTargets(token.rawArgs);
36478
- const view = sourceView(passage, token.argsStart, token.argsEnd);
36479
- const argsIndex = viewIndex(view, token.argsStart);
36255
+ let view;
36480
36256
  const bodyStart = loop.node.token.end;
36481
36257
  const diagnostics = [];
36482
36258
  for (const target of targets) {
36483
36259
  if (!isReadInBody(passage, bodyStart, close.start, target.name, token.start, token.end)) continue;
36484
- const start = argsIndex + target.offset;
36260
+ view ??= sourceView(passage, token.argsStart, token.argsEnd);
36261
+ const start = viewIndex(view, token.argsStart) + target.offset;
36485
36262
  diagnostics.push(makeDiag(
36486
36263
  passage.range(pieceOffset(view, start), pieceOffset(view, start + 1 + target.name.length)),
36487
36264
  DiagnosticCode.TemporaryAssignedInLoop,
@@ -36490,26 +36267,50 @@ function loopDiagnostics(passage, token, ancestors, workspace) {
36490
36267
  }
36491
36268
  return diagnostics;
36492
36269
  }
36493
- function isReadInBody(passage, bodyStart, bodyEnd, name, macroStart, macroEnd) {
36494
- const eligible = (offset2) => offset2 >= bodyStart && offset2 < bodyEnd && !(offset2 >= macroStart && offset2 < macroEnd);
36270
+ function temporaryReads(passage) {
36271
+ const cached2 = temporaryReadIndexes.get(passage);
36272
+ if (cached2) return cached2;
36273
+ const reads = /* @__PURE__ */ new Map();
36274
+ const add = (name, offset2) => {
36275
+ const offsets = reads.get(name);
36276
+ if (offsets) offsets.push(offset2);
36277
+ else reads.set(name, [offset2]);
36278
+ };
36495
36279
  for (const token of markupTokens(passage)) {
36496
- if (token.type === "variable" && token.scope === "temporary" && token.name.split(".")[0] === name && eligible(token.start)) return true;
36280
+ if (token.type === "variable" && token.scope === "temporary") add(token.name.split(".")[0], token.start);
36497
36281
  }
36498
36282
  for (const piece of passage.pieces) {
36499
36283
  if (piece.kind !== "code") continue;
36500
36284
  try {
36501
- if (parseCode(piece.code, piece.goal).refs.some(
36502
- (ref2) => ref2.sigil === "_" && ref2.name === name && ref2.read && eligible(pieceOffset(piece, ref2.start))
36503
- )) return true;
36285
+ for (const ref2 of parseCode(piece.code, piece.goal).refs) {
36286
+ if (ref2.sigil === "_" && ref2.read) add(ref2.name, pieceOffset(piece, ref2.start));
36287
+ }
36504
36288
  } catch {
36505
36289
  }
36506
36290
  }
36507
- return false;
36291
+ for (const offsets of reads.values()) offsets.sort((a, b) => a - b);
36292
+ temporaryReadIndexes.set(passage, reads);
36293
+ return reads;
36294
+ }
36295
+ function isReadInBody(passage, bodyStart, bodyEnd, name, macroStart, macroEnd) {
36296
+ const offsets = temporaryReads(passage).get(name);
36297
+ if (!offsets) return false;
36298
+ const firstAt = (start) => {
36299
+ let low = 0;
36300
+ let high = offsets.length;
36301
+ while (low < high) {
36302
+ const mid = low + high >>> 1;
36303
+ if (offsets[mid] < start) low = mid + 1;
36304
+ else high = mid;
36305
+ }
36306
+ return offsets[low] ?? Infinity;
36307
+ };
36308
+ const first = firstAt(bodyStart);
36309
+ return (first >= macroStart && first < macroEnd ? firstAt(macroEnd) : first) < bodyEnd;
36508
36310
  }
36509
36311
  function argumentDiagnostics(passage, workspace, getPassageNames) {
36510
36312
  const diagnostics = [];
36511
- for (const token of passage.isMarkup ? macroTokens(passage) : []) {
36512
- if (token.type !== "macro" || token.isClose) continue;
36313
+ for (const token of passage.invocations) {
36513
36314
  const info = workspace.getEffectiveMacro(token.name);
36514
36315
  if (!info?.parameters || info.skipArgs || info.parameterDefs?.length) continue;
36515
36316
  if (SPINDLE_MACROS.has(token.name.toLowerCase()) && !workspace.macros.hasDiscoveredMacro(token.name)) continue;
@@ -36520,21 +36321,26 @@ function argumentDiagnostics(passage, workspace, getPassageNames) {
36520
36321
  continue;
36521
36322
  }
36522
36323
  const range2 = passage.range(token.start, token.end);
36523
- const args2 = lexArguments(token.rawArgs);
36524
- if (params.isEmpty()) {
36525
- if (args2.length > 0) {
36526
- diagnostics.push(makeDiag(range2, DiagnosticCode.ExpectedNoArguments, `Expected no arguments for {${token.name}}, got ${args2.length}`));
36324
+ try {
36325
+ const args2 = lexArguments(token.rawArgs);
36326
+ if (params.isEmpty()) {
36327
+ if (args2.length > 0) {
36328
+ diagnostics.push(makeDiag(range2, DiagnosticCode.ExpectedNoArguments, `Expected no arguments for {${token.name}}, got ${args2.length}`));
36329
+ }
36330
+ continue;
36527
36331
  }
36528
- continue;
36529
- }
36530
- const result2 = params.validate(args2, { passages: getPassageNames() });
36531
- if (result2.variantIndex === null) continue;
36532
- for (const error62 of result2.errors) {
36533
- const code = error62.message.startsWith("Too many arguments") ? DiagnosticCode.TooManyArguments : DiagnosticCode.ParameterTypeError;
36534
- diagnostics.push(makeDiag(range2, code, `{${token.name}}: ${error62.message}`));
36535
- }
36536
- for (const warning of result2.warnings) {
36537
- diagnostics.push(makeDiag(range2, DiagnosticCode.ParameterWarning, `{${token.name}}: ${warning.message}`));
36332
+ const result2 = params.validate(args2, { passages: getPassageNames() });
36333
+ if (result2.variantIndex === null) continue;
36334
+ for (const error62 of result2.errors) {
36335
+ const code = error62.message.startsWith("Too many arguments") ? DiagnosticCode.TooManyArguments : DiagnosticCode.ParameterTypeError;
36336
+ diagnostics.push(makeDiag(range2, code, `{${token.name}}: ${error62.message}`));
36337
+ }
36338
+ for (const warning of result2.warnings) {
36339
+ diagnostics.push(makeDiag(range2, DiagnosticCode.ParameterWarning, `{${token.name}}: ${warning.message}`));
36340
+ }
36341
+ } catch (error62) {
36342
+ const reason = error62 instanceof Error ? error62.message : String(error62);
36343
+ diagnostics.push(makeDiag(range2, DiagnosticCode.ParameterTypeError, `{${token.name}}: Unable to validate arguments: ${reason}`));
36538
36344
  }
36539
36345
  }
36540
36346
  return diagnostics;
@@ -36557,6 +36363,7 @@ function widgetDiagnostics(passage, story, workspace) {
36557
36363
  ));
36558
36364
  }
36559
36365
  }
36366
+ if (workspace.getEffectiveMacro("include")?.source !== "builtin") return diagnostics;
36560
36367
  for (const piece of passage.pieces) {
36561
36368
  if (piece.kind !== "passage" || piece.macro !== "include") continue;
36562
36369
  const target = workspace.passages.getEffectivePassage(piece.name);
@@ -36662,7 +36469,7 @@ function toLspDiagnostic(d) {
36662
36469
  data: d.data
36663
36470
  };
36664
36471
  }
36665
- var tweeReports, reports, COMPILER_PASSAGES, MARKUP_CODES, text2, list2, VARIABLE_CODES, WILL_NOT_START, BRANCH_MACROS2, DIRECT_CHILD_MACROS, DEFERRED_CONTAINERS, SPINDLE_MACROS, diagnosticsPlugin;
36472
+ var tweeReports, reports, COMPILER_PASSAGES, MARKUP_CODES, text2, list2, VARIABLE_CODES, WILL_NOT_START, BRANCH_MACROS2, DIRECT_CHILD_MACROS, DEFERRED_CONTAINERS, temporaryReadIndexes, SPINDLE_MACROS, diagnosticsPlugin;
36666
36473
  var init_diagnostics = __esm({
36667
36474
  "src/plugins/diagnostics.ts"() {
36668
36475
  "use strict";
@@ -36717,6 +36524,7 @@ var init_diagnostics = __esm({
36717
36524
  BRANCH_MACROS2 = /* @__PURE__ */ new Set(["elseif", "else", "case", "default", "next"]);
36718
36525
  DIRECT_CHILD_MACROS = /* @__PURE__ */ new Set(["option"]);
36719
36526
  DEFERRED_CONTAINERS = /* @__PURE__ */ new Set(["link", "button"]);
36527
+ temporaryReadIndexes = /* @__PURE__ */ new WeakMap();
36720
36528
  SPINDLE_MACROS = /* @__PURE__ */ new Set([
36721
36529
  ...builtinMacros.flatMap((macro) => [macro.name, ...macro.subMacros]).map((name) => name.toLowerCase()),
36722
36530
  ...BRANCH_MACROS2