@danielx/civet 0.6.17 → 0.6.19

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/browser.js CHANGED
@@ -157,15 +157,8 @@ var Civet = (() => {
157
157
  }
158
158
  }
159
159
  function arrayElementHasTrailingComma(elementNode) {
160
- const { children } = elementNode, { length } = children;
161
- const lastChild = children[length - 1];
162
- if (lastChild) {
163
- const l2 = lastChild.length;
164
- if (lastChild[l2 - 1]?.token === ",") {
165
- return true;
166
- }
167
- }
168
- return false;
160
+ const lastChild = elementNode.children.at(-1);
161
+ return lastChild && lastChild[lastChild.length - 1]?.token === ",";
169
162
  }
170
163
  var assert = {
171
164
  equal(a, b, msg) {
@@ -592,7 +585,15 @@ var Civet = (() => {
592
585
  case "EmptyStatement":
593
586
  case "ReturnStatement":
594
587
  case "ThrowStatement":
588
+ return;
595
589
  case "Declaration":
590
+ exp.children.push(["", [
591
+ ";",
592
+ ref,
593
+ ".push(",
594
+ patternAsValue(exp.bindings.at(-1).pattern),
595
+ ")"
596
+ ]]);
596
597
  return;
597
598
  case "ForStatement":
598
599
  case "IterationStatement":
@@ -845,6 +846,39 @@ var Civet = (() => {
845
846
  const indent = expressions[index][0];
846
847
  expressions.splice(index, 0, [indent, dec, ";"]);
847
848
  }
849
+ function patternAsValue(pattern) {
850
+ switch (pattern.type) {
851
+ case "ArrayBindingPattern": {
852
+ const children = [...pattern.children];
853
+ const index = children.indexOf(pattern.elements);
854
+ if (index < 0)
855
+ throw new Error("failed to find elements in ArrayBindingPattern");
856
+ children[index] = pattern.elements.map((el) => {
857
+ const [ws, e, delim] = el.children;
858
+ return { ...el, children: [ws, patternAsValue(e), delim] };
859
+ });
860
+ return { ...pattern, children };
861
+ }
862
+ case "ObjectBindingPattern": {
863
+ const children = [...pattern.children];
864
+ const index = children.indexOf(pattern.properties);
865
+ if (index < 0)
866
+ throw new Error("failed to find properties in ArrayBindingPattern");
867
+ children[index] = pattern.properties.map(patternAsValue);
868
+ return { ...pattern, children };
869
+ }
870
+ case "Identifier":
871
+ case "BindingProperty": {
872
+ const children = [pattern.name, pattern.delim];
873
+ if (isWhitespaceOrEmpty(pattern.children[0])) {
874
+ children.unshift(pattern.children[0]);
875
+ }
876
+ return { ...pattern, children };
877
+ }
878
+ default:
879
+ return pattern;
880
+ }
881
+ }
848
882
  function insertReturn(node) {
849
883
  if (!node)
850
884
  return;
@@ -886,7 +920,12 @@ var Civet = (() => {
886
920
  case "EmptyStatement":
887
921
  case "ReturnStatement":
888
922
  case "ThrowStatement":
923
+ return;
889
924
  case "Declaration":
925
+ exp.children.push(["", {
926
+ type: "ReturnStatement",
927
+ children: [";return ", patternAsValue(exp.bindings.at(-1).pattern)]
928
+ }]);
890
929
  return;
891
930
  case "ForStatement":
892
931
  case "IterationStatement":
@@ -1301,72 +1340,59 @@ var Civet = (() => {
1301
1340
  children: [s, parts, e]
1302
1341
  };
1303
1342
  }
1304
- function processConstAssignmentDeclaration(c, id, suffix, ws, ca, e) {
1305
- c = {
1306
- ...c,
1343
+ function processAssignmentDeclaration(decl, id, suffix, ws, assign, e) {
1344
+ decl = {
1345
+ ...decl,
1307
1346
  $loc: {
1308
- pos: ca.$loc.pos - 1,
1309
- length: ca.$loc.length + 1
1347
+ pos: assign.$loc.pos - 1,
1348
+ length: assign.$loc.length + 1
1310
1349
  }
1311
1350
  };
1312
- let exp;
1313
- if (e.type === "FunctionExpression") {
1314
- exp = e;
1315
- } else {
1316
- exp = e[1];
1317
- }
1318
- if (exp?.children?.[0]?.token?.match(/^\s+$/))
1319
- exp.children.shift();
1320
- if (id.type === "Identifier" && exp?.type === "FunctionExpression" && !exp.id) {
1321
- const i = exp.children.findIndex((c2) => c2?.token === "function") + 1;
1322
- exp = {
1323
- ...exp,
1324
- children: [...exp.children.slice(0, i), " ", id, suffix, ws, ...exp.children.slice(i)]
1325
- };
1326
- return {
1327
- type: "Declaration",
1328
- children: [exp],
1329
- names: id.names
1330
- };
1351
+ if (decl.token.startsWith("const")) {
1352
+ let exp;
1353
+ if (e.type === "FunctionExpression") {
1354
+ exp = e;
1355
+ } else {
1356
+ exp = e[1];
1357
+ }
1358
+ if (exp?.children?.[0]?.token?.match(/^\s+$/))
1359
+ exp.children.shift();
1360
+ if (id.type === "Identifier" && exp?.type === "FunctionExpression" && !exp.id) {
1361
+ const i = exp.children.findIndex((c) => c?.token === "function") + 1;
1362
+ exp = {
1363
+ ...exp,
1364
+ children: [...exp.children.slice(0, i), " ", id, suffix, ws, ...exp.children.slice(i)]
1365
+ };
1366
+ return {
1367
+ type: "Declaration",
1368
+ decl,
1369
+ children: [exp],
1370
+ names: id.names
1371
+ };
1372
+ }
1331
1373
  }
1332
1374
  let [splices, thisAssignments] = gatherBindingCode(id);
1333
1375
  splices = splices.map((s) => [", ", s]);
1334
1376
  thisAssignments = thisAssignments.map((a) => ["", a, ";"]);
1335
- const binding = [c, id, suffix, ...ws];
1336
- const initializer = [ca, e];
1337
- const children = [binding, initializer];
1338
- return {
1339
- type: "Declaration",
1340
- names: id.names,
1341
- children,
1342
- binding,
1377
+ const initializer = [ws, assign, e];
1378
+ const binding = {
1379
+ type: "Binding",
1380
+ pattern: id,
1343
1381
  initializer,
1344
1382
  splices,
1345
- thisAssignments
1346
- };
1347
- }
1348
- function processLetAssignmentDeclaration(l, id, suffix, ws, la, e) {
1349
- l = {
1350
- ...l,
1351
- $loc: {
1352
- pos: la.$loc.pos - 1,
1353
- length: la.$loc.length + 1
1354
- }
1383
+ suffix,
1384
+ thisAssignments,
1385
+ children: [id, suffix, initializer]
1355
1386
  };
1356
- let [splices, thisAssignments] = gatherBindingCode(id);
1357
- splices = splices.map((s) => [", ", s]);
1358
- thisAssignments = thisAssignments.map((a) => ["", a, ";"]);
1359
- const binding = [l, id, suffix, ...ws];
1360
- const initializer = [la, e];
1361
- const children = [binding, initializer];
1387
+ const children = [decl, binding];
1362
1388
  return {
1363
1389
  type: "Declaration",
1364
1390
  names: id.names,
1365
- children,
1366
- binding,
1367
- initializer,
1391
+ decl,
1392
+ bindings: [binding],
1368
1393
  splices,
1369
- thisAssignments
1394
+ thisAssignments,
1395
+ children
1370
1396
  };
1371
1397
  }
1372
1398
  function implicitFunctionBlock(f) {
@@ -1577,9 +1603,9 @@ var Civet = (() => {
1577
1603
  const subRef = [ref, "[", i.toString(), "]"];
1578
1604
  getPatternConditions(e, subRef, conditions);
1579
1605
  });
1580
- const postRest = pattern.children.find((c) => c?.blockPrefix);
1581
- if (postRest) {
1582
- const postElements = postRest.blockPrefix.children[1], { length: postLength } = postElements;
1606
+ const { blockPrefix } = pattern;
1607
+ if (blockPrefix) {
1608
+ const postElements = blockPrefix.children[1], { length: postLength } = postElements;
1583
1609
  postElements.forEach(({ children: [, e] }, i) => {
1584
1610
  const subRef = [ref, "[", ref, ".length - ", (postLength + i).toString(), "]"];
1585
1611
  getPatternConditions(e, subRef, conditions);
@@ -1666,15 +1692,15 @@ var Civet = (() => {
1666
1692
  if (el.type === "BindingRestElement") {
1667
1693
  return ["", el, void 0];
1668
1694
  }
1669
- const { children: [ws, e, sep] } = el;
1695
+ const { children: [ws, e, delim] } = el;
1670
1696
  switch (e.type) {
1671
1697
  case "Literal":
1672
1698
  case "RegularExpressionLiteral":
1673
1699
  case "StringLiteral":
1674
1700
  case "PinPattern":
1675
- return sep;
1701
+ return delim;
1676
1702
  default:
1677
- return [ws, nonMatcherBindings(e), sep];
1703
+ return [ws, nonMatcherBindings(e), delim];
1678
1704
  }
1679
1705
  });
1680
1706
  }
@@ -1684,13 +1710,12 @@ var Civet = (() => {
1684
1710
  case "BindingProperty": {
1685
1711
  const { children, name, value } = p;
1686
1712
  const [ws] = children;
1687
- const sep = children[children.length - 1];
1688
1713
  switch (value && value.type) {
1689
1714
  case "ArrayBindingPattern":
1690
1715
  case "ObjectBindingPattern":
1691
1716
  return {
1692
1717
  ...p,
1693
- children: [ws, name, ": ", nonMatcherBindings(value)]
1718
+ children: [ws, name, ": ", nonMatcherBindings(value), p.delim]
1694
1719
  };
1695
1720
  case "Identifier":
1696
1721
  return p;
@@ -1700,7 +1725,7 @@ var Civet = (() => {
1700
1725
  default:
1701
1726
  return {
1702
1727
  ...p,
1703
- children: [ws, name, sep]
1728
+ children: [ws, name, p.delim]
1704
1729
  };
1705
1730
  }
1706
1731
  }
@@ -2370,9 +2395,20 @@ var Civet = (() => {
2370
2395
  let rest = props[restIndex];
2371
2396
  props = props.slice(0, restIndex);
2372
2397
  if (after.length) {
2373
- const [restDelim] = rest.children.slice(-1), lastAfterProp = after[after.length - 1], lastAfterChildren = lastAfterProp.children, [lastDelim] = lastAfterChildren.slice(-1);
2374
- rest = { ...rest, children: [...rest.children.slice(0, -1), lastDelim] };
2375
- after = [...after.slice(0, -1), { ...lastAfterProp, children: [...lastAfterChildren.slice(0, -1), restDelim] }];
2398
+ const { delim: restDelim } = rest, lastAfterProp = after[after.length - 1], { delim: lastDelim, children: lastAfterChildren } = lastAfterProp;
2399
+ rest = {
2400
+ ...rest,
2401
+ delim: lastDelim,
2402
+ children: [...rest.children.slice(0, -1), lastDelim]
2403
+ };
2404
+ after = [
2405
+ ...after.slice(0, -1),
2406
+ {
2407
+ ...lastAfterProp,
2408
+ delim: restDelim,
2409
+ children: [...lastAfterChildren.slice(0, -1), restDelim]
2410
+ }
2411
+ ];
2376
2412
  }
2377
2413
  const children = [...props, ...after, rest];
2378
2414
  return {
@@ -2552,8 +2588,7 @@ var Civet = (() => {
2552
2588
  processBinaryOpExpression,
2553
2589
  processCallMemberExpression,
2554
2590
  processCoffeeInterpolation,
2555
- processConstAssignmentDeclaration,
2556
- processLetAssignmentDeclaration,
2591
+ processAssignmentDeclaration,
2557
2592
  processParams,
2558
2593
  processProgram,
2559
2594
  processReturnValue,
@@ -3094,7 +3129,6 @@ ${input.slice(result.pos)}
3094
3129
  BindingProperty,
3095
3130
  BindingRestProperty,
3096
3131
  NestedBindingElements,
3097
- NestedBindingElement,
3098
3132
  BindingElement,
3099
3133
  BindingRestElement,
3100
3134
  EmptyBindingPattern,
@@ -3316,7 +3350,6 @@ ${input.slice(result.pos)}
3316
3350
  Initializer,
3317
3351
  VariableStatement,
3318
3352
  VariableDeclarationList,
3319
- VariableDeclaration,
3320
3353
  NumericLiteral,
3321
3354
  NumericLiteralKind,
3322
3355
  DecimalBigIntegerLiteral,
@@ -3884,23 +3917,24 @@ ${input.slice(result.pos)}
3884
3917
  var $R46 = $R(new RegExp("[^\\r\\n]", "suy"));
3885
3918
  var $R47 = $R(new RegExp("[ \\t]+", "suy"));
3886
3919
  var $R48 = $R(new RegExp("(?!\\p{ID_Continue})", "suy"));
3887
- var $R49 = $R(new RegExp("\\s", "suy"));
3888
- var $R50 = $R(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*", "suy"));
3889
- var $R51 = $R(new RegExp("[\\s>]|\\/>", "suy"));
3890
- var $R52 = $R(new RegExp("(?:[\\w\\-:]+|\\([^()]*\\)|\\[[^\\[\\]]*\\])+", "suy"));
3891
- var $R53 = $R(new RegExp(`"[^"]*"|'[^']*'`, "suy"));
3892
- var $R54 = $R(new RegExp("[<>]", "suy"));
3893
- var $R55 = $R(new RegExp("[!~+-](?!\\s|[!~+-]*&)", "suy"));
3894
- var $R56 = $R(new RegExp("(?:-[^-]|[^-]*)*", "suy"));
3895
- var $R57 = $R(new RegExp("[^{}<>\\r\\n]+", "suy"));
3896
- var $R58 = $R(new RegExp("[+-]?", "suy"));
3897
- var $R59 = $R(new RegExp("[+-]", "suy"));
3898
- var $R60 = $R(new RegExp("#![^\\r\\n]*", "suy"));
3899
- var $R61 = $R(new RegExp("[\\t ]*", "suy"));
3900
- var $R62 = $R(new RegExp("[\\s]*", "suy"));
3901
- var $R63 = $R(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?", "suy"));
3902
- var $R64 = $R(new RegExp("\\r\\n|\\n|\\r|$", "suy"));
3903
- var $R65 = $R(new RegExp("[ \\t]*", "suy"));
3920
+ var $R49 = $R(new RegExp("['\u2019]s", "suy"));
3921
+ var $R50 = $R(new RegExp("\\s", "suy"));
3922
+ var $R51 = $R(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*", "suy"));
3923
+ var $R52 = $R(new RegExp("[\\s>]|\\/>", "suy"));
3924
+ var $R53 = $R(new RegExp("(?:[\\w\\-:]+|\\([^()]*\\)|\\[[^\\[\\]]*\\])+", "suy"));
3925
+ var $R54 = $R(new RegExp(`"[^"]*"|'[^']*'`, "suy"));
3926
+ var $R55 = $R(new RegExp("[<>]", "suy"));
3927
+ var $R56 = $R(new RegExp("[!~+-](?!\\s|[!~+-]*&)", "suy"));
3928
+ var $R57 = $R(new RegExp("(?:-[^-]|[^-]*)*", "suy"));
3929
+ var $R58 = $R(new RegExp("[^{}<>\\r\\n]+", "suy"));
3930
+ var $R59 = $R(new RegExp("[+-]?", "suy"));
3931
+ var $R60 = $R(new RegExp("[+-]", "suy"));
3932
+ var $R61 = $R(new RegExp("#![^\\r\\n]*", "suy"));
3933
+ var $R62 = $R(new RegExp("[\\t ]*", "suy"));
3934
+ var $R63 = $R(new RegExp("[\\s]*", "suy"));
3935
+ var $R64 = $R(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?", "suy"));
3936
+ var $R65 = $R(new RegExp("\\r\\n|\\n|\\r|$", "suy"));
3937
+ var $R66 = $R(new RegExp("[ \\t]*", "suy"));
3904
3938
  var Program$0 = $TS($S(Reset, Init, $E(EOS), TopLevelStatements, __), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
3905
3939
  var statements = $4;
3906
3940
  processProgram({
@@ -6648,6 +6682,8 @@ ${input.slice(result.pos)}
6648
6682
  var MemberBracketContent$1 = $TS($S(Dot, $C(TemplateLiteral, StringLiteral)), function($skip, $loc, $0, $1, $2) {
6649
6683
  var dot = $1;
6650
6684
  var str = $2;
6685
+ if (Array.isArray(dot))
6686
+ dot = dot[0];
6651
6687
  return {
6652
6688
  type: "Index",
6653
6689
  children: [
@@ -6660,6 +6696,8 @@ ${input.slice(result.pos)}
6660
6696
  var MemberBracketContent$2 = $TS($S(Dot, IntegerLiteral), function($skip, $loc, $0, $1, $2) {
6661
6697
  var dot = $1;
6662
6698
  var num = $2;
6699
+ if (Array.isArray(dot))
6700
+ dot = dot[0];
6663
6701
  return {
6664
6702
  type: "Index",
6665
6703
  children: [
@@ -7337,7 +7375,7 @@ ${input.slice(result.pos)}
7337
7375
  var c = $3;
7338
7376
  return {
7339
7377
  type: "ObjectBindingPattern",
7340
- children: $0,
7378
+ children: [$1, $2, c.children, $4, $5],
7341
7379
  names: c.names,
7342
7380
  properties: c.children
7343
7381
  };
@@ -7398,6 +7436,7 @@ ${input.slice(result.pos)}
7398
7436
  return props.map(([prop, delim]) => {
7399
7437
  return {
7400
7438
  ...prop,
7439
+ delim,
7401
7440
  children: [...prop.children, delim]
7402
7441
  };
7403
7442
  });
@@ -7427,11 +7466,10 @@ ${input.slice(result.pos)}
7427
7466
  var ArrayBindingPattern$0 = $TS($S($E(_), OpenBracket, ArrayBindingPatternContent, __, CloseBracket), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
7428
7467
  var c = $3;
7429
7468
  return {
7469
+ ...c,
7430
7470
  type: "ArrayBindingPattern",
7431
- children: $0,
7432
- names: c.names,
7433
7471
  elements: c.children,
7434
- length: c.length
7472
+ children: [$1, $2, c.children, $4, $5]
7435
7473
  };
7436
7474
  });
7437
7475
  function ArrayBindingPattern(state) {
@@ -7517,14 +7555,14 @@ ${input.slice(result.pos)}
7517
7555
  }
7518
7556
  }
7519
7557
  var NestedBindingElementList$0 = $TS($S(Nested, BindingElementList), function($skip, $loc, $0, $1, $2) {
7520
- var ws = $1;
7558
+ var indent = $1;
7521
7559
  var elements = $2;
7522
7560
  return elements.map((element, i) => {
7523
7561
  if (i > 0)
7524
7562
  return element;
7525
7563
  return {
7526
7564
  ...element,
7527
- children: [ws, ...element.children]
7565
+ children: [indent, ...element.children.slice(1)]
7528
7566
  };
7529
7567
  });
7530
7568
  });
@@ -7639,13 +7677,13 @@ ${input.slice(result.pos)}
7639
7677
  var BindingProperty$1 = $TS($S($E(_), PropertyName, $E(_), Colon, $E(_), $C(BindingIdentifier, BindingPattern), $E(Initializer)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
7640
7678
  var name = $2;
7641
7679
  var value = $6;
7642
- var init = $7;
7680
+ var initializer = $7;
7643
7681
  return {
7644
7682
  type: "BindingProperty",
7645
7683
  children: $0,
7646
7684
  name,
7647
7685
  value,
7648
- init,
7686
+ initializer,
7649
7687
  names: value.names
7650
7688
  };
7651
7689
  });
@@ -7653,14 +7691,14 @@ ${input.slice(result.pos)}
7653
7691
  var ws = $1;
7654
7692
  var pin = $2;
7655
7693
  var binding = $3;
7656
- var init = $4;
7694
+ var initializer = $4;
7657
7695
  if (binding.type === "AtBinding") {
7658
7696
  return {
7659
7697
  type: "AtBindingProperty",
7660
7698
  children: $0,
7661
7699
  binding,
7662
7700
  ref: binding.ref,
7663
- init,
7701
+ initializer,
7664
7702
  names: []
7665
7703
  };
7666
7704
  }
@@ -7680,7 +7718,7 @@ ${input.slice(result.pos)}
7680
7718
  children: $0,
7681
7719
  name: binding,
7682
7720
  value: void 0,
7683
- init,
7721
+ initializer,
7684
7722
  names: binding.names,
7685
7723
  identifier: binding
7686
7724
  };
@@ -7777,36 +7815,6 @@ ${input.slice(result.pos)}
7777
7815
  return result;
7778
7816
  }
7779
7817
  }
7780
- var NestedBindingElement$0 = $TS($S(Nested, BindingElement), function($skip, $loc, $0, $1, $2) {
7781
- var indent = $1;
7782
- var element = $2;
7783
- return {
7784
- ...element,
7785
- children: [indent, ...element.children]
7786
- };
7787
- });
7788
- function NestedBindingElement(state) {
7789
- let eventData;
7790
- if (state.events) {
7791
- const result = state.events.enter?.("NestedBindingElement", state);
7792
- if (result) {
7793
- if (result.cache)
7794
- return result.cache;
7795
- eventData = result.data;
7796
- }
7797
- }
7798
- if (state.tokenize) {
7799
- const result = $TOKEN("NestedBindingElement", state, NestedBindingElement$0(state));
7800
- if (state.events)
7801
- state.events.exit?.("NestedBindingElement", state, result, eventData);
7802
- return result;
7803
- } else {
7804
- const result = NestedBindingElement$0(state);
7805
- if (state.events)
7806
- state.events.exit?.("NestedBindingElement", state, result, eventData);
7807
- return result;
7808
- }
7809
- }
7810
7818
  var BindingElement$0 = BindingRestElement;
7811
7819
  var BindingElement$1 = $TS($S($E(_), $C(BindingIdentifier, BindingPattern), $E(Initializer)), function($skip, $loc, $0, $1, $2, $3) {
7812
7820
  var ws = $1;
@@ -7815,6 +7823,7 @@ ${input.slice(result.pos)}
7815
7823
  if (binding.children) {
7816
7824
  binding = {
7817
7825
  ...binding,
7826
+ initializer,
7818
7827
  children: [...binding.children, initializer]
7819
7828
  };
7820
7829
  }
@@ -7860,7 +7869,7 @@ ${input.slice(result.pos)}
7860
7869
  var binding = $3;
7861
7870
  return {
7862
7871
  type: "BindingRestElement",
7863
- children: [...ws || [], dots, binding],
7872
+ children: [ws, [dots, binding]],
7864
7873
  binding,
7865
7874
  name: binding.name,
7866
7875
  names: binding.names,
@@ -9905,10 +9914,24 @@ ${input.slice(result.pos)}
9905
9914
  var NestedPropertyDefinition$0 = $TS($S(Nested, $P($S(PropertyDefinition, ObjectPropertyDelimiter))), function($skip, $loc, $0, $1, $2) {
9906
9915
  var ws = $1;
9907
9916
  var inlineProps = $2;
9908
- return inlineProps.map(([prop, delimiter], i) => ({
9909
- ...prop,
9910
- children: [...i === 0 ? ws : [], ...prop.children, delimiter]
9911
- }));
9917
+ return inlineProps.flatMap(([prop, delim], i) => {
9918
+ if (!Array.isArray(prop))
9919
+ prop = [prop];
9920
+ if (i === 0) {
9921
+ const [first, ...rest] = prop;
9922
+ prop = [{ ...first, children: [...ws, ...first.children] }, ...rest];
9923
+ }
9924
+ const last = prop[prop.length - 1];
9925
+ prop = [
9926
+ ...prop.slice(0, prop.length - 1),
9927
+ {
9928
+ ...last,
9929
+ delim,
9930
+ children: [...last.children, delim]
9931
+ }
9932
+ ];
9933
+ return prop;
9934
+ });
9912
9935
  });
9913
9936
  function NestedPropertyDefinition(state) {
9914
9937
  let eventData;
@@ -10019,12 +10042,15 @@ ${input.slice(result.pos)}
10019
10042
  }
10020
10043
  }
10021
10044
  var PropertyDefinitionList$0 = $TV($P($S(PropertyDefinition, ObjectPropertyDelimiter)), function($skip, $loc, $0, $1) {
10022
- return $0.map(([prop, delim]) => {
10023
- return {
10024
- ...prop,
10045
+ return $0.flatMap(([prop, delim]) => {
10046
+ prop = Array.isArray(prop) ? prop : [prop];
10047
+ let last = prop[prop.length - 1];
10048
+ last = {
10049
+ ...last,
10025
10050
  delim,
10026
- children: [...prop.children, delim]
10051
+ children: [...last.children, delim]
10027
10052
  };
10053
+ return [...prop.slice(0, prop.length - 1), last];
10028
10054
  });
10029
10055
  });
10030
10056
  function PropertyDefinitionList(state) {
@@ -10108,8 +10134,19 @@ ${input.slice(result.pos)}
10108
10134
  var PropertyDefinition$5 = $TS($S(__, CallExpression), function($skip, $loc, $0, $1, $2) {
10109
10135
  var ws = $1;
10110
10136
  var value = $2;
10111
- if (value.type === "Identifier") {
10112
- return { ...value, children: [ws, ...value.children] };
10137
+ switch (value.type) {
10138
+ case "Identifier":
10139
+ return { ...value, children: [ws, ...value.children] };
10140
+ case "ObjectExpression":
10141
+ let first = value.properties[0];
10142
+ if (first) {
10143
+ first = {
10144
+ ...first,
10145
+ children: [ws, ...first.children],
10146
+ hoistDec: value.hoistDec
10147
+ };
10148
+ }
10149
+ return [first, ...value.properties.slice(1)];
10113
10150
  }
10114
10151
  const last = lastAccessInCallExpression(value);
10115
10152
  if (!last)
@@ -13443,17 +13480,19 @@ ${input.slice(result.pos)}
13443
13480
  type: "Ref",
13444
13481
  base: "ref"
13445
13482
  };
13446
- const { binding, initializer, splices, thisAssignments } = dec;
13483
+ const { decl, bindings } = dec;
13484
+ const binding = bindings[0];
13485
+ const { pattern, suffix, initializer, splices, thisAssignments } = binding;
13447
13486
  const initCondition = {
13448
13487
  type: "AssignmentExpression",
13449
- children: [ref, " ", initializer],
13488
+ children: [ref, initializer],
13450
13489
  hoistDec: {
13451
13490
  type: "Declaration",
13452
- children: ["let ", ref],
13491
+ children: ["let ", ref, suffix],
13453
13492
  names: []
13454
13493
  },
13455
13494
  blockPrefix: [
13456
- ["", [binding, "= ", ref, ...splices], ";"],
13495
+ ["", [decl, pattern, suffix, " = ", ref, ...splices], ";"],
13457
13496
  ...thisAssignments
13458
13497
  ]
13459
13498
  };
@@ -15152,26 +15191,23 @@ ${input.slice(result.pos)}
15152
15191
  return result;
15153
15192
  }
15154
15193
  }
15155
- var LexicalDeclaration$0 = $TS($S(LetOrConst, LexicalBinding, $Q($S(__, Comma, LexicalBinding))), function($skip, $loc, $0, $1, $2, $3) {
15156
- var d = $1;
15194
+ var LexicalDeclaration$0 = $TS($S(LetOrConst, LexicalBinding, $Q($S(__, Comma, __, LexicalBinding))), function($skip, $loc, $0, $1, $2, $3) {
15195
+ var decl = $1;
15157
15196
  var binding = $2;
15158
15197
  var tail = $3;
15159
- const { splices, thisAssignments } = binding;
15198
+ const bindings = [binding].concat(tail.map(([, , , b]) => b));
15160
15199
  return {
15161
15200
  type: "Declaration",
15162
15201
  children: $0,
15163
- names: [...binding.names].concat(tail.flatMap(([, , b]) => b.names)),
15164
- binding: {
15165
- ...binding.binding,
15166
- children: [d, ...binding.binding.children]
15167
- },
15168
- initializer: binding.initializer,
15169
- splices,
15170
- thisAssignments
15202
+ names: bindings.flatMap((b) => b.names),
15203
+ bindings,
15204
+ decl,
15205
+ splices: bindings.flatMap((b) => b.splices),
15206
+ thisAssignments: bindings.flatMap((b) => b.thisAssignments)
15171
15207
  };
15172
15208
  });
15173
15209
  var LexicalDeclaration$1 = $TS($S(InsertConst, $C(BindingPattern, BindingIdentifier), $E(TypeSuffix), __, ConstAssignment, ExtendedExpression), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
15174
- return processConstAssignmentDeclaration(...$0);
15210
+ return processAssignmentDeclaration(...$0);
15175
15211
  });
15176
15212
  var LexicalDeclaration$2 = $TS($S(InsertLet, $C(BindingPattern, BindingIdentifier), $E(TypeSuffix), __, LetAssignment, ExtendedExpression), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
15177
15213
  var l = $1;
@@ -15180,7 +15216,7 @@ ${input.slice(result.pos)}
15180
15216
  var ws = $4;
15181
15217
  var la = $5;
15182
15218
  var e = $6;
15183
- return processLetAssignmentDeclaration(...$0);
15219
+ return processAssignmentDeclaration(...$0);
15184
15220
  });
15185
15221
  function LexicalDeclaration(state) {
15186
15222
  let eventData;
@@ -15254,48 +15290,32 @@ ${input.slice(result.pos)}
15254
15290
  return result;
15255
15291
  }
15256
15292
  }
15257
- var LexicalBinding$0 = $TS($S(BindingPattern, $E(TypeSuffix), $E(_), Initializer), function($skip, $loc, $0, $1, $2, $3, $4) {
15258
- var binding = $1;
15293
+ var LexicalBinding$0 = $TS($S(BindingPattern, $E(TypeSuffix), Initializer), function($skip, $loc, $0, $1, $2, $3) {
15294
+ var pattern = $1;
15259
15295
  var suffix = $2;
15260
- var ws = $3;
15261
- var initializer = $4;
15262
- const bindingChildren = [...binding.children];
15263
- if (suffix)
15264
- bindingChildren.push(suffix);
15265
- if (ws)
15266
- bindingChildren.push(...ws);
15267
- binding = {
15268
- ...binding,
15269
- children: bindingChildren
15270
- };
15271
- const [splices, thisAssignments] = gatherBindingCode(binding.children);
15296
+ var initializer = $3;
15297
+ const [splices, thisAssignments] = gatherBindingCode(pattern);
15272
15298
  return {
15273
- children: [binding, initializer],
15274
- names: binding.names,
15275
- binding,
15299
+ type: "Binding",
15300
+ children: $0,
15301
+ names: pattern.names,
15302
+ pattern,
15303
+ suffix,
15276
15304
  initializer,
15277
15305
  splices: splices.map((s) => [",", s]),
15278
15306
  thisAssignments: thisAssignments.map((s) => ["", s, ";"])
15279
15307
  };
15280
15308
  });
15281
- var LexicalBinding$1 = $TS($S(BindingIdentifier, $E(TypeSuffix), $E(_), $E(Initializer)), function($skip, $loc, $0, $1, $2, $3, $4) {
15282
- var binding = $1;
15309
+ var LexicalBinding$1 = $TS($S(BindingIdentifier, $E(TypeSuffix), $E(Initializer)), function($skip, $loc, $0, $1, $2, $3) {
15310
+ var pattern = $1;
15283
15311
  var suffix = $2;
15284
- var ws = $3;
15285
- var initializer = $4;
15286
- const bindingChildren = [...binding.children];
15287
- if (suffix)
15288
- bindingChildren.push(suffix);
15289
- if (ws)
15290
- bindingChildren.push(...ws);
15291
- binding = {
15292
- ...binding,
15293
- children: bindingChildren
15294
- };
15312
+ var initializer = $3;
15295
15313
  return {
15296
- children: [binding, initializer],
15297
- names: binding.names,
15298
- binding,
15314
+ type: "Binding",
15315
+ children: $0,
15316
+ names: pattern.names,
15317
+ pattern,
15318
+ suffix,
15299
15319
  initializer,
15300
15320
  splices: [],
15301
15321
  thisAssignments: []
@@ -15347,9 +15367,10 @@ ${input.slice(result.pos)}
15347
15367
  }
15348
15368
  }
15349
15369
  var VariableStatement$0 = $TS($S(Var, __, VariableDeclarationList), function($skip, $loc, $0, $1, $2, $3) {
15350
- return Object.assign({}, $3, {
15370
+ return {
15371
+ ...$3,
15351
15372
  children: [$1, ...$2, ...$3.children]
15352
- });
15373
+ };
15353
15374
  });
15354
15375
  function VariableStatement(state) {
15355
15376
  let eventData;
@@ -15373,18 +15394,15 @@ ${input.slice(result.pos)}
15373
15394
  return result;
15374
15395
  }
15375
15396
  }
15376
- var VariableDeclarationList$0 = $TS($S(VariableDeclaration, $Q($S(__, Comma, __, VariableDeclaration))), function($skip, $loc, $0, $1, $2) {
15377
- let children;
15378
- if ($2.length) {
15379
- children = [$1, ...$2];
15380
- } else {
15381
- children = [$1];
15382
- }
15383
- const names = children.flatMap((c) => c.names || []);
15397
+ var VariableDeclarationList$0 = $TS($S(LexicalBinding, $Q($S(__, Comma, __, LexicalBinding))), function($skip, $loc, $0, $1, $2) {
15398
+ var binding = $1;
15399
+ var tail = $2;
15400
+ const bindings = [binding].concat(tail.map(([, , , b]) => b));
15384
15401
  return {
15385
15402
  type: "Declaration",
15386
- children,
15387
- names
15403
+ children: [binding, ...tail],
15404
+ bindings,
15405
+ names: bindings.flatMap((b) => b.names)
15388
15406
  };
15389
15407
  });
15390
15408
  function VariableDeclarationList(state) {
@@ -15409,49 +15427,6 @@ ${input.slice(result.pos)}
15409
15427
  return result;
15410
15428
  }
15411
15429
  }
15412
- var VariableDeclaration$0 = $TS($S(BindingPattern, $E(TypeSuffix), Initializer), function($skip, $loc, $0, $1, $2, $3) {
15413
- const children = [...$1.children];
15414
- if ($2)
15415
- children.push($2);
15416
- children.push($3);
15417
- return {
15418
- children,
15419
- names: $1.names
15420
- };
15421
- });
15422
- var VariableDeclaration$1 = $TS($S(BindingIdentifier, $E(TypeSuffix), $E(Initializer)), function($skip, $loc, $0, $1, $2, $3) {
15423
- const children = [...$1.children];
15424
- if ($2)
15425
- children.push($2);
15426
- if ($3)
15427
- children.push($3);
15428
- return {
15429
- children,
15430
- names: $1.names
15431
- };
15432
- });
15433
- function VariableDeclaration(state) {
15434
- let eventData;
15435
- if (state.events) {
15436
- const result = state.events.enter?.("VariableDeclaration", state);
15437
- if (result) {
15438
- if (result.cache)
15439
- return result.cache;
15440
- eventData = result.data;
15441
- }
15442
- }
15443
- if (state.tokenize) {
15444
- const result = $TOKEN("VariableDeclaration", state, VariableDeclaration$0(state) || VariableDeclaration$1(state));
15445
- if (state.events)
15446
- state.events.exit?.("VariableDeclaration", state, result, eventData);
15447
- return result;
15448
- } else {
15449
- const result = VariableDeclaration$0(state) || VariableDeclaration$1(state);
15450
- if (state.events)
15451
- state.events.exit?.("VariableDeclaration", state, result, eventData);
15452
- return result;
15453
- }
15454
- }
15455
15430
  var NumericLiteral$0 = $TS($S(NumericLiteralKind), function($skip, $loc, $0, $1) {
15456
15431
  return { type: "NumericLiteral", $loc, token: $1 };
15457
15432
  });
@@ -17529,6 +17504,13 @@ ${input.slice(result.pos)}
17529
17504
  var Dot$0 = $TV($EXPECT($L6, fail, 'Dot "."'), function($skip, $loc, $0, $1) {
17530
17505
  return { $loc, token: $1 };
17531
17506
  });
17507
+ var Dot$1 = $TS($S($EXPECT($R49, fail, "Dot /['\u2019]s/"), _), function($skip, $loc, $0, $1, $2) {
17508
+ var ws = $2;
17509
+ return [
17510
+ { $loc, token: "." },
17511
+ insertTrimmingSpace(ws, "")
17512
+ ];
17513
+ });
17532
17514
  function Dot(state) {
17533
17515
  let eventData;
17534
17516
  if (state.events) {
@@ -17540,12 +17522,12 @@ ${input.slice(result.pos)}
17540
17522
  }
17541
17523
  }
17542
17524
  if (state.tokenize) {
17543
- const result = $TOKEN("Dot", state, Dot$0(state));
17525
+ const result = $TOKEN("Dot", state, Dot$0(state) || Dot$1(state));
17544
17526
  if (state.events)
17545
17527
  state.events.exit?.("Dot", state, result, eventData);
17546
17528
  return result;
17547
17529
  } else {
17548
- const result = Dot$0(state);
17530
+ const result = Dot$0(state) || Dot$1(state);
17549
17531
  if (state.events)
17550
17532
  state.events.exit?.("Dot", state, result, eventData);
17551
17533
  return result;
@@ -17907,7 +17889,7 @@ ${input.slice(result.pos)}
17907
17889
  return result;
17908
17890
  }
17909
17891
  }
17910
- var Import$0 = $TS($S($EXPECT($L17, fail, 'Import "import"'), $Y($EXPECT($R49, fail, "Import /\\s/"))), function($skip, $loc, $0, $1, $2) {
17892
+ var Import$0 = $TS($S($EXPECT($L17, fail, 'Import "import"'), $Y($EXPECT($R50, fail, "Import /\\s/"))), function($skip, $loc, $0, $1, $2) {
17911
17893
  return { $loc, token: $1 };
17912
17894
  });
17913
17895
  function Import(state) {
@@ -19485,7 +19467,7 @@ ${input.slice(result.pos)}
19485
19467
  return result;
19486
19468
  }
19487
19469
  }
19488
- var JSXIdentifierName$0 = $R$0($EXPECT($R50, fail, "JSXIdentifierName /(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*/"));
19470
+ var JSXIdentifierName$0 = $R$0($EXPECT($R51, fail, "JSXIdentifierName /(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*/"));
19489
19471
  function JSXIdentifierName(state) {
19490
19472
  let eventData;
19491
19473
  if (state.events) {
@@ -19723,7 +19705,7 @@ ${input.slice(result.pos)}
19723
19705
  return result;
19724
19706
  }
19725
19707
  }
19726
- var JSXAttributeSpace$0 = $R$0($EXPECT($R51, fail, "JSXAttributeSpace /[\\s>]|\\/>/"));
19708
+ var JSXAttributeSpace$0 = $R$0($EXPECT($R52, fail, "JSXAttributeSpace /[\\s>]|\\/>/"));
19727
19709
  function JSXAttributeSpace(state) {
19728
19710
  let eventData;
19729
19711
  if (state.events) {
@@ -19746,7 +19728,7 @@ ${input.slice(result.pos)}
19746
19728
  return result;
19747
19729
  }
19748
19730
  }
19749
- var JSXShorthandString$0 = $TR($EXPECT($R52, fail, "JSXShorthandString /(?:[\\w\\-:]+|\\([^()]*\\)|\\[[^\\[\\]]*\\])+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
19731
+ var JSXShorthandString$0 = $TR($EXPECT($R53, fail, "JSXShorthandString /(?:[\\w\\-:]+|\\([^()]*\\)|\\[[^\\[\\]]*\\])+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
19750
19732
  return quoteString($0);
19751
19733
  });
19752
19734
  var JSXShorthandString$1 = $TS($S(TemplateLiteral), function($skip, $loc, $0, $1) {
@@ -19835,7 +19817,7 @@ ${input.slice(result.pos)}
19835
19817
  }
19836
19818
  return [open, value, close];
19837
19819
  });
19838
- var JSXAttributeValue$4 = $R$0($EXPECT($R53, fail, `JSXAttributeValue /"[^"]*"|'[^']*'/`));
19820
+ var JSXAttributeValue$4 = $R$0($EXPECT($R54, fail, `JSXAttributeValue /"[^"]*"|'[^']*'/`));
19839
19821
  function JSXAttributeValue(state) {
19840
19822
  let eventData;
19841
19823
  if (state.events) {
@@ -19885,7 +19867,7 @@ ${input.slice(result.pos)}
19885
19867
  return result;
19886
19868
  }
19887
19869
  }
19888
- var InlineJSXBinaryOpRHS$0 = $TS($S($N($EXPECT($R54, fail, "InlineJSXBinaryOpRHS /[<>]/")), BinaryOp, InlineJSXUnaryExpression), function($skip, $loc, $0, $1, $2, $3) {
19870
+ var InlineJSXBinaryOpRHS$0 = $TS($S($N($EXPECT($R55, fail, "InlineJSXBinaryOpRHS /[<>]/")), BinaryOp, InlineJSXUnaryExpression), function($skip, $loc, $0, $1, $2, $3) {
19889
19871
  var op = $2;
19890
19872
  var rhs = $3;
19891
19873
  return [[], op, [], rhs];
@@ -19940,7 +19922,7 @@ ${input.slice(result.pos)}
19940
19922
  return result;
19941
19923
  }
19942
19924
  }
19943
- var InlineJSXUnaryOp$0 = $TR($EXPECT($R55, fail, "InlineJSXUnaryOp /[!~+-](?!\\s|[!~+-]*&)/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
19925
+ var InlineJSXUnaryOp$0 = $TR($EXPECT($R56, fail, "InlineJSXUnaryOp /[!~+-](?!\\s|[!~+-]*&)/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
19944
19926
  return { $loc, token: $0 };
19945
19927
  });
19946
19928
  function InlineJSXUnaryOp(state) {
@@ -20430,7 +20412,7 @@ ${input.slice(result.pos)}
20430
20412
  return result;
20431
20413
  }
20432
20414
  }
20433
- var JSXCommentContent$0 = $TR($EXPECT($R56, fail, "JSXCommentContent /(?:-[^-]|[^-]*)*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
20415
+ var JSXCommentContent$0 = $TR($EXPECT($R57, fail, "JSXCommentContent /(?:-[^-]|[^-]*)*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
20434
20416
  return { $loc, token: $0.replace(/\*\//g, "* /") };
20435
20417
  });
20436
20418
  function JSXCommentContent(state) {
@@ -20455,7 +20437,7 @@ ${input.slice(result.pos)}
20455
20437
  return result;
20456
20438
  }
20457
20439
  }
20458
- var JSXText$0 = $TR($EXPECT($R57, fail, "JSXText /[^{}<>\\r\\n]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
20440
+ var JSXText$0 = $TR($EXPECT($R58, fail, "JSXText /[^{}<>\\r\\n]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
20459
20441
  return {
20460
20442
  type: "JSXText",
20461
20443
  token: $0,
@@ -21205,9 +21187,9 @@ ${input.slice(result.pos)}
21205
21187
  ["let ", id, " = {};\n"],
21206
21188
  ...block.properties.map((property, i) => {
21207
21189
  let init, isString;
21208
- if (property.init) {
21190
+ if (property.initializer) {
21209
21191
  init = replaceNodes(
21210
- deepCopy(property.init),
21192
+ deepCopy(property.initializer),
21211
21193
  (n) => n.type === "Identifier" && names.has(n.name),
21212
21194
  (n) => [id, '["', n.name, '"]']
21213
21195
  );
@@ -21370,11 +21352,11 @@ ${input.slice(result.pos)}
21370
21352
  }
21371
21353
  var EnumProperty$0 = $TS($S(Identifier, $E($S(__, Equals, ExtendedExpression)), ObjectPropertyDelimiter), function($skip, $loc, $0, $1, $2, $3) {
21372
21354
  var name = $1;
21373
- var init = $2;
21355
+ var initializer = $2;
21374
21356
  return {
21375
21357
  type: "EnumProperty",
21376
21358
  name,
21377
- init,
21359
+ initializer,
21378
21360
  children: $0
21379
21361
  };
21380
21362
  });
@@ -21423,7 +21405,7 @@ ${input.slice(result.pos)}
21423
21405
  return result;
21424
21406
  }
21425
21407
  }
21426
- var TypeIndexSignature$0 = $S($E($S($R$0($EXPECT($R58, fail, "TypeIndexSignature /[+-]?/")), Readonly, NotDedented)), OpenBracket, TypeIndex, CloseBracket, $E($S(__, $R$0($EXPECT($R59, fail, "TypeIndexSignature /[+-]/")), $Y($S($E(_), QuestionMark)))));
21408
+ var TypeIndexSignature$0 = $S($E($S($R$0($EXPECT($R59, fail, "TypeIndexSignature /[+-]?/")), Readonly, NotDedented)), OpenBracket, TypeIndex, CloseBracket, $E($S(__, $R$0($EXPECT($R60, fail, "TypeIndexSignature /[+-]/")), $Y($S($E(_), QuestionMark)))));
21427
21409
  function TypeIndexSignature(state) {
21428
21410
  let eventData;
21429
21411
  if (state.events) {
@@ -21874,17 +21856,25 @@ ${input.slice(result.pos)}
21874
21856
  return result;
21875
21857
  }
21876
21858
  }
21877
- var TypeElement$0 = $S($S(__, DotDotDot, __), Type);
21878
- var TypeElement$1 = $TS($S(Type, $E($S($E(_), DotDotDot))), function($skip, $loc, $0, $1, $2) {
21859
+ var TypeElement$0 = $TS($S(__, IdentifierName, $E(_), DotDotDot, $S(__, $E($S(QuestionMark, $E(_))), Colon, __), Type), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
21860
+ var ws = $1;
21861
+ var name = $2;
21862
+ var space = $3;
21863
+ var dots = $4;
21864
+ var colon = $5;
21865
+ var type = $6;
21866
+ return [ws, dots, space, name, colon, type];
21867
+ });
21868
+ var TypeElement$1 = $TS($S(Type, $E(_), DotDotDot), function($skip, $loc, $0, $1, $2, $3) {
21879
21869
  var type = $1;
21880
- var dots = $2;
21881
- if (!dots)
21882
- return type;
21870
+ var space = $2;
21871
+ var dots = $3;
21883
21872
  const ws = getTrimmingSpace(type);
21884
21873
  if (!ws)
21885
- return [dots[1], dots[0], type];
21886
- return [ws, dots[1], dots[0], insertTrimmingSpace(type, "")];
21874
+ return [dots, space, type];
21875
+ return [ws, dots, space, insertTrimmingSpace(type, "")];
21887
21876
  });
21877
+ var TypeElement$2 = $S($E($S(__, DotDotDot)), $E($S(__, IdentifierName, __, $E($S(QuestionMark, $E(_))), Colon, __)), Type);
21888
21878
  function TypeElement(state) {
21889
21879
  let eventData;
21890
21880
  if (state.events) {
@@ -21896,12 +21886,12 @@ ${input.slice(result.pos)}
21896
21886
  }
21897
21887
  }
21898
21888
  if (state.tokenize) {
21899
- const result = $TOKEN("TypeElement", state, TypeElement$0(state) || TypeElement$1(state));
21889
+ const result = $TOKEN("TypeElement", state, TypeElement$0(state) || TypeElement$1(state) || TypeElement$2(state));
21900
21890
  if (state.events)
21901
21891
  state.events.exit?.("TypeElement", state, result, eventData);
21902
21892
  return result;
21903
21893
  } else {
21904
- const result = TypeElement$0(state) || TypeElement$1(state);
21894
+ const result = TypeElement$0(state) || TypeElement$1(state) || TypeElement$2(state);
21905
21895
  if (state.events)
21906
21896
  state.events.exit?.("TypeElement", state, result, eventData);
21907
21897
  return result;
@@ -21935,7 +21925,7 @@ ${input.slice(result.pos)}
21935
21925
  return result;
21936
21926
  }
21937
21927
  }
21938
- var NestedType$0 = $S(Nested, Type, ArrayElementDelimiter);
21928
+ var NestedType$0 = $S(Nested, TypeElement, ArrayElementDelimiter);
21939
21929
  function NestedType(state) {
21940
21930
  let eventData;
21941
21931
  if (state.events) {
@@ -22498,7 +22488,7 @@ ${input.slice(result.pos)}
22498
22488
  return result;
22499
22489
  }
22500
22490
  }
22501
- var Shebang$0 = $S($R$0($EXPECT($R60, fail, "Shebang /#![^\\r\\n]*/")), EOL);
22491
+ var Shebang$0 = $S($R$0($EXPECT($R61, fail, "Shebang /#![^\\r\\n]*/")), EOL);
22502
22492
  function Shebang(state) {
22503
22493
  let eventData;
22504
22494
  if (state.events) {
@@ -22521,11 +22511,11 @@ ${input.slice(result.pos)}
22521
22511
  return result;
22522
22512
  }
22523
22513
  }
22524
- var CivetPrologue$0 = $T($S($EXPECT($R61, fail, "CivetPrologue /[\\t ]*/"), DoubleQuote, CivetPrologueContent, DoubleQuote, $TEXT(SimpleStatementDelimiter), $E(EOS)), function(value) {
22514
+ var CivetPrologue$0 = $T($S($EXPECT($R62, fail, "CivetPrologue /[\\t ]*/"), DoubleQuote, CivetPrologueContent, DoubleQuote, $TEXT(SimpleStatementDelimiter), $E(EOS)), function(value) {
22525
22515
  var content = value[2];
22526
22516
  return content;
22527
22517
  });
22528
- var CivetPrologue$1 = $T($S($EXPECT($R61, fail, "CivetPrologue /[\\t ]*/"), SingleQuote, CivetPrologueContent, SingleQuote, $TEXT(SimpleStatementDelimiter), $E(EOS)), function(value) {
22518
+ var CivetPrologue$1 = $T($S($EXPECT($R62, fail, "CivetPrologue /[\\t ]*/"), SingleQuote, CivetPrologueContent, SingleQuote, $TEXT(SimpleStatementDelimiter), $E(EOS)), function(value) {
22529
22519
  var content = value[2];
22530
22520
  return content;
22531
22521
  });
@@ -22551,7 +22541,7 @@ ${input.slice(result.pos)}
22551
22541
  return result;
22552
22542
  }
22553
22543
  }
22554
- var CivetPrologueContent$0 = $TS($S($EXPECT($L206, fail, 'CivetPrologueContent "civet"'), NonIdContinue, $Q(CivetOption), $EXPECT($R62, fail, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3, $4) {
22544
+ var CivetPrologueContent$0 = $TS($S($EXPECT($L206, fail, 'CivetPrologueContent "civet"'), NonIdContinue, $Q(CivetOption), $EXPECT($R63, fail, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3, $4) {
22555
22545
  var options = $3;
22556
22546
  return {
22557
22547
  type: "CivetPrologue",
@@ -22581,7 +22571,7 @@ ${input.slice(result.pos)}
22581
22571
  return result;
22582
22572
  }
22583
22573
  }
22584
- var CivetOption$0 = $TR($EXPECT($R63, fail, "CivetOption /\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
22574
+ var CivetOption$0 = $TR($EXPECT($R64, fail, "CivetOption /\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
22585
22575
  const optionName = $2.replace(/-+([a-z]?)/g, (_2, l) => {
22586
22576
  if (l)
22587
22577
  return l.toUpperCase();
@@ -22617,7 +22607,7 @@ ${input.slice(result.pos)}
22617
22607
  return result;
22618
22608
  }
22619
22609
  }
22620
- var UnknownPrologue$0 = $S($R$0($EXPECT($R61, fail, "UnknownPrologue /[\\t ]*/")), StringLiteral, $TEXT(SimpleStatementDelimiter), EOS);
22610
+ var UnknownPrologue$0 = $S($R$0($EXPECT($R62, fail, "UnknownPrologue /[\\t ]*/")), StringLiteral, $TEXT(SimpleStatementDelimiter), EOS);
22621
22611
  function UnknownPrologue(state) {
22622
22612
  let eventData;
22623
22613
  if (state.events) {
@@ -22687,7 +22677,7 @@ ${input.slice(result.pos)}
22687
22677
  return result;
22688
22678
  }
22689
22679
  }
22690
- var EOL$0 = $TR($EXPECT($R64, fail, "EOL /\\r\\n|\\n|\\r|$/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
22680
+ var EOL$0 = $TR($EXPECT($R65, fail, "EOL /\\r\\n|\\n|\\r|$/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
22691
22681
  return { $loc, token: $0 };
22692
22682
  });
22693
22683
  function EOL(state) {
@@ -23873,7 +23863,7 @@ ${input.slice(result.pos)}
23873
23863
  return result;
23874
23864
  }
23875
23865
  }
23876
- var Indent$0 = $TR($EXPECT($R65, fail, "Indent /[ \\t]*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
23866
+ var Indent$0 = $TR($EXPECT($R66, fail, "Indent /[ \\t]*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
23877
23867
  let level;
23878
23868
  if (module.config.tab) {
23879
23869
  const tabs = $0.match(/\t/g);
@@ -24179,8 +24169,7 @@ ${input.slice(result.pos)}
24179
24169
  processBinaryOpExpression,
24180
24170
  processCallMemberExpression,
24181
24171
  processCoffeeInterpolation,
24182
- processConstAssignmentDeclaration,
24183
- processLetAssignmentDeclaration,
24172
+ processAssignmentDeclaration,
24184
24173
  processProgram,
24185
24174
  processUnaryExpression,
24186
24175
  quoteString,