@danielx/civet 0.8.8 → 0.8.9

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
@@ -66,7 +66,7 @@ var Civet = (() => {
66
66
  $EVENT: () => $EVENT2,
67
67
  $EVENT_C: () => $EVENT_C2,
68
68
  $EXPECT: () => $EXPECT2,
69
- $L: () => $L239,
69
+ $L: () => $L246,
70
70
  $N: () => $N2,
71
71
  $P: () => $P2,
72
72
  $Q: () => $Q2,
@@ -91,7 +91,7 @@ var Civet = (() => {
91
91
  return result;
92
92
  };
93
93
  }
94
- function $L239(str) {
94
+ function $L246(str) {
95
95
  return function(_ctx, state2) {
96
96
  const { input, pos } = state2, { length } = str, end = pos + length;
97
97
  if (input.substring(pos, end) === str) {
@@ -585,7 +585,8 @@ ${body}`;
585
585
  stripTrailingImplicitComma: () => stripTrailingImplicitComma,
586
586
  trimFirstSpace: () => trimFirstSpace,
587
587
  typeOfJSX: () => typeOfJSX,
588
- wrapIIFE: () => wrapIIFE
588
+ wrapIIFE: () => wrapIIFE,
589
+ wrapTypeInPromise: () => wrapTypeInPromise
589
590
  });
590
591
 
591
592
  // source/parser/util.civet
@@ -925,32 +926,54 @@ ${body}`;
925
926
  case "false":
926
927
  return false;
927
928
  }
928
- if (raw.startsWith('"') && raw.endsWith('"') || raw.startsWith("'") && raw.endsWith("'")) {
929
- return raw.slice(1, -1);
930
- }
931
- const numeric = literal.children.find(
932
- (child) => child.type === "NumericLiteral"
933
- );
934
- if (numeric) {
935
- raw = raw.replace(/_/g, "");
936
- const { token } = numeric;
937
- if (token.endsWith("n")) {
938
- return BigInt(raw.slice(0, -1));
939
- } else if (token.match(/[\.eE]/)) {
940
- return parseFloat(raw);
941
- } else if (token.startsWith("0")) {
942
- switch (token.charAt(1).toLowerCase()) {
943
- case "x":
944
- return parseInt(raw.replace(/0[xX]/, ""), 16);
945
- case "b":
946
- return parseInt(raw.replace(/0[bB]/, ""), 2);
947
- case "o":
948
- return parseInt(raw.replace(/0[oO]/, ""), 8);
929
+ let ref3;
930
+ switch (literal.subtype) {
931
+ case "StringLiteral": {
932
+ assert.equal(
933
+ raw.startsWith('"') && raw.endsWith('"') || raw.startsWith("'") && raw.endsWith("'"),
934
+ true,
935
+ "String literal should begin and end in single or double quotes"
936
+ );
937
+ return raw.slice(1, -1);
938
+ }
939
+ case "NumericLiteral": {
940
+ raw = raw.replace(/_/g, "");
941
+ if (raw.endsWith("n")) {
942
+ return BigInt(raw.slice(0, -1));
943
+ } else if (raw.match(/[\.eE]/)) {
944
+ return parseFloat(raw);
945
+ } else if ((ref3 = raw.match(/^[+-]?0(.)/)) && Array.isArray(ref3) && len(ref3, 2)) {
946
+ const [, base] = ref3;
947
+ switch (base.toLowerCase()) {
948
+ case "x":
949
+ return parseInt(raw.replace(/0[xX]/, ""), 16);
950
+ case "b":
951
+ return parseInt(raw.replace(/0[bB]/, ""), 2);
952
+ case "o":
953
+ return parseInt(raw.replace(/0[oO]/, ""), 8);
954
+ }
949
955
  }
956
+ return parseInt(raw, 10);
957
+ }
958
+ default: {
959
+ throw new Error("Unrecognized literal " + JSON.stringify(literal));
950
960
  }
951
- return parseInt(raw, 10);
952
961
  }
953
- throw new Error("Unrecognized literal " + JSON.stringify(literal));
962
+ }
963
+ function makeNumericLiteral(n) {
964
+ const s = n.toString();
965
+ return {
966
+ type: "Literal",
967
+ subtype: "NumericLiteral",
968
+ raw: s,
969
+ children: [
970
+ {
971
+ type: "NumericLiteral",
972
+ token: s
973
+ }
974
+ // missing $loc
975
+ ]
976
+ };
954
977
  }
955
978
  function startsWith(target, value) {
956
979
  if (!target)
@@ -1011,21 +1034,39 @@ ${body}`;
1011
1034
  function hasExportDeclaration(exp) {
1012
1035
  return gatherRecursiveWithinFunction(exp, ($4) => $4.type === "ExportDeclaration").length > 0;
1013
1036
  }
1014
- function deepCopy(node) {
1015
- if (node == null)
1016
- return node;
1017
- if (typeof node !== "object")
1018
- return node;
1019
- if (Array.isArray(node)) {
1020
- return node.map(deepCopy);
1037
+ function deepCopy(root) {
1038
+ const copied = /* @__PURE__ */ new Map();
1039
+ return recurse(root);
1040
+ function recurse(node) {
1041
+ if (!(node != null && typeof node === "object")) {
1042
+ return node;
1043
+ }
1044
+ if (!copied.has(node)) {
1045
+ if (Array.isArray(node)) {
1046
+ const array = new Array(node.length);
1047
+ copied.set(node, array);
1048
+ for (let i4 = 0, len4 = node.length; i4 < len4; i4++) {
1049
+ const i = i4;
1050
+ const item = node[i4];
1051
+ array[i] = recurse(item);
1052
+ }
1053
+ } else if (node?.type === "Ref") {
1054
+ copied.set(node, node);
1055
+ } else {
1056
+ const obj = {};
1057
+ copied.set(node, obj);
1058
+ for (const key in node) {
1059
+ const value = node[key];
1060
+ if (key === "parent") {
1061
+ obj.parent = copied.get(value) ?? value;
1062
+ } else {
1063
+ obj[key] = recurse(value);
1064
+ }
1065
+ }
1066
+ }
1067
+ }
1068
+ return copied.get(node);
1021
1069
  }
1022
- if (node?.type === "Ref")
1023
- return node;
1024
- return Object.fromEntries(
1025
- Object.entries(node).map(([key, value]) => {
1026
- return [key, deepCopy(value)];
1027
- })
1028
- );
1029
1070
  }
1030
1071
  function removeHoistDecs(node) {
1031
1072
  if (node == null)
@@ -1099,8 +1140,8 @@ ${body}`;
1099
1140
  return;
1100
1141
  }
1101
1142
  if (Array.isArray(node)) {
1102
- for (let i4 = 0, len4 = node.length; i4 < len4; i4++) {
1103
- const child = node[i4];
1143
+ for (let i5 = 0, len5 = node.length; i5 < len5; i5++) {
1144
+ const child = node[i5];
1104
1145
  updateParentPointers(child, parent, depth);
1105
1146
  }
1106
1147
  return;
@@ -1110,8 +1151,8 @@ ${body}`;
1110
1151
  node.parent = parent;
1111
1152
  }
1112
1153
  if (depth && isParent(node)) {
1113
- for (let ref3 = node.children, i5 = 0, len5 = ref3.length; i5 < len5; i5++) {
1114
- const child = ref3[i5];
1154
+ for (let ref4 = node.children, i6 = 0, len6 = ref4.length; i6 < len6; i6++) {
1155
+ const child = ref4[i6];
1115
1156
  updateParentPointers(child, node, depth - 1);
1116
1157
  }
1117
1158
  }
@@ -1148,7 +1189,7 @@ ${body}`;
1148
1189
  return children.splice(index, del, ...replacements);
1149
1190
  }
1150
1191
  function convertOptionalType(suffix) {
1151
- if (suffix.t.type === "AssertsType") {
1192
+ if (suffix.t.type === "TypeAsserts") {
1152
1193
  spliceChild(suffix, suffix.optional, 1, suffix.optional = {
1153
1194
  type: "Error",
1154
1195
  message: "Can't use optional ?: syntax with asserts type"
@@ -1170,7 +1211,7 @@ ${body}`;
1170
1211
  "TypeIdentifier",
1171
1212
  "ImportType",
1172
1213
  "TypeLiteral",
1173
- "TupleType",
1214
+ "TypeTuple",
1174
1215
  "TypeParenthesized"
1175
1216
  ]);
1176
1217
  function parenthesizeType(type) {
@@ -1248,8 +1289,8 @@ ${body}`;
1248
1289
  children.splice(1, 0, ".bind(this)");
1249
1290
  }
1250
1291
  if (gatherRecursiveWithinFunction(block, (a2) => typeof a2 === "object" && a2 != null && "token" in a2 && a2.token === "arguments").length) {
1251
- let ref4;
1252
- children[children.length - 1] = (ref4 = parameters.children)[ref4.length - 1] = "(arguments)";
1292
+ let ref5;
1293
+ children[children.length - 1] = (ref5 = parameters.children)[ref5.length - 1] = "(arguments)";
1253
1294
  }
1254
1295
  }
1255
1296
  let exp = makeNode({
@@ -1287,9 +1328,9 @@ ${body}`;
1287
1328
  }
1288
1329
  function flatJoin(array, separator) {
1289
1330
  const result = [];
1290
- for (let i6 = 0, len6 = array.length; i6 < len6; i6++) {
1291
- const i = i6;
1292
- const items = array[i6];
1331
+ for (let i7 = 0, len7 = array.length; i7 < len7; i7++) {
1332
+ const i = i7;
1333
+ const items = array[i7];
1293
1334
  if (i) {
1294
1335
  result.push(separator);
1295
1336
  }
@@ -1875,6 +1916,13 @@ ${body}`;
1875
1916
  ").push(rhs), lhs);\n"
1876
1917
  ]]);
1877
1918
  },
1919
+ AutoPromise(ref) {
1920
+ state.prelude.push([
1921
+ "",
1922
+ ts(["type ", ref, "<T> = T extends Promise<unknown> ? T : Promise<T>"]),
1923
+ ";\n"
1924
+ ]);
1925
+ },
1878
1926
  JSX(jsxRef) {
1879
1927
  state.prelude.push([
1880
1928
  "",
@@ -1980,12 +2028,17 @@ ${body}`;
1980
2028
  ));
1981
2029
  return "";
1982
2030
  }
1983
- if (node.$loc != null) {
2031
+ if ("$loc" in node) {
1984
2032
  const { token, $loc } = node;
1985
- updateSourceMap?.(token, $loc.pos);
2033
+ if ($loc != null) {
2034
+ updateSourceMap?.(token, $loc.pos);
2035
+ }
1986
2036
  return token;
1987
2037
  }
1988
2038
  if (!node.children) {
2039
+ if (node.token != null) {
2040
+ return node.token;
2041
+ }
1989
2042
  switch (node.type) {
1990
2043
  case "Ref": {
1991
2044
  throw new Error(`Unpopulated ref ${stringify(node)}`);
@@ -2363,9 +2416,49 @@ ${js}`
2363
2416
  function isVoidType(t) {
2364
2417
  return typeof t === "object" && t != null && "type" in t && t.type === "TypeLiteral" && "t" in t && typeof t.t === "object" && t.t != null && "type" in t.t && t.t.type === "VoidType";
2365
2418
  }
2419
+ function isPromiseType(t) {
2420
+ return typeof t === "object" && t != null && "type" in t && t.type === "TypeIdentifier" && "raw" in t && t.raw === "Promise";
2421
+ }
2366
2422
  function isPromiseVoidType(t) {
2367
- let args;
2368
- return typeof t === "object" && t != null && "type" in t && t.type === "TypeIdentifier" && "raw" in t && t.raw === "Promise" && (args = getTypeArguments(t.args?.args)).length === 1 && isVoidType(args[0].t);
2423
+ if (!isPromiseType(t)) {
2424
+ return false;
2425
+ }
2426
+ const args = getTypeArguments(t.args?.args);
2427
+ return args.length === 1 && isVoidType(args[0].t);
2428
+ }
2429
+ function wrapTypeInPromise(t) {
2430
+ if (isPromiseType(t)) {
2431
+ return t;
2432
+ }
2433
+ return wrapTypeInApplication(t, getHelperRef("AutoPromise"), "Promise");
2434
+ }
2435
+ function wrapTypeInApplication(t, id, raw) {
2436
+ const ws = getTrimmingSpace(t);
2437
+ t = trimFirstSpace(t);
2438
+ const innerArgs = [{
2439
+ type: "TypeArgument",
2440
+ ts: true,
2441
+ t,
2442
+ children: [t]
2443
+ }];
2444
+ const args = {
2445
+ type: "TypeArguments",
2446
+ ts: true,
2447
+ args: innerArgs,
2448
+ children: ["<", innerArgs, ">"]
2449
+ };
2450
+ if (!(raw != null)) {
2451
+ if (!(typeof id === "string")) {
2452
+ throw new Error("wrapTypeInApplication requires string id or raw argument");
2453
+ }
2454
+ raw = id;
2455
+ }
2456
+ return {
2457
+ type: "TypeIdentifier",
2458
+ raw,
2459
+ args,
2460
+ children: [ws, id, args]
2461
+ };
2369
2462
  }
2370
2463
  function implicitFunctionBlock(f) {
2371
2464
  if (f.abstract || f.block || f.signature?.optional)
@@ -2426,7 +2519,8 @@ ${js}`
2426
2519
  }
2427
2520
  const ref = makeRef("ret");
2428
2521
  let declaration;
2429
- values.forEach((value) => {
2522
+ for (let i1 = 0, len3 = values.length; i1 < len3; i1++) {
2523
+ const value = values[i1];
2430
2524
  value.children = [ref];
2431
2525
  const { ancestor, child } = findAncestor(
2432
2526
  value,
@@ -2434,21 +2528,41 @@ ${js}`
2434
2528
  isFunction
2435
2529
  );
2436
2530
  if (ancestor) {
2437
- return declaration ??= child;
2531
+ declaration ??= child;
2438
2532
  }
2439
- ;
2440
- return;
2441
- });
2533
+ }
2442
2534
  let returnType = func.returnType ?? func.signature?.returnType;
2443
2535
  if (returnType) {
2444
2536
  const { t } = returnType;
2445
2537
  let m;
2446
2538
  if (m = t.type, m === "TypePredicate") {
2447
- returnType = ": boolean";
2448
- } else if (m === "AssertsType") {
2539
+ const token = { token: "boolean" };
2540
+ const literal = {
2541
+ type: "TypeLiteral",
2542
+ t: token,
2543
+ children: [token]
2544
+ };
2545
+ returnType = {
2546
+ type: "ReturnTypeAnnotation",
2547
+ ts: true,
2548
+ t: literal,
2549
+ children: [": ", literal]
2550
+ };
2551
+ } else if (m === "TypeAsserts") {
2449
2552
  returnType = void 0;
2450
2553
  }
2451
2554
  }
2555
+ if (returnType) {
2556
+ returnType = deepCopy(returnType);
2557
+ addParentPointers(returnType);
2558
+ if (func.signature.modifier.async) {
2559
+ replaceNode(
2560
+ returnType.t,
2561
+ makeNode(wrapTypeInApplication(returnType.t, "Awaited")),
2562
+ returnType
2563
+ );
2564
+ }
2565
+ }
2452
2566
  if (declaration) {
2453
2567
  if (!(declaration.typeSuffix != null)) {
2454
2568
  declaration.children[1] = declaration.typeSuffix = returnType;
@@ -2456,11 +2570,11 @@ ${js}`
2456
2570
  } else {
2457
2571
  block.expressions.unshift([
2458
2572
  getIndent(block.expressions[0]),
2459
- {
2573
+ makeNode({
2460
2574
  type: "Declaration",
2461
2575
  children: ["let ", ref, returnType],
2462
2576
  names: []
2463
- },
2577
+ }),
2464
2578
  ";"
2465
2579
  ]);
2466
2580
  }
@@ -2878,19 +2992,15 @@ ${js}`
2878
2992
  "wrapIterationReturningResults should not be called twice on the same statement"
2879
2993
  );
2880
2994
  const resultsRef = statement.resultsRef = makeRef("results");
2881
- const { declaration, breakWithOnly } = iterationDeclaration(statement);
2995
+ const declaration = iterationDeclaration(statement);
2882
2996
  const { ancestor, child } = findAncestor(statement, ($4) => $4.type === "BlockStatement");
2883
2997
  assert.notNull(ancestor, `Could not find block containing ${statement.type}`);
2884
2998
  const index = findChildIndex(ancestor.expressions, child);
2999
+ assert.notEqual(index, -1, `Could not find ${statement.type} in containing block`);
2885
3000
  const iterationTuple = ancestor.expressions[index];
2886
3001
  ancestor.expressions.splice(index, 0, [iterationTuple[0], declaration, ";"]);
2887
3002
  iterationTuple[0] = "";
2888
3003
  braceBlock(ancestor);
2889
- if (!breakWithOnly) {
2890
- assignResults(statement.block, (node) => {
2891
- return [resultsRef, ".push(", node, ")"];
2892
- });
2893
- }
2894
3004
  if (collect) {
2895
3005
  statement.children.push(collect(resultsRef));
2896
3006
  } else {
@@ -2898,15 +3008,16 @@ ${js}`
2898
3008
  }
2899
3009
  }
2900
3010
  function iterationDeclaration(statement) {
2901
- const { resultsRef } = statement;
2902
- let decl = "const";
3011
+ const { resultsRef, block } = statement;
3012
+ const reduction = statement.type === "ForStatement" && statement.reduction;
3013
+ let decl = reduction ? "let" : "const";
2903
3014
  if (statement.type === "IterationStatement" || statement.type === "ForStatement") {
2904
3015
  if (processBreakContinueWith(statement)) {
2905
3016
  decl = "let";
2906
3017
  }
2907
3018
  }
2908
3019
  const breakWithOnly = decl === "let" && isLoopStatement(statement) && gatherRecursive(
2909
- statement.block,
3020
+ block,
2910
3021
  (s) => s.type === "BreakStatement" && !s.with,
2911
3022
  (s) => isFunction(s) || s.type === "IterationStatement"
2912
3023
  ).length === 0;
@@ -2917,14 +3028,124 @@ ${js}`
2917
3028
  names: [],
2918
3029
  bindings: []
2919
3030
  };
2920
- if (decl === "const") {
2921
- declaration.children.push("=[]");
3031
+ if (reduction) {
3032
+ declaration.children.push("=" + (() => {
3033
+ switch (reduction.subtype) {
3034
+ case "some": {
3035
+ return "false";
3036
+ }
3037
+ case "every": {
3038
+ return "true";
3039
+ }
3040
+ case "min": {
3041
+ return "Infinity";
3042
+ }
3043
+ case "max": {
3044
+ return "-Infinity";
3045
+ }
3046
+ case "product": {
3047
+ return "1";
3048
+ }
3049
+ default: {
3050
+ return "0";
3051
+ }
3052
+ }
3053
+ })());
2922
3054
  } else {
2923
- if (!breakWithOnly) {
2924
- declaration.children.push(";", resultsRef, "=[]");
3055
+ if (decl === "const") {
3056
+ declaration.children.push("=[]");
3057
+ } else {
3058
+ if (!breakWithOnly) {
3059
+ declaration.children.push(";", resultsRef, "=[]");
3060
+ }
3061
+ }
3062
+ }
3063
+ if (!breakWithOnly) {
3064
+ if (iterationDefaultBody(statement)) {
3065
+ return declaration;
3066
+ }
3067
+ if (!block.empty) {
3068
+ assignResults(block, (node) => {
3069
+ if (!reduction) {
3070
+ return [resultsRef, ".push(", node, ")"];
3071
+ }
3072
+ switch (reduction.subtype) {
3073
+ case "some": {
3074
+ return ["if (", node, ") {", resultsRef, " = true; break}"];
3075
+ }
3076
+ case "every": {
3077
+ return [
3078
+ "if (!",
3079
+ makeLeftHandSideExpression(node),
3080
+ ") {",
3081
+ resultsRef,
3082
+ " = false; break}"
3083
+ ];
3084
+ }
3085
+ case "count": {
3086
+ return ["if (", node, ") ++", resultsRef];
3087
+ }
3088
+ case "sum": {
3089
+ return [resultsRef, " += ", node];
3090
+ }
3091
+ case "product": {
3092
+ return [resultsRef, " *= ", node];
3093
+ }
3094
+ case "min": {
3095
+ return [resultsRef, " = Math.min(", resultsRef, ", ", node, ")"];
3096
+ }
3097
+ case "max": {
3098
+ return [resultsRef, " = Math.max(", resultsRef, ", ", node, ")"];
3099
+ }
3100
+ }
3101
+ });
2925
3102
  }
2926
3103
  }
2927
- return { declaration, breakWithOnly };
3104
+ return declaration;
3105
+ }
3106
+ function iterationDefaultBody(statement) {
3107
+ const { block, resultsRef } = statement;
3108
+ if (!block.empty) {
3109
+ return false;
3110
+ }
3111
+ const reduction = statement.type === "ForStatement" && statement.reduction;
3112
+ function fillBlock(expression) {
3113
+ let ref8;
3114
+ let m2;
3115
+ if (m2 = (ref8 = block.expressions)[ref8.length - 1], Array.isArray(m2) && m2.length >= 2 && typeof m2[1] === "object" && m2[1] != null && "type" in m2[1] && m2[1].type === "EmptyStatement" && "implicit" in m2[1] && m2[1].implicit === true) {
3116
+ block.expressions.pop();
3117
+ }
3118
+ block.expressions.push(expression);
3119
+ block.empty = false;
3120
+ return braceBlock(block);
3121
+ }
3122
+ if (reduction) {
3123
+ switch (reduction.subtype) {
3124
+ case "some": {
3125
+ fillBlock(["", [resultsRef, " = true; break"]]);
3126
+ block.empty = false;
3127
+ braceBlock(block);
3128
+ return true;
3129
+ }
3130
+ case "every": {
3131
+ fillBlock(["", [resultsRef, " = false; break"]]);
3132
+ block.empty = false;
3133
+ braceBlock(block);
3134
+ return true;
3135
+ }
3136
+ case "count": {
3137
+ fillBlock(["", ["++", resultsRef]]);
3138
+ block.empty = false;
3139
+ braceBlock(block);
3140
+ return true;
3141
+ }
3142
+ }
3143
+ }
3144
+ if (statement.type === "ForStatement" && statement.declaration?.type === "ForDeclaration") {
3145
+ fillBlock(["", patternAsValue(statement.declaration.binding)]);
3146
+ block.empty = false;
3147
+ }
3148
+ return false;
2928
3149
  }
2929
3150
  function processParams(f) {
2930
3151
  const { type, parameters, block } = f;
@@ -2955,18 +3176,18 @@ ${js}`
2955
3176
  const classExpressions = ancestor.body.expressions;
2956
3177
  let index = findChildIndex(classExpressions, f);
2957
3178
  assert.notEqual(index, -1, "Could not find constructor in class");
2958
- let m2;
2959
- while (m2 = classExpressions[index - 1]?.[1], typeof m2 === "object" && m2 != null && "type" in m2 && m2.type === "MethodDefinition" && "name" in m2 && m2.name === "constructor") {
3179
+ let m3;
3180
+ while (m3 = classExpressions[index - 1]?.[1], typeof m3 === "object" && m3 != null && "type" in m3 && m3.type === "MethodDefinition" && "name" in m3 && m3.name === "constructor") {
2960
3181
  index--;
2961
3182
  }
2962
3183
  const fStatement = classExpressions[index];
2963
- for (let ref8 = gatherRecursive(parameters, ($9) => $9.type === "Parameter"), i1 = 0, len3 = ref8.length; i1 < len3; i1++) {
2964
- const parameter = ref8[i1];
3184
+ for (let ref9 = gatherRecursive(parameters, ($9) => $9.type === "Parameter"), i2 = 0, len1 = ref9.length; i2 < len1; i2++) {
3185
+ const parameter = ref9[i2];
2965
3186
  if (!parameter.typeSuffix) {
2966
3187
  continue;
2967
3188
  }
2968
- for (let ref9 = gatherRecursive(parameter, ($10) => $10.type === "AtBinding"), i2 = 0, len1 = ref9.length; i2 < len1; i2++) {
2969
- const binding = ref9[i2];
3189
+ for (let ref10 = gatherRecursive(parameter, ($10) => $10.type === "AtBinding"), i3 = 0, len22 = ref10.length; i3 < len22; i3++) {
3190
+ const binding = ref10[i3];
2970
3191
  const typeSuffix = binding.parent?.typeSuffix;
2971
3192
  if (!typeSuffix) {
2972
3193
  continue;
@@ -3020,11 +3241,11 @@ ${js}`
3020
3241
  }
3021
3242
  function processSignature(f) {
3022
3243
  const { block, signature } = f;
3023
- if (hasAwait(block) && !f.async?.length) {
3244
+ if (!f.async?.length && hasAwait(block)) {
3024
3245
  f.async.push("async ");
3025
3246
  signature.modifier.async = true;
3026
3247
  }
3027
- if (hasYield(block) && !f.generator?.length) {
3248
+ if (!f.generator?.length && hasYield(block)) {
3028
3249
  if (f.type === "ArrowFunction") {
3029
3250
  gatherRecursiveWithinFunction(block, ($11) => $11.type === "YieldExpression").forEach((y) => {
3030
3251
  const i = y.children.findIndex(($12) => $12.type === "Yield");
@@ -3038,21 +3259,26 @@ ${js}`
3038
3259
  signature.modifier.generator = true;
3039
3260
  }
3040
3261
  }
3262
+ if (signature.modifier.async && !signature.modifier.generator && signature.returnType && !isPromiseType(signature.returnType.t)) {
3263
+ replaceNode(signature.returnType.t, wrapTypeInPromise(signature.returnType.t));
3264
+ }
3041
3265
  }
3042
3266
  function processFunctions(statements, config2) {
3043
- gatherRecursiveAll(statements, ({ type }) => type === "FunctionExpression" || type === "ArrowFunction").forEach((f) => {
3267
+ for (let ref11 = gatherRecursiveAll(statements, ($13) => $13.type === "FunctionExpression" || $13.type === "ArrowFunction"), i4 = 0, len3 = ref11.length; i4 < len3; i4++) {
3268
+ const f = ref11[i4];
3044
3269
  if (f.type === "FunctionExpression") {
3045
3270
  implicitFunctionBlock(f);
3046
3271
  }
3047
3272
  processSignature(f);
3048
3273
  processParams(f);
3049
- return processReturn(f, config2.implicitReturns);
3050
- });
3051
- gatherRecursiveAll(statements, ({ type }) => type === "MethodDefinition").forEach((f) => {
3274
+ processReturn(f, config2.implicitReturns);
3275
+ }
3276
+ for (let ref12 = gatherRecursiveAll(statements, ($14) => $14.type === "MethodDefinition"), i5 = 0, len4 = ref12.length; i5 < len4; i5++) {
3277
+ const f = ref12[i5];
3052
3278
  implicitFunctionBlock(f);
3053
3279
  processParams(f);
3054
- return processReturn(f, config2.implicitReturns);
3055
- });
3280
+ processReturn(f, config2.implicitReturns);
3281
+ }
3056
3282
  }
3057
3283
  function expressionizeIteration(exp) {
3058
3284
  let { async, generator, block, children, statement } = exp;
@@ -3065,47 +3291,65 @@ ${js}`
3065
3291
  updateParentPointers(exp);
3066
3292
  return;
3067
3293
  }
3294
+ let statements;
3068
3295
  if (generator) {
3296
+ if (statement.reduction) {
3297
+ children.unshift({
3298
+ type: "Error",
3299
+ message: `Cannot use reduction (${statement.reduction.subtype}) with generators`
3300
+ });
3301
+ }
3302
+ iterationDefaultBody(statement);
3069
3303
  assignResults(block, (node) => {
3070
3304
  return {
3071
3305
  type: "YieldExpression",
3072
3306
  expression: node,
3073
- children: ["yield ", node]
3307
+ children: [
3308
+ {
3309
+ type: "Yield",
3310
+ token: "yield "
3311
+ },
3312
+ node
3313
+ ]
3074
3314
  };
3075
3315
  });
3076
- children.splice(
3077
- i,
3078
- 1,
3079
- wrapIIFE([
3080
- ["", statement, void 0],
3081
- // Prevent implicit return in generator, by adding an explicit return
3082
- ["", {
3083
- type: "ReturnStatement",
3084
- expression: void 0,
3085
- children: [";return"]
3086
- }, void 0]
3087
- ], async, generator)
3088
- );
3316
+ statements = [
3317
+ ["", statement]
3318
+ ];
3089
3319
  } else {
3090
3320
  const resultsRef = statement.resultsRef ??= makeRef("results");
3091
- const { declaration, breakWithOnly } = iterationDeclaration(statement);
3092
- if (!breakWithOnly) {
3093
- assignResults(block, (node) => {
3094
- return [resultsRef, ".push(", node, ")"];
3095
- });
3096
- braceBlock(block);
3321
+ const declaration = iterationDeclaration(statement);
3322
+ statements = [
3323
+ ["", declaration, ";"],
3324
+ ["", statement, statement.block.bare ? ";" : void 0],
3325
+ ["", resultsRef]
3326
+ ];
3327
+ }
3328
+ let done;
3329
+ if (!async) {
3330
+ let ref13;
3331
+ if ((ref13 = blockContainingStatement(exp)) && typeof ref13 === "object" && "block" in ref13 && "index" in ref13) {
3332
+ const { block: parentBlock, index } = ref13;
3333
+ statements[0][0] = parentBlock.expressions[index][0];
3334
+ parentBlock.expressions.splice(index, index + 1 - index, ...statements);
3335
+ updateParentPointers(parentBlock);
3336
+ braceBlock(parentBlock);
3337
+ done = true;
3097
3338
  }
3098
- children.splice(
3099
- i,
3100
- 1,
3101
- wrapIIFE([
3102
- ["", declaration, ";"],
3103
- ["", statement, void 0],
3104
- ["", wrapWithReturn(resultsRef)]
3105
- ], async)
3106
- );
3107
3339
  }
3108
- updateParentPointers(exp);
3340
+ if (!done) {
3341
+ if (!generator) {
3342
+ statements[statements.length - 1][1] = wrapWithReturn(statements[statements.length - 1][1]);
3343
+ }
3344
+ children.splice(i, 1, wrapIIFE(statements, async, generator));
3345
+ updateParentPointers(exp);
3346
+ }
3347
+ }
3348
+ function processIterationExpressions(statements) {
3349
+ for (let ref14 = gatherRecursiveAll(statements, ($15) => $15.type === "IterationExpression"), i6 = 0, len5 = ref14.length; i6 < len5; i6++) {
3350
+ const s = ref14[i6];
3351
+ expressionizeIteration(s);
3352
+ }
3109
3353
  }
3110
3354
  function skipImplicitArguments(args) {
3111
3355
  if (args.length === 1) {
@@ -3129,12 +3373,12 @@ ${js}`
3129
3373
  ...parameters,
3130
3374
  children: (() => {
3131
3375
  const results1 = [];
3132
- for (let ref10 = parameters.children, i3 = 0, len22 = ref10.length; i3 < len22; i3++) {
3133
- let parameter = ref10[i3];
3376
+ for (let ref15 = parameters.children, i7 = 0, len6 = ref15.length; i7 < len6; i7++) {
3377
+ let parameter = ref15[i7];
3134
3378
  if (typeof parameter === "object" && parameter != null && "type" in parameter && parameter.type === "Parameter") {
3135
- let ref11;
3136
- if (ref11 = parameter.initializer) {
3137
- const initializer = ref11;
3379
+ let ref16;
3380
+ if (ref16 = parameter.initializer) {
3381
+ const initializer = ref16;
3138
3382
  args.push(initializer.expression, parameter.delim);
3139
3383
  parameter = {
3140
3384
  ...parameter,
@@ -3155,7 +3399,7 @@ ${js}`
3155
3399
  expression = {
3156
3400
  ...expression,
3157
3401
  parameters: newParameters,
3158
- children: expression.children.map(($13) => $13 === parameters ? newParameters : $13)
3402
+ children: expression.children.map(($16) => $16 === parameters ? newParameters : $16)
3159
3403
  };
3160
3404
  }
3161
3405
  return {
@@ -3177,7 +3421,7 @@ ${js}`
3177
3421
  ref = makeRef("$");
3178
3422
  inplacePrepend(ref, body);
3179
3423
  }
3180
- if (startsWithPredicate(body, ($14) => $14.type === "ObjectExpression")) {
3424
+ if (startsWithPredicate(body, ($17) => $17.type === "ObjectExpression")) {
3181
3425
  body = makeLeftHandSideExpression(body);
3182
3426
  }
3183
3427
  const parameters = makeNode({
@@ -3417,6 +3661,28 @@ ${js}`
3417
3661
  }
3418
3662
  }
3419
3663
  }
3664
+ function blockContainingStatement(exp) {
3665
+ let child = exp;
3666
+ let parent = exp.parent;
3667
+ let m;
3668
+ while (parent != null && (m = parent.type, m === "StatementExpression" || m === "PipelineExpression" || m === "UnwrappedExpression")) {
3669
+ child = parent;
3670
+ parent = parent.parent;
3671
+ }
3672
+ if (!(parent?.type === "BlockStatement")) {
3673
+ return;
3674
+ }
3675
+ const index = findChildIndex(parent.expressions, child);
3676
+ assert.notEqual(index, -1, "Could not find statement in parent block");
3677
+ if (!(parent.expressions[index][1] === child)) {
3678
+ return;
3679
+ }
3680
+ return {
3681
+ block: parent,
3682
+ index,
3683
+ child
3684
+ };
3685
+ }
3420
3686
 
3421
3687
  // source/parser/op.civet
3422
3688
  var precedenceOrder = [
@@ -4678,8 +4944,9 @@ ${js}`
4678
4944
 
4679
4945
  // source/parser/unary.civet
4680
4946
  function processUnaryExpression(pre, exp, post) {
4681
- if (!(pre.length || post))
4947
+ if (!(pre.length || post)) {
4682
4948
  return exp;
4949
+ }
4683
4950
  if (post?.token === "?") {
4684
4951
  post = {
4685
4952
  $loc: post.$loc,
@@ -4710,29 +4977,25 @@ ${js}`
4710
4977
  }
4711
4978
  return exp;
4712
4979
  }
4713
- if (exp.type === "Literal") {
4714
- if (pre.length === 1) {
4715
- const { token } = pre[0];
4716
- if (token === "-" || token === "+") {
4717
- const children = [pre[0], ...exp.children];
4718
- const literal = {
4719
- type: "Literal",
4720
- children,
4721
- raw: `${token}${exp.raw}`
4722
- };
4723
- if (post) {
4724
- return {
4725
- type: "UnaryExpression",
4726
- children: [literal, post]
4727
- };
4728
- }
4729
- return literal;
4980
+ if (exp?.type === "Literal" && pre.length) {
4981
+ let [...ref] = pre, [last] = ref.splice(-1);
4982
+ let m;
4983
+ if (m = last?.token, m === "+" || m === "-") {
4984
+ last = last;
4985
+ exp = {
4986
+ ...exp,
4987
+ children: [last, ...exp.children],
4988
+ raw: `${last.token}${exp.raw}`
4989
+ };
4990
+ pre = pre.slice(0, -1);
4991
+ if (!(pre.length || post)) {
4992
+ return exp;
4730
4993
  }
4731
4994
  }
4732
4995
  }
4733
- let ref;
4734
- while (ref = pre.length) {
4735
- const l = ref;
4996
+ let ref1;
4997
+ while (ref1 = pre.length) {
4998
+ const l = ref1;
4736
4999
  const last = pre[l - 1];
4737
5000
  if (last.type === "Await") {
4738
5001
  if (last.op) {
@@ -4745,8 +5008,8 @@ ${js}`
4745
5008
  };
4746
5009
  pre = pre.slice(0, -1);
4747
5010
  } else {
4748
- let m;
4749
- if (m = firstNonSpace(exp), typeof m === "string" && /^[ \t]*\n/.test(m) || typeof m === "object" && m != null && "token" in m && typeof m.token === "string" && /^[ \t]*\n/.test(m.token)) {
5011
+ let m1;
5012
+ if (m1 = firstNonSpace(exp), typeof m1 === "string" && /^[ \t]*\n/.test(m1) || typeof m1 === "object" && m1 != null && "token" in m1 && typeof m1.token === "string" && /^[ \t]*\n/.test(m1.token)) {
4750
5013
  exp = parenthesizeExpression(exp);
4751
5014
  }
4752
5015
  exp = {
@@ -4850,6 +5113,7 @@ ${js}`
4850
5113
  updateParentPointers(ref);
4851
5114
  return makeNode({
4852
5115
  type: "UnwrappedExpression",
5116
+ expression: body,
4853
5117
  children: [skipIfOnlyWS(fn.leadingComment), body, skipIfOnlyWS(fn.trailingComment)]
4854
5118
  });
4855
5119
  }
@@ -4886,6 +5150,17 @@ ${js}`
4886
5150
  returning
4887
5151
  ];
4888
5152
  }
5153
+ case "throw": {
5154
+ const statement = { type: "ThrowStatement", children };
5155
+ return [
5156
+ {
5157
+ type: "StatementExpression",
5158
+ statement,
5159
+ children: [statement]
5160
+ },
5161
+ null
5162
+ ];
5163
+ }
4889
5164
  case "return": {
4890
5165
  return [{
4891
5166
  type: "ReturnStatement",
@@ -5170,25 +5445,40 @@ ${js}`
5170
5445
  const infinite = typeof end === "object" && end != null && "type" in end && end.type === "Identifier" && "name" in end && end.name === "Infinity";
5171
5446
  let stepRef, asc;
5172
5447
  if (stepExp) {
5173
- stepExp = insertTrimmingSpace(stepExp, "");
5448
+ stepExp = trimFirstSpace(stepExp);
5174
5449
  stepRef = maybeRef(stepExp, "step");
5175
5450
  } else if (infinite) {
5176
- stepExp = stepRef = "1";
5451
+ stepExp = stepRef = makeNumericLiteral(1);
5177
5452
  } else if (increasing != null) {
5178
5453
  if (increasing) {
5179
- stepExp = stepRef = "1";
5454
+ stepExp = stepRef = makeNumericLiteral(1);
5180
5455
  asc = true;
5181
5456
  } else {
5182
- stepExp = stepRef = "-1";
5457
+ stepExp = stepRef = makeNumericLiteral(-1);
5183
5458
  asc = false;
5184
5459
  }
5185
5460
  }
5186
5461
  let ref2;
5462
+ if (stepExp?.type === "Literal") {
5463
+ try {
5464
+ ref2 = literalValue(stepExp);
5465
+ } catch (e) {
5466
+ ref2 = void 0;
5467
+ }
5468
+ } else {
5469
+ ref2 = void 0;
5470
+ }
5471
+ ;
5472
+ const stepValue = ref2;
5473
+ if (typeof stepValue === "number") {
5474
+ asc = stepValue > 0;
5475
+ }
5476
+ let ref3;
5187
5477
  if (stepRef)
5188
- ref2 = start;
5478
+ ref3 = start;
5189
5479
  else
5190
- ref2 = maybeRef(start, "start");
5191
- let startRef = ref2;
5480
+ ref3 = maybeRef(start, "start");
5481
+ let startRef = ref3;
5192
5482
  let endRef = maybeRef(end, "end");
5193
5483
  const startRefDec = startRef !== start ? [startRef, " = ", start, ", "] : [];
5194
5484
  const endRefDec = endRef !== end ? [endRef, " = ", end, ", "] : [];
@@ -5200,11 +5490,11 @@ ${js}`
5200
5490
  ];
5201
5491
  }
5202
5492
  let ascDec = [], ascRef;
5203
- if (stepRef) {
5493
+ if (stepExp) {
5204
5494
  if (!(stepRef === stepExp)) {
5205
5495
  ascDec = [", ", stepRef, " = ", stepExp];
5206
5496
  }
5207
- } else if ("Literal" === start.type && start.type === end.type) {
5497
+ } else if (start?.type === "Literal" && "Literal" === end?.type) {
5208
5498
  asc = literalValue(start) <= literalValue(end);
5209
5499
  if ("StringLiteral" === start.subtype && start.subtype === end.subtype) {
5210
5500
  startRef = literalValue(start).charCodeAt(0).toString();
@@ -5215,10 +5505,11 @@ ${js}`
5215
5505
  ascDec = [", ", ascRef, " = ", startRef, " <= ", endRef];
5216
5506
  }
5217
5507
  let varAssign = [], varLetAssign = varAssign, varLet = varAssign, blockPrefix;
5218
- if (forDeclaration?.declare) {
5219
- if (forDeclaration.declare.token === "let") {
5508
+ let names = forDeclaration?.names;
5509
+ if (forDeclaration?.decl) {
5510
+ if (forDeclaration.decl === "let") {
5220
5511
  const varName = forDeclaration.children.splice(1);
5221
- varAssign = [...insertTrimmingSpace(varName, ""), " = "];
5512
+ varAssign = [...trimFirstSpace(varName), " = "];
5222
5513
  varLet = [",", ...varName, " = ", counterRef];
5223
5514
  } else {
5224
5515
  const value = "StringLiteral" === start.subtype ? ["String.fromCharCode(", counterRef, ")"] : counterRef;
@@ -5227,26 +5518,41 @@ ${js}`
5227
5518
  ];
5228
5519
  }
5229
5520
  } else if (forDeclaration) {
5521
+ assert.equal(
5522
+ forDeclaration.type,
5523
+ "AssignmentExpression",
5524
+ "Internal error: Coffee-style for loop must be an assignment expression"
5525
+ );
5230
5526
  varAssign = varLetAssign = [forDeclaration, " = "];
5527
+ names = [];
5231
5528
  }
5232
5529
  const declaration = {
5233
5530
  type: "Declaration",
5234
5531
  children: ["let ", ...startRefDec, ...endRefDec, counterRef, " = ", ...varLetAssign, startRef, ...varLet, ...ascDec],
5235
- names: forDeclaration?.names
5532
+ names
5236
5533
  };
5237
5534
  const counterPart = right.inclusive ? [counterRef, " <= ", endRef, " : ", counterRef, " >= ", endRef] : [counterRef, " < ", endRef, " : ", counterRef, " > ", endRef];
5238
- const condition = infinite ? [] : asc != null ? asc ? counterPart.slice(0, 3) : counterPart.slice(4) : stepRef ? [stepRef, " !== 0 && (", stepRef, " > 0 ? ", ...counterPart, ")"] : [ascRef, " ? ", ...counterPart];
5239
- const increment = stepRef === "1" ? [...varAssign, "++", counterRef] : stepRef === "-1" ? [...varAssign, "--", counterRef] : stepRef ? [...varAssign, counterRef, " += ", stepRef] : ascRef ? [...varAssign, ascRef, " ? ++", counterRef, " : --", counterRef] : [...varAssign, asc ? "++" : "--", counterRef];
5535
+ const condition = infinite || stepValue === 0 ? [] : asc != null ? asc ? counterPart.slice(0, 3) : counterPart.slice(4) : stepRef ? [stepRef, " !== 0 && (", stepRef, " > 0 ? ", ...counterPart, ")"] : [ascRef, " ? ", ...counterPart];
5536
+ const increment = stepValue === 1 ? [...varAssign, "++", counterRef] : stepValue === -1 ? [...varAssign, "--", counterRef] : stepRef ? [...varAssign, counterRef, " += ", stepRef] : ascRef ? [...varAssign, ascRef, " ? ++", counterRef, " : --", counterRef] : [...varAssign, asc ? "++" : "--", counterRef];
5240
5537
  return {
5241
- declaration,
5538
+ // This declaration doesn't always appear in the output,
5539
+ // but it's still helpful for determining the primary loop variable
5540
+ declaration: forDeclaration,
5242
5541
  children: [range.error, open, declaration, "; ", ...condition, "; ", ...increment, close],
5243
5542
  blockPrefix
5244
5543
  };
5245
5544
  }
5246
- function processForInOf($0, getRef) {
5545
+ function processForInOf($0) {
5247
5546
  let [awaits, eachOwn, open, declaration, declaration2, ws, inOf, exp, step, close] = $0;
5248
5547
  if (exp.type === "RangeExpression" && inOf.token === "of" && !declaration2) {
5249
- return forRange(open, declaration, exp, step, close);
5548
+ return forRange(
5549
+ open,
5550
+ declaration,
5551
+ exp,
5552
+ step && prepend(trimFirstSpace(step[0]), trimFirstSpace(step[2])),
5553
+ // omit "by" token
5554
+ close
5555
+ );
5250
5556
  } else if (step) {
5251
5557
  throw new Error("for..of/in cannot use 'by' except with range literals");
5252
5558
  }
@@ -5262,22 +5568,22 @@ ${js}`
5262
5568
  if (declaration2) {
5263
5569
  const [, , ws22, decl22] = declaration2;
5264
5570
  blockPrefix.push(["", [
5265
- insertTrimmingSpace(ws22, ""),
5571
+ trimFirstSpace(ws22),
5266
5572
  decl22,
5267
5573
  " = ",
5268
5574
  counterRef
5269
5575
  ], ";"]);
5270
5576
  assignmentNames.push(...decl22.names);
5271
5577
  }
5272
- const expRefDec = expRef2 !== exp ? [insertTrimmingSpace(expRef2, " "), " = ", insertTrimmingSpace(exp, ""), ", "] : [];
5578
+ const expRefDec = expRef2 !== exp ? [trimFirstSpace(expRef2), " = ", trimFirstSpace(exp), ", "] : [];
5273
5579
  blockPrefix.push(["", {
5274
5580
  type: "Declaration",
5275
- children: [declaration, " = ", insertTrimmingSpace(expRef2, ""), "[", counterRef, "]"],
5581
+ children: [declaration, " = ", trimFirstSpace(expRef2), "[", counterRef, "]"],
5276
5582
  names: assignmentNames
5277
5583
  }, ";"]);
5278
5584
  declaration = {
5279
5585
  type: "Declaration",
5280
- children: ["let ", ...expRefDec, counterRef, " = 0, ", lenRef, " = ", insertTrimmingSpace(expRef2, ""), ".length"],
5586
+ children: ["let ", ...expRefDec, counterRef, " = 0, ", lenRef, " = ", trimFirstSpace(expRef2), ".length"],
5281
5587
  names: []
5282
5588
  };
5283
5589
  const condition = [counterRef, " < ", lenRef, "; "];
@@ -5325,7 +5631,7 @@ ${js}`
5325
5631
  return {
5326
5632
  declaration,
5327
5633
  blockPrefix,
5328
- children: [awaits, eachOwnError, open, declaration, ws, inOf, expRef ?? exp, step, close]
5634
+ children: [awaits, eachOwnError, open, declaration, ws, inOf, expRef ?? exp, close]
5329
5635
  // omit declaration2, replace eachOwn with eachOwnError, replace exp with expRef
5330
5636
  };
5331
5637
  }
@@ -5342,7 +5648,7 @@ ${js}`
5342
5648
  };
5343
5649
  blockPrefix.push(["", {
5344
5650
  type: "Declaration",
5345
- children: [insertTrimmingSpace(ws2, ""), decl2, " = ", counterRef, "++"],
5651
+ children: [trimFirstSpace(ws2), decl2, " = ", counterRef, "++"],
5346
5652
  names: decl2.names
5347
5653
  }, ";"]);
5348
5654
  break;
@@ -5361,13 +5667,13 @@ ${js}`
5361
5667
  };
5362
5668
  }
5363
5669
  if (own) {
5364
- const hasPropRef = getRef("hasProp");
5365
- blockPrefix.push(["", ["if (!", hasPropRef, "(", insertTrimmingSpace(expRef2, ""), ", ", insertTrimmingSpace(pattern, ""), ")) continue"], ";"]);
5670
+ const hasPropRef = getHelperRef("hasProp");
5671
+ blockPrefix.push(["", ["if (!", hasPropRef, "(", trimFirstSpace(expRef2), ", ", trimFirstSpace(pattern), ")) continue"], ";"]);
5366
5672
  }
5367
5673
  if (decl2) {
5368
5674
  blockPrefix.push(["", {
5369
5675
  type: "Declaration",
5370
- children: [insertTrimmingSpace(ws2, ""), decl2, " = ", insertTrimmingSpace(expRef2, ""), "[", insertTrimmingSpace(pattern, ""), "]"],
5676
+ children: [trimFirstSpace(ws2), decl2, " = ", trimFirstSpace(expRef2), "[", trimFirstSpace(pattern), "]"],
5371
5677
  names: decl2.names
5372
5678
  }, ";"]);
5373
5679
  }
@@ -5380,7 +5686,7 @@ ${js}`
5380
5686
  }
5381
5687
  return {
5382
5688
  declaration,
5383
- children: [awaits, eachOwnError, open, declaration, ws, inOf, exp, step, close],
5689
+ children: [awaits, eachOwnError, open, declaration, ws, inOf, exp, close],
5384
5690
  // omit declaration2, replace each with eachOwnError
5385
5691
  blockPrefix,
5386
5692
  hoistDec
@@ -5513,7 +5819,7 @@ ${js}`
5513
5819
  return createVarDecs(block2, scopes, pushVar);
5514
5820
  });
5515
5821
  forNodes.forEach(({ block: block2, declaration }) => {
5516
- scopes.push(new Set(declaration.names));
5822
+ scopes.push(new Set(declaration?.names));
5517
5823
  createVarDecs(block2, scopes, pushVar);
5518
5824
  return scopes.pop();
5519
5825
  });
@@ -6477,8 +6783,8 @@ ${js}`
6477
6783
  tail.push(...splices.map((s) => [", ", s]), ...thisAssignments.map((a) => [", ", a]));
6478
6784
  }
6479
6785
  function processAssignments(statements) {
6480
- gatherRecursiveAll(statements, (n) => n.type === "AssignmentExpression" || n.type === "UpdateExpression").forEach((exp) => {
6481
- function extractAssignment(lhs) {
6786
+ for (let ref6 = gatherRecursiveAll(statements, ($3) => $3.type === "AssignmentExpression" || $3.type === "UpdateExpression"), i5 = 0, len4 = ref6.length; i5 < len4; i5++) {
6787
+ let extractAssignment2 = function(lhs) {
6482
6788
  let expr = lhs;
6483
6789
  while (expr.type === "ParenthesizedExpression") {
6484
6790
  expr = expr.expression;
@@ -6496,17 +6802,20 @@ ${js}`
6496
6802
  }
6497
6803
  ;
6498
6804
  return;
6499
- }
6805
+ };
6806
+ var extractAssignment = extractAssignment2;
6807
+ const exp = ref6[i5];
6500
6808
  const pre = [], post = [];
6501
- let ref6;
6809
+ let ref7;
6502
6810
  switch (exp.type) {
6503
6811
  case "AssignmentExpression": {
6504
- if (!exp.lhs)
6505
- return;
6812
+ if (!exp.lhs) {
6813
+ continue;
6814
+ }
6506
6815
  exp.lhs.forEach((lhsPart, i) => {
6507
- let ref7;
6508
- if (ref7 = extractAssignment(lhsPart[1])) {
6509
- const newLhs = ref7;
6816
+ let ref8;
6817
+ if (ref8 = extractAssignment2(lhsPart[1])) {
6818
+ const newLhs = ref8;
6510
6819
  return lhsPart[1] = newLhs;
6511
6820
  }
6512
6821
  ;
@@ -6515,8 +6824,8 @@ ${js}`
6515
6824
  break;
6516
6825
  }
6517
6826
  case "UpdateExpression": {
6518
- if (ref6 = extractAssignment(exp.assigned)) {
6519
- const newLhs = ref6;
6827
+ if (ref7 = extractAssignment2(exp.assigned)) {
6828
+ const newLhs = ref7;
6520
6829
  const i = exp.children.indexOf(exp.assigned);
6521
6830
  exp.assigned = exp.children[i] = newLhs;
6522
6831
  }
@@ -6524,15 +6833,17 @@ ${js}`
6524
6833
  break;
6525
6834
  }
6526
6835
  }
6527
- if (pre.length)
6836
+ if (pre.length) {
6528
6837
  exp.children.unshift(...pre);
6529
- if (post.length)
6838
+ }
6839
+ if (post.length) {
6530
6840
  exp.children.push(...post);
6841
+ }
6531
6842
  if (exp.type === "UpdateExpression") {
6532
6843
  const { assigned } = exp;
6533
6844
  const ref = makeRef();
6534
6845
  const newMemberExp = unchainOptionalMemberExpression(assigned, ref, (children) => {
6535
- return exp.children.map(($3) => $3 === assigned ? children : $3);
6846
+ return exp.children.map(($4) => $4 === assigned ? children : $4);
6536
6847
  });
6537
6848
  if (newMemberExp !== assigned) {
6538
6849
  if (newMemberExp.usesRef) {
@@ -6542,169 +6853,163 @@ ${js}`
6542
6853
  names: []
6543
6854
  };
6544
6855
  }
6545
- return replaceNode(exp, newMemberExp);
6856
+ replaceNode(exp, newMemberExp);
6546
6857
  }
6547
- ;
6548
- return;
6549
6858
  }
6550
- ;
6551
- return;
6552
- });
6553
- replaceNodesRecursive(
6554
- statements,
6555
- (n) => n.type === "AssignmentExpression" && n.names === null,
6556
- (exp) => {
6557
- let { lhs: $1, expression: $2 } = exp, tail = [], len3 = $1.length;
6558
- let block;
6559
- let ref8;
6560
- if (exp.parent?.type === "BlockStatement" && !(ref8 = $1[$1.length - 1])?.[ref8.length - 1]?.special) {
6561
- block = makeBlockFragment();
6562
- let ref9;
6563
- if (ref9 = prependStatementExpressionBlock(
6564
- { type: "Initializer", expression: $2, children: [void 0, void 0, $2] },
6565
- block
6566
- )) {
6567
- const ref = ref9;
6568
- exp.children = exp.children.map(($4) => $4 === $2 ? ref : $4);
6569
- $2 = ref;
6570
- } else {
6571
- block = void 0;
6572
- }
6859
+ }
6860
+ for (let ref9 = gatherRecursiveAll(statements, ($5) => $5.type === "AssignmentExpression"), i6 = 0, len5 = ref9.length; i6 < len5; i6++) {
6861
+ const exp = ref9[i6];
6862
+ if (!(exp.names === null)) {
6863
+ continue;
6864
+ }
6865
+ let { lhs: $1, expression: $2 } = exp, tail = [], len3 = $1.length;
6866
+ let block;
6867
+ let ref10;
6868
+ if (exp.parent?.type === "BlockStatement" && !(ref10 = $1[$1.length - 1])?.[ref10.length - 1]?.special) {
6869
+ block = makeBlockFragment();
6870
+ let ref11;
6871
+ if (ref11 = prependStatementExpressionBlock(
6872
+ { type: "Initializer", expression: $2, children: [void 0, void 0, $2] },
6873
+ block
6874
+ )) {
6875
+ const ref = ref11;
6876
+ exp.children = exp.children.map(($6) => $6 === $2 ? ref : $6);
6877
+ $2 = ref;
6878
+ } else {
6879
+ block = void 0;
6573
6880
  }
6574
- let ref10;
6575
- if ($1.some(($5) => (ref10 = $5)[ref10.length - 1].special)) {
6576
- if ($1.length !== 1)
6577
- throw new Error("Only one assignment with id= is allowed");
6578
- const [, lhs, , op] = $1[0];
6579
- const { call, omitLhs } = op;
6580
- const index = exp.children.indexOf($2);
6581
- if (index < 0)
6582
- throw new Error("Assertion error: exp not in AssignmentExpression");
6583
- exp.children.splice(
6584
- index,
6585
- 1,
6586
- exp.expression = $2 = [call, "(", lhs, ", ", $2, ")"]
6587
- );
6588
- if (omitLhs) {
6589
- return $2;
6590
- }
6881
+ }
6882
+ let ref12;
6883
+ if ($1.some(($7) => (ref12 = $7)[ref12.length - 1].special)) {
6884
+ if ($1.length !== 1)
6885
+ throw new Error("Only one assignment with id= is allowed");
6886
+ const [, lhs, , op] = $1[0];
6887
+ const { call, omitLhs } = op;
6888
+ const index = exp.children.indexOf($2);
6889
+ if (index < 0)
6890
+ throw new Error("Assertion error: exp not in AssignmentExpression");
6891
+ exp.children.splice(
6892
+ index,
6893
+ 1,
6894
+ exp.expression = $2 = [call, "(", lhs, ", ", $2, ")"]
6895
+ );
6896
+ if (omitLhs) {
6897
+ replaceNode(exp, $2);
6898
+ continue;
6591
6899
  }
6592
- let wrapped = false;
6593
- let i = 0;
6594
- while (i < len3) {
6595
- const lastAssignment = $1[i++];
6596
- const [, lhs, , op] = lastAssignment;
6597
- if (!(op.token === "=")) {
6598
- continue;
6599
- }
6600
- let m2;
6601
- if (m2 = lhs.type, m2 === "ObjectExpression" || m2 === "ObjectBindingPattern") {
6602
- if (!wrapped) {
6603
- wrapped = true;
6604
- lhs.children.splice(0, 0, "(");
6605
- tail.push(")");
6606
- }
6900
+ }
6901
+ let wrapped = false;
6902
+ let i = 0;
6903
+ while (i < len3) {
6904
+ const lastAssignment = $1[i++];
6905
+ const [, lhs, , op] = lastAssignment;
6906
+ if (!(op.token === "=")) {
6907
+ continue;
6908
+ }
6909
+ let m2;
6910
+ if (m2 = lhs.type, m2 === "ObjectExpression" || m2 === "ObjectBindingPattern") {
6911
+ if (!wrapped) {
6912
+ wrapped = true;
6913
+ lhs.children.splice(0, 0, "(");
6914
+ tail.push(")");
6607
6915
  }
6608
6916
  }
6609
- const refsToDeclare = /* @__PURE__ */ new Set();
6610
- i = len3 - 1;
6611
- while (i >= 0) {
6612
- const lastAssignment = $1[i];
6613
- if (lastAssignment[3].token === "=") {
6614
- const lhs = lastAssignment[1];
6615
- let m3;
6616
- if (lhs.type === "MemberExpression") {
6617
- const members = lhs.children;
6618
- const lastMember = members[members.length - 1];
6619
- if (typeof lastMember === "object" && lastMember != null && "type" in lastMember && lastMember.type === "CallExpression" && "children" in lastMember && Array.isArray(lastMember.children) && lastMember.children.length >= 1 && lastMember.children[0] === peekHelperRef("rslice")) {
6620
- lastMember.children.push({
6621
- type: "Error",
6622
- message: "Slice range cannot be decreasing in assignment"
6623
- });
6624
- break;
6917
+ }
6918
+ const refsToDeclare = /* @__PURE__ */ new Set();
6919
+ i = len3 - 1;
6920
+ while (i >= 0) {
6921
+ const lastAssignment = $1[i];
6922
+ if (lastAssignment[3].token === "=") {
6923
+ const lhs = lastAssignment[1];
6924
+ let m3;
6925
+ if (lhs.type === "MemberExpression") {
6926
+ const members = lhs.children;
6927
+ const lastMember = members[members.length - 1];
6928
+ if (typeof lastMember === "object" && lastMember != null && "type" in lastMember && lastMember.type === "CallExpression" && "children" in lastMember && Array.isArray(lastMember.children) && lastMember.children.length >= 1 && lastMember.children[0] === peekHelperRef("rslice")) {
6929
+ lastMember.children.push({
6930
+ type: "Error",
6931
+ message: "Slice range cannot be decreasing in assignment"
6932
+ });
6933
+ break;
6934
+ }
6935
+ if (lastMember.type === "SliceExpression") {
6936
+ const { start, end, children: c } = lastMember;
6937
+ c[0].token = ".splice(";
6938
+ c[1] = start;
6939
+ c[2] = ", ";
6940
+ if (end) {
6941
+ c[3] = [end, " - ", start];
6942
+ } else {
6943
+ c[3] = ["1/0"];
6625
6944
  }
6626
- if (lastMember.type === "SliceExpression") {
6627
- const { start, end, children: c } = lastMember;
6628
- c[0].token = ".splice(";
6629
- c[1] = start;
6630
- c[2] = ", ";
6631
- if (end) {
6632
- c[3] = [end, " - ", start];
6633
- } else {
6634
- c[3] = ["1/0"];
6635
- }
6636
- c[4] = [", ...", $2];
6637
- c[5] = ")";
6945
+ c[4] = [", ...", $2];
6946
+ c[5] = ")";
6947
+ lastAssignment.pop();
6948
+ if (isWhitespaceOrEmpty(lastAssignment[2]))
6638
6949
  lastAssignment.pop();
6639
- if (isWhitespaceOrEmpty(lastAssignment[2]))
6640
- lastAssignment.pop();
6641
- if ($1.length > 1) {
6642
- throw new Error("Not implemented yet! TODO: Handle multiple splice assignments");
6643
- }
6644
- exp.children = [$1];
6645
- exp.names = [];
6646
- break;
6950
+ if ($1.length > 1) {
6951
+ throw new Error("Not implemented yet! TODO: Handle multiple splice assignments");
6647
6952
  }
6648
- } else if (m3 = lhs.type, m3 === "ObjectBindingPattern" || m3 === "ArrayBindingPattern") {
6649
- processBindingPatternLHS(lhs, tail);
6650
- gatherRecursiveAll(lhs, ($6) => $6.type === "Ref").forEach(refsToDeclare.add.bind(refsToDeclare));
6953
+ exp.children = [$1];
6954
+ exp.names = [];
6955
+ break;
6651
6956
  }
6957
+ } else if (m3 = lhs.type, m3 === "ObjectBindingPattern" || m3 === "ArrayBindingPattern") {
6958
+ processBindingPatternLHS(lhs, tail);
6959
+ gatherRecursiveAll(lhs, ($8) => $8.type === "Ref").forEach(refsToDeclare.add.bind(refsToDeclare));
6652
6960
  }
6653
- i--;
6654
6961
  }
6655
- i = len3 - 1;
6656
- const optionalChainRef = makeRef();
6657
- while (i >= 0) {
6658
- const assignment = $1[i];
6659
- const [ws1, lhs, ws2, op] = assignment;
6660
- if (lhs.type === "MemberExpression" || lhs.type === "CallExpression") {
6661
- const newMemberExp = unchainOptionalMemberExpression(lhs, optionalChainRef, (children) => {
6662
- const assigns = $1.splice(i + 1, len3 - 1 - i);
6663
- $1.pop();
6664
- return [ws1, ...children, ws2, op, ...assigns, $2];
6665
- });
6666
- if (newMemberExp !== lhs) {
6667
- if (newMemberExp.usesRef) {
6668
- exp.hoistDec = {
6669
- type: "Declaration",
6670
- children: ["let ", optionalChainRef],
6671
- names: []
6672
- };
6673
- }
6674
- replaceNode($2, newMemberExp);
6675
- newMemberExp.parent = exp;
6676
- $2 = newMemberExp;
6962
+ i--;
6963
+ }
6964
+ i = len3 - 1;
6965
+ const optionalChainRef = makeRef();
6966
+ while (i >= 0) {
6967
+ const assignment = $1[i];
6968
+ const [ws1, lhs, ws2, op] = assignment;
6969
+ if (lhs.type === "MemberExpression" || lhs.type === "CallExpression") {
6970
+ const newMemberExp = unchainOptionalMemberExpression(lhs, optionalChainRef, (children) => {
6971
+ const assigns = $1.splice(i + 1, len3 - 1 - i);
6972
+ $1.pop();
6973
+ return [ws1, ...children, ws2, op, ...assigns, $2];
6974
+ });
6975
+ if (newMemberExp !== lhs) {
6976
+ if (newMemberExp.usesRef) {
6977
+ exp.hoistDec = {
6978
+ type: "Declaration",
6979
+ children: ["let ", optionalChainRef],
6980
+ names: []
6981
+ };
6677
6982
  }
6983
+ replaceNode($2, newMemberExp);
6984
+ $2 = newMemberExp;
6678
6985
  }
6679
- i--;
6680
6986
  }
6681
- if (refsToDeclare.size) {
6682
- if (exp.hoistDec) {
6683
- exp.hoistDec.children.push([...refsToDeclare].map(($7) => [",", $7]));
6684
- } else {
6685
- exp.hoistDec = {
6686
- type: "Declaration",
6687
- children: ["let ", [...refsToDeclare].map((r, i2) => i2 ? [",", r] : r)],
6688
- names: []
6689
- };
6690
- }
6691
- }
6692
- exp.names = $1.flatMap(([, l]) => l.names || []);
6693
- if (tail.length) {
6694
- const index = exp.children.indexOf($2);
6695
- if (index < 0)
6696
- throw new Error("Assertion error: exp not in AssignmentExpression");
6697
- exp.children.splice(index + 1, 0, ...tail);
6698
- }
6699
- if (block) {
6700
- block.parent = exp.parent;
6701
- block.expressions.push(["", exp]);
6702
- exp.parent = block;
6703
- return block;
6987
+ i--;
6988
+ }
6989
+ if (refsToDeclare.size) {
6990
+ if (exp.hoistDec) {
6991
+ exp.hoistDec.children.push([...refsToDeclare].map(($9) => [",", $9]));
6992
+ } else {
6993
+ exp.hoistDec = {
6994
+ type: "Declaration",
6995
+ children: ["let ", [...refsToDeclare].map((r, i2) => i2 ? [",", r] : r)],
6996
+ names: []
6997
+ };
6704
6998
  }
6705
- return exp;
6706
6999
  }
6707
- );
7000
+ exp.names = $1.flatMap(([, l]) => l.names || []);
7001
+ if (tail.length) {
7002
+ const index = exp.children.indexOf($2);
7003
+ if (index < 0)
7004
+ throw new Error("Assertion error: exp not in AssignmentExpression");
7005
+ exp.children.splice(index + 1, 0, ...tail);
7006
+ }
7007
+ if (block) {
7008
+ replaceNode(exp, block);
7009
+ block.expressions.push(["", exp]);
7010
+ exp.parent = block;
7011
+ }
7012
+ }
6708
7013
  }
6709
7014
  function unchainOptionalMemberExpression(exp, ref, innerExp) {
6710
7015
  let j = 0;
@@ -6754,9 +7059,9 @@ ${js}`
6754
7059
  }
6755
7060
  j++;
6756
7061
  }
6757
- let ref11;
6758
- if (ref11 = conditions.length) {
6759
- const l = ref11;
7062
+ let ref13;
7063
+ if (ref13 = conditions.length) {
7064
+ const l = ref13;
6760
7065
  const cs = flatJoin(conditions, " && ");
6761
7066
  return {
6762
7067
  ...exp,
@@ -6795,28 +7100,28 @@ ${js}`
6795
7100
  if (!unary.suffix.length) {
6796
7101
  return;
6797
7102
  }
6798
- let ref12;
7103
+ let ref14;
6799
7104
  let m4;
6800
- if (m4 = (ref12 = unary.suffix)[ref12.length - 1], typeof m4 === "object" && m4 != null && "token" in m4 && m4.token === "?") {
7105
+ if (m4 = (ref14 = unary.suffix)[ref14.length - 1], typeof m4 === "object" && m4 != null && "token" in m4 && m4.token === "?") {
6801
7106
  const { token } = m4;
6802
7107
  let last;
6803
7108
  let count = 0;
6804
- let ref13;
6805
- while (unary.suffix.length && (ref13 = unary.suffix)[ref13.length - 1]?.token === "?") {
7109
+ let ref15;
7110
+ while (unary.suffix.length && (ref15 = unary.suffix)[ref15.length - 1]?.token === "?") {
6806
7111
  last = unary.suffix.pop();
6807
7112
  count++;
6808
7113
  }
6809
- let ref14;
6810
- while (unary.suffix.length && (ref14 = unary.suffix)[ref14.length - 1]?.type === "NonNullAssertion") {
7114
+ let ref16;
7115
+ while (unary.suffix.length && (ref16 = unary.suffix)[ref16.length - 1]?.type === "NonNullAssertion") {
6811
7116
  unary.suffix.pop();
6812
7117
  }
6813
- let ref15;
7118
+ let ref17;
6814
7119
  if (unary.suffix.length || unary.prefix.length)
6815
- ref15 = unary;
7120
+ ref17 = unary;
6816
7121
  else
6817
- ref15 = unary.t;
6818
- const t = ref15;
6819
- if (unary.parent?.type === "TypeTuple") {
7122
+ ref17 = unary.t;
7123
+ const t = ref17;
7124
+ if (unary.parent?.type === "TypeElement" && !unary.parent.name) {
6820
7125
  if (count === 1) {
6821
7126
  unary.suffix.push(last);
6822
7127
  return;
@@ -6843,12 +7148,12 @@ ${js}`
6843
7148
  }
6844
7149
  } else if (typeof m4 === "object" && m4 != null && "type" in m4 && m4.type === "NonNullAssertion") {
6845
7150
  const { type } = m4;
6846
- let ref16;
6847
- while (unary.suffix.length && (ref16 = unary.suffix)[ref16.length - 1]?.type === "NonNullAssertion") {
7151
+ let ref18;
7152
+ while (unary.suffix.length && (ref18 = unary.suffix)[ref18.length - 1]?.type === "NonNullAssertion") {
6848
7153
  unary.suffix.pop();
6849
7154
  }
6850
- let ref17;
6851
- while (unary.suffix.length && (ref17 = unary.suffix)[ref17.length - 1]?.token === "?") {
7155
+ let ref19;
7156
+ while (unary.suffix.length && (ref19 = unary.suffix)[ref19.length - 1]?.token === "?") {
6852
7157
  unary.suffix.pop();
6853
7158
  }
6854
7159
  const t = trimFirstSpace(
@@ -6874,35 +7179,41 @@ ${js}`
6874
7179
  });
6875
7180
  }
6876
7181
  function processStatementExpressions(statements) {
6877
- gatherRecursiveAll(statements, ($8) => $8.type === "StatementExpression").forEach((_exp) => {
6878
- const exp = _exp;
6879
- const { statement } = exp;
6880
- let ref18;
7182
+ for (let ref20 = gatherRecursiveAll(statements, ($10) => $10.type === "StatementExpression"), i7 = 0, len6 = ref20.length; i7 < len6; i7++) {
7183
+ const exp = ref20[i7];
7184
+ const { maybe, statement } = exp;
7185
+ if ((maybe || statement.type === "ThrowStatement") && blockContainingStatement(exp)) {
7186
+ replaceNode(exp, statement);
7187
+ continue;
7188
+ }
7189
+ let ref21;
6881
7190
  switch (statement.type) {
6882
7191
  case "IfStatement": {
6883
- if (ref18 = expressionizeIfStatement(statement)) {
6884
- const expression = ref18;
6885
- return replaceNode(statement, expression, exp);
7192
+ if (ref21 = expressionizeIfStatement(statement)) {
7193
+ const expression = ref21;
7194
+ replaceNode(statement, expression, exp);
6886
7195
  } else {
6887
- return replaceNode(statement, wrapIIFE([["", statement]]), exp);
7196
+ replaceNode(statement, wrapIIFE([["", statement]]), exp);
6888
7197
  }
7198
+ ;
7199
+ break;
6889
7200
  }
6890
7201
  case "IterationExpression": {
6891
7202
  if (statement.subtype === "ComptimeStatement") {
6892
- return replaceNode(
7203
+ replaceNode(
6893
7204
  statement,
6894
7205
  expressionizeComptime(statement.statement),
6895
7206
  exp
6896
7207
  );
6897
7208
  }
6898
7209
  ;
6899
- return;
7210
+ break;
6900
7211
  }
6901
7212
  default: {
6902
- return replaceNode(statement, wrapIIFE([["", statement]]), exp);
7213
+ replaceNode(statement, wrapIIFE([["", statement]]), exp);
6903
7214
  }
6904
7215
  }
6905
- });
7216
+ }
6906
7217
  }
6907
7218
  function processNegativeIndexAccess(statements) {
6908
7219
  gatherRecursiveAll(statements, (n) => n.type === "NegativeIndex").forEach((exp) => {
@@ -6950,7 +7261,7 @@ ${js}`
6950
7261
  if (config2.iife || config2.repl) {
6951
7262
  rootIIFE = wrapIIFE(root.expressions, root.topLevelAwait);
6952
7263
  const newExpressions = [["", rootIIFE]];
6953
- root.children = root.children.map(($9) => $9 === root.expressions ? newExpressions : $9);
7264
+ root.children = root.children.map(($11) => $11 === root.expressions ? newExpressions : $11);
6954
7265
  root.expressions = newExpressions;
6955
7266
  }
6956
7267
  addParentPointers(root);
@@ -6964,7 +7275,7 @@ ${js}`
6964
7275
  processAssignments(statements);
6965
7276
  processStatementExpressions(statements);
6966
7277
  processPatternMatching(statements);
6967
- gatherRecursiveAll(statements, (n) => n.type === "IterationExpression").forEach((e) => expressionizeIteration(e));
7278
+ processIterationExpressions(statements);
6968
7279
  hoistRefDecs(statements);
6969
7280
  processFunctions(statements, config2);
6970
7281
  statements.unshift(...state2.prelude);
@@ -6990,17 +7301,17 @@ ${js}`
6990
7301
  await processComptime(statements);
6991
7302
  }
6992
7303
  function processRepl(root, rootIIFE) {
6993
- const topBlock = gatherRecursive(rootIIFE, ($10) => $10.type === "BlockStatement")[0];
7304
+ const topBlock = gatherRecursive(rootIIFE, ($12) => $12.type === "BlockStatement")[0];
6994
7305
  let i = 0;
6995
- for (let ref19 = gatherRecursiveWithinFunction(topBlock, ($11) => $11.type === "Declaration"), i5 = 0, len4 = ref19.length; i5 < len4; i5++) {
6996
- const decl = ref19[i5];
7306
+ for (let ref22 = gatherRecursiveWithinFunction(topBlock, ($13) => $13.type === "Declaration"), i8 = 0, len7 = ref22.length; i8 < len7; i8++) {
7307
+ const decl = ref22[i8];
6997
7308
  if (decl.parent === topBlock || decl.decl === "var") {
6998
7309
  decl.children.shift();
6999
7310
  root.expressions.splice(i++, 0, ["", `var ${decl.names.join(",")};`]);
7000
7311
  }
7001
7312
  }
7002
- for (let ref20 = gatherRecursive(topBlock, ($12) => $12.type === "FunctionExpression"), i6 = 0, len5 = ref20.length; i6 < len5; i6++) {
7003
- const func = ref20[i6];
7313
+ for (let ref23 = gatherRecursive(topBlock, ($14) => $14.type === "FunctionExpression"), i9 = 0, len8 = ref23.length; i9 < len8; i9++) {
7314
+ const func = ref23[i9];
7004
7315
  if (func.name && func.parent?.type === "BlockStatement") {
7005
7316
  if (func.parent === topBlock) {
7006
7317
  replaceNode(func, void 0);
@@ -7012,8 +7323,8 @@ ${js}`
7012
7323
  }
7013
7324
  }
7014
7325
  }
7015
- for (let ref21 = gatherRecursiveWithinFunction(topBlock, ($13) => $13.type === "ClassExpression"), i7 = 0, len6 = ref21.length; i7 < len6; i7++) {
7016
- const classExp = ref21[i7];
7326
+ for (let ref24 = gatherRecursiveWithinFunction(topBlock, ($15) => $15.type === "ClassExpression"), i10 = 0, len9 = ref24.length; i10 < len9; i10++) {
7327
+ const classExp = ref24[i10];
7017
7328
  let m5;
7018
7329
  if (classExp.name && classExp.parent === topBlock || (m5 = classExp.parent, typeof m5 === "object" && m5 != null && "type" in m5 && m5.type === "ReturnStatement" && "parent" in m5 && m5.parent === topBlock)) {
7019
7330
  classExp.children.unshift(classExp.name, "=");
@@ -7022,7 +7333,7 @@ ${js}`
7022
7333
  }
7023
7334
  }
7024
7335
  function populateRefs(statements) {
7025
- const refNodes = gatherRecursive(statements, ($14) => $14.type === "Ref");
7336
+ const refNodes = gatherRecursive(statements, ($16) => $16.type === "Ref");
7026
7337
  if (refNodes.length) {
7027
7338
  const ids = gatherRecursive(statements, (s) => s.type === "Identifier");
7028
7339
  const names = new Set(ids.flatMap(({ names: names2 }) => names2 || []));
@@ -7045,13 +7356,14 @@ ${js}`
7045
7356
  function processPlaceholders(statements) {
7046
7357
  const placeholderMap = /* @__PURE__ */ new Map();
7047
7358
  const liftedIfs = /* @__PURE__ */ new Set();
7048
- gatherRecursiveAll(statements, ($15) => $15.type === "Placeholder").forEach((_exp) => {
7359
+ gatherRecursiveAll(statements, ($17) => $17.type === "Placeholder").forEach((_exp) => {
7049
7360
  const exp = _exp;
7050
7361
  let ancestor;
7051
7362
  if (exp.subtype === ".") {
7052
- ({ ancestor } = findAncestor(exp, ($16) => $16.type === "Call"));
7363
+ ({ ancestor } = findAncestor(exp, ($18) => $18.type === "Call"));
7053
7364
  ancestor = ancestor?.parent;
7054
- while (ancestor?.parent?.type === "UnaryExpression" || ancestor?.parent?.type === "NewExpression") {
7365
+ let m6;
7366
+ while (ancestor?.parent != null && (m6 = ancestor.parent.type, m6 === "UnaryExpression" || m6 === "NewExpression" || m6 === "AwaitExpression" || m6 === "ThrowStatement" || m6 === "StatementExpression")) {
7055
7367
  ancestor = ancestor.parent;
7056
7368
  }
7057
7369
  if (!ancestor) {
@@ -7068,10 +7380,10 @@ ${js}`
7068
7380
  if (type === "IfStatement") {
7069
7381
  liftedIfs.add(ancestor2);
7070
7382
  }
7071
- let m6;
7072
7383
  let m7;
7384
+ let m8;
7073
7385
  return type === "Call" || // Block, except for if/else blocks when condition already lifted
7074
- type === "BlockStatement" && !((m6 = ancestor2.parent, typeof m6 === "object" && m6 != null && "type" in m6 && m6.type === "IfStatement") && liftedIfs.has(ancestor2.parent)) && !((m7 = ancestor2.parent, typeof m7 === "object" && m7 != null && "type" in m7 && m7.type === "ElseClause" && "parent" in m7 && typeof m7.parent === "object" && m7.parent != null && "type" in m7.parent && m7.parent.type === "IfStatement") && liftedIfs.has(ancestor2.parent.parent)) || type === "PipelineExpression" || // Declaration
7386
+ type === "BlockStatement" && !((m7 = ancestor2.parent, typeof m7 === "object" && m7 != null && "type" in m7 && m7.type === "IfStatement") && liftedIfs.has(ancestor2.parent)) && !((m8 = ancestor2.parent, typeof m8 === "object" && m8 != null && "type" in m8 && m8.type === "ElseClause" && "parent" in m8 && typeof m8.parent === "object" && m8.parent != null && "type" in m8.parent && m8.parent.type === "IfStatement") && liftedIfs.has(ancestor2.parent.parent)) || type === "PipelineExpression" || // Declaration
7075
7387
  type === "Initializer" || // Right-hand side of assignment
7076
7388
  type === "AssignmentExpression" && findChildIndex(ancestor2, child2) === ancestor2.children.indexOf(ancestor2.expression) || type === "ReturnStatement" || type === "YieldExpression";
7077
7389
  }));
@@ -7147,11 +7459,11 @@ ${js}`
7147
7459
  for (const [ancestor, placeholders] of placeholderMap) {
7148
7460
  let ref = makeRef("$");
7149
7461
  let typeSuffix;
7150
- for (let i8 = 0, len7 = placeholders.length; i8 < len7; i8++) {
7151
- const placeholder = placeholders[i8];
7462
+ for (let i11 = 0, len10 = placeholders.length; i11 < len10; i11++) {
7463
+ const placeholder = placeholders[i11];
7152
7464
  typeSuffix ??= placeholder.typeSuffix;
7153
- let ref22;
7154
- replaceNode((ref22 = placeholder.children)[ref22.length - 1], ref);
7465
+ let ref25;
7466
+ replaceNode((ref25 = placeholder.children)[ref25.length - 1], ref);
7155
7467
  }
7156
7468
  const { parent } = ancestor;
7157
7469
  const body = maybeUnwrap(ancestor);
@@ -7172,16 +7484,16 @@ ${js}`
7172
7484
  }
7173
7485
  case "PipelineExpression": {
7174
7486
  const i = findChildIndex(parent, ancestor);
7175
- let ref23;
7487
+ let ref26;
7176
7488
  if (i === 1) {
7177
- ref23 = ancestor === parent.children[i];
7489
+ ref26 = ancestor === parent.children[i];
7178
7490
  } else if (i === 2) {
7179
- ref23 = ancestor === parent.children[i][findChildIndex(parent.children[i], ancestor)][3];
7491
+ ref26 = ancestor === parent.children[i][findChildIndex(parent.children[i], ancestor)][3];
7180
7492
  } else {
7181
- ref23 = void 0;
7493
+ ref26 = void 0;
7182
7494
  }
7183
7495
  ;
7184
- outer = ref23;
7496
+ outer = ref26;
7185
7497
  break;
7186
7498
  }
7187
7499
  case "AssignmentExpression":
@@ -7196,9 +7508,9 @@ ${js}`
7196
7508
  fnExp = makeLeftHandSideExpression(fnExp);
7197
7509
  }
7198
7510
  replaceNode(ancestor, fnExp, parent);
7199
- let ref24;
7200
- if (ref24 = getTrimmingSpace(body)) {
7201
- const ws = ref24;
7511
+ let ref27;
7512
+ if (ref27 = getTrimmingSpace(body)) {
7513
+ const ws = ref27;
7202
7514
  inplaceInsertTrimmingSpace(body, "");
7203
7515
  inplacePrepend(ws, fnExp);
7204
7516
  }
@@ -7243,8 +7555,8 @@ ${js}`
7243
7555
  }
7244
7556
  ];
7245
7557
  }
7246
- let ref25;
7247
- if (Array.isArray(rest.delim) && (ref25 = rest.delim)[ref25.length - 1]?.token === ",") {
7558
+ let ref28;
7559
+ if (Array.isArray(rest.delim) && (ref28 = rest.delim)[ref28.length - 1]?.token === ",") {
7248
7560
  rest.delim = rest.delim.slice(0, -1);
7249
7561
  rest.children = [...rest.children.slice(0, -1), rest.delim];
7250
7562
  }
@@ -7269,9 +7581,9 @@ ${js}`
7269
7581
  return root;
7270
7582
  }
7271
7583
  }
7272
- for (let i9 = 0, len8 = array.length; i9 < len8; i9++) {
7273
- const i = i9;
7274
- const node = array[i9];
7584
+ for (let i12 = 0, len11 = array.length; i12 < len11; i12++) {
7585
+ const i = i12;
7586
+ const node = array[i12];
7275
7587
  if (!(node != null)) {
7276
7588
  return;
7277
7589
  }
@@ -7283,34 +7595,6 @@ ${js}`
7283
7595
  }
7284
7596
  return root;
7285
7597
  }
7286
- function replaceNodesRecursive(root, predicate, replacer) {
7287
- if (!(root != null)) {
7288
- return root;
7289
- }
7290
- const array = Array.isArray(root) ? root : root.children;
7291
- if (!array) {
7292
- if (predicate(root)) {
7293
- return replacer(root, root);
7294
- } else {
7295
- return root;
7296
- }
7297
- }
7298
- for (let i10 = 0, len9 = array.length; i10 < len9; i10++) {
7299
- const i = i10;
7300
- const node = array[i10];
7301
- if (!(node != null)) {
7302
- continue;
7303
- }
7304
- if (predicate(node)) {
7305
- const ret = replacer(node, root);
7306
- replaceNodesRecursive(ret, predicate, replacer);
7307
- array[i] = ret;
7308
- } else {
7309
- replaceNodesRecursive(node, predicate, replacer);
7310
- }
7311
- }
7312
- return root;
7313
- }
7314
7598
  function typeOfJSX(node, config2) {
7315
7599
  switch (node.type) {
7316
7600
  case "JSXElement":
@@ -7694,6 +7978,7 @@ ${js}`
7694
7978
  ForStatement,
7695
7979
  ForClause,
7696
7980
  ForStatementControlWithWhen,
7981
+ ForReduction,
7697
7982
  ForStatementControl,
7698
7983
  WhenCondition,
7699
7984
  CoffeeForStatementParameters,
@@ -8107,7 +8392,7 @@ ${js}`
8107
8392
  InlineInterfacePropertyDelimiter,
8108
8393
  TypeBinaryOp,
8109
8394
  TypeFunction,
8110
- TypeArrowFunction,
8395
+ TypeFunctionArrow,
8111
8396
  TypeArguments,
8112
8397
  ImplicitTypeArguments,
8113
8398
  TypeApplicationStart,
@@ -8314,128 +8599,135 @@ ${js}`
8314
8599
  var $L117 = (0, import_lib4.$L)("&");
8315
8600
  var $L118 = (0, import_lib4.$L)("|");
8316
8601
  var $L119 = (0, import_lib4.$L)(";");
8317
- var $L120 = (0, import_lib4.$L)("break");
8318
- var $L121 = (0, import_lib4.$L)("continue");
8319
- var $L122 = (0, import_lib4.$L)("debugger");
8320
- var $L123 = (0, import_lib4.$L)("require");
8321
- var $L124 = (0, import_lib4.$L)("with");
8322
- var $L125 = (0, import_lib4.$L)("assert");
8323
- var $L126 = (0, import_lib4.$L)(":=");
8324
- var $L127 = (0, import_lib4.$L)("\u2254");
8325
- var $L128 = (0, import_lib4.$L)(".=");
8326
- var $L129 = (0, import_lib4.$L)("::=");
8327
- var $L130 = (0, import_lib4.$L)("/*");
8328
- var $L131 = (0, import_lib4.$L)("*/");
8329
- var $L132 = (0, import_lib4.$L)("\\");
8330
- var $L133 = (0, import_lib4.$L)(")");
8331
- var $L134 = (0, import_lib4.$L)("abstract");
8332
- var $L135 = (0, import_lib4.$L)("as");
8333
- var $L136 = (0, import_lib4.$L)("@");
8334
- var $L137 = (0, import_lib4.$L)("@@");
8335
- var $L138 = (0, import_lib4.$L)("async");
8336
- var $L139 = (0, import_lib4.$L)("await");
8337
- var $L140 = (0, import_lib4.$L)("`");
8338
- var $L141 = (0, import_lib4.$L)("by");
8339
- var $L142 = (0, import_lib4.$L)("case");
8340
- var $L143 = (0, import_lib4.$L)("catch");
8341
- var $L144 = (0, import_lib4.$L)("class");
8342
- var $L145 = (0, import_lib4.$L)("#{");
8343
- var $L146 = (0, import_lib4.$L)("comptime");
8344
- var $L147 = (0, import_lib4.$L)("declare");
8345
- var $L148 = (0, import_lib4.$L)("default");
8346
- var $L149 = (0, import_lib4.$L)("delete");
8347
- var $L150 = (0, import_lib4.$L)("do");
8348
- var $L151 = (0, import_lib4.$L)("..");
8349
- var $L152 = (0, import_lib4.$L)("\u2025");
8350
- var $L153 = (0, import_lib4.$L)("...");
8351
- var $L154 = (0, import_lib4.$L)("\u2026");
8352
- var $L155 = (0, import_lib4.$L)("::");
8353
- var $L156 = (0, import_lib4.$L)('"');
8354
- var $L157 = (0, import_lib4.$L)("each");
8355
- var $L158 = (0, import_lib4.$L)("else");
8356
- var $L159 = (0, import_lib4.$L)("!");
8357
- var $L160 = (0, import_lib4.$L)("export");
8358
- var $L161 = (0, import_lib4.$L)("extends");
8359
- var $L162 = (0, import_lib4.$L)("finally");
8360
- var $L163 = (0, import_lib4.$L)("for");
8361
- var $L164 = (0, import_lib4.$L)("from");
8362
- var $L165 = (0, import_lib4.$L)("function");
8363
- var $L166 = (0, import_lib4.$L)("get");
8364
- var $L167 = (0, import_lib4.$L)("set");
8365
- var $L168 = (0, import_lib4.$L)("#");
8366
- var $L169 = (0, import_lib4.$L)("if");
8367
- var $L170 = (0, import_lib4.$L)("in");
8368
- var $L171 = (0, import_lib4.$L)("infer");
8369
- var $L172 = (0, import_lib4.$L)("let");
8370
- var $L173 = (0, import_lib4.$L)("const");
8371
- var $L174 = (0, import_lib4.$L)("is");
8372
- var $L175 = (0, import_lib4.$L)("var");
8373
- var $L176 = (0, import_lib4.$L)("like");
8374
- var $L177 = (0, import_lib4.$L)("loop");
8375
- var $L178 = (0, import_lib4.$L)("new");
8376
- var $L179 = (0, import_lib4.$L)("not");
8377
- var $L180 = (0, import_lib4.$L)("of");
8378
- var $L181 = (0, import_lib4.$L)("[");
8379
- var $L182 = (0, import_lib4.$L)("operator");
8380
- var $L183 = (0, import_lib4.$L)("override");
8381
- var $L184 = (0, import_lib4.$L)("own");
8382
- var $L185 = (0, import_lib4.$L)("public");
8383
- var $L186 = (0, import_lib4.$L)("private");
8384
- var $L187 = (0, import_lib4.$L)("protected");
8385
- var $L188 = (0, import_lib4.$L)("||>");
8386
- var $L189 = (0, import_lib4.$L)("|\u25B7");
8387
- var $L190 = (0, import_lib4.$L)("|>=");
8388
- var $L191 = (0, import_lib4.$L)("\u25B7=");
8389
- var $L192 = (0, import_lib4.$L)("|>");
8390
- var $L193 = (0, import_lib4.$L)("\u25B7");
8391
- var $L194 = (0, import_lib4.$L)("readonly");
8392
- var $L195 = (0, import_lib4.$L)("return");
8393
- var $L196 = (0, import_lib4.$L)("satisfies");
8394
- var $L197 = (0, import_lib4.$L)("'");
8395
- var $L198 = (0, import_lib4.$L)("static");
8396
- var $L199 = (0, import_lib4.$L)("${");
8397
- var $L200 = (0, import_lib4.$L)("super");
8398
- var $L201 = (0, import_lib4.$L)("switch");
8399
- var $L202 = (0, import_lib4.$L)("target");
8400
- var $L203 = (0, import_lib4.$L)("then");
8401
- var $L204 = (0, import_lib4.$L)("this");
8402
- var $L205 = (0, import_lib4.$L)("throw");
8403
- var $L206 = (0, import_lib4.$L)('"""');
8404
- var $L207 = (0, import_lib4.$L)("'''");
8405
- var $L208 = (0, import_lib4.$L)("///");
8406
- var $L209 = (0, import_lib4.$L)("```");
8407
- var $L210 = (0, import_lib4.$L)("try");
8408
- var $L211 = (0, import_lib4.$L)("typeof");
8409
- var $L212 = (0, import_lib4.$L)("undefined");
8410
- var $L213 = (0, import_lib4.$L)("unless");
8411
- var $L214 = (0, import_lib4.$L)("until");
8412
- var $L215 = (0, import_lib4.$L)("using");
8413
- var $L216 = (0, import_lib4.$L)("void");
8414
- var $L217 = (0, import_lib4.$L)("when");
8415
- var $L218 = (0, import_lib4.$L)("while");
8416
- var $L219 = (0, import_lib4.$L)("yield");
8417
- var $L220 = (0, import_lib4.$L)("/>");
8418
- var $L221 = (0, import_lib4.$L)("</");
8419
- var $L222 = (0, import_lib4.$L)("<>");
8420
- var $L223 = (0, import_lib4.$L)("</>");
8421
- var $L224 = (0, import_lib4.$L)("<!--");
8422
- var $L225 = (0, import_lib4.$L)("-->");
8423
- var $L226 = (0, import_lib4.$L)("type");
8424
- var $L227 = (0, import_lib4.$L)("enum");
8425
- var $L228 = (0, import_lib4.$L)("interface");
8426
- var $L229 = (0, import_lib4.$L)("global");
8427
- var $L230 = (0, import_lib4.$L)("module");
8428
- var $L231 = (0, import_lib4.$L)("namespace");
8429
- var $L232 = (0, import_lib4.$L)("asserts");
8430
- var $L233 = (0, import_lib4.$L)("keyof");
8431
- var $L234 = (0, import_lib4.$L)("???");
8432
- var $L235 = (0, import_lib4.$L)("unique");
8433
- var $L236 = (0, import_lib4.$L)("symbol");
8434
- var $L237 = (0, import_lib4.$L)("[]");
8435
- var $L238 = (0, import_lib4.$L)("civet");
8602
+ var $L120 = (0, import_lib4.$L)("some");
8603
+ var $L121 = (0, import_lib4.$L)("every");
8604
+ var $L122 = (0, import_lib4.$L)("count");
8605
+ var $L123 = (0, import_lib4.$L)("sum");
8606
+ var $L124 = (0, import_lib4.$L)("product");
8607
+ var $L125 = (0, import_lib4.$L)("min");
8608
+ var $L126 = (0, import_lib4.$L)("max");
8609
+ var $L127 = (0, import_lib4.$L)("break");
8610
+ var $L128 = (0, import_lib4.$L)("continue");
8611
+ var $L129 = (0, import_lib4.$L)("debugger");
8612
+ var $L130 = (0, import_lib4.$L)("require");
8613
+ var $L131 = (0, import_lib4.$L)("with");
8614
+ var $L132 = (0, import_lib4.$L)("assert");
8615
+ var $L133 = (0, import_lib4.$L)(":=");
8616
+ var $L134 = (0, import_lib4.$L)("\u2254");
8617
+ var $L135 = (0, import_lib4.$L)(".=");
8618
+ var $L136 = (0, import_lib4.$L)("::=");
8619
+ var $L137 = (0, import_lib4.$L)("/*");
8620
+ var $L138 = (0, import_lib4.$L)("*/");
8621
+ var $L139 = (0, import_lib4.$L)("\\");
8622
+ var $L140 = (0, import_lib4.$L)(")");
8623
+ var $L141 = (0, import_lib4.$L)("abstract");
8624
+ var $L142 = (0, import_lib4.$L)("as");
8625
+ var $L143 = (0, import_lib4.$L)("@");
8626
+ var $L144 = (0, import_lib4.$L)("@@");
8627
+ var $L145 = (0, import_lib4.$L)("async");
8628
+ var $L146 = (0, import_lib4.$L)("await");
8629
+ var $L147 = (0, import_lib4.$L)("`");
8630
+ var $L148 = (0, import_lib4.$L)("by");
8631
+ var $L149 = (0, import_lib4.$L)("case");
8632
+ var $L150 = (0, import_lib4.$L)("catch");
8633
+ var $L151 = (0, import_lib4.$L)("class");
8634
+ var $L152 = (0, import_lib4.$L)("#{");
8635
+ var $L153 = (0, import_lib4.$L)("comptime");
8636
+ var $L154 = (0, import_lib4.$L)("declare");
8637
+ var $L155 = (0, import_lib4.$L)("default");
8638
+ var $L156 = (0, import_lib4.$L)("delete");
8639
+ var $L157 = (0, import_lib4.$L)("do");
8640
+ var $L158 = (0, import_lib4.$L)("..");
8641
+ var $L159 = (0, import_lib4.$L)("\u2025");
8642
+ var $L160 = (0, import_lib4.$L)("...");
8643
+ var $L161 = (0, import_lib4.$L)("\u2026");
8644
+ var $L162 = (0, import_lib4.$L)("::");
8645
+ var $L163 = (0, import_lib4.$L)('"');
8646
+ var $L164 = (0, import_lib4.$L)("each");
8647
+ var $L165 = (0, import_lib4.$L)("else");
8648
+ var $L166 = (0, import_lib4.$L)("!");
8649
+ var $L167 = (0, import_lib4.$L)("export");
8650
+ var $L168 = (0, import_lib4.$L)("extends");
8651
+ var $L169 = (0, import_lib4.$L)("finally");
8652
+ var $L170 = (0, import_lib4.$L)("for");
8653
+ var $L171 = (0, import_lib4.$L)("from");
8654
+ var $L172 = (0, import_lib4.$L)("function");
8655
+ var $L173 = (0, import_lib4.$L)("get");
8656
+ var $L174 = (0, import_lib4.$L)("set");
8657
+ var $L175 = (0, import_lib4.$L)("#");
8658
+ var $L176 = (0, import_lib4.$L)("if");
8659
+ var $L177 = (0, import_lib4.$L)("in");
8660
+ var $L178 = (0, import_lib4.$L)("infer");
8661
+ var $L179 = (0, import_lib4.$L)("let");
8662
+ var $L180 = (0, import_lib4.$L)("const");
8663
+ var $L181 = (0, import_lib4.$L)("is");
8664
+ var $L182 = (0, import_lib4.$L)("var");
8665
+ var $L183 = (0, import_lib4.$L)("like");
8666
+ var $L184 = (0, import_lib4.$L)("loop");
8667
+ var $L185 = (0, import_lib4.$L)("new");
8668
+ var $L186 = (0, import_lib4.$L)("not");
8669
+ var $L187 = (0, import_lib4.$L)("of");
8670
+ var $L188 = (0, import_lib4.$L)("[");
8671
+ var $L189 = (0, import_lib4.$L)("operator");
8672
+ var $L190 = (0, import_lib4.$L)("override");
8673
+ var $L191 = (0, import_lib4.$L)("own");
8674
+ var $L192 = (0, import_lib4.$L)("public");
8675
+ var $L193 = (0, import_lib4.$L)("private");
8676
+ var $L194 = (0, import_lib4.$L)("protected");
8677
+ var $L195 = (0, import_lib4.$L)("||>");
8678
+ var $L196 = (0, import_lib4.$L)("|\u25B7");
8679
+ var $L197 = (0, import_lib4.$L)("|>=");
8680
+ var $L198 = (0, import_lib4.$L)("\u25B7=");
8681
+ var $L199 = (0, import_lib4.$L)("|>");
8682
+ var $L200 = (0, import_lib4.$L)("\u25B7");
8683
+ var $L201 = (0, import_lib4.$L)("readonly");
8684
+ var $L202 = (0, import_lib4.$L)("return");
8685
+ var $L203 = (0, import_lib4.$L)("satisfies");
8686
+ var $L204 = (0, import_lib4.$L)("'");
8687
+ var $L205 = (0, import_lib4.$L)("static");
8688
+ var $L206 = (0, import_lib4.$L)("${");
8689
+ var $L207 = (0, import_lib4.$L)("super");
8690
+ var $L208 = (0, import_lib4.$L)("switch");
8691
+ var $L209 = (0, import_lib4.$L)("target");
8692
+ var $L210 = (0, import_lib4.$L)("then");
8693
+ var $L211 = (0, import_lib4.$L)("this");
8694
+ var $L212 = (0, import_lib4.$L)("throw");
8695
+ var $L213 = (0, import_lib4.$L)('"""');
8696
+ var $L214 = (0, import_lib4.$L)("'''");
8697
+ var $L215 = (0, import_lib4.$L)("///");
8698
+ var $L216 = (0, import_lib4.$L)("```");
8699
+ var $L217 = (0, import_lib4.$L)("try");
8700
+ var $L218 = (0, import_lib4.$L)("typeof");
8701
+ var $L219 = (0, import_lib4.$L)("undefined");
8702
+ var $L220 = (0, import_lib4.$L)("unless");
8703
+ var $L221 = (0, import_lib4.$L)("until");
8704
+ var $L222 = (0, import_lib4.$L)("using");
8705
+ var $L223 = (0, import_lib4.$L)("void");
8706
+ var $L224 = (0, import_lib4.$L)("when");
8707
+ var $L225 = (0, import_lib4.$L)("while");
8708
+ var $L226 = (0, import_lib4.$L)("yield");
8709
+ var $L227 = (0, import_lib4.$L)("/>");
8710
+ var $L228 = (0, import_lib4.$L)("</");
8711
+ var $L229 = (0, import_lib4.$L)("<>");
8712
+ var $L230 = (0, import_lib4.$L)("</>");
8713
+ var $L231 = (0, import_lib4.$L)("<!--");
8714
+ var $L232 = (0, import_lib4.$L)("-->");
8715
+ var $L233 = (0, import_lib4.$L)("type");
8716
+ var $L234 = (0, import_lib4.$L)("enum");
8717
+ var $L235 = (0, import_lib4.$L)("interface");
8718
+ var $L236 = (0, import_lib4.$L)("global");
8719
+ var $L237 = (0, import_lib4.$L)("module");
8720
+ var $L238 = (0, import_lib4.$L)("namespace");
8721
+ var $L239 = (0, import_lib4.$L)("asserts");
8722
+ var $L240 = (0, import_lib4.$L)("keyof");
8723
+ var $L241 = (0, import_lib4.$L)("???");
8724
+ var $L242 = (0, import_lib4.$L)("unique");
8725
+ var $L243 = (0, import_lib4.$L)("symbol");
8726
+ var $L244 = (0, import_lib4.$L)("[]");
8727
+ var $L245 = (0, import_lib4.$L)("civet");
8436
8728
  var $R0 = (0, import_lib4.$R)(new RegExp("(?=async|debugger|if|unless|comptime|do|for|loop|until|while|switch|throw|try)", "suy"));
8437
8729
  var $R1 = (0, import_lib4.$R)(new RegExp("&(?=\\s)", "suy"));
8438
- var $R2 = (0, import_lib4.$R)(new RegExp("(as|of|satisfies|then|when|implements|xor|xnor)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
8730
+ var $R2 = (0, import_lib4.$R)(new RegExp("(as|of|by|satisfies|then|when|implements|xor|xnor)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
8439
8731
  var $R3 = (0, import_lib4.$R)(new RegExp("[0-9]", "suy"));
8440
8732
  var $R4 = (0, import_lib4.$R)(new RegExp("(?!\\p{ID_Start}|[_$0-9(\\[{])", "suy"));
8441
8733
  var $R5 = (0, import_lib4.$R)(new RegExp("[ \\t]", "suy"));
@@ -8662,12 +8954,7 @@ ${js}`
8662
8954
  return $skip;
8663
8955
  return $1;
8664
8956
  });
8665
- var StatementExpression$2 = (0, import_lib4.$TS)((0, import_lib4.$S)(IterationExpression), function($skip, $loc, $0, $1) {
8666
- if ($1.block.implicit && $1.subtype !== "DoStatement" && $1.subtype !== "ComptimeStatement") {
8667
- return $skip;
8668
- }
8669
- return $1;
8670
- });
8957
+ var StatementExpression$2 = IterationExpression;
8671
8958
  var StatementExpression$3 = SwitchStatement;
8672
8959
  var StatementExpression$4 = ThrowStatement;
8673
8960
  var StatementExpression$5 = TryStatement;
@@ -8765,7 +9052,7 @@ ${js}`
8765
9052
  function ForbiddenImplicitCalls(ctx, state2) {
8766
9053
  return (0, import_lib4.$EVENT_C)(ctx, state2, "ForbiddenImplicitCalls", ForbiddenImplicitCalls$$);
8767
9054
  }
8768
- var ReservedBinary$0 = (0, import_lib4.$R$0)((0, import_lib4.$EXPECT)($R2, "ReservedBinary /(as|of|satisfies|then|when|implements|xor|xnor)(?!\\p{ID_Continue}|[\\u200C\\u200D$])/"));
9055
+ var ReservedBinary$0 = (0, import_lib4.$R$0)((0, import_lib4.$EXPECT)($R2, "ReservedBinary /(as|of|by|satisfies|then|when|implements|xor|xnor)(?!\\p{ID_Continue}|[\\u200C\\u200D$])/"));
8769
9056
  function ReservedBinary(ctx, state2) {
8770
9057
  return (0, import_lib4.$EVENT)(ctx, state2, "ReservedBinary", ReservedBinary$0);
8771
9058
  }
@@ -9396,7 +9683,7 @@ ${js}`
9396
9683
  function PipelineHeadItem(ctx, state2) {
9397
9684
  return (0, import_lib4.$EVENT_C)(ctx, state2, "PipelineHeadItem", PipelineHeadItem$$);
9398
9685
  }
9399
- var PipelineTailItem$0 = (0, import_lib4.$T)((0, import_lib4.$S)((0, import_lib4.$C)(AwaitOp, Yield, Return), (0, import_lib4.$N)(AccessStart)), function(value) {
9686
+ var PipelineTailItem$0 = (0, import_lib4.$T)((0, import_lib4.$S)((0, import_lib4.$C)(AwaitOp, Yield, Return, Throw), (0, import_lib4.$N)(AccessStart), (0, import_lib4.$N)(MaybeNestedExpression)), function(value) {
9400
9687
  return value[0];
9401
9688
  });
9402
9689
  var PipelineTailItem$1 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L15, 'PipelineTailItem "import"'), (0, import_lib4.$N)(AccessStart)), function($skip, $loc, $0, $1, $2) {
@@ -11803,16 +12090,31 @@ ${js}`
11803
12090
  function CoffeeScriptBooleanLiteral(ctx, state2) {
11804
12091
  return (0, import_lib4.$EVENT_C)(ctx, state2, "CoffeeScriptBooleanLiteral", CoffeeScriptBooleanLiteral$$);
11805
12092
  }
11806
- var SymbolLiteral$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(Colon, IdentifierName), function($skip, $loc, $0, $1, $2) {
12093
+ var SymbolLiteral$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(Colon, (0, import_lib4.$C)(IdentifierName, StringLiteral)), function($skip, $loc, $0, $1, $2) {
11807
12094
  var colon = $1;
11808
12095
  var id = $2;
11809
- const { name, children: [token] } = id;
12096
+ let name, token;
12097
+ if (id.type === "Identifier") {
12098
+ ({ name, children: [token] } = id);
12099
+ } else {
12100
+ name = literalValue({
12101
+ type: "Literal",
12102
+ subtype: "StringLiteral",
12103
+ raw: id.token,
12104
+ children: [id]
12105
+ });
12106
+ token = id;
12107
+ }
11810
12108
  if (config.symbols.includes(name)) {
11811
12109
  return {
11812
12110
  type: "SymbolLiteral",
11813
- children: [
12111
+ children: id.type === "Identifier" ? [
11814
12112
  { ...colon, token: "Symbol." },
11815
12113
  token
12114
+ ] : [
12115
+ { ...colon, token: "Symbol[" },
12116
+ token,
12117
+ "]"
11816
12118
  ],
11817
12119
  name
11818
12120
  };
@@ -11820,9 +12122,9 @@ ${js}`
11820
12122
  return {
11821
12123
  type: "SymbolLiteral",
11822
12124
  children: [
11823
- { ...colon, token: 'Symbol.for("' },
11824
- token,
11825
- '")'
12125
+ { ...colon, token: "Symbol.for(" },
12126
+ id.type === "Identifier" ? ['"', token, '"'] : token,
12127
+ ")"
11826
12128
  ],
11827
12129
  name
11828
12130
  };
@@ -13465,6 +13767,8 @@ ${js}`
13465
13767
  var Statement$3 = (0, import_lib4.$TS)((0, import_lib4.$S)(IterationStatement, (0, import_lib4.$N)(ShouldExpressionize)), function($skip, $loc, $0, $1, $2) {
13466
13768
  if ($1.generator)
13467
13769
  return $skip;
13770
+ if ($1.reduction)
13771
+ return $skip;
13468
13772
  return $1;
13469
13773
  });
13470
13774
  var Statement$4 = (0, import_lib4.$T)((0, import_lib4.$S)(SwitchStatement, (0, import_lib4.$N)(ShouldExpressionize)), function(value) {
@@ -13510,7 +13814,7 @@ ${js}`
13510
13814
  return (0, import_lib4.$EVENT)(ctx, state2, "EmptyStatement", EmptyStatement$0);
13511
13815
  }
13512
13816
  var InsertEmptyStatement$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(InsertSemicolon), function($skip, $loc, $0, $1) {
13513
- return { type: "EmptyStatement", children: [$1] };
13817
+ return { type: "EmptyStatement", children: [$1], implicit: true };
13514
13818
  });
13515
13819
  function InsertEmptyStatement(ctx, state2) {
13516
13820
  return (0, import_lib4.$EVENT)(ctx, state2, "InsertEmptyStatement", InsertEmptyStatement$0);
@@ -13816,15 +14120,19 @@ ${js}`
13816
14120
  block: null,
13817
14121
  blockPrefix: c.blockPrefix,
13818
14122
  hoistDec: c.hoistDec,
14123
+ reduction: c.reduction,
13819
14124
  generator
13820
14125
  };
13821
14126
  });
13822
14127
  function ForClause(ctx, state2) {
13823
14128
  return (0, import_lib4.$EVENT)(ctx, state2, "ForClause", ForClause$0);
13824
14129
  }
13825
- var ForStatementControlWithWhen$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(ForStatementControl, (0, import_lib4.$E)(WhenCondition)), function($skip, $loc, $0, $1, $2) {
13826
- var control = $1;
13827
- var condition = $2;
14130
+ var ForStatementControlWithWhen$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)(ForReduction), ForStatementControl, (0, import_lib4.$E)(WhenCondition)), function($skip, $loc, $0, $1, $2, $3) {
14131
+ var reduction = $1;
14132
+ var control = $2;
14133
+ var condition = $3;
14134
+ if (reduction)
14135
+ control = { ...control, reduction };
13828
14136
  if (!condition)
13829
14137
  return control;
13830
14138
  const expressions = [["", {
@@ -13840,7 +14148,7 @@ ${js}`
13840
14148
  return {
13841
14149
  ...control,
13842
14150
  blockPrefix: [
13843
- ...control.blockPrefix,
14151
+ ...control.blockPrefix ?? [],
13844
14152
  ["", {
13845
14153
  type: "IfStatement",
13846
14154
  then: block,
@@ -13852,6 +14160,18 @@ ${js}`
13852
14160
  function ForStatementControlWithWhen(ctx, state2) {
13853
14161
  return (0, import_lib4.$EVENT)(ctx, state2, "ForStatementControlWithWhen", ForStatementControlWithWhen$0);
13854
14162
  }
14163
+ var ForReduction$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L120, 'ForReduction "some"'), (0, import_lib4.$EXPECT)($L121, 'ForReduction "every"'), (0, import_lib4.$EXPECT)($L122, 'ForReduction "count"'), (0, import_lib4.$EXPECT)($L123, 'ForReduction "sum"'), (0, import_lib4.$EXPECT)($L124, 'ForReduction "product"'), (0, import_lib4.$EXPECT)($L125, 'ForReduction "min"'), (0, import_lib4.$EXPECT)($L126, 'ForReduction "max"')), NonIdContinue, __), function($skip, $loc, $0, $1, $2, $3) {
14164
+ var subtype = $1;
14165
+ var ws = $3;
14166
+ return {
14167
+ type: "ForReduction",
14168
+ subtype,
14169
+ children: [ws]
14170
+ };
14171
+ });
14172
+ function ForReduction(ctx, state2) {
14173
+ return (0, import_lib4.$EVENT)(ctx, state2, "ForReduction", ForReduction$0);
14174
+ }
13855
14175
  var ForStatementControl$0 = (0, import_lib4.$T)((0, import_lib4.$S)((0, import_lib4.$N)(CoffeeForLoopsEnabled), ForStatementParameters), function(value) {
13856
14176
  return value[1];
13857
14177
  });
@@ -13905,7 +14225,7 @@ ${js}`
13905
14225
  const counterRef = makeRef("i");
13906
14226
  const lenRef = makeRef("len");
13907
14227
  if (exp.type === "RangeExpression") {
13908
- return forRange(open, declaration, exp, step?.[2], close);
14228
+ return forRange(open, declaration, exp, step && prepend(trimFirstSpace(step[0]), trimFirstSpace(step[2])), close);
13909
14229
  }
13910
14230
  const expRef = maybeRef(exp);
13911
14231
  const varRef = declaration;
@@ -14007,10 +14327,10 @@ ${js}`
14007
14327
  };
14008
14328
  });
14009
14329
  var ForStatementParameters$2 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)((0, import_lib4.$S)(Await, __)), (0, import_lib4.$E)((0, import_lib4.$S)((0, import_lib4.$C)(Each, Own), __)), (0, import_lib4.$S)(OpenParen, __), ForInOfDeclaration, (0, import_lib4.$E)((0, import_lib4.$S)(__, Comma, __, ForInOfDeclaration)), __, (0, import_lib4.$C)(In, Of), ExpressionWithObjectApplicationForbidden, (0, import_lib4.$E)((0, import_lib4.$S)(__, By, ExpressionWithObjectApplicationForbidden)), (0, import_lib4.$S)(__, CloseParen)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10) {
14010
- return processForInOf($0, getHelperRef);
14330
+ return processForInOf($0);
14011
14331
  });
14012
14332
  var ForStatementParameters$3 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)((0, import_lib4.$S)(Await, __)), (0, import_lib4.$E)((0, import_lib4.$S)((0, import_lib4.$C)(Each, Own), __)), InsertOpenParen, ForInOfDeclaration, (0, import_lib4.$E)((0, import_lib4.$S)(__, Comma, __, ForInOfDeclaration)), __, (0, import_lib4.$C)(In, Of), ExpressionWithObjectApplicationForbidden, (0, import_lib4.$E)((0, import_lib4.$S)(__, By, ExpressionWithObjectApplicationForbidden)), InsertCloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10) {
14013
- return processForInOf($0, getHelperRef);
14333
+ return processForInOf($0);
14014
14334
  });
14015
14335
  var ForStatementParameters$4 = ForRangeParameters;
14016
14336
  var ForStatementParameters$$ = [ForStatementParameters$0, ForStatementParameters$1, ForStatementParameters$2, ForStatementParameters$3, ForStatementParameters$4];
@@ -14047,7 +14367,7 @@ ${js}`
14047
14367
  return {
14048
14368
  type: "ForDeclaration",
14049
14369
  children: [c, binding],
14050
- declare: c,
14370
+ decl: c.token,
14051
14371
  binding,
14052
14372
  names: binding.names
14053
14373
  };
@@ -14058,7 +14378,7 @@ ${js}`
14058
14378
  return {
14059
14379
  type: "ForDeclaration",
14060
14380
  children: [c, binding],
14061
- declare: c,
14381
+ decl: c.token,
14062
14382
  binding,
14063
14383
  names: binding.names
14064
14384
  };
@@ -14778,19 +15098,19 @@ ${js}`
14778
15098
  function ThrowStatement(ctx, state2) {
14779
15099
  return (0, import_lib4.$EVENT)(ctx, state2, "ThrowStatement", ThrowStatement$0);
14780
15100
  }
14781
- var Break$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L120, 'Break "break"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
15101
+ var Break$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L127, 'Break "break"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
14782
15102
  return { $loc, token: $1 };
14783
15103
  });
14784
15104
  function Break(ctx, state2) {
14785
15105
  return (0, import_lib4.$EVENT)(ctx, state2, "Break", Break$0);
14786
15106
  }
14787
- var Continue$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L121, 'Continue "continue"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
15107
+ var Continue$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L128, 'Continue "continue"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
14788
15108
  return { $loc, token: $1 };
14789
15109
  });
14790
15110
  function Continue(ctx, state2) {
14791
15111
  return (0, import_lib4.$EVENT)(ctx, state2, "Continue", Continue$0);
14792
15112
  }
14793
- var Debugger$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L122, 'Debugger "debugger"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
15113
+ var Debugger$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L129, 'Debugger "debugger"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
14794
15114
  return { $loc, token: $1 };
14795
15115
  });
14796
15116
  function Debugger(ctx, state2) {
@@ -14858,7 +15178,7 @@ ${js}`
14858
15178
  function MaybeParenNestedExpression(ctx, state2) {
14859
15179
  return (0, import_lib4.$EVENT_C)(ctx, state2, "MaybeParenNestedExpression", MaybeParenNestedExpression$$);
14860
15180
  }
14861
- var ImportDeclaration$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(Import, _, Identifier, (0, import_lib4.$E)(_), Equals, __, (0, import_lib4.$EXPECT)($L123, 'ImportDeclaration "require"'), NonIdContinue, Arguments), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
15181
+ var ImportDeclaration$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(Import, _, Identifier, (0, import_lib4.$E)(_), Equals, __, (0, import_lib4.$EXPECT)($L130, 'ImportDeclaration "require"'), NonIdContinue, Arguments), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
14862
15182
  const imp = [
14863
15183
  { ...$1, ts: true },
14864
15184
  { ...$1, token: "const", js: true }
@@ -15048,7 +15368,7 @@ ${js}`
15048
15368
  function ImpliedFrom(ctx, state2) {
15049
15369
  return (0, import_lib4.$EVENT)(ctx, state2, "ImpliedFrom", ImpliedFrom$0);
15050
15370
  }
15051
- var ImportAssertion$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)(_), (0, import_lib4.$C)((0, import_lib4.$EXPECT)($L124, 'ImportAssertion "with"'), (0, import_lib4.$EXPECT)($L125, 'ImportAssertion "assert"')), NonIdContinue, (0, import_lib4.$E)(_), ObjectLiteral), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
15371
+ var ImportAssertion$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)(_), (0, import_lib4.$C)((0, import_lib4.$EXPECT)($L131, 'ImportAssertion "with"'), (0, import_lib4.$EXPECT)($L132, 'ImportAssertion "assert"')), NonIdContinue, (0, import_lib4.$E)(_), ObjectLiteral), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
15052
15372
  var keyword = $2;
15053
15373
  var object = $5;
15054
15374
  return {
@@ -15367,19 +15687,19 @@ ${js}`
15367
15687
  function LexicalDeclaration(ctx, state2) {
15368
15688
  return (0, import_lib4.$EVENT_C)(ctx, state2, "LexicalDeclaration", LexicalDeclaration$$);
15369
15689
  }
15370
- var ConstAssignment$0 = (0, import_lib4.$TV)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L126, 'ConstAssignment ":="'), (0, import_lib4.$EXPECT)($L127, 'ConstAssignment "\u2254"')), function($skip, $loc, $0, $1) {
15690
+ var ConstAssignment$0 = (0, import_lib4.$TV)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L133, 'ConstAssignment ":="'), (0, import_lib4.$EXPECT)($L134, 'ConstAssignment "\u2254"')), function($skip, $loc, $0, $1) {
15371
15691
  return { $loc, token: "=", decl: "const " };
15372
15692
  });
15373
15693
  function ConstAssignment(ctx, state2) {
15374
15694
  return (0, import_lib4.$EVENT)(ctx, state2, "ConstAssignment", ConstAssignment$0);
15375
15695
  }
15376
- var LetAssignment$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L128, 'LetAssignment ".="'), function($skip, $loc, $0, $1) {
15696
+ var LetAssignment$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L135, 'LetAssignment ".="'), function($skip, $loc, $0, $1) {
15377
15697
  return { $loc, token: "=", decl: "let " };
15378
15698
  });
15379
15699
  function LetAssignment(ctx, state2) {
15380
15700
  return (0, import_lib4.$EVENT)(ctx, state2, "LetAssignment", LetAssignment$0);
15381
15701
  }
15382
- var TypeAssignment$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L129, 'TypeAssignment "::="'), function($skip, $loc, $0, $1) {
15702
+ var TypeAssignment$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L136, 'TypeAssignment "::="'), function($skip, $loc, $0, $1) {
15383
15703
  return { $loc, token: "=" };
15384
15704
  });
15385
15705
  function TypeAssignment(ctx, state2) {
@@ -15802,7 +16122,7 @@ ${js}`
15802
16122
  function MultiLineComment(ctx, state2) {
15803
16123
  return (0, import_lib4.$EVENT_C)(ctx, state2, "MultiLineComment", MultiLineComment$$);
15804
16124
  }
15805
- var JSMultiLineComment$0 = (0, import_lib4.$TV)((0, import_lib4.$TEXT)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L130, 'JSMultiLineComment "/*"'), (0, import_lib4.$Q)((0, import_lib4.$S)((0, import_lib4.$N)((0, import_lib4.$EXPECT)($L131, 'JSMultiLineComment "*/"')), (0, import_lib4.$EXPECT)($R67, "JSMultiLineComment /./"))), (0, import_lib4.$EXPECT)($L131, 'JSMultiLineComment "*/"'))), function($skip, $loc, $0, $1) {
16125
+ var JSMultiLineComment$0 = (0, import_lib4.$TV)((0, import_lib4.$TEXT)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L137, 'JSMultiLineComment "/*"'), (0, import_lib4.$Q)((0, import_lib4.$S)((0, import_lib4.$N)((0, import_lib4.$EXPECT)($L138, 'JSMultiLineComment "*/"')), (0, import_lib4.$EXPECT)($R67, "JSMultiLineComment /./"))), (0, import_lib4.$EXPECT)($L138, 'JSMultiLineComment "*/"'))), function($skip, $loc, $0, $1) {
15806
16126
  return { type: "Comment", $loc, token: $1 };
15807
16127
  });
15808
16128
  function JSMultiLineComment(ctx, state2) {
@@ -15848,7 +16168,7 @@ ${js}`
15848
16168
  var NonNewlineWhitespace$0 = (0, import_lib4.$TR)((0, import_lib4.$EXPECT)($R22, "NonNewlineWhitespace /[ \\t]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
15849
16169
  return { $loc, token: $0 };
15850
16170
  });
15851
- var NonNewlineWhitespace$1 = (0, import_lib4.$T)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L132, 'NonNewlineWhitespace "\\\\\\\\"'), CoffeeLineContinuationEnabled, EOL), function(value) {
16171
+ var NonNewlineWhitespace$1 = (0, import_lib4.$T)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L139, 'NonNewlineWhitespace "\\\\\\\\"'), CoffeeLineContinuationEnabled, EOL), function(value) {
15852
16172
  return " ";
15853
16173
  });
15854
16174
  var NonNewlineWhitespace$$ = [NonNewlineWhitespace$0, NonNewlineWhitespace$1];
@@ -15894,7 +16214,7 @@ ${js}`
15894
16214
  }
15895
16215
  var StatementDelimiter$0 = (0, import_lib4.$Y)(EOS);
15896
16216
  var StatementDelimiter$1 = SemicolonDelimiter;
15897
- var StatementDelimiter$2 = (0, import_lib4.$Y)((0, import_lib4.$S)((0, import_lib4.$E)(_), (0, import_lib4.$C)((0, import_lib4.$EXPECT)($L37, 'StatementDelimiter "}"'), (0, import_lib4.$EXPECT)($L133, 'StatementDelimiter ")"'), (0, import_lib4.$EXPECT)($L46, 'StatementDelimiter "]"'))));
16217
+ var StatementDelimiter$2 = (0, import_lib4.$Y)((0, import_lib4.$S)((0, import_lib4.$E)(_), (0, import_lib4.$C)((0, import_lib4.$EXPECT)($L37, 'StatementDelimiter "}"'), (0, import_lib4.$EXPECT)($L140, 'StatementDelimiter ")"'), (0, import_lib4.$EXPECT)($L46, 'StatementDelimiter "]"'))));
15898
16218
  var StatementDelimiter$$ = [StatementDelimiter$0, StatementDelimiter$1, StatementDelimiter$2];
15899
16219
  function StatementDelimiter(ctx, state2) {
15900
16220
  return (0, import_lib4.$EVENT_C)(ctx, state2, "StatementDelimiter", StatementDelimiter$$);
@@ -15918,7 +16238,7 @@ ${js}`
15918
16238
  function Loc(ctx, state2) {
15919
16239
  return (0, import_lib4.$EVENT)(ctx, state2, "Loc", Loc$0);
15920
16240
  }
15921
- var Abstract$0 = (0, import_lib4.$TV)((0, import_lib4.$TEXT)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L134, 'Abstract "abstract"'), NonIdContinue, (0, import_lib4.$E)((0, import_lib4.$EXPECT)($L18, 'Abstract " "')))), function($skip, $loc, $0, $1) {
16241
+ var Abstract$0 = (0, import_lib4.$TV)((0, import_lib4.$TEXT)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L141, 'Abstract "abstract"'), NonIdContinue, (0, import_lib4.$E)((0, import_lib4.$EXPECT)($L18, 'Abstract " "')))), function($skip, $loc, $0, $1) {
15922
16242
  return { $loc, token: $1, ts: true };
15923
16243
  });
15924
16244
  function Abstract(ctx, state2) {
@@ -15930,43 +16250,43 @@ ${js}`
15930
16250
  function Ampersand(ctx, state2) {
15931
16251
  return (0, import_lib4.$EVENT)(ctx, state2, "Ampersand", Ampersand$0);
15932
16252
  }
15933
- var As$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L135, 'As "as"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16253
+ var As$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L142, 'As "as"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
15934
16254
  return { $loc, token: $1 };
15935
16255
  });
15936
16256
  function As(ctx, state2) {
15937
16257
  return (0, import_lib4.$EVENT)(ctx, state2, "As", As$0);
15938
16258
  }
15939
- var At$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L136, 'At "@"'), function($skip, $loc, $0, $1) {
16259
+ var At$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L143, 'At "@"'), function($skip, $loc, $0, $1) {
15940
16260
  return { $loc, token: $1 };
15941
16261
  });
15942
16262
  function At(ctx, state2) {
15943
16263
  return (0, import_lib4.$EVENT)(ctx, state2, "At", At$0);
15944
16264
  }
15945
- var AtAt$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L137, 'AtAt "@@"'), function($skip, $loc, $0, $1) {
16265
+ var AtAt$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L144, 'AtAt "@@"'), function($skip, $loc, $0, $1) {
15946
16266
  return { $loc, token: "@" };
15947
16267
  });
15948
16268
  function AtAt(ctx, state2) {
15949
16269
  return (0, import_lib4.$EVENT)(ctx, state2, "AtAt", AtAt$0);
15950
16270
  }
15951
- var Async$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L138, 'Async "async"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16271
+ var Async$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L145, 'Async "async"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
15952
16272
  return { $loc, token: $1, type: "Async" };
15953
16273
  });
15954
16274
  function Async(ctx, state2) {
15955
16275
  return (0, import_lib4.$EVENT)(ctx, state2, "Async", Async$0);
15956
16276
  }
15957
- var Await$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L139, 'Await "await"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16277
+ var Await$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L146, 'Await "await"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
15958
16278
  return { $loc, token: $1, type: "Await" };
15959
16279
  });
15960
16280
  function Await(ctx, state2) {
15961
16281
  return (0, import_lib4.$EVENT)(ctx, state2, "Await", Await$0);
15962
16282
  }
15963
- var Backtick$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L140, 'Backtick "`"'), function($skip, $loc, $0, $1) {
16283
+ var Backtick$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L147, 'Backtick "`"'), function($skip, $loc, $0, $1) {
15964
16284
  return { $loc, token: $1 };
15965
16285
  });
15966
16286
  function Backtick(ctx, state2) {
15967
16287
  return (0, import_lib4.$EVENT)(ctx, state2, "Backtick", Backtick$0);
15968
16288
  }
15969
- var By$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L141, 'By "by"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16289
+ var By$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L148, 'By "by"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
15970
16290
  return { $loc, token: $1 };
15971
16291
  });
15972
16292
  function By(ctx, state2) {
@@ -15978,19 +16298,19 @@ ${js}`
15978
16298
  function Caret(ctx, state2) {
15979
16299
  return (0, import_lib4.$EVENT)(ctx, state2, "Caret", Caret$0);
15980
16300
  }
15981
- var Case$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L142, 'Case "case"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16301
+ var Case$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L149, 'Case "case"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
15982
16302
  return { $loc, token: $1 };
15983
16303
  });
15984
16304
  function Case(ctx, state2) {
15985
16305
  return (0, import_lib4.$EVENT)(ctx, state2, "Case", Case$0);
15986
16306
  }
15987
- var Catch$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L143, 'Catch "catch"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16307
+ var Catch$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L150, 'Catch "catch"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
15988
16308
  return { $loc, token: $1 };
15989
16309
  });
15990
16310
  function Catch(ctx, state2) {
15991
16311
  return (0, import_lib4.$EVENT)(ctx, state2, "Catch", Catch$0);
15992
16312
  }
15993
- var Class$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L144, 'Class "class"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16313
+ var Class$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L151, 'Class "class"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
15994
16314
  return { $loc, token: $1 };
15995
16315
  });
15996
16316
  function Class(ctx, state2) {
@@ -16014,13 +16334,13 @@ ${js}`
16014
16334
  function CloseBracket(ctx, state2) {
16015
16335
  return (0, import_lib4.$EVENT)(ctx, state2, "CloseBracket", CloseBracket$0);
16016
16336
  }
16017
- var CloseParen$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L133, 'CloseParen ")"'), function($skip, $loc, $0, $1) {
16337
+ var CloseParen$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L140, 'CloseParen ")"'), function($skip, $loc, $0, $1) {
16018
16338
  return { $loc, token: $1 };
16019
16339
  });
16020
16340
  function CloseParen(ctx, state2) {
16021
16341
  return (0, import_lib4.$EVENT)(ctx, state2, "CloseParen", CloseParen$0);
16022
16342
  }
16023
- var CoffeeSubstitutionStart$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L145, 'CoffeeSubstitutionStart "#{"'), function($skip, $loc, $0, $1) {
16343
+ var CoffeeSubstitutionStart$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L152, 'CoffeeSubstitutionStart "#{"'), function($skip, $loc, $0, $1) {
16024
16344
  return { $loc, token: "${" };
16025
16345
  });
16026
16346
  function CoffeeSubstitutionStart(ctx, state2) {
@@ -16038,37 +16358,37 @@ ${js}`
16038
16358
  function Comma(ctx, state2) {
16039
16359
  return (0, import_lib4.$EVENT)(ctx, state2, "Comma", Comma$0);
16040
16360
  }
16041
- var Comptime$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L146, 'Comptime "comptime"'), NonIdContinue, (0, import_lib4.$N)((0, import_lib4.$EXPECT)($L16, 'Comptime ":"'))), function($skip, $loc, $0, $1, $2, $3) {
16361
+ var Comptime$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L153, 'Comptime "comptime"'), NonIdContinue, (0, import_lib4.$N)((0, import_lib4.$EXPECT)($L16, 'Comptime ":"'))), function($skip, $loc, $0, $1, $2, $3) {
16042
16362
  return { $loc, token: $1 };
16043
16363
  });
16044
16364
  function Comptime(ctx, state2) {
16045
16365
  return (0, import_lib4.$EVENT)(ctx, state2, "Comptime", Comptime$0);
16046
16366
  }
16047
- var ConstructorShorthand$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L136, 'ConstructorShorthand "@"'), function($skip, $loc, $0, $1) {
16367
+ var ConstructorShorthand$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L143, 'ConstructorShorthand "@"'), function($skip, $loc, $0, $1) {
16048
16368
  return { $loc, token: "constructor" };
16049
16369
  });
16050
16370
  function ConstructorShorthand(ctx, state2) {
16051
16371
  return (0, import_lib4.$EVENT)(ctx, state2, "ConstructorShorthand", ConstructorShorthand$0);
16052
16372
  }
16053
- var Declare$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L147, 'Declare "declare"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16373
+ var Declare$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L154, 'Declare "declare"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16054
16374
  return { $loc, token: $1 };
16055
16375
  });
16056
16376
  function Declare(ctx, state2) {
16057
16377
  return (0, import_lib4.$EVENT)(ctx, state2, "Declare", Declare$0);
16058
16378
  }
16059
- var Default$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L148, 'Default "default"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16379
+ var Default$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L155, 'Default "default"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16060
16380
  return { $loc, token: $1 };
16061
16381
  });
16062
16382
  function Default(ctx, state2) {
16063
16383
  return (0, import_lib4.$EVENT)(ctx, state2, "Default", Default$0);
16064
16384
  }
16065
- var Delete$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L149, 'Delete "delete"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16385
+ var Delete$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L156, 'Delete "delete"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16066
16386
  return { $loc, token: $1 };
16067
16387
  });
16068
16388
  function Delete(ctx, state2) {
16069
16389
  return (0, import_lib4.$EVENT)(ctx, state2, "Delete", Delete$0);
16070
16390
  }
16071
- var Do$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L150, 'Do "do"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16391
+ var Do$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L157, 'Do "do"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16072
16392
  return { $loc, token: $1 };
16073
16393
  });
16074
16394
  function Do(ctx, state2) {
@@ -16088,51 +16408,51 @@ ${js}`
16088
16408
  function Dot(ctx, state2) {
16089
16409
  return (0, import_lib4.$EVENT_C)(ctx, state2, "Dot", Dot$$);
16090
16410
  }
16091
- var DotDot$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L151, 'DotDot ".."'), (0, import_lib4.$N)((0, import_lib4.$EXPECT)($L7, 'DotDot "."'))), function($skip, $loc, $0, $1, $2) {
16411
+ var DotDot$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L158, 'DotDot ".."'), (0, import_lib4.$N)((0, import_lib4.$EXPECT)($L7, 'DotDot "."'))), function($skip, $loc, $0, $1, $2) {
16092
16412
  return { $loc, token: $1 };
16093
16413
  });
16094
- var DotDot$1 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L152, 'DotDot "\u2025"'), function($skip, $loc, $0, $1) {
16414
+ var DotDot$1 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L159, 'DotDot "\u2025"'), function($skip, $loc, $0, $1) {
16095
16415
  return { $loc, token: ".." };
16096
16416
  });
16097
16417
  var DotDot$$ = [DotDot$0, DotDot$1];
16098
16418
  function DotDot(ctx, state2) {
16099
16419
  return (0, import_lib4.$EVENT_C)(ctx, state2, "DotDot", DotDot$$);
16100
16420
  }
16101
- var DotDotDot$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L153, 'DotDotDot "..."'), function($skip, $loc, $0, $1) {
16421
+ var DotDotDot$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L160, 'DotDotDot "..."'), function($skip, $loc, $0, $1) {
16102
16422
  return { $loc, token: $1 };
16103
16423
  });
16104
- var DotDotDot$1 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L154, 'DotDotDot "\u2026"'), function($skip, $loc, $0, $1) {
16424
+ var DotDotDot$1 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L161, 'DotDotDot "\u2026"'), function($skip, $loc, $0, $1) {
16105
16425
  return { $loc, token: "..." };
16106
16426
  });
16107
16427
  var DotDotDot$$ = [DotDotDot$0, DotDotDot$1];
16108
16428
  function DotDotDot(ctx, state2) {
16109
16429
  return (0, import_lib4.$EVENT_C)(ctx, state2, "DotDotDot", DotDotDot$$);
16110
16430
  }
16111
- var DoubleColon$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L155, 'DoubleColon "::"'), function($skip, $loc, $0, $1) {
16431
+ var DoubleColon$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L162, 'DoubleColon "::"'), function($skip, $loc, $0, $1) {
16112
16432
  return { $loc, token: $1 };
16113
16433
  });
16114
16434
  function DoubleColon(ctx, state2) {
16115
16435
  return (0, import_lib4.$EVENT)(ctx, state2, "DoubleColon", DoubleColon$0);
16116
16436
  }
16117
- var DoubleColonAsColon$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L155, 'DoubleColonAsColon "::"'), function($skip, $loc, $0, $1) {
16437
+ var DoubleColonAsColon$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L162, 'DoubleColonAsColon "::"'), function($skip, $loc, $0, $1) {
16118
16438
  return { $loc, token: ":" };
16119
16439
  });
16120
16440
  function DoubleColonAsColon(ctx, state2) {
16121
16441
  return (0, import_lib4.$EVENT)(ctx, state2, "DoubleColonAsColon", DoubleColonAsColon$0);
16122
16442
  }
16123
- var DoubleQuote$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L156, 'DoubleQuote "\\\\\\""'), function($skip, $loc, $0, $1) {
16443
+ var DoubleQuote$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L163, 'DoubleQuote "\\\\\\""'), function($skip, $loc, $0, $1) {
16124
16444
  return { $loc, token: $1 };
16125
16445
  });
16126
16446
  function DoubleQuote(ctx, state2) {
16127
16447
  return (0, import_lib4.$EVENT)(ctx, state2, "DoubleQuote", DoubleQuote$0);
16128
16448
  }
16129
- var Each$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L157, 'Each "each"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16449
+ var Each$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L164, 'Each "each"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16130
16450
  return { $loc, token: $1 };
16131
16451
  });
16132
16452
  function Each(ctx, state2) {
16133
16453
  return (0, import_lib4.$EVENT)(ctx, state2, "Each", Each$0);
16134
16454
  }
16135
- var Else$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L158, 'Else "else"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16455
+ var Else$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L165, 'Else "else"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16136
16456
  return { $loc, token: $1 };
16137
16457
  });
16138
16458
  function Else(ctx, state2) {
@@ -16144,61 +16464,61 @@ ${js}`
16144
16464
  function Equals(ctx, state2) {
16145
16465
  return (0, import_lib4.$EVENT)(ctx, state2, "Equals", Equals$0);
16146
16466
  }
16147
- var ExclamationPoint$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L159, 'ExclamationPoint "!"'), function($skip, $loc, $0, $1) {
16467
+ var ExclamationPoint$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L166, 'ExclamationPoint "!"'), function($skip, $loc, $0, $1) {
16148
16468
  return { $loc, token: $1 };
16149
16469
  });
16150
16470
  function ExclamationPoint(ctx, state2) {
16151
16471
  return (0, import_lib4.$EVENT)(ctx, state2, "ExclamationPoint", ExclamationPoint$0);
16152
16472
  }
16153
- var Export$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L160, 'Export "export"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16473
+ var Export$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L167, 'Export "export"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16154
16474
  return { $loc, token: $1 };
16155
16475
  });
16156
16476
  function Export(ctx, state2) {
16157
16477
  return (0, import_lib4.$EVENT)(ctx, state2, "Export", Export$0);
16158
16478
  }
16159
- var Extends$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L161, 'Extends "extends"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16479
+ var Extends$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L168, 'Extends "extends"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16160
16480
  return { $loc, token: $1 };
16161
16481
  });
16162
16482
  function Extends(ctx, state2) {
16163
16483
  return (0, import_lib4.$EVENT)(ctx, state2, "Extends", Extends$0);
16164
16484
  }
16165
- var Finally$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L162, 'Finally "finally"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16485
+ var Finally$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L169, 'Finally "finally"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16166
16486
  return { $loc, token: $1 };
16167
16487
  });
16168
16488
  function Finally(ctx, state2) {
16169
16489
  return (0, import_lib4.$EVENT)(ctx, state2, "Finally", Finally$0);
16170
16490
  }
16171
- var For$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L163, 'For "for"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16491
+ var For$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L170, 'For "for"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16172
16492
  return { $loc, token: $1 };
16173
16493
  });
16174
16494
  function For(ctx, state2) {
16175
16495
  return (0, import_lib4.$EVENT)(ctx, state2, "For", For$0);
16176
16496
  }
16177
- var From$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L164, 'From "from"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16497
+ var From$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L171, 'From "from"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16178
16498
  return { $loc, token: $1 };
16179
16499
  });
16180
16500
  function From(ctx, state2) {
16181
16501
  return (0, import_lib4.$EVENT)(ctx, state2, "From", From$0);
16182
16502
  }
16183
- var Function$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L165, 'Function "function"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16503
+ var Function$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L172, 'Function "function"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16184
16504
  return { $loc, token: $1 };
16185
16505
  });
16186
16506
  function Function2(ctx, state2) {
16187
16507
  return (0, import_lib4.$EVENT)(ctx, state2, "Function", Function$0);
16188
16508
  }
16189
- var GetOrSet$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L166, 'GetOrSet "get"'), (0, import_lib4.$EXPECT)($L167, 'GetOrSet "set"')), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16509
+ var GetOrSet$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L173, 'GetOrSet "get"'), (0, import_lib4.$EXPECT)($L174, 'GetOrSet "set"')), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16190
16510
  return { $loc, token: $1, type: "GetOrSet" };
16191
16511
  });
16192
16512
  function GetOrSet(ctx, state2) {
16193
16513
  return (0, import_lib4.$EVENT)(ctx, state2, "GetOrSet", GetOrSet$0);
16194
16514
  }
16195
- var Hash$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L168, 'Hash "#"'), function($skip, $loc, $0, $1) {
16515
+ var Hash$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L175, 'Hash "#"'), function($skip, $loc, $0, $1) {
16196
16516
  return { $loc, token: $1 };
16197
16517
  });
16198
16518
  function Hash(ctx, state2) {
16199
16519
  return (0, import_lib4.$EVENT)(ctx, state2, "Hash", Hash$0);
16200
16520
  }
16201
- var If$0 = (0, import_lib4.$TV)((0, import_lib4.$TEXT)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L169, 'If "if"'), NonIdContinue, (0, import_lib4.$E)((0, import_lib4.$EXPECT)($L18, 'If " "')))), function($skip, $loc, $0, $1) {
16521
+ var If$0 = (0, import_lib4.$TV)((0, import_lib4.$TEXT)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L176, 'If "if"'), NonIdContinue, (0, import_lib4.$E)((0, import_lib4.$EXPECT)($L18, 'If " "')))), function($skip, $loc, $0, $1) {
16202
16522
  return { $loc, token: $1 };
16203
16523
  });
16204
16524
  function If(ctx, state2) {
@@ -16210,67 +16530,67 @@ ${js}`
16210
16530
  function Import(ctx, state2) {
16211
16531
  return (0, import_lib4.$EVENT)(ctx, state2, "Import", Import$0);
16212
16532
  }
16213
- var In$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L170, 'In "in"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16533
+ var In$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L177, 'In "in"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16214
16534
  return { $loc, token: $1 };
16215
16535
  });
16216
16536
  function In(ctx, state2) {
16217
16537
  return (0, import_lib4.$EVENT)(ctx, state2, "In", In$0);
16218
16538
  }
16219
- var Infer$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L171, 'Infer "infer"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16539
+ var Infer$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L178, 'Infer "infer"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16220
16540
  return { $loc, token: $1 };
16221
16541
  });
16222
16542
  function Infer(ctx, state2) {
16223
16543
  return (0, import_lib4.$EVENT)(ctx, state2, "Infer", Infer$0);
16224
16544
  }
16225
- var LetOrConst$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L172, 'LetOrConst "let"'), (0, import_lib4.$EXPECT)($L173, 'LetOrConst "const"')), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16545
+ var LetOrConst$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L179, 'LetOrConst "let"'), (0, import_lib4.$EXPECT)($L180, 'LetOrConst "const"')), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16226
16546
  return { $loc, token: $1 };
16227
16547
  });
16228
16548
  function LetOrConst(ctx, state2) {
16229
16549
  return (0, import_lib4.$EVENT)(ctx, state2, "LetOrConst", LetOrConst$0);
16230
16550
  }
16231
- var Const$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L173, 'Const "const"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16551
+ var Const$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L180, 'Const "const"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16232
16552
  return { $loc, token: $1 };
16233
16553
  });
16234
16554
  function Const(ctx, state2) {
16235
16555
  return (0, import_lib4.$EVENT)(ctx, state2, "Const", Const$0);
16236
16556
  }
16237
- var Is$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L174, 'Is "is"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16557
+ var Is$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L181, 'Is "is"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16238
16558
  return { $loc, token: $1 };
16239
16559
  });
16240
16560
  function Is(ctx, state2) {
16241
16561
  return (0, import_lib4.$EVENT)(ctx, state2, "Is", Is$0);
16242
16562
  }
16243
- var LetOrConstOrVar$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L172, 'LetOrConstOrVar "let"'), (0, import_lib4.$EXPECT)($L173, 'LetOrConstOrVar "const"'), (0, import_lib4.$EXPECT)($L175, 'LetOrConstOrVar "var"')), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16563
+ var LetOrConstOrVar$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L179, 'LetOrConstOrVar "let"'), (0, import_lib4.$EXPECT)($L180, 'LetOrConstOrVar "const"'), (0, import_lib4.$EXPECT)($L182, 'LetOrConstOrVar "var"')), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16244
16564
  return { $loc, token: $1 };
16245
16565
  });
16246
16566
  function LetOrConstOrVar(ctx, state2) {
16247
16567
  return (0, import_lib4.$EVENT)(ctx, state2, "LetOrConstOrVar", LetOrConstOrVar$0);
16248
16568
  }
16249
- var Like$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L176, 'Like "like"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16569
+ var Like$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L183, 'Like "like"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16250
16570
  return { $loc, token: $1 };
16251
16571
  });
16252
16572
  function Like(ctx, state2) {
16253
16573
  return (0, import_lib4.$EVENT)(ctx, state2, "Like", Like$0);
16254
16574
  }
16255
- var Loop$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L177, 'Loop "loop"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16575
+ var Loop$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L184, 'Loop "loop"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16256
16576
  return { $loc, token: "while" };
16257
16577
  });
16258
16578
  function Loop(ctx, state2) {
16259
16579
  return (0, import_lib4.$EVENT)(ctx, state2, "Loop", Loop$0);
16260
16580
  }
16261
- var New$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L178, 'New "new"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16581
+ var New$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L185, 'New "new"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16262
16582
  return { $loc, token: $1 };
16263
16583
  });
16264
16584
  function New(ctx, state2) {
16265
16585
  return (0, import_lib4.$EVENT)(ctx, state2, "New", New$0);
16266
16586
  }
16267
- var Not$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L179, 'Not "not"'), NonIdContinue, (0, import_lib4.$N)((0, import_lib4.$S)((0, import_lib4.$E)(_), (0, import_lib4.$EXPECT)($L16, 'Not ":"')))), function($skip, $loc, $0, $1, $2, $3) {
16587
+ var Not$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L186, 'Not "not"'), NonIdContinue, (0, import_lib4.$N)((0, import_lib4.$S)((0, import_lib4.$E)(_), (0, import_lib4.$EXPECT)($L16, 'Not ":"')))), function($skip, $loc, $0, $1, $2, $3) {
16268
16588
  return { $loc, token: "!" };
16269
16589
  });
16270
16590
  function Not(ctx, state2) {
16271
16591
  return (0, import_lib4.$EVENT)(ctx, state2, "Not", Not$0);
16272
16592
  }
16273
- var Of$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L180, 'Of "of"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16593
+ var Of$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L187, 'Of "of"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16274
16594
  return { $loc, token: $1 };
16275
16595
  });
16276
16596
  function Of(ctx, state2) {
@@ -16288,7 +16608,7 @@ ${js}`
16288
16608
  function OpenBrace(ctx, state2) {
16289
16609
  return (0, import_lib4.$EVENT)(ctx, state2, "OpenBrace", OpenBrace$0);
16290
16610
  }
16291
- var OpenBracket$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L181, 'OpenBracket "["'), function($skip, $loc, $0, $1) {
16611
+ var OpenBracket$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L188, 'OpenBracket "["'), function($skip, $loc, $0, $1) {
16292
16612
  return { $loc, token: $1 };
16293
16613
  });
16294
16614
  function OpenBracket(ctx, state2) {
@@ -16300,49 +16620,49 @@ ${js}`
16300
16620
  function OpenParen(ctx, state2) {
16301
16621
  return (0, import_lib4.$EVENT)(ctx, state2, "OpenParen", OpenParen$0);
16302
16622
  }
16303
- var Operator$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L182, 'Operator "operator"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16623
+ var Operator$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L189, 'Operator "operator"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16304
16624
  return { $loc, token: $1 };
16305
16625
  });
16306
16626
  function Operator(ctx, state2) {
16307
16627
  return (0, import_lib4.$EVENT)(ctx, state2, "Operator", Operator$0);
16308
16628
  }
16309
- var Override$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L183, 'Override "override"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16629
+ var Override$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L190, 'Override "override"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16310
16630
  return { $loc, token: $1, ts: true };
16311
16631
  });
16312
16632
  function Override(ctx, state2) {
16313
16633
  return (0, import_lib4.$EVENT)(ctx, state2, "Override", Override$0);
16314
16634
  }
16315
- var Own$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L184, 'Own "own"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16635
+ var Own$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L191, 'Own "own"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16316
16636
  return { $loc, token: $1 };
16317
16637
  });
16318
16638
  function Own(ctx, state2) {
16319
16639
  return (0, import_lib4.$EVENT)(ctx, state2, "Own", Own$0);
16320
16640
  }
16321
- var Public$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L185, 'Public "public"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16641
+ var Public$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L192, 'Public "public"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16322
16642
  return { $loc, token: $1 };
16323
16643
  });
16324
16644
  function Public(ctx, state2) {
16325
16645
  return (0, import_lib4.$EVENT)(ctx, state2, "Public", Public$0);
16326
16646
  }
16327
- var Private$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L186, 'Private "private"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16647
+ var Private$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L193, 'Private "private"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16328
16648
  return { $loc, token: $1 };
16329
16649
  });
16330
16650
  function Private(ctx, state2) {
16331
16651
  return (0, import_lib4.$EVENT)(ctx, state2, "Private", Private$0);
16332
16652
  }
16333
- var Protected$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L187, 'Protected "protected"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16653
+ var Protected$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L194, 'Protected "protected"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16334
16654
  return { $loc, token: $1 };
16335
16655
  });
16336
16656
  function Protected(ctx, state2) {
16337
16657
  return (0, import_lib4.$EVENT)(ctx, state2, "Protected", Protected$0);
16338
16658
  }
16339
- var Pipe$0 = (0, import_lib4.$TV)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L188, 'Pipe "||>"'), (0, import_lib4.$EXPECT)($L189, 'Pipe "|\u25B7"')), function($skip, $loc, $0, $1) {
16659
+ var Pipe$0 = (0, import_lib4.$TV)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L195, 'Pipe "||>"'), (0, import_lib4.$EXPECT)($L196, 'Pipe "|\u25B7"')), function($skip, $loc, $0, $1) {
16340
16660
  return { $loc, token: "||>" };
16341
16661
  });
16342
- var Pipe$1 = (0, import_lib4.$TV)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L190, 'Pipe "|>="'), (0, import_lib4.$EXPECT)($L191, 'Pipe "\u25B7="')), function($skip, $loc, $0, $1) {
16662
+ var Pipe$1 = (0, import_lib4.$TV)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L197, 'Pipe "|>="'), (0, import_lib4.$EXPECT)($L198, 'Pipe "\u25B7="')), function($skip, $loc, $0, $1) {
16343
16663
  return { $loc, token: "|>=" };
16344
16664
  });
16345
- var Pipe$2 = (0, import_lib4.$TV)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L192, 'Pipe "|>"'), (0, import_lib4.$EXPECT)($L193, 'Pipe "\u25B7"')), function($skip, $loc, $0, $1) {
16665
+ var Pipe$2 = (0, import_lib4.$TV)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L199, 'Pipe "|>"'), (0, import_lib4.$EXPECT)($L200, 'Pipe "\u25B7"')), function($skip, $loc, $0, $1) {
16346
16666
  return { $loc, token: "|>" };
16347
16667
  });
16348
16668
  var Pipe$$ = [Pipe$0, Pipe$1, Pipe$2];
@@ -16355,19 +16675,19 @@ ${js}`
16355
16675
  function QuestionMark(ctx, state2) {
16356
16676
  return (0, import_lib4.$EVENT)(ctx, state2, "QuestionMark", QuestionMark$0);
16357
16677
  }
16358
- var Readonly$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L194, 'Readonly "readonly"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16678
+ var Readonly$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L201, 'Readonly "readonly"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16359
16679
  return { $loc, token: $1, ts: true };
16360
16680
  });
16361
16681
  function Readonly(ctx, state2) {
16362
16682
  return (0, import_lib4.$EVENT)(ctx, state2, "Readonly", Readonly$0);
16363
16683
  }
16364
- var Return$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L195, 'Return "return"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16684
+ var Return$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L202, 'Return "return"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16365
16685
  return { $loc, token: $1 };
16366
16686
  });
16367
16687
  function Return(ctx, state2) {
16368
16688
  return (0, import_lib4.$EVENT)(ctx, state2, "Return", Return$0);
16369
16689
  }
16370
- var Satisfies$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L196, 'Satisfies "satisfies"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16690
+ var Satisfies$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L203, 'Satisfies "satisfies"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16371
16691
  return { $loc, token: $1 };
16372
16692
  });
16373
16693
  function Satisfies(ctx, state2) {
@@ -16379,7 +16699,7 @@ ${js}`
16379
16699
  function Semicolon(ctx, state2) {
16380
16700
  return (0, import_lib4.$EVENT)(ctx, state2, "Semicolon", Semicolon$0);
16381
16701
  }
16382
- var SingleQuote$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L197, `SingleQuote "'"`), function($skip, $loc, $0, $1) {
16702
+ var SingleQuote$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L204, `SingleQuote "'"`), function($skip, $loc, $0, $1) {
16383
16703
  return { $loc, token: $1 };
16384
16704
  });
16385
16705
  function SingleQuote(ctx, state2) {
@@ -16391,149 +16711,149 @@ ${js}`
16391
16711
  function Star(ctx, state2) {
16392
16712
  return (0, import_lib4.$EVENT)(ctx, state2, "Star", Star$0);
16393
16713
  }
16394
- var Static$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L198, 'Static "static"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16714
+ var Static$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L205, 'Static "static"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16395
16715
  return { $loc, token: $1 };
16396
16716
  });
16397
- var Static$1 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L136, 'Static "@"'), (0, import_lib4.$N)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L4, 'Static "("'), (0, import_lib4.$EXPECT)($L136, 'Static "@"')))), function($skip, $loc, $0, $1, $2) {
16717
+ var Static$1 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L143, 'Static "@"'), (0, import_lib4.$N)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L4, 'Static "("'), (0, import_lib4.$EXPECT)($L143, 'Static "@"')))), function($skip, $loc, $0, $1, $2) {
16398
16718
  return { $loc, token: "static " };
16399
16719
  });
16400
16720
  var Static$$ = [Static$0, Static$1];
16401
16721
  function Static(ctx, state2) {
16402
16722
  return (0, import_lib4.$EVENT_C)(ctx, state2, "Static", Static$$);
16403
16723
  }
16404
- var SubstitutionStart$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L199, 'SubstitutionStart "${"'), function($skip, $loc, $0, $1) {
16724
+ var SubstitutionStart$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L206, 'SubstitutionStart "${"'), function($skip, $loc, $0, $1) {
16405
16725
  return { $loc, token: $1 };
16406
16726
  });
16407
16727
  function SubstitutionStart(ctx, state2) {
16408
16728
  return (0, import_lib4.$EVENT)(ctx, state2, "SubstitutionStart", SubstitutionStart$0);
16409
16729
  }
16410
- var Super$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L200, 'Super "super"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16730
+ var Super$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L207, 'Super "super"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16411
16731
  return { $loc, token: $1 };
16412
16732
  });
16413
16733
  function Super(ctx, state2) {
16414
16734
  return (0, import_lib4.$EVENT)(ctx, state2, "Super", Super$0);
16415
16735
  }
16416
- var Switch$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L201, 'Switch "switch"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16736
+ var Switch$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L208, 'Switch "switch"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16417
16737
  return { $loc, token: $1 };
16418
16738
  });
16419
16739
  function Switch(ctx, state2) {
16420
16740
  return (0, import_lib4.$EVENT)(ctx, state2, "Switch", Switch$0);
16421
16741
  }
16422
- var Target$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L202, 'Target "target"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16742
+ var Target$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L209, 'Target "target"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16423
16743
  return { $loc, token: $1 };
16424
16744
  });
16425
16745
  function Target(ctx, state2) {
16426
16746
  return (0, import_lib4.$EVENT)(ctx, state2, "Target", Target$0);
16427
16747
  }
16428
- var Then$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(__, (0, import_lib4.$EXPECT)($L203, 'Then "then"'), NonIdContinue), function($skip, $loc, $0, $1, $2, $3) {
16748
+ var Then$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(__, (0, import_lib4.$EXPECT)($L210, 'Then "then"'), NonIdContinue), function($skip, $loc, $0, $1, $2, $3) {
16429
16749
  return { $loc, token: "" };
16430
16750
  });
16431
16751
  function Then(ctx, state2) {
16432
16752
  return (0, import_lib4.$EVENT)(ctx, state2, "Then", Then$0);
16433
16753
  }
16434
- var This$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L204, 'This "this"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16754
+ var This$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L211, 'This "this"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16435
16755
  return { $loc, token: $1 };
16436
16756
  });
16437
16757
  function This(ctx, state2) {
16438
16758
  return (0, import_lib4.$EVENT)(ctx, state2, "This", This$0);
16439
16759
  }
16440
- var Throw$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L205, 'Throw "throw"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16760
+ var Throw$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L212, 'Throw "throw"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16441
16761
  return { $loc, token: $1 };
16442
16762
  });
16443
16763
  function Throw(ctx, state2) {
16444
16764
  return (0, import_lib4.$EVENT)(ctx, state2, "Throw", Throw$0);
16445
16765
  }
16446
- var TripleDoubleQuote$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L206, 'TripleDoubleQuote "\\\\\\"\\\\\\"\\\\\\""'), function($skip, $loc, $0, $1) {
16766
+ var TripleDoubleQuote$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L213, 'TripleDoubleQuote "\\\\\\"\\\\\\"\\\\\\""'), function($skip, $loc, $0, $1) {
16447
16767
  return { $loc, token: "`" };
16448
16768
  });
16449
16769
  function TripleDoubleQuote(ctx, state2) {
16450
16770
  return (0, import_lib4.$EVENT)(ctx, state2, "TripleDoubleQuote", TripleDoubleQuote$0);
16451
16771
  }
16452
- var TripleSingleQuote$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L207, `TripleSingleQuote "'''"`), function($skip, $loc, $0, $1) {
16772
+ var TripleSingleQuote$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L214, `TripleSingleQuote "'''"`), function($skip, $loc, $0, $1) {
16453
16773
  return { $loc, token: "`" };
16454
16774
  });
16455
16775
  function TripleSingleQuote(ctx, state2) {
16456
16776
  return (0, import_lib4.$EVENT)(ctx, state2, "TripleSingleQuote", TripleSingleQuote$0);
16457
16777
  }
16458
- var TripleSlash$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L208, 'TripleSlash "///"'), function($skip, $loc, $0, $1) {
16778
+ var TripleSlash$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L215, 'TripleSlash "///"'), function($skip, $loc, $0, $1) {
16459
16779
  return { $loc, token: "/" };
16460
16780
  });
16461
16781
  function TripleSlash(ctx, state2) {
16462
16782
  return (0, import_lib4.$EVENT)(ctx, state2, "TripleSlash", TripleSlash$0);
16463
16783
  }
16464
- var TripleTick$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L209, 'TripleTick "```"'), function($skip, $loc, $0, $1) {
16784
+ var TripleTick$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L216, 'TripleTick "```"'), function($skip, $loc, $0, $1) {
16465
16785
  return { $loc, token: "`" };
16466
16786
  });
16467
16787
  function TripleTick(ctx, state2) {
16468
16788
  return (0, import_lib4.$EVENT)(ctx, state2, "TripleTick", TripleTick$0);
16469
16789
  }
16470
- var Try$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L210, 'Try "try"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16790
+ var Try$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L217, 'Try "try"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16471
16791
  return { $loc, token: $1 };
16472
16792
  });
16473
16793
  function Try(ctx, state2) {
16474
16794
  return (0, import_lib4.$EVENT)(ctx, state2, "Try", Try$0);
16475
16795
  }
16476
- var Typeof$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L211, 'Typeof "typeof"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16796
+ var Typeof$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L218, 'Typeof "typeof"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16477
16797
  return { $loc, token: $1 };
16478
16798
  });
16479
16799
  function Typeof(ctx, state2) {
16480
16800
  return (0, import_lib4.$EVENT)(ctx, state2, "Typeof", Typeof$0);
16481
16801
  }
16482
- var Undefined$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L212, 'Undefined "undefined"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16802
+ var Undefined$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L219, 'Undefined "undefined"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16483
16803
  return { $loc, token: $1 };
16484
16804
  });
16485
16805
  function Undefined(ctx, state2) {
16486
16806
  return (0, import_lib4.$EVENT)(ctx, state2, "Undefined", Undefined$0);
16487
16807
  }
16488
- var Unless$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L213, 'Unless "unless"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16808
+ var Unless$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L220, 'Unless "unless"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16489
16809
  return { $loc, token: $1, negated: true };
16490
16810
  });
16491
16811
  function Unless(ctx, state2) {
16492
16812
  return (0, import_lib4.$EVENT)(ctx, state2, "Unless", Unless$0);
16493
16813
  }
16494
- var Until$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L214, 'Until "until"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16814
+ var Until$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L221, 'Until "until"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16495
16815
  return { $loc, token: $1, negated: true };
16496
16816
  });
16497
16817
  function Until(ctx, state2) {
16498
16818
  return (0, import_lib4.$EVENT)(ctx, state2, "Until", Until$0);
16499
16819
  }
16500
- var Using$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L215, 'Using "using"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16820
+ var Using$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L222, 'Using "using"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16501
16821
  return { $loc, token: $1 };
16502
16822
  });
16503
16823
  function Using(ctx, state2) {
16504
16824
  return (0, import_lib4.$EVENT)(ctx, state2, "Using", Using$0);
16505
16825
  }
16506
- var Var$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L175, 'Var "var"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16826
+ var Var$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L182, 'Var "var"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16507
16827
  return { $loc, token: $1 };
16508
16828
  });
16509
16829
  function Var(ctx, state2) {
16510
16830
  return (0, import_lib4.$EVENT)(ctx, state2, "Var", Var$0);
16511
16831
  }
16512
- var Void$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L216, 'Void "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16832
+ var Void$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L223, 'Void "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16513
16833
  return { $loc, token: $1 };
16514
16834
  });
16515
16835
  function Void(ctx, state2) {
16516
16836
  return (0, import_lib4.$EVENT)(ctx, state2, "Void", Void$0);
16517
16837
  }
16518
- var When$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L217, 'When "when"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16838
+ var When$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L224, 'When "when"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16519
16839
  return { $loc, token: "case" };
16520
16840
  });
16521
16841
  function When(ctx, state2) {
16522
16842
  return (0, import_lib4.$EVENT)(ctx, state2, "When", When$0);
16523
16843
  }
16524
- var While$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L218, 'While "while"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16844
+ var While$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L225, 'While "while"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16525
16845
  return { $loc, token: $1 };
16526
16846
  });
16527
16847
  function While(ctx, state2) {
16528
16848
  return (0, import_lib4.$EVENT)(ctx, state2, "While", While$0);
16529
16849
  }
16530
- var With$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L124, 'With "with"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16850
+ var With$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L131, 'With "with"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16531
16851
  return { $loc, token: $1 };
16532
16852
  });
16533
16853
  function With(ctx, state2) {
16534
16854
  return (0, import_lib4.$EVENT)(ctx, state2, "With", With$0);
16535
16855
  }
16536
- var Yield$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L219, 'Yield "yield"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16856
+ var Yield$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L226, 'Yield "yield"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
16537
16857
  return { $loc, token: $1, type: "Yield" };
16538
16858
  });
16539
16859
  function Yield(ctx, state2) {
@@ -16552,7 +16872,7 @@ ${js}`
16552
16872
  ],
16553
16873
  jsxChildren: [$1].concat($2.map(([, tag]) => tag))
16554
16874
  };
16555
- const type = typeOfJSX(jsx, config, getHelperRef);
16875
+ const type = typeOfJSX(jsx, config);
16556
16876
  return type ? [
16557
16877
  { ts: true, children: ["("] },
16558
16878
  jsx,
@@ -16612,7 +16932,7 @@ ${js}`
16612
16932
  function JSXElement(ctx, state2) {
16613
16933
  return (0, import_lib4.$EVENT_C)(ctx, state2, "JSXElement", JSXElement$$);
16614
16934
  }
16615
- var JSXSelfClosingElement$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L19, 'JSXSelfClosingElement "<"'), JSXElementName, (0, import_lib4.$E)(TypeArguments), (0, import_lib4.$E)(JSXAttributes), (0, import_lib4.$E)(Whitespace), (0, import_lib4.$EXPECT)($L220, 'JSXSelfClosingElement "/>"')), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
16935
+ var JSXSelfClosingElement$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L19, 'JSXSelfClosingElement "<"'), JSXElementName, (0, import_lib4.$E)(TypeArguments), (0, import_lib4.$E)(JSXAttributes), (0, import_lib4.$E)(Whitespace), (0, import_lib4.$EXPECT)($L227, 'JSXSelfClosingElement "/>"')), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
16616
16936
  return { type: "JSXElement", children: $0, tag: $2 };
16617
16937
  });
16618
16938
  function JSXSelfClosingElement(ctx, state2) {
@@ -16646,7 +16966,7 @@ ${js}`
16646
16966
  function JSXOptionalClosingElement(ctx, state2) {
16647
16967
  return (0, import_lib4.$EVENT_C)(ctx, state2, "JSXOptionalClosingElement", JSXOptionalClosingElement$$);
16648
16968
  }
16649
- var JSXClosingElement$0 = (0, import_lib4.$S)((0, import_lib4.$EXPECT)($L221, 'JSXClosingElement "</"'), (0, import_lib4.$E)(Whitespace), JSXElementName, (0, import_lib4.$E)(Whitespace), (0, import_lib4.$EXPECT)($L45, 'JSXClosingElement ">"'));
16969
+ var JSXClosingElement$0 = (0, import_lib4.$S)((0, import_lib4.$EXPECT)($L228, 'JSXClosingElement "</"'), (0, import_lib4.$E)(Whitespace), JSXElementName, (0, import_lib4.$E)(Whitespace), (0, import_lib4.$EXPECT)($L45, 'JSXClosingElement ">"'));
16650
16970
  function JSXClosingElement(ctx, state2) {
16651
16971
  return (0, import_lib4.$EVENT)(ctx, state2, "JSXClosingElement", JSXClosingElement$0);
16652
16972
  }
@@ -16667,7 +16987,7 @@ ${js}`
16667
16987
  ];
16668
16988
  return { type: "JSXFragment", children: parts, jsxChildren: children.jsxChildren };
16669
16989
  });
16670
- var JSXFragment$1 = (0, import_lib4.$TS)((0, import_lib4.$S)(CoffeeJSXEnabled, (0, import_lib4.$EXPECT)($L222, 'JSXFragment "<>"'), (0, import_lib4.$E)(JSXChildren), (0, import_lib4.$E)(Whitespace), JSXClosingFragment), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
16990
+ var JSXFragment$1 = (0, import_lib4.$TS)((0, import_lib4.$S)(CoffeeJSXEnabled, (0, import_lib4.$EXPECT)($L229, 'JSXFragment "<>"'), (0, import_lib4.$E)(JSXChildren), (0, import_lib4.$E)(Whitespace), JSXClosingFragment), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
16671
16991
  var children = $3;
16672
16992
  $0 = $0.slice(1);
16673
16993
  return {
@@ -16680,7 +17000,7 @@ ${js}`
16680
17000
  function JSXFragment(ctx, state2) {
16681
17001
  return (0, import_lib4.$EVENT_C)(ctx, state2, "JSXFragment", JSXFragment$$);
16682
17002
  }
16683
- var PushJSXOpeningFragment$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L222, 'PushJSXOpeningFragment "<>"'), function($skip, $loc, $0, $1) {
17003
+ var PushJSXOpeningFragment$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L229, 'PushJSXOpeningFragment "<>"'), function($skip, $loc, $0, $1) {
16684
17004
  state.JSXTagStack.push("");
16685
17005
  return $1;
16686
17006
  });
@@ -16697,11 +17017,11 @@ ${js}`
16697
17017
  function JSXOptionalClosingFragment(ctx, state2) {
16698
17018
  return (0, import_lib4.$EVENT_C)(ctx, state2, "JSXOptionalClosingFragment", JSXOptionalClosingFragment$$);
16699
17019
  }
16700
- var JSXClosingFragment$0 = (0, import_lib4.$EXPECT)($L223, 'JSXClosingFragment "</>"');
17020
+ var JSXClosingFragment$0 = (0, import_lib4.$EXPECT)($L230, 'JSXClosingFragment "</>"');
16701
17021
  function JSXClosingFragment(ctx, state2) {
16702
17022
  return (0, import_lib4.$EVENT)(ctx, state2, "JSXClosingFragment", JSXClosingFragment$0);
16703
17023
  }
16704
- var JSXElementName$0 = (0, import_lib4.$TV)((0, import_lib4.$Y)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L168, 'JSXElementName "#"'), Dot), JSXShorthandString)), function($skip, $loc, $0, $1) {
17024
+ var JSXElementName$0 = (0, import_lib4.$TV)((0, import_lib4.$Y)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L175, 'JSXElementName "#"'), Dot), JSXShorthandString)), function($skip, $loc, $0, $1) {
16705
17025
  return config.defaultElement;
16706
17026
  });
16707
17027
  var JSXElementName$1 = (0, import_lib4.$TEXT)((0, import_lib4.$S)(JSXIdentifierName, (0, import_lib4.$C)((0, import_lib4.$S)(Colon, JSXIdentifierName), (0, import_lib4.$Q)((0, import_lib4.$S)(Dot, JSXIdentifierName)))));
@@ -16879,7 +17199,7 @@ ${js}`
16879
17199
  }
16880
17200
  return $skip;
16881
17201
  });
16882
- var JSXAttribute$5 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L168, 'JSXAttribute "#"'), JSXShorthandString), function($skip, $loc, $0, $1, $2) {
17202
+ var JSXAttribute$5 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L175, 'JSXAttribute "#"'), JSXShorthandString), function($skip, $loc, $0, $1, $2) {
16883
17203
  return [" ", "id=", $2];
16884
17204
  });
16885
17205
  var JSXAttribute$6 = (0, import_lib4.$TS)((0, import_lib4.$S)(Dot, JSXShorthandString), function($skip, $loc, $0, $1, $2) {
@@ -17224,7 +17544,7 @@ ${js}`
17224
17544
  function JSXChildGeneral(ctx, state2) {
17225
17545
  return (0, import_lib4.$EVENT_C)(ctx, state2, "JSXChildGeneral", JSXChildGeneral$$);
17226
17546
  }
17227
- var JSXComment$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L224, 'JSXComment "<!--"'), JSXCommentContent, (0, import_lib4.$EXPECT)($L225, 'JSXComment "-->"')), function($skip, $loc, $0, $1, $2, $3) {
17547
+ var JSXComment$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L231, 'JSXComment "<!--"'), JSXCommentContent, (0, import_lib4.$EXPECT)($L232, 'JSXComment "-->"')), function($skip, $loc, $0, $1, $2, $3) {
17228
17548
  return ["{/*", $2, "*/}"];
17229
17549
  });
17230
17550
  function JSXComment(ctx, state2) {
@@ -17512,37 +17832,37 @@ ${js}`
17512
17832
  function InterfaceExtendsTarget(ctx, state2) {
17513
17833
  return (0, import_lib4.$EVENT)(ctx, state2, "InterfaceExtendsTarget", InterfaceExtendsTarget$0);
17514
17834
  }
17515
- var TypeKeyword$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L226, 'TypeKeyword "type"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
17835
+ var TypeKeyword$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L233, 'TypeKeyword "type"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
17516
17836
  return { $loc, token: $1 };
17517
17837
  });
17518
17838
  function TypeKeyword(ctx, state2) {
17519
17839
  return (0, import_lib4.$EVENT)(ctx, state2, "TypeKeyword", TypeKeyword$0);
17520
17840
  }
17521
- var Enum$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L227, 'Enum "enum"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
17841
+ var Enum$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L234, 'Enum "enum"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
17522
17842
  return { $loc, token: $1 };
17523
17843
  });
17524
17844
  function Enum(ctx, state2) {
17525
17845
  return (0, import_lib4.$EVENT)(ctx, state2, "Enum", Enum$0);
17526
17846
  }
17527
- var Interface$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L228, 'Interface "interface"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
17847
+ var Interface$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L235, 'Interface "interface"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
17528
17848
  return { $loc, token: $1 };
17529
17849
  });
17530
17850
  function Interface(ctx, state2) {
17531
17851
  return (0, import_lib4.$EVENT)(ctx, state2, "Interface", Interface$0);
17532
17852
  }
17533
- var Global$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L229, 'Global "global"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
17853
+ var Global$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L236, 'Global "global"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
17534
17854
  return { $loc, token: $1 };
17535
17855
  });
17536
17856
  function Global(ctx, state2) {
17537
17857
  return (0, import_lib4.$EVENT)(ctx, state2, "Global", Global$0);
17538
17858
  }
17539
- var Module$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L230, 'Module "module"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
17859
+ var Module$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L237, 'Module "module"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
17540
17860
  return { $loc, token: $1 };
17541
17861
  });
17542
17862
  function Module(ctx, state2) {
17543
17863
  return (0, import_lib4.$EVENT)(ctx, state2, "Module", Module$0);
17544
17864
  }
17545
- var Namespace$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L231, 'Namespace "namespace"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
17865
+ var Namespace$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L238, 'Namespace "namespace"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
17546
17866
  return { $loc, token: $1 };
17547
17867
  });
17548
17868
  function Namespace(ctx, state2) {
@@ -17856,14 +18176,14 @@ ${js}`
17856
18176
  function ReturnTypeSuffix(ctx, state2) {
17857
18177
  return (0, import_lib4.$EVENT)(ctx, state2, "ReturnTypeSuffix", ReturnTypeSuffix$0);
17858
18178
  }
17859
- var ReturnType$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)((0, import_lib4.$S)(__, (0, import_lib4.$EXPECT)($L232, 'ReturnType "asserts"'), NonIdContinue)), ForbidIndentedApplication, (0, import_lib4.$E)(TypePredicate), RestoreIndentedApplication), function($skip, $loc, $0, $1, $2, $3, $4) {
18179
+ var ReturnType$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)((0, import_lib4.$S)(__, (0, import_lib4.$EXPECT)($L239, 'ReturnType "asserts"'), NonIdContinue)), ForbidIndentedApplication, (0, import_lib4.$E)(TypePredicate), RestoreIndentedApplication), function($skip, $loc, $0, $1, $2, $3, $4) {
17860
18180
  var asserts = $1;
17861
18181
  var t = $3;
17862
18182
  if (!t)
17863
18183
  return $skip;
17864
18184
  if (asserts) {
17865
18185
  t = {
17866
- type: "AssertsType",
18186
+ type: "TypeAsserts",
17867
18187
  t,
17868
18188
  children: [asserts[0], asserts[1], t],
17869
18189
  ts: true
@@ -17957,8 +18277,8 @@ ${js}`
17957
18277
  function TypeUnarySuffix(ctx, state2) {
17958
18278
  return (0, import_lib4.$EVENT_C)(ctx, state2, "TypeUnarySuffix", TypeUnarySuffix$$);
17959
18279
  }
17960
- var TypeUnaryOp$0 = (0, import_lib4.$S)((0, import_lib4.$EXPECT)($L233, 'TypeUnaryOp "keyof"'), NonIdContinue);
17961
- var TypeUnaryOp$1 = (0, import_lib4.$S)((0, import_lib4.$EXPECT)($L194, 'TypeUnaryOp "readonly"'), NonIdContinue);
18280
+ var TypeUnaryOp$0 = (0, import_lib4.$S)((0, import_lib4.$EXPECT)($L240, 'TypeUnaryOp "keyof"'), NonIdContinue);
18281
+ var TypeUnaryOp$1 = (0, import_lib4.$S)((0, import_lib4.$EXPECT)($L201, 'TypeUnaryOp "readonly"'), NonIdContinue);
17962
18282
  var TypeUnaryOp$$ = [TypeUnaryOp$0, TypeUnaryOp$1];
17963
18283
  function TypeUnaryOp(ctx, state2) {
17964
18284
  return (0, import_lib4.$EVENT_C)(ctx, state2, "TypeUnaryOp", TypeUnaryOp$$);
@@ -17988,7 +18308,7 @@ ${js}`
17988
18308
  function TypeIndexedAccess(ctx, state2) {
17989
18309
  return (0, import_lib4.$EVENT_C)(ctx, state2, "TypeIndexedAccess", TypeIndexedAccess$$);
17990
18310
  }
17991
- var UnknownAlias$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L234, 'UnknownAlias "???"'), function($skip, $loc, $0, $1) {
18311
+ var UnknownAlias$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L241, 'UnknownAlias "???"'), function($skip, $loc, $0, $1) {
17992
18312
  return { $loc, token: "unknown" };
17993
18313
  });
17994
18314
  function UnknownAlias(ctx, state2) {
@@ -18059,12 +18379,17 @@ ${js}`
18059
18379
  function ImportType(ctx, state2) {
18060
18380
  return (0, import_lib4.$EVENT_C)(ctx, state2, "ImportType", ImportType$$);
18061
18381
  }
18062
- var TypeTuple$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(OpenBracket, AllowAll, (0, import_lib4.$E)((0, import_lib4.$S)(TypeTupleContent, __, CloseBracket)), RestoreAll), function($skip, $loc, $0, $1, $2, $3, $4) {
18063
- if (!$3)
18382
+ var TypeTuple$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(OpenBracket, AllowAll, (0, import_lib4.$E)(TypeTupleContent), RestoreAll, __, CloseBracket), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
18383
+ var open = $1;
18384
+ var elements = $3;
18385
+ var ws = $5;
18386
+ var close = $6;
18387
+ if (!elements)
18064
18388
  return $skip;
18065
18389
  return {
18066
18390
  type: "TypeTuple",
18067
- children: [$1, ...$3]
18391
+ elements,
18392
+ children: [open, elements, ws, close]
18068
18393
  };
18069
18394
  });
18070
18395
  function TypeTuple(ctx, state2) {
@@ -18126,19 +18451,28 @@ ${js}`
18126
18451
  message: "... both before and after identifier"
18127
18452
  }];
18128
18453
  }
18129
- return [ws, dots, name, colon, type];
18454
+ return {
18455
+ type: "TypeElement",
18456
+ name,
18457
+ t: type,
18458
+ children: [ws, dots, name, colon, type]
18459
+ };
18130
18460
  });
18131
18461
  var TypeElement$1 = (0, import_lib4.$S)(__, DotDotDot, __, Type);
18132
18462
  var TypeElement$2 = (0, import_lib4.$TS)((0, import_lib4.$S)(Type, (0, import_lib4.$E)((0, import_lib4.$S)((0, import_lib4.$E)(_), DotDotDot))), function($skip, $loc, $0, $1, $2) {
18133
18463
  var type = $1;
18134
18464
  var spaceDots = $2;
18135
- if (!spaceDots)
18136
- return type;
18137
- const [space, dots] = spaceDots;
18138
- const ws = getTrimmingSpace(type);
18139
- if (!ws)
18140
- return [dots, space, type];
18141
- return [ws, dots, space, trimFirstSpace(type)];
18465
+ if (spaceDots) {
18466
+ const [space, dots] = spaceDots;
18467
+ const ws = getTrimmingSpace(type);
18468
+ spaceDots = [ws, dots, space];
18469
+ type = trimFirstSpace(type);
18470
+ }
18471
+ return {
18472
+ type: "TypeElement",
18473
+ t: type,
18474
+ children: [spaceDots, type]
18475
+ };
18142
18476
  });
18143
18477
  var TypeElement$$ = [TypeElement$0, TypeElement$1, TypeElement$2];
18144
18478
  function TypeElement(ctx, state2) {
@@ -18367,13 +18701,13 @@ ${js}`
18367
18701
  return num;
18368
18702
  return $0;
18369
18703
  });
18370
- var TypeLiteral$3 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L216, 'TypeLiteral "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
18704
+ var TypeLiteral$3 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L223, 'TypeLiteral "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
18371
18705
  return { type: "VoidType", $loc, token: $1 };
18372
18706
  });
18373
- var TypeLiteral$4 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L235, 'TypeLiteral "unique"'), _, (0, import_lib4.$EXPECT)($L236, 'TypeLiteral "symbol"'), NonIdContinue), function($skip, $loc, $0, $1, $2, $3, $4) {
18707
+ var TypeLiteral$4 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L242, 'TypeLiteral "unique"'), _, (0, import_lib4.$EXPECT)($L243, 'TypeLiteral "symbol"'), NonIdContinue), function($skip, $loc, $0, $1, $2, $3, $4) {
18374
18708
  return { type: "UniqueSymbolType", children: $0 };
18375
18709
  });
18376
- var TypeLiteral$5 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L237, 'TypeLiteral "[]"'), function($skip, $loc, $0, $1) {
18710
+ var TypeLiteral$5 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L244, 'TypeLiteral "[]"'), function($skip, $loc, $0, $1) {
18377
18711
  return { $loc, token: "[]" };
18378
18712
  });
18379
18713
  var TypeLiteral$$ = [TypeLiteral$0, TypeLiteral$1, TypeLiteral$2, TypeLiteral$3, TypeLiteral$4, TypeLiteral$5];
@@ -18392,7 +18726,7 @@ ${js}`
18392
18726
  var InlineInterfacePropertyDelimiter$1 = (0, import_lib4.$T)((0, import_lib4.$S)((0, import_lib4.$Y)((0, import_lib4.$S)(SameLineOrIndentedFurther, InlineBasicInterfaceProperty)), InsertComma), function(value) {
18393
18727
  return value[1];
18394
18728
  });
18395
- var InlineInterfacePropertyDelimiter$2 = (0, import_lib4.$Y)((0, import_lib4.$S)(__, (0, import_lib4.$C)((0, import_lib4.$EXPECT)($L16, 'InlineInterfacePropertyDelimiter ":"'), (0, import_lib4.$EXPECT)($L133, 'InlineInterfacePropertyDelimiter ")"'), (0, import_lib4.$EXPECT)($L46, 'InlineInterfacePropertyDelimiter "]"'), (0, import_lib4.$EXPECT)($L37, 'InlineInterfacePropertyDelimiter "}"'))));
18729
+ var InlineInterfacePropertyDelimiter$2 = (0, import_lib4.$Y)((0, import_lib4.$S)(__, (0, import_lib4.$C)((0, import_lib4.$EXPECT)($L16, 'InlineInterfacePropertyDelimiter ":"'), (0, import_lib4.$EXPECT)($L140, 'InlineInterfacePropertyDelimiter ")"'), (0, import_lib4.$EXPECT)($L46, 'InlineInterfacePropertyDelimiter "]"'), (0, import_lib4.$EXPECT)($L37, 'InlineInterfacePropertyDelimiter "}"'))));
18396
18730
  var InlineInterfacePropertyDelimiter$3 = (0, import_lib4.$Y)(EOS);
18397
18731
  var InlineInterfacePropertyDelimiter$$ = [InlineInterfacePropertyDelimiter$0, InlineInterfacePropertyDelimiter$1, InlineInterfacePropertyDelimiter$2, InlineInterfacePropertyDelimiter$3];
18398
18732
  function InlineInterfacePropertyDelimiter(ctx, state2) {
@@ -18408,31 +18742,54 @@ ${js}`
18408
18742
  function TypeBinaryOp(ctx, state2) {
18409
18743
  return (0, import_lib4.$EVENT_C)(ctx, state2, "TypeBinaryOp", TypeBinaryOp$$);
18410
18744
  }
18411
- var TypeFunction$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)((0, import_lib4.$S)(Abstract, (0, import_lib4.$E)(_))), (0, import_lib4.$E)((0, import_lib4.$S)(New, (0, import_lib4.$E)(_))), Parameters, __, TypeArrowFunction, (0, import_lib4.$E)(ReturnType)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
18412
- var type = $6;
18413
- const children = [...$0];
18414
- if ($1 && !$2) {
18745
+ var TypeFunction$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)((0, import_lib4.$S)(Abstract, (0, import_lib4.$E)(_))), (0, import_lib4.$E)((0, import_lib4.$S)(Async, (0, import_lib4.$E)(_))), (0, import_lib4.$E)((0, import_lib4.$S)(New, (0, import_lib4.$E)(_))), Parameters, __, TypeFunctionArrow, (0, import_lib4.$C)(ReturnType, Loc)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
18746
+ var abstract = $1;
18747
+ var async = $2;
18748
+ var new_ = $3;
18749
+ var returnType = $7;
18750
+ const children = [abstract, ...$0.slice(2)];
18751
+ if (abstract && !new_) {
18415
18752
  children[1] = {
18416
18753
  type: "Error",
18417
18754
  message: "abstract function types must be constructors (abstract new)"
18418
18755
  };
18419
18756
  }
18420
- if (!type)
18421
- children.push("void");
18757
+ if (returnType.$loc && returnType.token === "") {
18758
+ const t = {
18759
+ type: "VoidType",
18760
+ $loc: returnType.$loc,
18761
+ token: "void"
18762
+ };
18763
+ children[children.length - 1] = returnType = {
18764
+ type: "ReturnTypeAnnotation",
18765
+ ts: true,
18766
+ t,
18767
+ children: [t]
18768
+ };
18769
+ }
18770
+ if (async) {
18771
+ const t = wrapTypeInPromise(returnType.t);
18772
+ children[children.length - 1] = returnType = {
18773
+ ...returnType,
18774
+ t,
18775
+ children: returnType.children.map(($) => $ === returnType.t ? t : $)
18776
+ };
18777
+ }
18422
18778
  return {
18423
18779
  type: "TypeFunction",
18424
18780
  children,
18425
- ts: true
18781
+ ts: true,
18782
+ returnType
18426
18783
  };
18427
18784
  });
18428
18785
  function TypeFunction(ctx, state2) {
18429
18786
  return (0, import_lib4.$EVENT)(ctx, state2, "TypeFunction", TypeFunction$0);
18430
18787
  }
18431
- var TypeArrowFunction$0 = (0, import_lib4.$TV)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L13, 'TypeArrowFunction "=>"'), (0, import_lib4.$EXPECT)($L14, 'TypeArrowFunction "\u21D2"'), (0, import_lib4.$EXPECT)($L35, 'TypeArrowFunction "->"'), (0, import_lib4.$EXPECT)($L36, 'TypeArrowFunction "\u2192"')), function($skip, $loc, $0, $1) {
18788
+ var TypeFunctionArrow$0 = (0, import_lib4.$TV)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L13, 'TypeFunctionArrow "=>"'), (0, import_lib4.$EXPECT)($L14, 'TypeFunctionArrow "\u21D2"'), (0, import_lib4.$EXPECT)($L35, 'TypeFunctionArrow "->"'), (0, import_lib4.$EXPECT)($L36, 'TypeFunctionArrow "\u2192"')), function($skip, $loc, $0, $1) {
18432
18789
  return { $loc, token: "=>" };
18433
18790
  });
18434
- function TypeArrowFunction(ctx, state2) {
18435
- return (0, import_lib4.$EVENT)(ctx, state2, "TypeArrowFunction", TypeArrowFunction$0);
18791
+ function TypeFunctionArrow(ctx, state2) {
18792
+ return (0, import_lib4.$EVENT)(ctx, state2, "TypeFunctionArrow", TypeFunctionArrow$0);
18436
18793
  }
18437
18794
  var TypeArguments$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(OpenAngleBracket, (0, import_lib4.$P)((0, import_lib4.$S)(__, TypeArgumentDelimited)), __, CloseAngleBracket), function($skip, $loc, $0, $1, $2, $3, $4) {
18438
18795
  var args = $2;
@@ -18608,7 +18965,7 @@ ${js}`
18608
18965
  function CivetPrologue(ctx, state2) {
18609
18966
  return (0, import_lib4.$EVENT_C)(ctx, state2, "CivetPrologue", CivetPrologue$$);
18610
18967
  }
18611
- var CivetPrologueContent$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L238, 'CivetPrologueContent "civet"'), NonIdContinue, (0, import_lib4.$Q)(CivetOption), (0, import_lib4.$EXPECT)($R95, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3, $4) {
18968
+ var CivetPrologueContent$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L245, 'CivetPrologueContent "civet"'), NonIdContinue, (0, import_lib4.$Q)(CivetOption), (0, import_lib4.$EXPECT)($R95, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3, $4) {
18612
18969
  var options = $3;
18613
18970
  return {
18614
18971
  type: "CivetPrologue",