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