@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.mjs CHANGED
@@ -154,15 +154,8 @@ var require_lib = __commonJS({
154
154
  }
155
155
  }
156
156
  function arrayElementHasTrailingComma(elementNode) {
157
- const { children } = elementNode, { length } = children;
158
- const lastChild = children[length - 1];
159
- if (lastChild) {
160
- const l2 = lastChild.length;
161
- if (lastChild[l2 - 1]?.token === ",") {
162
- return true;
163
- }
164
- }
165
- return false;
157
+ const lastChild = elementNode.children.at(-1);
158
+ return lastChild && lastChild[lastChild.length - 1]?.token === ",";
166
159
  }
167
160
  var assert = {
168
161
  equal(a, b, msg) {
@@ -589,7 +582,15 @@ var require_lib = __commonJS({
589
582
  case "EmptyStatement":
590
583
  case "ReturnStatement":
591
584
  case "ThrowStatement":
585
+ return;
592
586
  case "Declaration":
587
+ exp.children.push(["", [
588
+ ";",
589
+ ref,
590
+ ".push(",
591
+ patternAsValue(exp.bindings.at(-1).pattern),
592
+ ")"
593
+ ]]);
593
594
  return;
594
595
  case "ForStatement":
595
596
  case "IterationStatement":
@@ -842,6 +843,39 @@ var require_lib = __commonJS({
842
843
  const indent = expressions[index][0];
843
844
  expressions.splice(index, 0, [indent, dec, ";"]);
844
845
  }
846
+ function patternAsValue(pattern) {
847
+ switch (pattern.type) {
848
+ case "ArrayBindingPattern": {
849
+ const children = [...pattern.children];
850
+ const index = children.indexOf(pattern.elements);
851
+ if (index < 0)
852
+ throw new Error("failed to find elements in ArrayBindingPattern");
853
+ children[index] = pattern.elements.map((el) => {
854
+ const [ws, e, delim] = el.children;
855
+ return { ...el, children: [ws, patternAsValue(e), delim] };
856
+ });
857
+ return { ...pattern, children };
858
+ }
859
+ case "ObjectBindingPattern": {
860
+ const children = [...pattern.children];
861
+ const index = children.indexOf(pattern.properties);
862
+ if (index < 0)
863
+ throw new Error("failed to find properties in ArrayBindingPattern");
864
+ children[index] = pattern.properties.map(patternAsValue);
865
+ return { ...pattern, children };
866
+ }
867
+ case "Identifier":
868
+ case "BindingProperty": {
869
+ const children = [pattern.name, pattern.delim];
870
+ if (isWhitespaceOrEmpty(pattern.children[0])) {
871
+ children.unshift(pattern.children[0]);
872
+ }
873
+ return { ...pattern, children };
874
+ }
875
+ default:
876
+ return pattern;
877
+ }
878
+ }
845
879
  function insertReturn(node) {
846
880
  if (!node)
847
881
  return;
@@ -883,7 +917,12 @@ var require_lib = __commonJS({
883
917
  case "EmptyStatement":
884
918
  case "ReturnStatement":
885
919
  case "ThrowStatement":
920
+ return;
886
921
  case "Declaration":
922
+ exp.children.push(["", {
923
+ type: "ReturnStatement",
924
+ children: [";return ", patternAsValue(exp.bindings.at(-1).pattern)]
925
+ }]);
887
926
  return;
888
927
  case "ForStatement":
889
928
  case "IterationStatement":
@@ -1298,72 +1337,59 @@ var require_lib = __commonJS({
1298
1337
  children: [s, parts, e]
1299
1338
  };
1300
1339
  }
1301
- function processConstAssignmentDeclaration(c, id, suffix, ws, ca, e) {
1302
- c = {
1303
- ...c,
1340
+ function processAssignmentDeclaration(decl, id, suffix, ws, assign, e) {
1341
+ decl = {
1342
+ ...decl,
1304
1343
  $loc: {
1305
- pos: ca.$loc.pos - 1,
1306
- length: ca.$loc.length + 1
1344
+ pos: assign.$loc.pos - 1,
1345
+ length: assign.$loc.length + 1
1307
1346
  }
1308
1347
  };
1309
- let exp;
1310
- if (e.type === "FunctionExpression") {
1311
- exp = e;
1312
- } else {
1313
- exp = e[1];
1314
- }
1315
- if (exp?.children?.[0]?.token?.match(/^\s+$/))
1316
- exp.children.shift();
1317
- if (id.type === "Identifier" && exp?.type === "FunctionExpression" && !exp.id) {
1318
- const i = exp.children.findIndex((c2) => c2?.token === "function") + 1;
1319
- exp = {
1320
- ...exp,
1321
- children: [...exp.children.slice(0, i), " ", id, suffix, ws, ...exp.children.slice(i)]
1322
- };
1323
- return {
1324
- type: "Declaration",
1325
- children: [exp],
1326
- names: id.names
1327
- };
1348
+ if (decl.token.startsWith("const")) {
1349
+ let exp;
1350
+ if (e.type === "FunctionExpression") {
1351
+ exp = e;
1352
+ } else {
1353
+ exp = e[1];
1354
+ }
1355
+ if (exp?.children?.[0]?.token?.match(/^\s+$/))
1356
+ exp.children.shift();
1357
+ if (id.type === "Identifier" && exp?.type === "FunctionExpression" && !exp.id) {
1358
+ const i = exp.children.findIndex((c) => c?.token === "function") + 1;
1359
+ exp = {
1360
+ ...exp,
1361
+ children: [...exp.children.slice(0, i), " ", id, suffix, ws, ...exp.children.slice(i)]
1362
+ };
1363
+ return {
1364
+ type: "Declaration",
1365
+ decl,
1366
+ children: [exp],
1367
+ names: id.names
1368
+ };
1369
+ }
1328
1370
  }
1329
1371
  let [splices, thisAssignments] = gatherBindingCode(id);
1330
1372
  splices = splices.map((s) => [", ", s]);
1331
1373
  thisAssignments = thisAssignments.map((a) => ["", a, ";"]);
1332
- const binding = [c, id, suffix, ...ws];
1333
- const initializer = [ca, e];
1334
- const children = [binding, initializer];
1335
- return {
1336
- type: "Declaration",
1337
- names: id.names,
1338
- children,
1339
- binding,
1374
+ const initializer = [ws, assign, e];
1375
+ const binding = {
1376
+ type: "Binding",
1377
+ pattern: id,
1340
1378
  initializer,
1341
1379
  splices,
1342
- thisAssignments
1343
- };
1344
- }
1345
- function processLetAssignmentDeclaration(l, id, suffix, ws, la, e) {
1346
- l = {
1347
- ...l,
1348
- $loc: {
1349
- pos: la.$loc.pos - 1,
1350
- length: la.$loc.length + 1
1351
- }
1380
+ suffix,
1381
+ thisAssignments,
1382
+ children: [id, suffix, initializer]
1352
1383
  };
1353
- let [splices, thisAssignments] = gatherBindingCode(id);
1354
- splices = splices.map((s) => [", ", s]);
1355
- thisAssignments = thisAssignments.map((a) => ["", a, ";"]);
1356
- const binding = [l, id, suffix, ...ws];
1357
- const initializer = [la, e];
1358
- const children = [binding, initializer];
1384
+ const children = [decl, binding];
1359
1385
  return {
1360
1386
  type: "Declaration",
1361
1387
  names: id.names,
1362
- children,
1363
- binding,
1364
- initializer,
1388
+ decl,
1389
+ bindings: [binding],
1365
1390
  splices,
1366
- thisAssignments
1391
+ thisAssignments,
1392
+ children
1367
1393
  };
1368
1394
  }
1369
1395
  function implicitFunctionBlock(f) {
@@ -1574,9 +1600,9 @@ var require_lib = __commonJS({
1574
1600
  const subRef = [ref, "[", i.toString(), "]"];
1575
1601
  getPatternConditions(e, subRef, conditions);
1576
1602
  });
1577
- const postRest = pattern.children.find((c) => c?.blockPrefix);
1578
- if (postRest) {
1579
- const postElements = postRest.blockPrefix.children[1], { length: postLength } = postElements;
1603
+ const { blockPrefix } = pattern;
1604
+ if (blockPrefix) {
1605
+ const postElements = blockPrefix.children[1], { length: postLength } = postElements;
1580
1606
  postElements.forEach(({ children: [, e] }, i) => {
1581
1607
  const subRef = [ref, "[", ref, ".length - ", (postLength + i).toString(), "]"];
1582
1608
  getPatternConditions(e, subRef, conditions);
@@ -1663,15 +1689,15 @@ var require_lib = __commonJS({
1663
1689
  if (el.type === "BindingRestElement") {
1664
1690
  return ["", el, void 0];
1665
1691
  }
1666
- const { children: [ws, e, sep] } = el;
1692
+ const { children: [ws, e, delim] } = el;
1667
1693
  switch (e.type) {
1668
1694
  case "Literal":
1669
1695
  case "RegularExpressionLiteral":
1670
1696
  case "StringLiteral":
1671
1697
  case "PinPattern":
1672
- return sep;
1698
+ return delim;
1673
1699
  default:
1674
- return [ws, nonMatcherBindings(e), sep];
1700
+ return [ws, nonMatcherBindings(e), delim];
1675
1701
  }
1676
1702
  });
1677
1703
  }
@@ -1681,13 +1707,12 @@ var require_lib = __commonJS({
1681
1707
  case "BindingProperty": {
1682
1708
  const { children, name, value } = p;
1683
1709
  const [ws] = children;
1684
- const sep = children[children.length - 1];
1685
1710
  switch (value && value.type) {
1686
1711
  case "ArrayBindingPattern":
1687
1712
  case "ObjectBindingPattern":
1688
1713
  return {
1689
1714
  ...p,
1690
- children: [ws, name, ": ", nonMatcherBindings(value)]
1715
+ children: [ws, name, ": ", nonMatcherBindings(value), p.delim]
1691
1716
  };
1692
1717
  case "Identifier":
1693
1718
  return p;
@@ -1697,7 +1722,7 @@ var require_lib = __commonJS({
1697
1722
  default:
1698
1723
  return {
1699
1724
  ...p,
1700
- children: [ws, name, sep]
1725
+ children: [ws, name, p.delim]
1701
1726
  };
1702
1727
  }
1703
1728
  }
@@ -2367,9 +2392,20 @@ var require_lib = __commonJS({
2367
2392
  let rest = props[restIndex];
2368
2393
  props = props.slice(0, restIndex);
2369
2394
  if (after.length) {
2370
- const [restDelim] = rest.children.slice(-1), lastAfterProp = after[after.length - 1], lastAfterChildren = lastAfterProp.children, [lastDelim] = lastAfterChildren.slice(-1);
2371
- rest = { ...rest, children: [...rest.children.slice(0, -1), lastDelim] };
2372
- after = [...after.slice(0, -1), { ...lastAfterProp, children: [...lastAfterChildren.slice(0, -1), restDelim] }];
2395
+ const { delim: restDelim } = rest, lastAfterProp = after[after.length - 1], { delim: lastDelim, children: lastAfterChildren } = lastAfterProp;
2396
+ rest = {
2397
+ ...rest,
2398
+ delim: lastDelim,
2399
+ children: [...rest.children.slice(0, -1), lastDelim]
2400
+ };
2401
+ after = [
2402
+ ...after.slice(0, -1),
2403
+ {
2404
+ ...lastAfterProp,
2405
+ delim: restDelim,
2406
+ children: [...lastAfterChildren.slice(0, -1), restDelim]
2407
+ }
2408
+ ];
2373
2409
  }
2374
2410
  const children = [...props, ...after, rest];
2375
2411
  return {
@@ -2549,8 +2585,7 @@ var require_lib = __commonJS({
2549
2585
  processBinaryOpExpression,
2550
2586
  processCallMemberExpression,
2551
2587
  processCoffeeInterpolation,
2552
- processConstAssignmentDeclaration,
2553
- processLetAssignmentDeclaration,
2588
+ processAssignmentDeclaration,
2554
2589
  processParams,
2555
2590
  processProgram,
2556
2591
  processReturnValue,
@@ -3091,7 +3126,6 @@ ${input.slice(result.pos)}
3091
3126
  BindingProperty,
3092
3127
  BindingRestProperty,
3093
3128
  NestedBindingElements,
3094
- NestedBindingElement,
3095
3129
  BindingElement,
3096
3130
  BindingRestElement,
3097
3131
  EmptyBindingPattern,
@@ -3313,7 +3347,6 @@ ${input.slice(result.pos)}
3313
3347
  Initializer,
3314
3348
  VariableStatement,
3315
3349
  VariableDeclarationList,
3316
- VariableDeclaration,
3317
3350
  NumericLiteral,
3318
3351
  NumericLiteralKind,
3319
3352
  DecimalBigIntegerLiteral,
@@ -3881,23 +3914,24 @@ ${input.slice(result.pos)}
3881
3914
  var $R46 = $R(new RegExp("[^\\r\\n]", "suy"));
3882
3915
  var $R47 = $R(new RegExp("[ \\t]+", "suy"));
3883
3916
  var $R48 = $R(new RegExp("(?!\\p{ID_Continue})", "suy"));
3884
- var $R49 = $R(new RegExp("\\s", "suy"));
3885
- var $R50 = $R(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*", "suy"));
3886
- var $R51 = $R(new RegExp("[\\s>]|\\/>", "suy"));
3887
- var $R52 = $R(new RegExp("(?:[\\w\\-:]+|\\([^()]*\\)|\\[[^\\[\\]]*\\])+", "suy"));
3888
- var $R53 = $R(new RegExp(`"[^"]*"|'[^']*'`, "suy"));
3889
- var $R54 = $R(new RegExp("[<>]", "suy"));
3890
- var $R55 = $R(new RegExp("[!~+-](?!\\s|[!~+-]*&)", "suy"));
3891
- var $R56 = $R(new RegExp("(?:-[^-]|[^-]*)*", "suy"));
3892
- var $R57 = $R(new RegExp("[^{}<>\\r\\n]+", "suy"));
3893
- var $R58 = $R(new RegExp("[+-]?", "suy"));
3894
- var $R59 = $R(new RegExp("[+-]", "suy"));
3895
- var $R60 = $R(new RegExp("#![^\\r\\n]*", "suy"));
3896
- var $R61 = $R(new RegExp("[\\t ]*", "suy"));
3897
- var $R62 = $R(new RegExp("[\\s]*", "suy"));
3898
- var $R63 = $R(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?", "suy"));
3899
- var $R64 = $R(new RegExp("\\r\\n|\\n|\\r|$", "suy"));
3900
- var $R65 = $R(new RegExp("[ \\t]*", "suy"));
3917
+ var $R49 = $R(new RegExp("['\u2019]s", "suy"));
3918
+ var $R50 = $R(new RegExp("\\s", "suy"));
3919
+ var $R51 = $R(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*", "suy"));
3920
+ var $R52 = $R(new RegExp("[\\s>]|\\/>", "suy"));
3921
+ var $R53 = $R(new RegExp("(?:[\\w\\-:]+|\\([^()]*\\)|\\[[^\\[\\]]*\\])+", "suy"));
3922
+ var $R54 = $R(new RegExp(`"[^"]*"|'[^']*'`, "suy"));
3923
+ var $R55 = $R(new RegExp("[<>]", "suy"));
3924
+ var $R56 = $R(new RegExp("[!~+-](?!\\s|[!~+-]*&)", "suy"));
3925
+ var $R57 = $R(new RegExp("(?:-[^-]|[^-]*)*", "suy"));
3926
+ var $R58 = $R(new RegExp("[^{}<>\\r\\n]+", "suy"));
3927
+ var $R59 = $R(new RegExp("[+-]?", "suy"));
3928
+ var $R60 = $R(new RegExp("[+-]", "suy"));
3929
+ var $R61 = $R(new RegExp("#![^\\r\\n]*", "suy"));
3930
+ var $R62 = $R(new RegExp("[\\t ]*", "suy"));
3931
+ var $R63 = $R(new RegExp("[\\s]*", "suy"));
3932
+ var $R64 = $R(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?", "suy"));
3933
+ var $R65 = $R(new RegExp("\\r\\n|\\n|\\r|$", "suy"));
3934
+ var $R66 = $R(new RegExp("[ \\t]*", "suy"));
3901
3935
  var Program$0 = $TS($S(Reset, Init, $E(EOS), TopLevelStatements, __), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
3902
3936
  var statements = $4;
3903
3937
  processProgram({
@@ -6645,6 +6679,8 @@ ${input.slice(result.pos)}
6645
6679
  var MemberBracketContent$1 = $TS($S(Dot, $C(TemplateLiteral, StringLiteral)), function($skip, $loc, $0, $1, $2) {
6646
6680
  var dot = $1;
6647
6681
  var str = $2;
6682
+ if (Array.isArray(dot))
6683
+ dot = dot[0];
6648
6684
  return {
6649
6685
  type: "Index",
6650
6686
  children: [
@@ -6657,6 +6693,8 @@ ${input.slice(result.pos)}
6657
6693
  var MemberBracketContent$2 = $TS($S(Dot, IntegerLiteral), function($skip, $loc, $0, $1, $2) {
6658
6694
  var dot = $1;
6659
6695
  var num = $2;
6696
+ if (Array.isArray(dot))
6697
+ dot = dot[0];
6660
6698
  return {
6661
6699
  type: "Index",
6662
6700
  children: [
@@ -7334,7 +7372,7 @@ ${input.slice(result.pos)}
7334
7372
  var c = $3;
7335
7373
  return {
7336
7374
  type: "ObjectBindingPattern",
7337
- children: $0,
7375
+ children: [$1, $2, c.children, $4, $5],
7338
7376
  names: c.names,
7339
7377
  properties: c.children
7340
7378
  };
@@ -7395,6 +7433,7 @@ ${input.slice(result.pos)}
7395
7433
  return props.map(([prop, delim]) => {
7396
7434
  return {
7397
7435
  ...prop,
7436
+ delim,
7398
7437
  children: [...prop.children, delim]
7399
7438
  };
7400
7439
  });
@@ -7424,11 +7463,10 @@ ${input.slice(result.pos)}
7424
7463
  var ArrayBindingPattern$0 = $TS($S($E(_), OpenBracket, ArrayBindingPatternContent, __, CloseBracket), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
7425
7464
  var c = $3;
7426
7465
  return {
7466
+ ...c,
7427
7467
  type: "ArrayBindingPattern",
7428
- children: $0,
7429
- names: c.names,
7430
7468
  elements: c.children,
7431
- length: c.length
7469
+ children: [$1, $2, c.children, $4, $5]
7432
7470
  };
7433
7471
  });
7434
7472
  function ArrayBindingPattern(state) {
@@ -7514,14 +7552,14 @@ ${input.slice(result.pos)}
7514
7552
  }
7515
7553
  }
7516
7554
  var NestedBindingElementList$0 = $TS($S(Nested, BindingElementList), function($skip, $loc, $0, $1, $2) {
7517
- var ws = $1;
7555
+ var indent = $1;
7518
7556
  var elements = $2;
7519
7557
  return elements.map((element, i) => {
7520
7558
  if (i > 0)
7521
7559
  return element;
7522
7560
  return {
7523
7561
  ...element,
7524
- children: [ws, ...element.children]
7562
+ children: [indent, ...element.children.slice(1)]
7525
7563
  };
7526
7564
  });
7527
7565
  });
@@ -7636,13 +7674,13 @@ ${input.slice(result.pos)}
7636
7674
  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) {
7637
7675
  var name = $2;
7638
7676
  var value = $6;
7639
- var init = $7;
7677
+ var initializer = $7;
7640
7678
  return {
7641
7679
  type: "BindingProperty",
7642
7680
  children: $0,
7643
7681
  name,
7644
7682
  value,
7645
- init,
7683
+ initializer,
7646
7684
  names: value.names
7647
7685
  };
7648
7686
  });
@@ -7650,14 +7688,14 @@ ${input.slice(result.pos)}
7650
7688
  var ws = $1;
7651
7689
  var pin = $2;
7652
7690
  var binding = $3;
7653
- var init = $4;
7691
+ var initializer = $4;
7654
7692
  if (binding.type === "AtBinding") {
7655
7693
  return {
7656
7694
  type: "AtBindingProperty",
7657
7695
  children: $0,
7658
7696
  binding,
7659
7697
  ref: binding.ref,
7660
- init,
7698
+ initializer,
7661
7699
  names: []
7662
7700
  };
7663
7701
  }
@@ -7677,7 +7715,7 @@ ${input.slice(result.pos)}
7677
7715
  children: $0,
7678
7716
  name: binding,
7679
7717
  value: void 0,
7680
- init,
7718
+ initializer,
7681
7719
  names: binding.names,
7682
7720
  identifier: binding
7683
7721
  };
@@ -7774,36 +7812,6 @@ ${input.slice(result.pos)}
7774
7812
  return result;
7775
7813
  }
7776
7814
  }
7777
- var NestedBindingElement$0 = $TS($S(Nested, BindingElement), function($skip, $loc, $0, $1, $2) {
7778
- var indent = $1;
7779
- var element = $2;
7780
- return {
7781
- ...element,
7782
- children: [indent, ...element.children]
7783
- };
7784
- });
7785
- function NestedBindingElement(state) {
7786
- let eventData;
7787
- if (state.events) {
7788
- const result = state.events.enter?.("NestedBindingElement", state);
7789
- if (result) {
7790
- if (result.cache)
7791
- return result.cache;
7792
- eventData = result.data;
7793
- }
7794
- }
7795
- if (state.tokenize) {
7796
- const result = $TOKEN("NestedBindingElement", state, NestedBindingElement$0(state));
7797
- if (state.events)
7798
- state.events.exit?.("NestedBindingElement", state, result, eventData);
7799
- return result;
7800
- } else {
7801
- const result = NestedBindingElement$0(state);
7802
- if (state.events)
7803
- state.events.exit?.("NestedBindingElement", state, result, eventData);
7804
- return result;
7805
- }
7806
- }
7807
7815
  var BindingElement$0 = BindingRestElement;
7808
7816
  var BindingElement$1 = $TS($S($E(_), $C(BindingIdentifier, BindingPattern), $E(Initializer)), function($skip, $loc, $0, $1, $2, $3) {
7809
7817
  var ws = $1;
@@ -7812,6 +7820,7 @@ ${input.slice(result.pos)}
7812
7820
  if (binding.children) {
7813
7821
  binding = {
7814
7822
  ...binding,
7823
+ initializer,
7815
7824
  children: [...binding.children, initializer]
7816
7825
  };
7817
7826
  }
@@ -7857,7 +7866,7 @@ ${input.slice(result.pos)}
7857
7866
  var binding = $3;
7858
7867
  return {
7859
7868
  type: "BindingRestElement",
7860
- children: [...ws || [], dots, binding],
7869
+ children: [ws, [dots, binding]],
7861
7870
  binding,
7862
7871
  name: binding.name,
7863
7872
  names: binding.names,
@@ -9902,10 +9911,24 @@ ${input.slice(result.pos)}
9902
9911
  var NestedPropertyDefinition$0 = $TS($S(Nested, $P($S(PropertyDefinition, ObjectPropertyDelimiter))), function($skip, $loc, $0, $1, $2) {
9903
9912
  var ws = $1;
9904
9913
  var inlineProps = $2;
9905
- return inlineProps.map(([prop, delimiter], i) => ({
9906
- ...prop,
9907
- children: [...i === 0 ? ws : [], ...prop.children, delimiter]
9908
- }));
9914
+ return inlineProps.flatMap(([prop, delim], i) => {
9915
+ if (!Array.isArray(prop))
9916
+ prop = [prop];
9917
+ if (i === 0) {
9918
+ const [first, ...rest] = prop;
9919
+ prop = [{ ...first, children: [...ws, ...first.children] }, ...rest];
9920
+ }
9921
+ const last = prop[prop.length - 1];
9922
+ prop = [
9923
+ ...prop.slice(0, prop.length - 1),
9924
+ {
9925
+ ...last,
9926
+ delim,
9927
+ children: [...last.children, delim]
9928
+ }
9929
+ ];
9930
+ return prop;
9931
+ });
9909
9932
  });
9910
9933
  function NestedPropertyDefinition(state) {
9911
9934
  let eventData;
@@ -10016,12 +10039,15 @@ ${input.slice(result.pos)}
10016
10039
  }
10017
10040
  }
10018
10041
  var PropertyDefinitionList$0 = $TV($P($S(PropertyDefinition, ObjectPropertyDelimiter)), function($skip, $loc, $0, $1) {
10019
- return $0.map(([prop, delim]) => {
10020
- return {
10021
- ...prop,
10042
+ return $0.flatMap(([prop, delim]) => {
10043
+ prop = Array.isArray(prop) ? prop : [prop];
10044
+ let last = prop[prop.length - 1];
10045
+ last = {
10046
+ ...last,
10022
10047
  delim,
10023
- children: [...prop.children, delim]
10048
+ children: [...last.children, delim]
10024
10049
  };
10050
+ return [...prop.slice(0, prop.length - 1), last];
10025
10051
  });
10026
10052
  });
10027
10053
  function PropertyDefinitionList(state) {
@@ -10105,8 +10131,19 @@ ${input.slice(result.pos)}
10105
10131
  var PropertyDefinition$5 = $TS($S(__, CallExpression), function($skip, $loc, $0, $1, $2) {
10106
10132
  var ws = $1;
10107
10133
  var value = $2;
10108
- if (value.type === "Identifier") {
10109
- return { ...value, children: [ws, ...value.children] };
10134
+ switch (value.type) {
10135
+ case "Identifier":
10136
+ return { ...value, children: [ws, ...value.children] };
10137
+ case "ObjectExpression":
10138
+ let first = value.properties[0];
10139
+ if (first) {
10140
+ first = {
10141
+ ...first,
10142
+ children: [ws, ...first.children],
10143
+ hoistDec: value.hoistDec
10144
+ };
10145
+ }
10146
+ return [first, ...value.properties.slice(1)];
10110
10147
  }
10111
10148
  const last = lastAccessInCallExpression(value);
10112
10149
  if (!last)
@@ -13440,17 +13477,19 @@ ${input.slice(result.pos)}
13440
13477
  type: "Ref",
13441
13478
  base: "ref"
13442
13479
  };
13443
- const { binding, initializer, splices, thisAssignments } = dec;
13480
+ const { decl, bindings } = dec;
13481
+ const binding = bindings[0];
13482
+ const { pattern, suffix, initializer, splices, thisAssignments } = binding;
13444
13483
  const initCondition = {
13445
13484
  type: "AssignmentExpression",
13446
- children: [ref, " ", initializer],
13485
+ children: [ref, initializer],
13447
13486
  hoistDec: {
13448
13487
  type: "Declaration",
13449
- children: ["let ", ref],
13488
+ children: ["let ", ref, suffix],
13450
13489
  names: []
13451
13490
  },
13452
13491
  blockPrefix: [
13453
- ["", [binding, "= ", ref, ...splices], ";"],
13492
+ ["", [decl, pattern, suffix, " = ", ref, ...splices], ";"],
13454
13493
  ...thisAssignments
13455
13494
  ]
13456
13495
  };
@@ -15149,26 +15188,23 @@ ${input.slice(result.pos)}
15149
15188
  return result;
15150
15189
  }
15151
15190
  }
15152
- var LexicalDeclaration$0 = $TS($S(LetOrConst, LexicalBinding, $Q($S(__, Comma, LexicalBinding))), function($skip, $loc, $0, $1, $2, $3) {
15153
- var d = $1;
15191
+ var LexicalDeclaration$0 = $TS($S(LetOrConst, LexicalBinding, $Q($S(__, Comma, __, LexicalBinding))), function($skip, $loc, $0, $1, $2, $3) {
15192
+ var decl = $1;
15154
15193
  var binding = $2;
15155
15194
  var tail = $3;
15156
- const { splices, thisAssignments } = binding;
15195
+ const bindings = [binding].concat(tail.map(([, , , b]) => b));
15157
15196
  return {
15158
15197
  type: "Declaration",
15159
15198
  children: $0,
15160
- names: [...binding.names].concat(tail.flatMap(([, , b]) => b.names)),
15161
- binding: {
15162
- ...binding.binding,
15163
- children: [d, ...binding.binding.children]
15164
- },
15165
- initializer: binding.initializer,
15166
- splices,
15167
- thisAssignments
15199
+ names: bindings.flatMap((b) => b.names),
15200
+ bindings,
15201
+ decl,
15202
+ splices: bindings.flatMap((b) => b.splices),
15203
+ thisAssignments: bindings.flatMap((b) => b.thisAssignments)
15168
15204
  };
15169
15205
  });
15170
15206
  var LexicalDeclaration$1 = $TS($S(InsertConst, $C(BindingPattern, BindingIdentifier), $E(TypeSuffix), __, ConstAssignment, ExtendedExpression), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
15171
- return processConstAssignmentDeclaration(...$0);
15207
+ return processAssignmentDeclaration(...$0);
15172
15208
  });
15173
15209
  var LexicalDeclaration$2 = $TS($S(InsertLet, $C(BindingPattern, BindingIdentifier), $E(TypeSuffix), __, LetAssignment, ExtendedExpression), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
15174
15210
  var l = $1;
@@ -15177,7 +15213,7 @@ ${input.slice(result.pos)}
15177
15213
  var ws = $4;
15178
15214
  var la = $5;
15179
15215
  var e = $6;
15180
- return processLetAssignmentDeclaration(...$0);
15216
+ return processAssignmentDeclaration(...$0);
15181
15217
  });
15182
15218
  function LexicalDeclaration(state) {
15183
15219
  let eventData;
@@ -15251,48 +15287,32 @@ ${input.slice(result.pos)}
15251
15287
  return result;
15252
15288
  }
15253
15289
  }
15254
- var LexicalBinding$0 = $TS($S(BindingPattern, $E(TypeSuffix), $E(_), Initializer), function($skip, $loc, $0, $1, $2, $3, $4) {
15255
- var binding = $1;
15290
+ var LexicalBinding$0 = $TS($S(BindingPattern, $E(TypeSuffix), Initializer), function($skip, $loc, $0, $1, $2, $3) {
15291
+ var pattern = $1;
15256
15292
  var suffix = $2;
15257
- var ws = $3;
15258
- var initializer = $4;
15259
- const bindingChildren = [...binding.children];
15260
- if (suffix)
15261
- bindingChildren.push(suffix);
15262
- if (ws)
15263
- bindingChildren.push(...ws);
15264
- binding = {
15265
- ...binding,
15266
- children: bindingChildren
15267
- };
15268
- const [splices, thisAssignments] = gatherBindingCode(binding.children);
15293
+ var initializer = $3;
15294
+ const [splices, thisAssignments] = gatherBindingCode(pattern);
15269
15295
  return {
15270
- children: [binding, initializer],
15271
- names: binding.names,
15272
- binding,
15296
+ type: "Binding",
15297
+ children: $0,
15298
+ names: pattern.names,
15299
+ pattern,
15300
+ suffix,
15273
15301
  initializer,
15274
15302
  splices: splices.map((s) => [",", s]),
15275
15303
  thisAssignments: thisAssignments.map((s) => ["", s, ";"])
15276
15304
  };
15277
15305
  });
15278
- var LexicalBinding$1 = $TS($S(BindingIdentifier, $E(TypeSuffix), $E(_), $E(Initializer)), function($skip, $loc, $0, $1, $2, $3, $4) {
15279
- var binding = $1;
15306
+ var LexicalBinding$1 = $TS($S(BindingIdentifier, $E(TypeSuffix), $E(Initializer)), function($skip, $loc, $0, $1, $2, $3) {
15307
+ var pattern = $1;
15280
15308
  var suffix = $2;
15281
- var ws = $3;
15282
- var initializer = $4;
15283
- const bindingChildren = [...binding.children];
15284
- if (suffix)
15285
- bindingChildren.push(suffix);
15286
- if (ws)
15287
- bindingChildren.push(...ws);
15288
- binding = {
15289
- ...binding,
15290
- children: bindingChildren
15291
- };
15309
+ var initializer = $3;
15292
15310
  return {
15293
- children: [binding, initializer],
15294
- names: binding.names,
15295
- binding,
15311
+ type: "Binding",
15312
+ children: $0,
15313
+ names: pattern.names,
15314
+ pattern,
15315
+ suffix,
15296
15316
  initializer,
15297
15317
  splices: [],
15298
15318
  thisAssignments: []
@@ -15344,9 +15364,10 @@ ${input.slice(result.pos)}
15344
15364
  }
15345
15365
  }
15346
15366
  var VariableStatement$0 = $TS($S(Var, __, VariableDeclarationList), function($skip, $loc, $0, $1, $2, $3) {
15347
- return Object.assign({}, $3, {
15367
+ return {
15368
+ ...$3,
15348
15369
  children: [$1, ...$2, ...$3.children]
15349
- });
15370
+ };
15350
15371
  });
15351
15372
  function VariableStatement(state) {
15352
15373
  let eventData;
@@ -15370,18 +15391,15 @@ ${input.slice(result.pos)}
15370
15391
  return result;
15371
15392
  }
15372
15393
  }
15373
- var VariableDeclarationList$0 = $TS($S(VariableDeclaration, $Q($S(__, Comma, __, VariableDeclaration))), function($skip, $loc, $0, $1, $2) {
15374
- let children;
15375
- if ($2.length) {
15376
- children = [$1, ...$2];
15377
- } else {
15378
- children = [$1];
15379
- }
15380
- const names = children.flatMap((c) => c.names || []);
15394
+ var VariableDeclarationList$0 = $TS($S(LexicalBinding, $Q($S(__, Comma, __, LexicalBinding))), function($skip, $loc, $0, $1, $2) {
15395
+ var binding = $1;
15396
+ var tail = $2;
15397
+ const bindings = [binding].concat(tail.map(([, , , b]) => b));
15381
15398
  return {
15382
15399
  type: "Declaration",
15383
- children,
15384
- names
15400
+ children: [binding, ...tail],
15401
+ bindings,
15402
+ names: bindings.flatMap((b) => b.names)
15385
15403
  };
15386
15404
  });
15387
15405
  function VariableDeclarationList(state) {
@@ -15406,49 +15424,6 @@ ${input.slice(result.pos)}
15406
15424
  return result;
15407
15425
  }
15408
15426
  }
15409
- var VariableDeclaration$0 = $TS($S(BindingPattern, $E(TypeSuffix), Initializer), function($skip, $loc, $0, $1, $2, $3) {
15410
- const children = [...$1.children];
15411
- if ($2)
15412
- children.push($2);
15413
- children.push($3);
15414
- return {
15415
- children,
15416
- names: $1.names
15417
- };
15418
- });
15419
- var VariableDeclaration$1 = $TS($S(BindingIdentifier, $E(TypeSuffix), $E(Initializer)), function($skip, $loc, $0, $1, $2, $3) {
15420
- const children = [...$1.children];
15421
- if ($2)
15422
- children.push($2);
15423
- if ($3)
15424
- children.push($3);
15425
- return {
15426
- children,
15427
- names: $1.names
15428
- };
15429
- });
15430
- function VariableDeclaration(state) {
15431
- let eventData;
15432
- if (state.events) {
15433
- const result = state.events.enter?.("VariableDeclaration", state);
15434
- if (result) {
15435
- if (result.cache)
15436
- return result.cache;
15437
- eventData = result.data;
15438
- }
15439
- }
15440
- if (state.tokenize) {
15441
- const result = $TOKEN("VariableDeclaration", state, VariableDeclaration$0(state) || VariableDeclaration$1(state));
15442
- if (state.events)
15443
- state.events.exit?.("VariableDeclaration", state, result, eventData);
15444
- return result;
15445
- } else {
15446
- const result = VariableDeclaration$0(state) || VariableDeclaration$1(state);
15447
- if (state.events)
15448
- state.events.exit?.("VariableDeclaration", state, result, eventData);
15449
- return result;
15450
- }
15451
- }
15452
15427
  var NumericLiteral$0 = $TS($S(NumericLiteralKind), function($skip, $loc, $0, $1) {
15453
15428
  return { type: "NumericLiteral", $loc, token: $1 };
15454
15429
  });
@@ -17526,6 +17501,13 @@ ${input.slice(result.pos)}
17526
17501
  var Dot$0 = $TV($EXPECT($L6, fail, 'Dot "."'), function($skip, $loc, $0, $1) {
17527
17502
  return { $loc, token: $1 };
17528
17503
  });
17504
+ var Dot$1 = $TS($S($EXPECT($R49, fail, "Dot /['\u2019]s/"), _), function($skip, $loc, $0, $1, $2) {
17505
+ var ws = $2;
17506
+ return [
17507
+ { $loc, token: "." },
17508
+ insertTrimmingSpace(ws, "")
17509
+ ];
17510
+ });
17529
17511
  function Dot(state) {
17530
17512
  let eventData;
17531
17513
  if (state.events) {
@@ -17537,12 +17519,12 @@ ${input.slice(result.pos)}
17537
17519
  }
17538
17520
  }
17539
17521
  if (state.tokenize) {
17540
- const result = $TOKEN("Dot", state, Dot$0(state));
17522
+ const result = $TOKEN("Dot", state, Dot$0(state) || Dot$1(state));
17541
17523
  if (state.events)
17542
17524
  state.events.exit?.("Dot", state, result, eventData);
17543
17525
  return result;
17544
17526
  } else {
17545
- const result = Dot$0(state);
17527
+ const result = Dot$0(state) || Dot$1(state);
17546
17528
  if (state.events)
17547
17529
  state.events.exit?.("Dot", state, result, eventData);
17548
17530
  return result;
@@ -17904,7 +17886,7 @@ ${input.slice(result.pos)}
17904
17886
  return result;
17905
17887
  }
17906
17888
  }
17907
- var Import$0 = $TS($S($EXPECT($L17, fail, 'Import "import"'), $Y($EXPECT($R49, fail, "Import /\\s/"))), function($skip, $loc, $0, $1, $2) {
17889
+ var Import$0 = $TS($S($EXPECT($L17, fail, 'Import "import"'), $Y($EXPECT($R50, fail, "Import /\\s/"))), function($skip, $loc, $0, $1, $2) {
17908
17890
  return { $loc, token: $1 };
17909
17891
  });
17910
17892
  function Import(state) {
@@ -19482,7 +19464,7 @@ ${input.slice(result.pos)}
19482
19464
  return result;
19483
19465
  }
19484
19466
  }
19485
- var JSXIdentifierName$0 = $R$0($EXPECT($R50, fail, "JSXIdentifierName /(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*/"));
19467
+ var JSXIdentifierName$0 = $R$0($EXPECT($R51, fail, "JSXIdentifierName /(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*/"));
19486
19468
  function JSXIdentifierName(state) {
19487
19469
  let eventData;
19488
19470
  if (state.events) {
@@ -19720,7 +19702,7 @@ ${input.slice(result.pos)}
19720
19702
  return result;
19721
19703
  }
19722
19704
  }
19723
- var JSXAttributeSpace$0 = $R$0($EXPECT($R51, fail, "JSXAttributeSpace /[\\s>]|\\/>/"));
19705
+ var JSXAttributeSpace$0 = $R$0($EXPECT($R52, fail, "JSXAttributeSpace /[\\s>]|\\/>/"));
19724
19706
  function JSXAttributeSpace(state) {
19725
19707
  let eventData;
19726
19708
  if (state.events) {
@@ -19743,7 +19725,7 @@ ${input.slice(result.pos)}
19743
19725
  return result;
19744
19726
  }
19745
19727
  }
19746
- var JSXShorthandString$0 = $TR($EXPECT($R52, fail, "JSXShorthandString /(?:[\\w\\-:]+|\\([^()]*\\)|\\[[^\\[\\]]*\\])+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
19728
+ var JSXShorthandString$0 = $TR($EXPECT($R53, fail, "JSXShorthandString /(?:[\\w\\-:]+|\\([^()]*\\)|\\[[^\\[\\]]*\\])+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
19747
19729
  return quoteString($0);
19748
19730
  });
19749
19731
  var JSXShorthandString$1 = $TS($S(TemplateLiteral), function($skip, $loc, $0, $1) {
@@ -19832,7 +19814,7 @@ ${input.slice(result.pos)}
19832
19814
  }
19833
19815
  return [open, value, close];
19834
19816
  });
19835
- var JSXAttributeValue$4 = $R$0($EXPECT($R53, fail, `JSXAttributeValue /"[^"]*"|'[^']*'/`));
19817
+ var JSXAttributeValue$4 = $R$0($EXPECT($R54, fail, `JSXAttributeValue /"[^"]*"|'[^']*'/`));
19836
19818
  function JSXAttributeValue(state) {
19837
19819
  let eventData;
19838
19820
  if (state.events) {
@@ -19882,7 +19864,7 @@ ${input.slice(result.pos)}
19882
19864
  return result;
19883
19865
  }
19884
19866
  }
19885
- var InlineJSXBinaryOpRHS$0 = $TS($S($N($EXPECT($R54, fail, "InlineJSXBinaryOpRHS /[<>]/")), BinaryOp, InlineJSXUnaryExpression), function($skip, $loc, $0, $1, $2, $3) {
19867
+ var InlineJSXBinaryOpRHS$0 = $TS($S($N($EXPECT($R55, fail, "InlineJSXBinaryOpRHS /[<>]/")), BinaryOp, InlineJSXUnaryExpression), function($skip, $loc, $0, $1, $2, $3) {
19886
19868
  var op = $2;
19887
19869
  var rhs = $3;
19888
19870
  return [[], op, [], rhs];
@@ -19937,7 +19919,7 @@ ${input.slice(result.pos)}
19937
19919
  return result;
19938
19920
  }
19939
19921
  }
19940
- var InlineJSXUnaryOp$0 = $TR($EXPECT($R55, fail, "InlineJSXUnaryOp /[!~+-](?!\\s|[!~+-]*&)/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
19922
+ var InlineJSXUnaryOp$0 = $TR($EXPECT($R56, fail, "InlineJSXUnaryOp /[!~+-](?!\\s|[!~+-]*&)/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
19941
19923
  return { $loc, token: $0 };
19942
19924
  });
19943
19925
  function InlineJSXUnaryOp(state) {
@@ -20427,7 +20409,7 @@ ${input.slice(result.pos)}
20427
20409
  return result;
20428
20410
  }
20429
20411
  }
20430
- var JSXCommentContent$0 = $TR($EXPECT($R56, fail, "JSXCommentContent /(?:-[^-]|[^-]*)*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
20412
+ var JSXCommentContent$0 = $TR($EXPECT($R57, fail, "JSXCommentContent /(?:-[^-]|[^-]*)*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
20431
20413
  return { $loc, token: $0.replace(/\*\//g, "* /") };
20432
20414
  });
20433
20415
  function JSXCommentContent(state) {
@@ -20452,7 +20434,7 @@ ${input.slice(result.pos)}
20452
20434
  return result;
20453
20435
  }
20454
20436
  }
20455
- var JSXText$0 = $TR($EXPECT($R57, fail, "JSXText /[^{}<>\\r\\n]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
20437
+ var JSXText$0 = $TR($EXPECT($R58, fail, "JSXText /[^{}<>\\r\\n]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
20456
20438
  return {
20457
20439
  type: "JSXText",
20458
20440
  token: $0,
@@ -21202,9 +21184,9 @@ ${input.slice(result.pos)}
21202
21184
  ["let ", id, " = {};\n"],
21203
21185
  ...block.properties.map((property, i) => {
21204
21186
  let init, isString;
21205
- if (property.init) {
21187
+ if (property.initializer) {
21206
21188
  init = replaceNodes(
21207
- deepCopy(property.init),
21189
+ deepCopy(property.initializer),
21208
21190
  (n) => n.type === "Identifier" && names.has(n.name),
21209
21191
  (n) => [id, '["', n.name, '"]']
21210
21192
  );
@@ -21367,11 +21349,11 @@ ${input.slice(result.pos)}
21367
21349
  }
21368
21350
  var EnumProperty$0 = $TS($S(Identifier, $E($S(__, Equals, ExtendedExpression)), ObjectPropertyDelimiter), function($skip, $loc, $0, $1, $2, $3) {
21369
21351
  var name = $1;
21370
- var init = $2;
21352
+ var initializer = $2;
21371
21353
  return {
21372
21354
  type: "EnumProperty",
21373
21355
  name,
21374
- init,
21356
+ initializer,
21375
21357
  children: $0
21376
21358
  };
21377
21359
  });
@@ -21420,7 +21402,7 @@ ${input.slice(result.pos)}
21420
21402
  return result;
21421
21403
  }
21422
21404
  }
21423
- 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)))));
21405
+ 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)))));
21424
21406
  function TypeIndexSignature(state) {
21425
21407
  let eventData;
21426
21408
  if (state.events) {
@@ -21871,17 +21853,25 @@ ${input.slice(result.pos)}
21871
21853
  return result;
21872
21854
  }
21873
21855
  }
21874
- var TypeElement$0 = $S($S(__, DotDotDot, __), Type);
21875
- var TypeElement$1 = $TS($S(Type, $E($S($E(_), DotDotDot))), function($skip, $loc, $0, $1, $2) {
21856
+ 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) {
21857
+ var ws = $1;
21858
+ var name = $2;
21859
+ var space = $3;
21860
+ var dots = $4;
21861
+ var colon = $5;
21862
+ var type = $6;
21863
+ return [ws, dots, space, name, colon, type];
21864
+ });
21865
+ var TypeElement$1 = $TS($S(Type, $E(_), DotDotDot), function($skip, $loc, $0, $1, $2, $3) {
21876
21866
  var type = $1;
21877
- var dots = $2;
21878
- if (!dots)
21879
- return type;
21867
+ var space = $2;
21868
+ var dots = $3;
21880
21869
  const ws = getTrimmingSpace(type);
21881
21870
  if (!ws)
21882
- return [dots[1], dots[0], type];
21883
- return [ws, dots[1], dots[0], insertTrimmingSpace(type, "")];
21871
+ return [dots, space, type];
21872
+ return [ws, dots, space, insertTrimmingSpace(type, "")];
21884
21873
  });
21874
+ var TypeElement$2 = $S($E($S(__, DotDotDot)), $E($S(__, IdentifierName, __, $E($S(QuestionMark, $E(_))), Colon, __)), Type);
21885
21875
  function TypeElement(state) {
21886
21876
  let eventData;
21887
21877
  if (state.events) {
@@ -21893,12 +21883,12 @@ ${input.slice(result.pos)}
21893
21883
  }
21894
21884
  }
21895
21885
  if (state.tokenize) {
21896
- const result = $TOKEN("TypeElement", state, TypeElement$0(state) || TypeElement$1(state));
21886
+ const result = $TOKEN("TypeElement", state, TypeElement$0(state) || TypeElement$1(state) || TypeElement$2(state));
21897
21887
  if (state.events)
21898
21888
  state.events.exit?.("TypeElement", state, result, eventData);
21899
21889
  return result;
21900
21890
  } else {
21901
- const result = TypeElement$0(state) || TypeElement$1(state);
21891
+ const result = TypeElement$0(state) || TypeElement$1(state) || TypeElement$2(state);
21902
21892
  if (state.events)
21903
21893
  state.events.exit?.("TypeElement", state, result, eventData);
21904
21894
  return result;
@@ -21932,7 +21922,7 @@ ${input.slice(result.pos)}
21932
21922
  return result;
21933
21923
  }
21934
21924
  }
21935
- var NestedType$0 = $S(Nested, Type, ArrayElementDelimiter);
21925
+ var NestedType$0 = $S(Nested, TypeElement, ArrayElementDelimiter);
21936
21926
  function NestedType(state) {
21937
21927
  let eventData;
21938
21928
  if (state.events) {
@@ -22495,7 +22485,7 @@ ${input.slice(result.pos)}
22495
22485
  return result;
22496
22486
  }
22497
22487
  }
22498
- var Shebang$0 = $S($R$0($EXPECT($R60, fail, "Shebang /#![^\\r\\n]*/")), EOL);
22488
+ var Shebang$0 = $S($R$0($EXPECT($R61, fail, "Shebang /#![^\\r\\n]*/")), EOL);
22499
22489
  function Shebang(state) {
22500
22490
  let eventData;
22501
22491
  if (state.events) {
@@ -22518,11 +22508,11 @@ ${input.slice(result.pos)}
22518
22508
  return result;
22519
22509
  }
22520
22510
  }
22521
- var CivetPrologue$0 = $T($S($EXPECT($R61, fail, "CivetPrologue /[\\t ]*/"), DoubleQuote, CivetPrologueContent, DoubleQuote, $TEXT(SimpleStatementDelimiter), $E(EOS)), function(value) {
22511
+ var CivetPrologue$0 = $T($S($EXPECT($R62, fail, "CivetPrologue /[\\t ]*/"), DoubleQuote, CivetPrologueContent, DoubleQuote, $TEXT(SimpleStatementDelimiter), $E(EOS)), function(value) {
22522
22512
  var content = value[2];
22523
22513
  return content;
22524
22514
  });
22525
- var CivetPrologue$1 = $T($S($EXPECT($R61, fail, "CivetPrologue /[\\t ]*/"), SingleQuote, CivetPrologueContent, SingleQuote, $TEXT(SimpleStatementDelimiter), $E(EOS)), function(value) {
22515
+ var CivetPrologue$1 = $T($S($EXPECT($R62, fail, "CivetPrologue /[\\t ]*/"), SingleQuote, CivetPrologueContent, SingleQuote, $TEXT(SimpleStatementDelimiter), $E(EOS)), function(value) {
22526
22516
  var content = value[2];
22527
22517
  return content;
22528
22518
  });
@@ -22548,7 +22538,7 @@ ${input.slice(result.pos)}
22548
22538
  return result;
22549
22539
  }
22550
22540
  }
22551
- 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) {
22541
+ 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) {
22552
22542
  var options = $3;
22553
22543
  return {
22554
22544
  type: "CivetPrologue",
@@ -22578,7 +22568,7 @@ ${input.slice(result.pos)}
22578
22568
  return result;
22579
22569
  }
22580
22570
  }
22581
- 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) {
22571
+ 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) {
22582
22572
  const optionName = $2.replace(/-+([a-z]?)/g, (_2, l) => {
22583
22573
  if (l)
22584
22574
  return l.toUpperCase();
@@ -22614,7 +22604,7 @@ ${input.slice(result.pos)}
22614
22604
  return result;
22615
22605
  }
22616
22606
  }
22617
- var UnknownPrologue$0 = $S($R$0($EXPECT($R61, fail, "UnknownPrologue /[\\t ]*/")), StringLiteral, $TEXT(SimpleStatementDelimiter), EOS);
22607
+ var UnknownPrologue$0 = $S($R$0($EXPECT($R62, fail, "UnknownPrologue /[\\t ]*/")), StringLiteral, $TEXT(SimpleStatementDelimiter), EOS);
22618
22608
  function UnknownPrologue(state) {
22619
22609
  let eventData;
22620
22610
  if (state.events) {
@@ -22684,7 +22674,7 @@ ${input.slice(result.pos)}
22684
22674
  return result;
22685
22675
  }
22686
22676
  }
22687
- 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) {
22677
+ 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) {
22688
22678
  return { $loc, token: $0 };
22689
22679
  });
22690
22680
  function EOL(state) {
@@ -23870,7 +23860,7 @@ ${input.slice(result.pos)}
23870
23860
  return result;
23871
23861
  }
23872
23862
  }
23873
- var Indent$0 = $TR($EXPECT($R65, fail, "Indent /[ \\t]*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
23863
+ var Indent$0 = $TR($EXPECT($R66, fail, "Indent /[ \\t]*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
23874
23864
  let level;
23875
23865
  if (module.config.tab) {
23876
23866
  const tabs = $0.match(/\t/g);
@@ -24176,8 +24166,7 @@ ${input.slice(result.pos)}
24176
24166
  processBinaryOpExpression,
24177
24167
  processCallMemberExpression,
24178
24168
  processCoffeeInterpolation,
24179
- processConstAssignmentDeclaration,
24180
- processLetAssignmentDeclaration,
24169
+ processAssignmentDeclaration,
24181
24170
  processProgram,
24182
24171
  processUnaryExpression,
24183
24172
  quoteString,