@danielx/civet 0.7.28 → 0.7.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -62,7 +62,7 @@ var require_machine = __commonJS({
62
62
  $N: () => $N2,
63
63
  $P: () => $P2,
64
64
  $Q: () => $Q2,
65
- $R: () => $R98,
65
+ $R: () => $R100,
66
66
  $R$0: () => $R$02,
67
67
  $S: () => $S2,
68
68
  $T: () => $T2,
@@ -99,7 +99,7 @@ var require_machine = __commonJS({
99
99
  return;
100
100
  };
101
101
  }
102
- function $R98(regExp) {
102
+ function $R100(regExp) {
103
103
  return function(_ctx, state2) {
104
104
  const { input, pos } = state2;
105
105
  regExp.lastIndex = state2.pos;
@@ -511,6 +511,7 @@ __export(lib_exports, {
511
511
  addPostfixStatement: () => addPostfixStatement,
512
512
  adjustBindingElements: () => adjustBindingElements,
513
513
  adjustIndexAccess: () => adjustIndexAccess,
514
+ append: () => append,
514
515
  attachPostfixStatementAsExpression: () => attachPostfixStatementAsExpression,
515
516
  blockWithPrefix: () => blockWithPrefix,
516
517
  convertNamedImportsToObject: () => convertNamedImportsToObject,
@@ -677,7 +678,7 @@ var statementTypes = /* @__PURE__ */ new Set([
677
678
  "ForStatement",
678
679
  "IfStatement",
679
680
  "IterationStatement",
680
- "LabeledStatement",
681
+ "LabelledStatement",
681
682
  "ReturnStatement",
682
683
  "SwitchStatement",
683
684
  "ThrowStatement",
@@ -722,13 +723,16 @@ function isExit(node) {
722
723
  return node.expressions.some((s) => isExit(s[1]));
723
724
  }
724
725
  case "IterationStatement": {
725
- return node.condition?.type === "ParenthesizedExpression" && node.condition.expression?.type === "Literal" && node.condition.expression?.raw === "true" && gatherRecursiveWithinFunction(node.block, ($) => $.type === "BreakStatement").length === 0;
726
+ return isLoopStatement(node) && gatherRecursiveWithinFunction(node.block, ($) => $.type === "BreakStatement").length === 0;
726
727
  }
727
728
  default: {
728
729
  return false;
729
730
  }
730
731
  }
731
732
  }
733
+ function isLoopStatement(node) {
734
+ return node.type === "IterationStatement" && node.condition?.type === "ParenthesizedExpression" && node.condition.expression?.type === "Literal" && node.condition.expression?.raw === "true";
735
+ }
732
736
  function isComma(node) {
733
737
  if (node?.token === ",") {
734
738
  return node;
@@ -799,7 +803,7 @@ function getTrimmingSpace(target) {
799
803
  return;
800
804
  }
801
805
  function prepend(prefix, node) {
802
- if (!(prefix && prefix.length)) {
806
+ if (!prefix || Array.isArray(prefix) && len(prefix, 0)) {
803
807
  return node;
804
808
  }
805
809
  if (Array.isArray(node)) {
@@ -813,6 +817,21 @@ function prepend(prefix, node) {
813
817
  return [prefix, node];
814
818
  }
815
819
  }
820
+ function append(node, suffix) {
821
+ if (!suffix || Array.isArray(suffix) && len(suffix, 0)) {
822
+ return node;
823
+ }
824
+ if (Array.isArray(node)) {
825
+ return [...node, suffix];
826
+ } else if (isParent(node)) {
827
+ return {
828
+ ...node,
829
+ children: [...node.children, suffix]
830
+ };
831
+ } else {
832
+ return [node, suffix];
833
+ }
834
+ }
816
835
  function inplacePrepend(prefix, node) {
817
836
  if (!prefix) {
818
837
  return;
@@ -1079,7 +1098,7 @@ function parenthesizeType(type) {
1079
1098
  }
1080
1099
  return ["(", type, ")"];
1081
1100
  }
1082
- function wrapIIFE(expressions, asyncFlag) {
1101
+ function wrapIIFE(expressions, asyncFlag, generator) {
1083
1102
  let prefix;
1084
1103
  const async = [];
1085
1104
  if (asyncFlag) {
@@ -1105,23 +1124,49 @@ function wrapIIFE(expressions, asyncFlag) {
1105
1124
  };
1106
1125
  const signature = {
1107
1126
  modifier: {
1108
- async: !!async.length
1127
+ async: !!async.length,
1128
+ generator: !!generator
1109
1129
  },
1110
1130
  returnType: void 0
1111
1131
  };
1112
- const fn = makeNode({
1113
- type: "ArrowFunction",
1114
- signature,
1115
- parameters,
1116
- returnType: void 0,
1117
- ts: false,
1118
- async,
1119
- block,
1120
- children: [async, parameters, "=>", block]
1121
- });
1132
+ let fn;
1133
+ if (generator) {
1134
+ fn = makeNode({
1135
+ type: "FunctionExpression",
1136
+ signature,
1137
+ parameters,
1138
+ returnType: void 0,
1139
+ ts: false,
1140
+ async,
1141
+ block,
1142
+ generator,
1143
+ children: [async, "function", generator, parameters, block]
1144
+ });
1145
+ } else {
1146
+ fn = makeNode({
1147
+ type: "ArrowFunction",
1148
+ signature,
1149
+ parameters,
1150
+ returnType: void 0,
1151
+ ts: false,
1152
+ async,
1153
+ block,
1154
+ children: [async, parameters, "=>", block]
1155
+ });
1156
+ }
1157
+ const children = [makeLeftHandSideExpression(fn), "()"];
1158
+ if (fn.type === "FunctionExpression") {
1159
+ if (gatherRecursiveWithinFunction(block, (a1) => typeof a1 === "object" && a1 != null && "token" in a1 && a1.token === "this").length) {
1160
+ children.splice(1, 0, ".bind(this)");
1161
+ }
1162
+ if (gatherRecursiveWithinFunction(block, (a2) => typeof a2 === "object" && a2 != null && "token" in a2 && a2.token === "arguments").length) {
1163
+ let ref2;
1164
+ children[children.length - 1] = (ref2 = parameters.children)[ref2.length - 1] = "(arguments)";
1165
+ }
1166
+ }
1122
1167
  const exp = makeNode({
1123
1168
  type: "CallExpression",
1124
- children: [makeLeftHandSideExpression(fn), "()"]
1169
+ children
1125
1170
  });
1126
1171
  if (prefix) {
1127
1172
  return makeLeftHandSideExpression([prefix, exp]);
@@ -1742,7 +1787,7 @@ function assignResults(node, collect) {
1742
1787
  ({ type } = exp);
1743
1788
  }
1744
1789
  let ref4;
1745
- switch (exp.type) {
1790
+ switch (type) {
1746
1791
  case "BreakStatement":
1747
1792
  case "ContinueStatement":
1748
1793
  case "DebuggerStatement":
@@ -1963,6 +2008,58 @@ function insertSwitchReturns(exp) {
1963
2008
  return insertReturn(clause);
1964
2009
  });
1965
2010
  }
2011
+ function processBreakContinueWith(statement) {
2012
+ let changed = false;
2013
+ for (const control of gatherRecursiveWithinFunction(
2014
+ statement.block,
2015
+ ($) => $.type === "BreakStatement" || $.type === "ContinueStatement"
2016
+ )) {
2017
+ let controlName2 = function() {
2018
+ switch (control.type) {
2019
+ case "BreakStatement": {
2020
+ return "break";
2021
+ }
2022
+ case "ContinueStatement": {
2023
+ return "continue";
2024
+ }
2025
+ }
2026
+ };
2027
+ var controlName = controlName2;
2028
+ if (control.with) {
2029
+ if (control.label) {
2030
+ let m1;
2031
+ if (!(m1 = statement.parent, typeof m1 === "object" && m1 != null && "type" in m1 && m1.type === "LabelledStatement" && "label" in m1 && typeof m1.label === "object" && m1.label != null && "name" in m1.label && m1.label.name === control.label.name)) {
2032
+ continue;
2033
+ }
2034
+ } else {
2035
+ const { ancestor } = findAncestor(
2036
+ control,
2037
+ (s) => s === statement || s.type === "IterationStatement" || s.type === "ForStatement" || s.type === "SwitchStatement" && control.type === "BreakStatement"
2038
+ );
2039
+ if (!(ancestor === statement)) {
2040
+ continue;
2041
+ }
2042
+ }
2043
+ control.children.unshift(
2044
+ control.type === "BreakStatement" ? (changed = true, [statement.resultsRef, " =", control.with, ";"]) : (
2045
+ // control.type is "ContinueStatement"
2046
+ [statement.resultsRef, ".push(", trimFirstSpace(control.with), ");"]
2047
+ )
2048
+ );
2049
+ updateParentPointers(control.with, control);
2050
+ const i = control.children.findIndex(($1) => $1?.type === "Error");
2051
+ if (i >= 0) {
2052
+ control.children.splice(i, 1);
2053
+ }
2054
+ const block = control.parent;
2055
+ if (!(block?.type === "BlockStatement")) {
2056
+ throw new Error(`Expected parent of ${controlName2()} to be BlockStatement`);
2057
+ }
2058
+ braceBlock(block);
2059
+ }
2060
+ }
2061
+ return changed;
2062
+ }
1966
2063
  function wrapIterationReturningResults(statement, outer, collect) {
1967
2064
  if (statement.type === "DoStatement" || statement.type === "ComptimeStatement") {
1968
2065
  if (collect) {
@@ -1978,14 +2075,37 @@ function wrapIterationReturningResults(statement, outer, collect) {
1978
2075
  "wrapIterationReturningResults should not be called twice on the same statement"
1979
2076
  );
1980
2077
  const resultsRef = statement.resultsRef = makeRef("results");
2078
+ let decl = "const";
2079
+ if (statement.type === "IterationStatement" || statement.type === "ForStatement") {
2080
+ if (processBreakContinueWith(statement)) {
2081
+ decl = "let";
2082
+ }
2083
+ }
2084
+ const breakWithOnly = decl === "let" && isLoopStatement(statement) && gatherRecursive(
2085
+ statement.block,
2086
+ (s) => s.type === "BreakStatement" && !s.with,
2087
+ (s) => isFunction(s) || s.type === "IterationStatement"
2088
+ ).length === 0;
1981
2089
  const declaration = {
1982
2090
  type: "Declaration",
1983
- children: ["const ", resultsRef, "=[]"]
2091
+ children: [decl, " ", resultsRef],
2092
+ decl,
2093
+ names: [],
2094
+ bindings: []
1984
2095
  };
2096
+ if (decl === "const") {
2097
+ declaration.children.push("=[]");
2098
+ } else {
2099
+ if (!breakWithOnly) {
2100
+ declaration.children.push(";", resultsRef, "=[]");
2101
+ }
2102
+ }
1985
2103
  outer.children.unshift(["", declaration, ";"]);
1986
- assignResults(statement.block, (node) => {
1987
- return [resultsRef, ".push(", node, ")"];
1988
- });
2104
+ if (!breakWithOnly) {
2105
+ assignResults(statement.block, (node) => {
2106
+ return [resultsRef, ".push(", node, ")"];
2107
+ });
2108
+ }
1989
2109
  if (collect) {
1990
2110
  statement.children.push(collect(resultsRef));
1991
2111
  } else {
@@ -2051,8 +2171,8 @@ function processSignature(f) {
2051
2171
  }
2052
2172
  if (hasYield(block) && !f.generator?.length) {
2053
2173
  if (f.type === "ArrowFunction") {
2054
- gatherRecursiveWithinFunction(block, ($) => $.type === "YieldExpression").forEach((y) => {
2055
- const i = y.children.findIndex(($1) => $1.type === "Yield");
2174
+ gatherRecursiveWithinFunction(block, ($2) => $2.type === "YieldExpression").forEach((y) => {
2175
+ const i = y.children.findIndex(($3) => $3.type === "Yield");
2056
2176
  return y.children.splice(i + 1, 0, {
2057
2177
  type: "Error",
2058
2178
  message: "Can't use yield inside of => arrow function"
@@ -2080,31 +2200,55 @@ function processFunctions(statements, config2) {
2080
2200
  });
2081
2201
  }
2082
2202
  function expressionizeIteration(exp) {
2083
- const { async, subtype, block, children, statement } = exp;
2203
+ const { async, generator, subtype, block, children, statement } = exp;
2084
2204
  const i = children.indexOf(statement);
2085
2205
  if (i < 0) {
2086
2206
  throw new Error("Could not find iteration statement in iteration expression");
2087
2207
  }
2088
2208
  if (subtype === "DoStatement" || subtype === "ComptimeStatement") {
2089
- children.splice(i, 1, wrapIIFE([["", statement, void 0]], async));
2209
+ children.splice(i, 1, wrapIIFE([["", statement, void 0]], async, generator));
2090
2210
  updateParentPointers(exp);
2091
2211
  return;
2092
2212
  }
2093
- exp.resultsRef ??= makeRef("results");
2094
- const { resultsRef } = exp;
2095
- assignResults(block, (node) => {
2096
- return [resultsRef, ".push(", node, ")"];
2097
- });
2098
- braceBlock(block);
2099
- children.splice(
2100
- i,
2101
- 1,
2102
- wrapIIFE([
2103
- ["", ["const ", resultsRef, "=[]"], ";"],
2104
- ...children.map((c) => ["", c, void 0]),
2105
- ["", wrapWithReturn(resultsRef)]
2106
- ], async)
2107
- );
2213
+ if (generator) {
2214
+ assignResults(block, (node) => {
2215
+ return {
2216
+ type: "YieldExpression",
2217
+ expression: node,
2218
+ children: ["yield ", node]
2219
+ };
2220
+ });
2221
+ braceBlock(block);
2222
+ children.splice(
2223
+ i,
2224
+ 1,
2225
+ wrapIIFE([
2226
+ ["", statement, void 0],
2227
+ // Prevent implicit return in generator, by adding an explicit return
2228
+ ["", {
2229
+ type: "ReturnStatement",
2230
+ expression: void 0,
2231
+ children: [";return"]
2232
+ }, void 0]
2233
+ ], async, generator)
2234
+ );
2235
+ } else {
2236
+ exp.resultsRef ??= makeRef("results");
2237
+ const { resultsRef } = exp;
2238
+ assignResults(block, (node) => {
2239
+ return [resultsRef, ".push(", node, ")"];
2240
+ });
2241
+ braceBlock(block);
2242
+ children.splice(
2243
+ i,
2244
+ 1,
2245
+ wrapIIFE([
2246
+ ["", ["const ", resultsRef, "=[]"], ";"],
2247
+ ["", statement, void 0],
2248
+ ["", wrapWithReturn(resultsRef)]
2249
+ ], async)
2250
+ );
2251
+ }
2108
2252
  updateParentPointers(exp);
2109
2253
  }
2110
2254
  function skipImplicitArguments(args) {
@@ -2118,7 +2262,7 @@ function skipImplicitArguments(args) {
2118
2262
  return false;
2119
2263
  }
2120
2264
  function processCoffeeDo(ws, expression) {
2121
- ws = insertTrimmingSpace(ws, "");
2265
+ ws = trimFirstSpace(ws);
2122
2266
  const args = [];
2123
2267
  if (typeof expression === "object" && expression != null && "type" in expression && expression.type === "ArrowFunction" || typeof expression === "object" && expression != null && "type" in expression && expression.type === "FunctionExpression") {
2124
2268
  const { parameters } = expression;
@@ -2152,7 +2296,7 @@ function processCoffeeDo(ws, expression) {
2152
2296
  expression = {
2153
2297
  ...expression,
2154
2298
  parameters: newParameters,
2155
- children: expression.children.map(($2) => $2 === parameters ? newParameters : $2)
2299
+ children: expression.children.map(($4) => $4 === parameters ? newParameters : $4)
2156
2300
  };
2157
2301
  }
2158
2302
  return {
@@ -2173,7 +2317,7 @@ function makeAmpersandFunction(rhs) {
2173
2317
  ref = makeRef("$");
2174
2318
  inplacePrepend(ref, body);
2175
2319
  }
2176
- if (startsWithPredicate(body, ($3) => $3.type === "ObjectExpression")) {
2320
+ if (startsWithPredicate(body, ($5) => $5.type === "ObjectExpression")) {
2177
2321
  body = makeLeftHandSideExpression(body);
2178
2322
  }
2179
2323
  const parameters = makeNode({
@@ -3277,26 +3421,24 @@ function nonMatcherBindings(pattern) {
3277
3421
  function aggregateDuplicateBindings(bindings) {
3278
3422
  const props = gatherRecursiveAll(bindings, ($10) => $10.type === "BindingProperty");
3279
3423
  const arrayBindings = gatherRecursiveAll(bindings, ($11) => $11.type === "ArrayBindingPattern");
3280
- arrayBindings.forEach((a) => {
3281
- const { elements } = a;
3282
- return elements.forEach((element) => {
3424
+ for (let i5 = 0, len4 = arrayBindings.length; i5 < len4; i5++) {
3425
+ const { elements } = arrayBindings[i5];
3426
+ for (let i6 = 0, len5 = elements.length; i6 < len5; i6++) {
3427
+ const element = elements[i6];
3283
3428
  if (Array.isArray(element)) {
3284
3429
  const [, e] = element;
3285
3430
  if (e.type === "Identifier") {
3286
- return props.push(e);
3431
+ props.push(e);
3287
3432
  } else if (e.type === "BindingRestElement") {
3288
- return props.push(e);
3433
+ props.push(e);
3289
3434
  }
3290
- ;
3291
- return;
3292
3435
  }
3293
- ;
3294
- return;
3295
- });
3296
- });
3436
+ }
3437
+ }
3297
3438
  const declarations = [];
3298
3439
  const propsGroupedByName = /* @__PURE__ */ new Map();
3299
- for (const p of props) {
3440
+ for (let i7 = 0, len6 = props.length; i7 < len6; i7++) {
3441
+ const p = props[i7];
3300
3442
  const { name, value } = p;
3301
3443
  let m1;
3302
3444
  if (m1 = value?.type, m1 === "ArrayBindingPattern" || m1 === "ObjectBindingPattern") {
@@ -3318,9 +3460,10 @@ function aggregateDuplicateBindings(bindings) {
3318
3460
  pos: 0,
3319
3461
  input: key
3320
3462
  })) {
3321
- shared.forEach((p) => {
3322
- return aliasBinding(p, makeRef(`_${key}`, key));
3323
- });
3463
+ for (let i8 = 0, len7 = shared.length; i8 < len7; i8++) {
3464
+ const p = shared[i8];
3465
+ aliasBinding(p, makeRef(`_${key}`, key));
3466
+ }
3324
3467
  return;
3325
3468
  }
3326
3469
  if (shared.length === 1) {
@@ -3435,7 +3578,7 @@ function prependStatementExpressionBlock(initializer, statement) {
3435
3578
  const blockStatement = ["", statementExp];
3436
3579
  let ref;
3437
3580
  if (statementExp.type === "IterationExpression") {
3438
- if (statementExp.async) {
3581
+ if (statementExp.async || statementExp.generator) {
3439
3582
  return;
3440
3583
  }
3441
3584
  const statement2 = statementExp.statement;
@@ -5198,9 +5341,8 @@ function expressionizeIfStatement(statement) {
5198
5341
  children
5199
5342
  });
5200
5343
  }
5201
- function expressionizeTypeIf([ws, ifOp, condition, t, e]) {
5344
+ function expressionizeTypeIf([ifOp, condition, t, e]) {
5202
5345
  const children = [
5203
- ws,
5204
5346
  "(",
5205
5347
  insertTrimmingSpace(condition, ""),
5206
5348
  "?"
@@ -5984,7 +6126,8 @@ function attachPostfixStatementAsExpression(exp, post) {
5984
6126
  type: "IterationExpression",
5985
6127
  children: [statement],
5986
6128
  block: statement.block,
5987
- statement
6129
+ statement,
6130
+ generator: statement.generator
5988
6131
  };
5989
6132
  }
5990
6133
  case "IfStatement": {
@@ -6511,6 +6654,7 @@ var grammar = {
6511
6654
  ReservedBinary,
6512
6655
  ArgumentsWithTrailingMemberExpressions,
6513
6656
  TrailingMemberExpressions,
6657
+ IndentedTrailingMemberExpression,
6514
6658
  AllowedTrailingMemberExpressions,
6515
6659
  TrailingCallExpressions,
6516
6660
  AllowedTrailingCallExpressions,
@@ -6779,6 +6923,7 @@ var grammar = {
6779
6923
  BlockStatement,
6780
6924
  LabelledStatement,
6781
6925
  Label,
6926
+ LabelIdentifier,
6782
6927
  LabelledItem,
6783
6928
  IfStatement,
6784
6929
  ElseClause,
@@ -7157,6 +7302,8 @@ var grammar = {
7157
7302
  TypePredicate,
7158
7303
  Type,
7159
7304
  TypeBinary,
7305
+ NestedTypeBinaryChain,
7306
+ NestedTypeBinary,
7160
7307
  TypeUnary,
7161
7308
  TypeUnarySuffix,
7162
7309
  TypeUnaryOp,
@@ -7165,13 +7312,21 @@ var grammar = {
7165
7312
  TypePrimary,
7166
7313
  ImportType,
7167
7314
  TypeTuple,
7168
- TypeList,
7315
+ TypeTupleContent,
7316
+ TypeElementListWithIndentedApplicationForbidden,
7317
+ TypeElementList,
7169
7318
  TypeElement,
7170
- NestedTypeList,
7171
- NestedType,
7319
+ NestedTypeElementList,
7320
+ NestedTypeElement,
7321
+ NestedTypeBulletedTuple,
7322
+ TypeBulletedTuple,
7323
+ NestedTypeBullet,
7324
+ TypeBullet,
7325
+ TypeWithPostfix,
7172
7326
  TypeConditional,
7173
7327
  TypeCondition,
7174
7328
  TypeIfThenElse,
7329
+ TypeIfClause,
7175
7330
  TypeElse,
7176
7331
  TypeBlock,
7177
7332
  TypeTemplateSubstitution,
@@ -7186,6 +7341,14 @@ var grammar = {
7186
7341
  TypeFunction,
7187
7342
  TypeArrowFunction,
7188
7343
  TypeArguments,
7344
+ ImplicitTypeArguments,
7345
+ TypeApplicationStart,
7346
+ ForbiddenImplicitTypeCalls,
7347
+ TypeArgumentList,
7348
+ NestedTypeArgumentList,
7349
+ NestedTypeArgument,
7350
+ SingleLineTypeArgumentList,
7351
+ TypeArgumentDelimited,
7189
7352
  TypeArgument,
7190
7353
  TypeArgumentDelimiter,
7191
7354
  TypeParameters,
@@ -7214,6 +7377,8 @@ var grammar = {
7214
7377
  InsertCloseBrace,
7215
7378
  InsertOpenBracket,
7216
7379
  InsertCloseBracket,
7380
+ InsertOpenAngleBracket,
7381
+ InsertCloseAngleBracket,
7217
7382
  InsertComma,
7218
7383
  InsertSpaceEquals,
7219
7384
  InsertConst,
@@ -7255,7 +7420,8 @@ var grammar = {
7255
7420
  IndentedFurther,
7256
7421
  IndentedAtLeast,
7257
7422
  NotDedented,
7258
- Dedented
7423
+ Dedented,
7424
+ PushExtraIndent1
7259
7425
  };
7260
7426
  var $L0 = (0, import_lib3.$L)("");
7261
7427
  var $L1 = (0, import_lib3.$L)("{");
@@ -7502,7 +7668,7 @@ var $R2 = (0, import_lib3.$R)(new RegExp("(as|of|satisfies|then|when|implements|
7502
7668
  var $R3 = (0, import_lib3.$R)(new RegExp("[0-9]", "suy"));
7503
7669
  var $R4 = (0, import_lib3.$R)(new RegExp("(?!\\p{ID_Start}|[_$0-9(\\[{])", "suy"));
7504
7670
  var $R5 = (0, import_lib3.$R)(new RegExp("[ \\t]", "suy"));
7505
- var $R6 = (0, import_lib3.$R)(new RegExp("\\p{ID_Continue}|[\\u200C\\u200D$.#{]", "suy"));
7671
+ var $R6 = (0, import_lib3.$R)(new RegExp("\\p{ID_Continue}|[\\u200C\\u200D$.#{=]", "suy"));
7506
7672
  var $R7 = (0, import_lib3.$R)(new RegExp("[&=]", "suy"));
7507
7673
  var $R8 = (0, import_lib3.$R)(new RegExp("(?=['\"`])", "suy"));
7508
7674
  var $R9 = (0, import_lib3.$R)(new RegExp("(?=[\\/?])", "suy"));
@@ -7586,14 +7752,16 @@ var $R86 = (0, import_lib3.$R)(new RegExp("(?:-[^-]|[^-]*)*", "suy"));
7586
7752
  var $R87 = (0, import_lib3.$R)(new RegExp("[^{}<>\\r\\n]+", "suy"));
7587
7753
  var $R88 = (0, import_lib3.$R)(new RegExp("[+-]?", "suy"));
7588
7754
  var $R89 = (0, import_lib3.$R)(new RegExp("(?=if|unless)", "suy"));
7589
- var $R90 = (0, import_lib3.$R)(new RegExp("#![^\\r\\n]*", "suy"));
7590
- var $R91 = (0, import_lib3.$R)(new RegExp("[\\t ]*", "suy"));
7591
- var $R92 = (0, import_lib3.$R)(new RegExp("[\\s]*", "suy"));
7592
- var $R93 = (0, import_lib3.$R)(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?", "suy"));
7593
- var $R94 = (0, import_lib3.$R)(new RegExp("\\/\\/\\/[^\\r\\n]*", "suy"));
7594
- var $R95 = (0, import_lib3.$R)(new RegExp("(?=[ \\t\\r\\n\\/#]|$)", "suy"));
7595
- var $R96 = (0, import_lib3.$R)(new RegExp("\\r\\n|\\n|\\r|$", "suy"));
7596
- var $R97 = (0, import_lib3.$R)(new RegExp("[^]*", "suy"));
7755
+ var $R90 = (0, import_lib3.$R)(new RegExp("[|&<!=\\-\u21D2\u2192]", "suy"));
7756
+ var $R91 = (0, import_lib3.$R)(new RegExp("(extends|not|is)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
7757
+ var $R92 = (0, import_lib3.$R)(new RegExp("#![^\\r\\n]*", "suy"));
7758
+ var $R93 = (0, import_lib3.$R)(new RegExp("[\\t ]*", "suy"));
7759
+ var $R94 = (0, import_lib3.$R)(new RegExp("[\\s]*", "suy"));
7760
+ var $R95 = (0, import_lib3.$R)(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?", "suy"));
7761
+ var $R96 = (0, import_lib3.$R)(new RegExp("\\/\\/\\/[^\\r\\n]*", "suy"));
7762
+ var $R97 = (0, import_lib3.$R)(new RegExp("(?=[ \\t\\r\\n\\/#]|$)", "suy"));
7763
+ var $R98 = (0, import_lib3.$R)(new RegExp("\\r\\n|\\n|\\r|$", "suy"));
7764
+ var $R99 = (0, import_lib3.$R)(new RegExp("[^]*", "suy"));
7597
7765
  var Program$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Reset, Init, (0, import_lib3.$E)(EOS), TopLevelStatements, __), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
7598
7766
  var reset = $1;
7599
7767
  var init = $2;
@@ -7780,6 +7948,9 @@ var ImplicitArguments$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(ApplicationSt
7780
7948
  var close = $5;
7781
7949
  if (skipImplicitArguments(args))
7782
7950
  return $skip;
7951
+ let last = args[args.length - 1];
7952
+ if (last?.token === "," && last.implicit)
7953
+ args = args.slice(0, -1);
7783
7954
  return {
7784
7955
  type: "Call",
7785
7956
  args,
@@ -7812,7 +7983,7 @@ var ExplicitArguments$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(OpenParen, (0
7812
7983
  function ExplicitArguments(ctx, state2) {
7813
7984
  return (0, import_lib3.$EVENT)(ctx, state2, "ExplicitArguments", ExplicitArguments$0);
7814
7985
  }
7815
- var ApplicationStart$0 = (0, import_lib3.$S)(IndentedApplicationAllowed, (0, import_lib3.$Y)((0, import_lib3.$S)(IndentedFurther, (0, import_lib3.$N)(IdentifierBinaryOp), (0, import_lib3.$N)(AccessStart))));
7986
+ var ApplicationStart$0 = (0, import_lib3.$S)(IndentedApplicationAllowed, (0, import_lib3.$Y)((0, import_lib3.$S)(IndentedFurther, (0, import_lib3.$N)(IdentifierBinaryOp))), (0, import_lib3.$N)(IndentedTrailingMemberExpression));
7816
7987
  var ApplicationStart$1 = (0, import_lib3.$S)((0, import_lib3.$N)(EOS), (0, import_lib3.$Y)((0, import_lib3.$S)(_, (0, import_lib3.$C)(BracedApplicationAllowed, (0, import_lib3.$N)((0, import_lib3.$EXPECT)($L1, 'ApplicationStart "{"'))), (0, import_lib3.$N)(ForbiddenImplicitCalls))));
7817
7988
  var ApplicationStart$$ = [ApplicationStart$0, ApplicationStart$1];
7818
7989
  function ApplicationStart(ctx, state2) {
@@ -7853,20 +8024,20 @@ var ArgumentsWithTrailingMemberExpressions$0 = (0, import_lib3.$TS)((0, import_l
7853
8024
  function ArgumentsWithTrailingMemberExpressions(ctx, state2) {
7854
8025
  return (0, import_lib3.$EVENT)(ctx, state2, "ArgumentsWithTrailingMemberExpressions", ArgumentsWithTrailingMemberExpressions$0);
7855
8026
  }
7856
- var TrailingMemberExpressions$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$Q)(MemberExpressionRest), (0, import_lib3.$Q)((0, import_lib3.$S)(IndentedAtLeast, (0, import_lib3.$Y)((0, import_lib3.$S)((0, import_lib3.$E)((0, import_lib3.$EXPECT)($L6, 'TrailingMemberExpressions "?"')), (0, import_lib3.$EXPECT)($L7, 'TrailingMemberExpressions "."'), (0, import_lib3.$N)((0, import_lib3.$EXPECT)($R3, "TrailingMemberExpressions /[0-9]/")))), MemberExpressionRest))), function($skip, $loc, $0, $1, $2) {
7857
- return $1.concat($2.map(([ws, , memberExpressionRest]) => {
7858
- if (Array.isArray(memberExpressionRest)) {
7859
- return [ws, ...memberExpressionRest];
7860
- }
7861
- return {
7862
- ...memberExpressionRest,
7863
- children: [ws, ...memberExpressionRest.children]
7864
- };
7865
- }));
8027
+ var TrailingMemberExpressions$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$Q)(MemberExpressionRest), (0, import_lib3.$Q)(IndentedTrailingMemberExpression)), function($skip, $loc, $0, $1, $2) {
8028
+ return [...$1, ...$2];
7866
8029
  });
7867
8030
  function TrailingMemberExpressions(ctx, state2) {
7868
8031
  return (0, import_lib3.$EVENT)(ctx, state2, "TrailingMemberExpressions", TrailingMemberExpressions$0);
7869
8032
  }
8033
+ var IndentedTrailingMemberExpression$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(IndentedAtLeast, (0, import_lib3.$Y)((0, import_lib3.$S)((0, import_lib3.$E)((0, import_lib3.$EXPECT)($L6, 'IndentedTrailingMemberExpression "?"')), (0, import_lib3.$EXPECT)($L7, 'IndentedTrailingMemberExpression "."'), (0, import_lib3.$N)((0, import_lib3.$EXPECT)($R3, "IndentedTrailingMemberExpression /[0-9]/")))), MemberExpressionRest), function($skip, $loc, $0, $1, $2, $3) {
8034
+ var ws = $1;
8035
+ var rest = $3;
8036
+ return prepend(ws, rest);
8037
+ });
8038
+ function IndentedTrailingMemberExpression(ctx, state2) {
8039
+ return (0, import_lib3.$EVENT)(ctx, state2, "IndentedTrailingMemberExpression", IndentedTrailingMemberExpression$0);
8040
+ }
7870
8041
  var AllowedTrailingMemberExpressions$0 = (0, import_lib3.$T)((0, import_lib3.$S)(TrailingMemberPropertyAllowed, TrailingMemberExpressions), function(value) {
7871
8042
  return value[1];
7872
8043
  });
@@ -8134,7 +8305,7 @@ var NWTypePostfix$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(As, _, Tuple), fu
8134
8305
  children: [{ $loc: $1.$loc, token: "satisfies" }, $2, $3]
8135
8306
  };
8136
8307
  });
8137
- var NWTypePostfix$1 = (0, import_lib3.$TS)((0, import_lib3.$S)(As, (0, import_lib3.$E)(ExclamationPoint), Type), function($skip, $loc, $0, $1, $2, $3) {
8308
+ var NWTypePostfix$1 = (0, import_lib3.$TS)((0, import_lib3.$S)(As, (0, import_lib3.$E)(ExclamationPoint), (0, import_lib3.$C)(Type, (0, import_lib3.$S)(__, Const))), function($skip, $loc, $0, $1, $2, $3) {
8138
8309
  var as = $1;
8139
8310
  var ex = $2;
8140
8311
  var type = $3;
@@ -8488,7 +8659,7 @@ var ParenthesizedExpression$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(OpenPar
8488
8659
  function ParenthesizedExpression(ctx, state2) {
8489
8660
  return (0, import_lib3.$EVENT)(ctx, state2, "ParenthesizedExpression", ParenthesizedExpression$0);
8490
8661
  }
8491
- var Placeholder$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Dot, (0, import_lib3.$N)((0, import_lib3.$EXPECT)($R6, "Placeholder /\\p{ID_Continue}|[\\u200C\\u200D$.#{]/")), (0, import_lib3.$E)(PlaceholderTypeSuffix)), function($skip, $loc, $0, $1, $2, $3) {
8662
+ var Placeholder$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Dot, (0, import_lib3.$N)((0, import_lib3.$EXPECT)($R6, "Placeholder /\\p{ID_Continue}|[\\u200C\\u200D$.#{=]/")), (0, import_lib3.$E)(PlaceholderTypeSuffix)), function($skip, $loc, $0, $1, $2, $3) {
8492
8663
  var dot = $1;
8493
8664
  var typeSuffix = $3;
8494
8665
  return {
@@ -9441,18 +9612,18 @@ var NonEmptyParameters$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_l
9441
9612
  var params = $3;
9442
9613
  var close = $4;
9443
9614
  let tt, before = [], rest, after = [], errors = [];
9444
- function append(p) {
9615
+ function append2(p) {
9445
9616
  (rest ? after : before).push(p);
9446
9617
  }
9447
9618
  for (const param of params) {
9448
9619
  switch (param.type) {
9449
9620
  case "ThisType":
9450
9621
  if (tt) {
9451
- append({
9622
+ append2({
9452
9623
  type: "Error",
9453
9624
  message: "Only one typed this parameter is allowed"
9454
9625
  });
9455
- append(param);
9626
+ append2(param);
9456
9627
  } else {
9457
9628
  tt = trimFirstSpace(param);
9458
9629
  if (before.length || rest) {
@@ -9470,17 +9641,17 @@ var NonEmptyParameters$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_l
9470
9641
  break;
9471
9642
  case "FunctionRestParameter":
9472
9643
  if (rest) {
9473
- append({
9644
+ append2({
9474
9645
  type: "Error",
9475
9646
  message: "Only one rest parameter is allowed"
9476
9647
  });
9477
- append(param);
9648
+ append2(param);
9478
9649
  } else {
9479
9650
  rest = param;
9480
9651
  }
9481
9652
  break;
9482
9653
  default:
9483
- append(param);
9654
+ append2(param);
9484
9655
  }
9485
9656
  }
9486
9657
  const names = before.flatMap((p) => p.names);
@@ -10985,15 +11156,10 @@ var NestedElement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Nested, ElementLi
10985
11156
  if (!length)
10986
11157
  return $skip;
10987
11158
  return list.map((e, i) => {
10988
- if (i === 0 && i === length - 1) {
10989
- return { ...e, children: [indent, ...e.children, delimiter] };
10990
- }
10991
- if (i === 0) {
10992
- return { ...e, children: [indent, ...e.children] };
10993
- }
10994
- if (i === length - 1) {
10995
- return { ...e, children: [...e.children, delimiter] };
10996
- }
11159
+ if (i === 0)
11160
+ e = prepend(indent, e);
11161
+ if (i === length - 1)
11162
+ e = append(e, delimiter);
10997
11163
  return e;
10998
11164
  });
10999
11165
  });
@@ -11023,19 +11189,13 @@ var ElementList$0 = (0, import_lib3.$T)((0, import_lib3.$S)(BulletedArray), func
11023
11189
  var ElementList$1 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$N)(EOS), ArrayElementExpression, (0, import_lib3.$Q)(ElementListRest)), function($skip, $loc, $0, $1, $2, $3) {
11024
11190
  var first = $2;
11025
11191
  var rest = $3;
11026
- if (rest.length) {
11027
- return [{
11028
- ...first,
11029
- children: [...first.children, rest[0][0]]
11030
- }].concat(rest.map(([_2, e], i) => {
11031
- const delim = rest[i + 1]?.[0];
11032
- return {
11033
- ...e,
11034
- children: [...e.children, delim]
11035
- };
11036
- }));
11037
- }
11038
- return [first];
11192
+ if (!rest.length)
11193
+ return [first];
11194
+ return [
11195
+ append(first, rest[0][0])
11196
+ ].concat(
11197
+ rest.map(([_2, e], i) => append(e, rest[i + 1]?.[0]))
11198
+ );
11039
11199
  });
11040
11200
  var ElementList$$ = [ElementList$0, ElementList$1];
11041
11201
  function ElementList(ctx, state2) {
@@ -11096,9 +11256,10 @@ var NestedBulletedArray$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_
11096
11256
  if (!content.length)
11097
11257
  return $skip;
11098
11258
  content = content.flat();
11099
- const { children } = content[content.length - 1];
11100
- if (children.at(-1).implicit)
11101
- children.pop();
11259
+ const last = content[content.length - 1];
11260
+ if (last.children?.at(-1)?.implicit) {
11261
+ last.children = last.children.slice(0, -1);
11262
+ }
11102
11263
  return {
11103
11264
  type: "ArrayExpression",
11104
11265
  children: [...open, ...content, close]
@@ -11118,9 +11279,10 @@ var BulletedArray$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(InsertOpenBracket
11118
11279
  // replace first space with bracket
11119
11280
  ...content[1].flat()
11120
11281
  ];
11121
- const { children } = content[content.length - 1];
11122
- if (children.at(-1).implicit)
11123
- children.pop();
11282
+ const last = content[content.length - 1];
11283
+ if (last.children?.at(-1)?.implicit) {
11284
+ last.children = last.children.slice(0, -1);
11285
+ }
11124
11286
  return {
11125
11287
  type: "ArrayExpression",
11126
11288
  children: [open, ...content, close]
@@ -11132,7 +11294,7 @@ function BulletedArray(ctx, state2) {
11132
11294
  var NestedArrayBullet$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Nested, ArrayBullet), function($skip, $loc, $0, $1, $2) {
11133
11295
  var indent = $1;
11134
11296
  var list = $2;
11135
- return list.map((e, i) => i === 0 ? { ...e, children: [indent, ...e.children] } : e);
11297
+ return list.map((e, i) => i === 0 ? prepend(indent, e) : e);
11136
11298
  });
11137
11299
  function NestedArrayBullet(ctx, state2) {
11138
11300
  return (0, import_lib3.$EVENT)(ctx, state2, "NestedArrayBullet", NestedArrayBullet$0);
@@ -11143,15 +11305,13 @@ var ArrayBullet$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(BulletIndent, (0, i
11143
11305
  if (!content)
11144
11306
  return $skip;
11145
11307
  let [list, delimiter] = content;
11146
- if (list.type === "ArrayExpression")
11147
- list = [list];
11148
11308
  if (!list.length)
11149
11309
  return $skip;
11150
11310
  list = list.slice();
11151
- list[0] = { ...list[0], children: [bullet, ...list[0].children] };
11311
+ list[0] = prepend(bullet, list[0]);
11152
11312
  if (delimiter) {
11153
11313
  const last = list.length - 1;
11154
- list[last] = { ...list[last], children: [...list[last].children, delimiter] };
11314
+ list[last] = append(list[last], delimiter);
11155
11315
  }
11156
11316
  return list;
11157
11317
  });
@@ -12421,8 +12581,10 @@ var Statement$1 = VariableStatement;
12421
12581
  var Statement$2 = (0, import_lib3.$T)((0, import_lib3.$S)(IfStatement, (0, import_lib3.$N)(ShouldExpressionize)), function(value) {
12422
12582
  return value[0];
12423
12583
  });
12424
- var Statement$3 = (0, import_lib3.$T)((0, import_lib3.$S)(IterationStatement, (0, import_lib3.$N)(ShouldExpressionize)), function(value) {
12425
- return value[0];
12584
+ var Statement$3 = (0, import_lib3.$TS)((0, import_lib3.$S)(IterationStatement, (0, import_lib3.$N)(ShouldExpressionize)), function($skip, $loc, $0, $1, $2) {
12585
+ if ($1.generator)
12586
+ return $skip;
12587
+ return $1;
12426
12588
  });
12427
12589
  var Statement$4 = (0, import_lib3.$T)((0, import_lib3.$S)(SwitchStatement, (0, import_lib3.$N)(ShouldExpressionize)), function(value) {
12428
12590
  return value[0];
@@ -12493,11 +12655,22 @@ var Label$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Colon, Identifier, Whites
12493
12655
  var colon = $1;
12494
12656
  var id = $2;
12495
12657
  var w = $3;
12496
- return [id, colon, w];
12658
+ return {
12659
+ type: "Label",
12660
+ name: id.name,
12661
+ children: [id, colon, w]
12662
+ };
12497
12663
  });
12498
12664
  function Label(ctx, state2) {
12499
12665
  return (0, import_lib3.$EVENT)(ctx, state2, "Label", Label$0);
12500
12666
  }
12667
+ var LabelIdentifier$0 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$E)(Colon), Identifier), function(value) {
12668
+ var id = value[1];
12669
+ return id;
12670
+ });
12671
+ function LabelIdentifier(ctx, state2) {
12672
+ return (0, import_lib3.$EVENT)(ctx, state2, "LabelIdentifier", LabelIdentifier$0);
12673
+ }
12501
12674
  var LabelledItem$0 = Statement;
12502
12675
  var LabelledItem$1 = FunctionDeclaration;
12503
12676
  var LabelledItem$$ = [LabelledItem$0, LabelledItem$1];
@@ -12594,7 +12767,8 @@ var IterationExpression$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_
12594
12767
  children: [statement],
12595
12768
  block: statement.block,
12596
12769
  statement,
12597
- async
12770
+ async,
12771
+ generator: statement.generator
12598
12772
  };
12599
12773
  });
12600
12774
  function IterationExpression(ctx, state2) {
@@ -12613,8 +12787,9 @@ var LoopStatement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(LoopClause, Block
12613
12787
  function LoopStatement(ctx, state2) {
12614
12788
  return (0, import_lib3.$EVENT)(ctx, state2, "LoopStatement", LoopStatement$0);
12615
12789
  }
12616
- var LoopClause$0 = (0, import_lib3.$TV)(Loop, function($skip, $loc, $0, $1) {
12617
- var kind = $0;
12790
+ var LoopClause$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Loop, (0, import_lib3.$E)((0, import_lib3.$S)((0, import_lib3.$E)(_), Star))), function($skip, $loc, $0, $1, $2) {
12791
+ var kind = $1;
12792
+ var generator = $2;
12618
12793
  const expression = {
12619
12794
  type: "Literal",
12620
12795
  children: ["true"],
@@ -12629,33 +12804,41 @@ var LoopClause$0 = (0, import_lib3.$TV)(Loop, function($skip, $loc, $0, $1) {
12629
12804
  type: "IterationStatement",
12630
12805
  subtype: kind.token,
12631
12806
  children: [kind, condition],
12632
- condition
12807
+ condition,
12808
+ generator
12633
12809
  };
12634
12810
  });
12635
12811
  function LoopClause(ctx, state2) {
12636
12812
  return (0, import_lib3.$EVENT)(ctx, state2, "LoopClause", LoopClause$0);
12637
12813
  }
12638
- var DoWhileStatement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Do, NoPostfixBracedOrEmptyBlock, __, WhileClause), function($skip, $loc, $0, $1, $2, $3, $4) {
12639
- var block = $2;
12640
- var clause = $4;
12814
+ var DoWhileStatement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Do, (0, import_lib3.$E)((0, import_lib3.$S)((0, import_lib3.$E)(_), Star)), NoPostfixBracedOrEmptyBlock, __, WhileClause), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
12815
+ var d = $1;
12816
+ var generator = $2;
12817
+ var block = $3;
12818
+ var ws = $4;
12819
+ var clause = $5;
12641
12820
  return {
12642
12821
  ...clause,
12643
12822
  type: "IterationStatement",
12644
12823
  subtype: "do-while",
12645
- children: $0,
12646
- block
12824
+ children: [d, block, ws, clause],
12825
+ block,
12826
+ generator
12647
12827
  };
12648
12828
  });
12649
12829
  function DoWhileStatement(ctx, state2) {
12650
12830
  return (0, import_lib3.$EVENT)(ctx, state2, "DoWhileStatement", DoWhileStatement$0);
12651
12831
  }
12652
- var DoStatement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Do, NoPostfixBracedOrEmptyBlock), function($skip, $loc, $0, $1, $2) {
12653
- var block = $2;
12832
+ var DoStatement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Do, (0, import_lib3.$E)((0, import_lib3.$S)((0, import_lib3.$E)(_), Star)), NoPostfixBracedOrEmptyBlock), function($skip, $loc, $0, $1, $2, $3) {
12833
+ var d = $1;
12834
+ var generator = $2;
12835
+ var block = $3;
12654
12836
  block = trimFirstSpace(block);
12655
12837
  return {
12656
12838
  type: "DoStatement",
12657
12839
  children: [block],
12658
- block
12840
+ block,
12841
+ generator
12659
12842
  };
12660
12843
  });
12661
12844
  function DoStatement(ctx, state2) {
@@ -12690,10 +12873,11 @@ var WhileStatement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(WhileClause, Blo
12690
12873
  function WhileStatement(ctx, state2) {
12691
12874
  return (0, import_lib3.$EVENT)(ctx, state2, "WhileStatement", WhileStatement$0);
12692
12875
  }
12693
- var WhileClause$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$C)(While, Until), (0, import_lib3.$E)(_), Condition), function($skip, $loc, $0, $1, $2, $3) {
12876
+ var WhileClause$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$C)(While, Until), (0, import_lib3.$E)((0, import_lib3.$S)((0, import_lib3.$E)(_), Star)), (0, import_lib3.$E)(_), Condition), function($skip, $loc, $0, $1, $2, $3, $4) {
12694
12877
  var kind = $1;
12695
- var ws = $2;
12696
- var condition = $3;
12878
+ var generator = $2;
12879
+ var ws = $3;
12880
+ var condition = $4;
12697
12881
  if (kind.negated) {
12698
12882
  kind = { ...kind, token: "while" };
12699
12883
  condition = negateCondition(condition);
@@ -12703,6 +12887,7 @@ var WhileClause$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$C)
12703
12887
  subtype: kind.token,
12704
12888
  children: [kind, ws, condition],
12705
12889
  condition,
12890
+ generator,
12706
12891
  negated: kind.negated
12707
12892
  };
12708
12893
  });
@@ -12722,16 +12907,18 @@ var ForStatement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(ForClause, BlockOr
12722
12907
  function ForStatement(ctx, state2) {
12723
12908
  return (0, import_lib3.$EVENT)(ctx, state2, "ForStatement", ForStatement$0);
12724
12909
  }
12725
- var ForClause$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(For, __, ForStatementControl), function($skip, $loc, $0, $1, $2, $3) {
12726
- var c = $3;
12910
+ var ForClause$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(For, (0, import_lib3.$E)((0, import_lib3.$S)((0, import_lib3.$E)(_), Star)), __, ForStatementControl), function($skip, $loc, $0, $1, $2, $3, $4) {
12911
+ var generator = $2;
12912
+ var c = $4;
12727
12913
  const { children, declaration } = c;
12728
12914
  return {
12729
12915
  type: "ForStatement",
12730
- children: [$1, ...$2, ...children],
12916
+ children: [$1, ...$3, ...children],
12731
12917
  declaration,
12732
12918
  block: null,
12733
12919
  blockPrefix: c.blockPrefix,
12734
- hoistDec: c.hoistDec
12920
+ hoistDec: c.hoistDec,
12921
+ generator
12735
12922
  };
12736
12923
  });
12737
12924
  function ForClause(ctx, state2) {
@@ -13498,11 +13685,21 @@ var ExpressionStatement$$ = [ExpressionStatement$0, ExpressionStatement$1];
13498
13685
  function ExpressionStatement(ctx, state2) {
13499
13686
  return (0, import_lib3.$EVENT_C)(ctx, state2, "ExpressionStatement", ExpressionStatement$$);
13500
13687
  }
13501
- var KeywordStatement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Break, (0, import_lib3.$E)((0, import_lib3.$S)(_, (0, import_lib3.$E)(Colon), Identifier))), function($skip, $loc, $0, $1, $2) {
13688
+ var KeywordStatement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Break, (0, import_lib3.$E)((0, import_lib3.$S)(_, LabelIdentifier)), (0, import_lib3.$E)((0, import_lib3.$S)(_, With, MaybeNestedExtendedExpression))), function($skip, $loc, $0, $1, $2, $3) {
13689
+ const children = [$1];
13690
+ if ($2)
13691
+ children.push($2);
13692
+ if ($3)
13693
+ children.push({
13694
+ type: "Error",
13695
+ subtype: "Warning",
13696
+ message: "'break with' outside of loop that returns a value"
13697
+ });
13502
13698
  return {
13503
13699
  type: "BreakStatement",
13504
- children: $2 ? [$1, $2[0], $2[2]] : [$1]
13505
- // omit colon
13700
+ label: $2?.[1],
13701
+ with: $3?.[2],
13702
+ children
13506
13703
  };
13507
13704
  });
13508
13705
  var KeywordStatement$1 = (0, import_lib3.$TS)((0, import_lib3.$S)(Continue, _, Switch), function($skip, $loc, $0, $1, $2, $3) {
@@ -13512,11 +13709,21 @@ var KeywordStatement$1 = (0, import_lib3.$TS)((0, import_lib3.$S)(Continue, _, S
13512
13709
  children: []
13513
13710
  };
13514
13711
  });
13515
- var KeywordStatement$2 = (0, import_lib3.$TS)((0, import_lib3.$S)(Continue, (0, import_lib3.$E)((0, import_lib3.$S)(_, (0, import_lib3.$E)(Colon), Identifier))), function($skip, $loc, $0, $1, $2) {
13712
+ var KeywordStatement$2 = (0, import_lib3.$TS)((0, import_lib3.$S)(Continue, (0, import_lib3.$E)((0, import_lib3.$S)(_, LabelIdentifier)), (0, import_lib3.$E)((0, import_lib3.$S)(_, With, MaybeNestedExtendedExpression))), function($skip, $loc, $0, $1, $2, $3) {
13713
+ const children = [$1];
13714
+ if ($2)
13715
+ children.push($2);
13716
+ if ($3)
13717
+ children.push({
13718
+ type: "Error",
13719
+ subtype: "Warning",
13720
+ message: "'continue with' outside of loop that returns a value"
13721
+ });
13516
13722
  return {
13517
13723
  type: "ContinueStatement",
13518
- children: $2 ? [$1, $2[0], $2[2]] : [$1]
13519
- // omit colon
13724
+ label: $2?.[1],
13725
+ with: $3?.[2],
13726
+ children
13520
13727
  };
13521
13728
  });
13522
13729
  var KeywordStatement$3 = DebuggerStatement;
@@ -15944,9 +16151,42 @@ var JSXText$0 = (0, import_lib3.$TR)((0, import_lib3.$EXPECT)($R87, "JSXText /[^
15944
16151
  function JSXText(ctx, state2) {
15945
16152
  return (0, import_lib3.$EVENT)(ctx, state2, "JSXText", JSXText$0);
15946
16153
  }
15947
- var JSXChildExpression$0 = (0, import_lib3.$S)((0, import_lib3.$E)(Whitespace), (0, import_lib3.$E)((0, import_lib3.$S)(DotDotDot, (0, import_lib3.$E)(Whitespace))), PostfixedExpression);
16154
+ var JSXChildExpression$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(Whitespace), LexicalDeclaration), function($skip, $loc, $0, $1, $2) {
16155
+ var d = $2;
16156
+ let names = d.names.concat(
16157
+ d.thisAssignments.map((a) => a[1][1])
16158
+ );
16159
+ names.sort();
16160
+ names = names.filter((name, i) => i === 0 || name !== names[i - 1]);
16161
+ d = {
16162
+ ...d,
16163
+ hoistDec: {
16164
+ type: "Declaration",
16165
+ children: [
16166
+ "let ",
16167
+ names.map((n, i) => i === 0 ? [n] : [",", n]).flat()
16168
+ ]
16169
+ },
16170
+ children: d.children.slice(1)
16171
+ // drop LetOrConst
16172
+ };
16173
+ if (d.thisAssignments?.length) {
16174
+ d.children.push(...d.splices, ",", ...d.thisAssignments.map(
16175
+ (a, i) => a[a.length - 1] === ";" ? [
16176
+ ...a.slice(0, -1),
16177
+ i === d.thisAssignments.length - 1 ? "" : ","
16178
+ ] : a
16179
+ ));
16180
+ } else if (d.splices?.length) {
16181
+ d.children.push(...d.splices);
16182
+ }
16183
+ d.children.push(",void 0");
16184
+ return d;
16185
+ });
16186
+ var JSXChildExpression$1 = (0, import_lib3.$S)((0, import_lib3.$E)(Whitespace), (0, import_lib3.$E)((0, import_lib3.$S)(DotDotDot, (0, import_lib3.$E)(Whitespace))), PostfixedExpression);
16187
+ var JSXChildExpression$$ = [JSXChildExpression$0, JSXChildExpression$1];
15948
16188
  function JSXChildExpression(ctx, state2) {
15949
- return (0, import_lib3.$EVENT)(ctx, state2, "JSXChildExpression", JSXChildExpression$0);
16189
+ return (0, import_lib3.$EVENT_C)(ctx, state2, "JSXChildExpression", JSXChildExpression$$);
15950
16190
  }
15951
16191
  var IndentedJSXChildExpression$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(PushIndent, (0, import_lib3.$E)(NestedJSXChildExpression), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
15952
16192
  if (!$2)
@@ -16443,14 +16683,16 @@ var TypeSuffix$$ = [TypeSuffix$0, TypeSuffix$1, TypeSuffix$2];
16443
16683
  function TypeSuffix(ctx, state2) {
16444
16684
  return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeSuffix", TypeSuffix$$);
16445
16685
  }
16446
- var MaybeNestedType$0 = NestedInterfaceBlock;
16447
- var MaybeNestedType$1 = (0, import_lib3.$TS)((0, import_lib3.$S)(PushIndent, (0, import_lib3.$E)((0, import_lib3.$S)(Nested, Type)), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
16686
+ var MaybeNestedType$0 = NestedTypeBulletedTuple;
16687
+ var MaybeNestedType$1 = NestedInterfaceBlock;
16688
+ var MaybeNestedType$2 = NestedTypeBinaryChain;
16689
+ var MaybeNestedType$3 = (0, import_lib3.$TS)((0, import_lib3.$S)(PushIndent, (0, import_lib3.$E)((0, import_lib3.$S)(Nested, Type)), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
16448
16690
  if (!$2)
16449
16691
  return $skip;
16450
16692
  return $2;
16451
16693
  });
16452
- var MaybeNestedType$2 = Type;
16453
- var MaybeNestedType$$ = [MaybeNestedType$0, MaybeNestedType$1, MaybeNestedType$2];
16694
+ var MaybeNestedType$4 = Type;
16695
+ var MaybeNestedType$$ = [MaybeNestedType$0, MaybeNestedType$1, MaybeNestedType$2, MaybeNestedType$3, MaybeNestedType$4];
16454
16696
  function MaybeNestedType(ctx, state2) {
16455
16697
  return (0, import_lib3.$EVENT_C)(ctx, state2, "MaybeNestedType", MaybeNestedType$$);
16456
16698
  }
@@ -16466,9 +16708,11 @@ var ReturnTypeSuffix$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib
16466
16708
  function ReturnTypeSuffix(ctx, state2) {
16467
16709
  return (0, import_lib3.$EVENT)(ctx, state2, "ReturnTypeSuffix", ReturnTypeSuffix$0);
16468
16710
  }
16469
- var ReturnType$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)((0, import_lib3.$S)(__, (0, import_lib3.$EXPECT)($L232, 'ReturnType "asserts"'), NonIdContinue)), TypePredicate), function($skip, $loc, $0, $1, $2) {
16711
+ var ReturnType$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)((0, import_lib3.$S)(__, (0, import_lib3.$EXPECT)($L232, 'ReturnType "asserts"'), NonIdContinue)), ForbidIndentedApplication, (0, import_lib3.$E)(TypePredicate), RestoreIndentedApplication), function($skip, $loc, $0, $1, $2, $3, $4) {
16470
16712
  var asserts = $1;
16471
- var t = $2;
16713
+ var t = $3;
16714
+ if (!t)
16715
+ return $skip;
16472
16716
  if (asserts) {
16473
16717
  t = {
16474
16718
  type: "AssertsType",
@@ -16487,7 +16731,7 @@ var ReturnType$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(
16487
16731
  function ReturnType(ctx, state2) {
16488
16732
  return (0, import_lib3.$EVENT)(ctx, state2, "ReturnType", ReturnType$0);
16489
16733
  }
16490
- var TypePredicate$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(MaybeNestedType, (0, import_lib3.$E)((0, import_lib3.$S)(__, (0, import_lib3.$EXPECT)($L174, 'TypePredicate "is"'), NonIdContinue, Type))), function($skip, $loc, $0, $1, $2) {
16734
+ var TypePredicate$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(MaybeNestedType, (0, import_lib3.$E)((0, import_lib3.$S)(__, Is, Type))), function($skip, $loc, $0, $1, $2) {
16491
16735
  var lhs = $1;
16492
16736
  var rhs = $2;
16493
16737
  if (!rhs)
@@ -16502,11 +16746,11 @@ var TypePredicate$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(MaybeNestedType,
16502
16746
  function TypePredicate(ctx, state2) {
16503
16747
  return (0, import_lib3.$EVENT)(ctx, state2, "TypePredicate", TypePredicate$0);
16504
16748
  }
16505
- var Type$0 = TypeConditional;
16749
+ var Type$0 = TypeWithPostfix;
16506
16750
  function Type(ctx, state2) {
16507
16751
  return (0, import_lib3.$EVENT)(ctx, state2, "Type", Type$0);
16508
16752
  }
16509
- var TypeBinary$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)((0, import_lib3.$S)(__, TypeBinaryOp, __)), TypeUnary, (0, import_lib3.$Q)((0, import_lib3.$S)(__, TypeBinaryOp, __, TypeUnary))), function($skip, $loc, $0, $1, $2, $3) {
16753
+ var TypeBinary$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)((0, import_lib3.$S)(NotDedented, TypeBinaryOp, __)), TypeUnary, (0, import_lib3.$Q)((0, import_lib3.$S)(NotDedented, TypeBinaryOp, __, TypeUnary))), function($skip, $loc, $0, $1, $2, $3) {
16510
16754
  var optionalPrefix = $1;
16511
16755
  var t = $2;
16512
16756
  var ops = $3;
@@ -16521,6 +16765,25 @@ var TypeBinary$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(
16521
16765
  function TypeBinary(ctx, state2) {
16522
16766
  return (0, import_lib3.$EVENT)(ctx, state2, "TypeBinary", TypeBinary$0);
16523
16767
  }
16768
+ var NestedTypeBinaryChain$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(PushIndent, (0, import_lib3.$Q)(NestedTypeBinary), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
16769
+ if (!$2.length)
16770
+ return $skip;
16771
+ return $2;
16772
+ });
16773
+ function NestedTypeBinaryChain(ctx, state2) {
16774
+ return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeBinaryChain", NestedTypeBinaryChain$0);
16775
+ }
16776
+ var NestedTypeBinary$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Nested, TypeBinaryOp, PushExtraIndent1, (0, import_lib3.$E)(TypeUnary), PopIndent), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
16777
+ var indent = $1;
16778
+ var op = $2;
16779
+ var t = $4;
16780
+ if (!t)
16781
+ return $skip;
16782
+ return [indent, op, t];
16783
+ });
16784
+ function NestedTypeBinary(ctx, state2) {
16785
+ return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeBinary", NestedTypeBinary$0);
16786
+ }
16524
16787
  var TypeUnary$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$Q)((0, import_lib3.$S)(__, TypeUnaryOp)), TypePrimary, (0, import_lib3.$Q)(TypeUnarySuffix)), function($skip, $loc, $0, $1, $2, $3) {
16525
16788
  var prefix = $1;
16526
16789
  var t = $2;
@@ -16590,7 +16853,7 @@ var TypePrimary$1 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)
16590
16853
  };
16591
16854
  });
16592
16855
  var TypePrimary$2 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_), TypeTuple), function($skip, $loc, $0, $1, $2) {
16593
- return { ...$2, children: [$1, ...$2.children] };
16856
+ return prepend($1, $2);
16594
16857
  });
16595
16858
  var TypePrimary$3 = InterfaceBlock;
16596
16859
  var TypePrimary$4 = (0, import_lib3.$S)((0, import_lib3.$E)(_), TypeFunction);
@@ -16619,7 +16882,7 @@ var TypePrimary$8 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)
16619
16882
  args: void 0
16620
16883
  };
16621
16884
  });
16622
- var TypePrimary$9 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_), IdentifierName, (0, import_lib3.$Q)((0, import_lib3.$S)(Dot, IdentifierName)), (0, import_lib3.$E)(TypeArguments)), function($skip, $loc, $0, $1, $2, $3, $4) {
16885
+ var TypePrimary$9 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_), Identifier, (0, import_lib3.$Q)((0, import_lib3.$S)(Dot, IdentifierName)), (0, import_lib3.$E)((0, import_lib3.$C)(TypeArguments, ImplicitTypeArguments))), function($skip, $loc, $0, $1, $2, $3, $4) {
16623
16886
  var args = $4;
16624
16887
  return {
16625
16888
  type: "IdentifierType",
@@ -16628,10 +16891,13 @@ var TypePrimary$9 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)
16628
16891
  args
16629
16892
  };
16630
16893
  });
16631
- var TypePrimary$10 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_), OpenParen, (0, import_lib3.$C)(Type, (0, import_lib3.$S)(EOS, Type)), __, CloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
16894
+ var TypePrimary$10 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_), OpenParen, AllowAll, (0, import_lib3.$E)((0, import_lib3.$C)(Type, (0, import_lib3.$S)(EOS, Type))), RestoreAll, __, CloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
16895
+ if (!$4)
16896
+ return $skip;
16632
16897
  return {
16633
16898
  type: "ParenthesizedType",
16634
- children: $0
16899
+ children: [$1, $2, $4, $6, $7]
16900
+ // omit AllowAll/RestoreAll
16635
16901
  };
16636
16902
  });
16637
16903
  var TypePrimary$$ = [TypePrimary$0, TypePrimary$1, TypePrimary$2, TypePrimary$3, TypePrimary$4, TypePrimary$5, TypePrimary$6, TypePrimary$7, TypePrimary$8, TypePrimary$9, TypePrimary$10];
@@ -16644,18 +16910,58 @@ var ImportType$$ = [ImportType$0, ImportType$1];
16644
16910
  function ImportType(ctx, state2) {
16645
16911
  return (0, import_lib3.$EVENT_C)(ctx, state2, "ImportType", ImportType$$);
16646
16912
  }
16647
- var TypeTuple$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(OpenBracket, (0, import_lib3.$C)(NestedTypeList, (0, import_lib3.$E)(TypeList)), __, CloseBracket), function($skip, $loc, $0, $1, $2, $3, $4) {
16913
+ var TypeTuple$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(OpenBracket, AllowAll, (0, import_lib3.$E)((0, import_lib3.$S)(TypeTupleContent, __, CloseBracket)), RestoreAll), function($skip, $loc, $0, $1, $2, $3, $4) {
16914
+ if (!$3)
16915
+ return $skip;
16648
16916
  return {
16649
16917
  type: "TypeTuple",
16650
- children: $0
16918
+ children: [$1, ...$3]
16651
16919
  };
16652
16920
  });
16653
16921
  function TypeTuple(ctx, state2) {
16654
16922
  return (0, import_lib3.$EVENT)(ctx, state2, "TypeTuple", TypeTuple$0);
16655
16923
  }
16656
- var TypeList$0 = (0, import_lib3.$S)(TypeElement, (0, import_lib3.$Q)((0, import_lib3.$S)(__, Comma, TypeElement)));
16657
- function TypeList(ctx, state2) {
16658
- return (0, import_lib3.$EVENT)(ctx, state2, "TypeList", TypeList$0);
16924
+ var TypeTupleContent$0 = (0, import_lib3.$S)(NestedTypeElementList, (0, import_lib3.$Y)((0, import_lib3.$S)(__, CloseBracket)));
16925
+ var TypeTupleContent$1 = (0, import_lib3.$TS)((0, import_lib3.$S)(TypeElementListWithIndentedApplicationForbidden, ArrayElementDelimiter, (0, import_lib3.$E)(NestedTypeElementList), (0, import_lib3.$Y)((0, import_lib3.$S)(__, CloseBracket))), function($skip, $loc, $0, $1, $2, $3, $4) {
16926
+ var list = $1;
16927
+ var delimiter = $2;
16928
+ var nested = $3;
16929
+ if (!nested)
16930
+ return list;
16931
+ return [...list, delimiter, ...nested];
16932
+ });
16933
+ var TypeTupleContent$2 = (0, import_lib3.$TV)((0, import_lib3.$Q)((0, import_lib3.$S)(__, TypeElementListWithIndentedApplicationForbidden, ArrayElementDelimiter)), function($skip, $loc, $0, $1) {
16934
+ return $1.flat();
16935
+ });
16936
+ var TypeTupleContent$$ = [TypeTupleContent$0, TypeTupleContent$1, TypeTupleContent$2];
16937
+ function TypeTupleContent(ctx, state2) {
16938
+ return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeTupleContent", TypeTupleContent$$);
16939
+ }
16940
+ var TypeElementListWithIndentedApplicationForbidden$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(ForbidIndentedApplication, (0, import_lib3.$E)(TypeElementList), RestoreIndentedApplication), function($skip, $loc, $0, $1, $2, $3) {
16941
+ if ($2)
16942
+ return $2;
16943
+ return $skip;
16944
+ });
16945
+ function TypeElementListWithIndentedApplicationForbidden(ctx, state2) {
16946
+ return (0, import_lib3.$EVENT)(ctx, state2, "TypeElementListWithIndentedApplicationForbidden", TypeElementListWithIndentedApplicationForbidden$0);
16947
+ }
16948
+ var TypeElementList$0 = (0, import_lib3.$T)((0, import_lib3.$S)(TypeBulletedTuple), function(value) {
16949
+ return [value[0]];
16950
+ });
16951
+ var TypeElementList$1 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$N)(EOS), TypeElement, (0, import_lib3.$Q)((0, import_lib3.$S)((0, import_lib3.$S)((0, import_lib3.$E)(_), Comma, (0, import_lib3.$N)(EOS)), TypeElement))), function($skip, $loc, $0, $1, $2, $3) {
16952
+ var first = $2;
16953
+ var rest = $3;
16954
+ if (!rest.length)
16955
+ return [first];
16956
+ return [
16957
+ append(first, rest[0][0])
16958
+ ].concat(
16959
+ rest.map(([_2, e], i) => append(e, rest[i + 1]?.[0]))
16960
+ );
16961
+ });
16962
+ var TypeElementList$$ = [TypeElementList$0, TypeElementList$1];
16963
+ function TypeElementList(ctx, state2) {
16964
+ return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeElementList", TypeElementList$$);
16659
16965
  }
16660
16966
  var TypeElement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(__, (0, import_lib3.$E)((0, import_lib3.$S)(DotDotDot, __)), IdentifierName, (0, import_lib3.$E)((0, import_lib3.$S)((0, import_lib3.$E)(_), DotDotDot)), (0, import_lib3.$S)(__, (0, import_lib3.$E)((0, import_lib3.$S)(QuestionMark, (0, import_lib3.$E)(_))), Colon, __), Type), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
16661
16967
  var ws = $1;
@@ -16689,21 +16995,129 @@ var TypeElement$$ = [TypeElement$0, TypeElement$1, TypeElement$2];
16689
16995
  function TypeElement(ctx, state2) {
16690
16996
  return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeElement", TypeElement$$);
16691
16997
  }
16692
- var NestedTypeList$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(PushIndent, (0, import_lib3.$Q)(NestedType), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
16998
+ var NestedTypeElementList$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(PushIndent, (0, import_lib3.$Q)(NestedTypeElement), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
16693
16999
  var types = $2;
16694
17000
  if (types.length)
16695
17001
  return types;
16696
17002
  return $skip;
16697
17003
  });
16698
- function NestedTypeList(ctx, state2) {
16699
- return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeList", NestedTypeList$0);
17004
+ function NestedTypeElementList(ctx, state2) {
17005
+ return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeElementList", NestedTypeElementList$0);
16700
17006
  }
16701
- var NestedType$0 = (0, import_lib3.$S)(Nested, TypeElement, ArrayElementDelimiter);
16702
- function NestedType(ctx, state2) {
16703
- return (0, import_lib3.$EVENT)(ctx, state2, "NestedType", NestedType$0);
17007
+ var NestedTypeElement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Nested, TypeElementList, ArrayElementDelimiter), function($skip, $loc, $0, $1, $2, $3) {
17008
+ var indent = $1;
17009
+ var list = $2;
17010
+ var delimiter = $3;
17011
+ const { length } = list;
17012
+ if (!length)
17013
+ return $skip;
17014
+ return list.map((e, i) => {
17015
+ if (i === 0)
17016
+ e = prepend(indent, e);
17017
+ if (i === length - 1)
17018
+ e = append(e, delimiter);
17019
+ return e;
17020
+ });
17021
+ });
17022
+ function NestedTypeElement(ctx, state2) {
17023
+ return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeElement", NestedTypeElement$0);
17024
+ }
17025
+ var NestedTypeBulletedTuple$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$S)(InsertSpace, InsertOpenBracket), PushIndent, (0, import_lib3.$Q)(NestedTypeBullet), InsertCloseBracket, PopIndent), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
17026
+ var open = $1;
17027
+ var content = $3;
17028
+ var close = $4;
17029
+ if (!content.length)
17030
+ return $skip;
17031
+ content = content.flat();
17032
+ const last = content[content.length - 1];
17033
+ let children = Array.isArray(last) ? last : last?.children;
17034
+ if (children?.at(-1).implicit) {
17035
+ children = children.slice(0, -1);
17036
+ if (Array.isArray(last)) {
17037
+ content[content.length - 1] = children;
17038
+ } else {
17039
+ content[content.length - 1] = { ...last, children };
17040
+ }
17041
+ }
17042
+ return {
17043
+ type: "TypeTuple",
17044
+ children: [...open, ...content, close]
17045
+ };
17046
+ });
17047
+ function NestedTypeBulletedTuple(ctx, state2) {
17048
+ return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeBulletedTuple", NestedTypeBulletedTuple$0);
17049
+ }
17050
+ var TypeBulletedTuple$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(InsertOpenBracket, (0, import_lib3.$E)((0, import_lib3.$S)(TypeBullet, (0, import_lib3.$Q)(NestedTypeBullet))), InsertCloseBracket), function($skip, $loc, $0, $1, $2, $3) {
17051
+ var open = $1;
17052
+ var content = $2;
17053
+ var close = $3;
17054
+ if (!content)
17055
+ return $skip;
17056
+ content = [
17057
+ ...trimFirstSpace(content[0]),
17058
+ // replace first space with bracket
17059
+ ...content[1].flat()
17060
+ ];
17061
+ const last = content[content.length - 1];
17062
+ let children = Array.isArray(last) ? last : last?.children;
17063
+ if (children?.at(-1).implicit) {
17064
+ children = children.slice(0, -1);
17065
+ if (Array.isArray(last)) {
17066
+ content[content.length - 1] = children;
17067
+ } else {
17068
+ content[content.length - 1] = { ...last, children };
17069
+ }
17070
+ }
17071
+ return {
17072
+ type: "TypeTuple",
17073
+ children: [open, ...content, close]
17074
+ };
17075
+ });
17076
+ function TypeBulletedTuple(ctx, state2) {
17077
+ return (0, import_lib3.$EVENT)(ctx, state2, "TypeBulletedTuple", TypeBulletedTuple$0);
17078
+ }
17079
+ var NestedTypeBullet$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Nested, TypeBullet), function($skip, $loc, $0, $1, $2) {
17080
+ var indent = $1;
17081
+ var list = $2;
17082
+ return list.map((e, i) => i === 0 ? prepend(indent, e) : e);
17083
+ });
17084
+ function NestedTypeBullet(ctx, state2) {
17085
+ return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeBullet", NestedTypeBullet$0);
17086
+ }
17087
+ var TypeBullet$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(BulletIndent, (0, import_lib3.$E)((0, import_lib3.$S)(TypeElementList, ArrayBulletDelimiter)), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
17088
+ var bullet = $1;
17089
+ var content = $2;
17090
+ if (!content)
17091
+ return $skip;
17092
+ let [list, delimiter] = content;
17093
+ if (!list.length)
17094
+ return $skip;
17095
+ list = list.slice();
17096
+ list[0] = prepend(bullet, list[0]);
17097
+ if (delimiter) {
17098
+ const last = list.length - 1;
17099
+ list[last] = append(list[last], delimiter);
17100
+ }
17101
+ return list;
17102
+ });
17103
+ function TypeBullet(ctx, state2) {
17104
+ return (0, import_lib3.$EVENT)(ctx, state2, "TypeBullet", TypeBullet$0);
17105
+ }
17106
+ var TypeWithPostfix$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(TypeConditional, (0, import_lib3.$E)((0, import_lib3.$S)((0, import_lib3.$E)((0, import_lib3.$C)(_, IndentedFurther)), TypeIfClause))), function($skip, $loc, $0, $1, $2) {
17107
+ var t = $1;
17108
+ var postfix = $2;
17109
+ if (!postfix)
17110
+ return t;
17111
+ return prepend(
17112
+ postfix[0],
17113
+ expressionizeTypeIf([...postfix[1], $1, void 0])
17114
+ );
17115
+ });
17116
+ function TypeWithPostfix(ctx, state2) {
17117
+ return (0, import_lib3.$EVENT)(ctx, state2, "TypeWithPostfix", TypeWithPostfix$0);
16704
17118
  }
16705
17119
  var TypeConditional$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_), (0, import_lib3.$EXPECT)($R89, "TypeConditional /(?=if|unless)/"), TypeIfThenElse), function($skip, $loc, $0, $1, $2, $3) {
16706
- return [$1, expressionizeTypeIf($3)];
17120
+ return prepend($1, expressionizeTypeIf($3));
16707
17121
  });
16708
17122
  var TypeConditional$1 = (0, import_lib3.$TS)((0, import_lib3.$S)(TypeCondition, NotDedented, QuestionMark, __, Type, __, Colon, __, Type), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
16709
17123
  if ($1.negated)
@@ -16715,7 +17129,7 @@ var TypeConditional$$ = [TypeConditional$0, TypeConditional$1, TypeConditional$2
16715
17129
  function TypeConditional(ctx, state2) {
16716
17130
  return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeConditional", TypeConditional$$);
16717
17131
  }
16718
- var TypeCondition$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(TypeBinary, (0, import_lib3.$E)(IndentedFurther), (0, import_lib3.$C)(ExtendsToken, NotExtendsToken), Type), function($skip, $loc, $0, $1, $2, $3, $4) {
17132
+ var TypeCondition$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(TypeBinary, (0, import_lib3.$E)(IndentedFurther), (0, import_lib3.$C)(ExtendsToken, NotExtendsToken), TypeConditional), function($skip, $loc, $0, $1, $2, $3, $4) {
16719
17133
  return {
16720
17134
  type: "TypeCondition",
16721
17135
  negated: $3.negated,
@@ -16725,13 +17139,27 @@ var TypeCondition$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(TypeBinary, (0, i
16725
17139
  function TypeCondition(ctx, state2) {
16726
17140
  return (0, import_lib3.$EVENT)(ctx, state2, "TypeCondition", TypeCondition$0);
16727
17141
  }
16728
- var TypeIfThenElse$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_), (0, import_lib3.$C)(If, Unless), (0, import_lib3.$S)(OpenParen, TypeCondition, CloseParen), TypeBlock, (0, import_lib3.$E)(TypeElse)), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
16729
- return [$1, $2, $3[1], $4, $5];
17142
+ var TypeIfThenElse$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(TypeIfClause, TypeBlock, (0, import_lib3.$E)(TypeElse)), function($skip, $loc, $0, $1, $2, $3) {
17143
+ return [...$1, $2, $3];
16730
17144
  });
16731
- var TypeIfThenElse$1 = (0, import_lib3.$S)((0, import_lib3.$E)(_), (0, import_lib3.$C)(If, Unless), TypeCondition, TypeBlock, (0, import_lib3.$E)(TypeElse));
16732
- var TypeIfThenElse$$ = [TypeIfThenElse$0, TypeIfThenElse$1];
16733
17145
  function TypeIfThenElse(ctx, state2) {
16734
- return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeIfThenElse", TypeIfThenElse$$);
17146
+ return (0, import_lib3.$EVENT)(ctx, state2, "TypeIfThenElse", TypeIfThenElse$0);
17147
+ }
17148
+ var TypeIfClause$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$C)(If, Unless), OpenParen, AllowAll, (0, import_lib3.$E)(TypeCondition), RestoreAll, CloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
17149
+ var condition = $4;
17150
+ if (!condition)
17151
+ return $skip;
17152
+ return [$1, condition];
17153
+ });
17154
+ var TypeIfClause$1 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$C)(If, Unless), ForbidIndentedApplication, (0, import_lib3.$E)(TypeCondition), RestoreIndentedApplication), function($skip, $loc, $0, $1, $2, $3, $4) {
17155
+ var condition = $3;
17156
+ if (!condition)
17157
+ return $skip;
17158
+ return [$1, condition];
17159
+ });
17160
+ var TypeIfClause$$ = [TypeIfClause$0, TypeIfClause$1];
17161
+ function TypeIfClause(ctx, state2) {
17162
+ return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeIfClause", TypeIfClause$$);
16735
17163
  }
16736
17164
  var TypeElse$0 = (0, import_lib3.$S)(NotDedented, Else, TypeBlock);
16737
17165
  function TypeElse(ctx, state2) {
@@ -16831,12 +17259,18 @@ var TypeBinaryOp$$ = [TypeBinaryOp$0, TypeBinaryOp$1];
16831
17259
  function TypeBinaryOp(ctx, state2) {
16832
17260
  return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeBinaryOp", TypeBinaryOp$$);
16833
17261
  }
16834
- var TypeFunction$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)((0, import_lib3.$S)((0, import_lib3.$E)((0, import_lib3.$S)(Abstract, (0, import_lib3.$E)(_))), New, (0, import_lib3.$E)(_))), Parameters, __, TypeArrowFunction, (0, import_lib3.$E)(ReturnType)), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
16835
- var type = $5;
16836
- if (type) {
16837
- return $0;
17262
+ var TypeFunction$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)((0, import_lib3.$S)(Abstract, (0, import_lib3.$E)(_))), (0, import_lib3.$E)((0, import_lib3.$S)(New, (0, import_lib3.$E)(_))), Parameters, __, TypeArrowFunction, (0, import_lib3.$E)(ReturnType)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
17263
+ var type = $6;
17264
+ const ret = [...$0];
17265
+ if ($1 && !$2) {
17266
+ ret[1] = {
17267
+ type: "Error",
17268
+ message: "abstract function types must be constructors (abstract new)"
17269
+ };
16838
17270
  }
16839
- return [...$0, "void"];
17271
+ if (!type)
17272
+ ret.push("void");
17273
+ return ret;
16840
17274
  });
16841
17275
  function TypeFunction(ctx, state2) {
16842
17276
  return (0, import_lib3.$EVENT)(ctx, state2, "TypeFunction", TypeFunction$0);
@@ -16847,8 +17281,9 @@ var TypeArrowFunction$0 = (0, import_lib3.$TV)((0, import_lib3.$C)((0, import_li
16847
17281
  function TypeArrowFunction(ctx, state2) {
16848
17282
  return (0, import_lib3.$EVENT)(ctx, state2, "TypeArrowFunction", TypeArrowFunction$0);
16849
17283
  }
16850
- var TypeArguments$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(OpenAngleBracket, (0, import_lib3.$P)(TypeArgument), __, CloseAngleBracket), function($skip, $loc, $0, $1, $2, $3, $4) {
17284
+ var TypeArguments$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(OpenAngleBracket, (0, import_lib3.$P)((0, import_lib3.$S)(__, TypeArgumentDelimited)), __, CloseAngleBracket), function($skip, $loc, $0, $1, $2, $3, $4) {
16851
17285
  var args = $2;
17286
+ args = args.map(([ws, arg]) => [ws, ...arg]);
16852
17287
  return {
16853
17288
  type: "TypeArguments",
16854
17289
  ts: true,
@@ -16859,7 +17294,91 @@ var TypeArguments$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(OpenAngleBracket,
16859
17294
  function TypeArguments(ctx, state2) {
16860
17295
  return (0, import_lib3.$EVENT)(ctx, state2, "TypeArguments", TypeArguments$0);
16861
17296
  }
16862
- var TypeArgument$0 = (0, import_lib3.$S)(__, Type, TypeArgumentDelimiter);
17297
+ var ImplicitTypeArguments$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(TypeApplicationStart, InsertOpenAngleBracket, (0, import_lib3.$E)(Trimmed_), TypeArgumentList, InsertCloseAngleBracket), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
17298
+ var open = $2;
17299
+ var ws = $3;
17300
+ var args = $4;
17301
+ var close = $5;
17302
+ let last = args[args.length - 1];
17303
+ if (last?.token === ",")
17304
+ args = args.slice(0, -1);
17305
+ return [open, ws, args, close];
17306
+ });
17307
+ function ImplicitTypeArguments(ctx, state2) {
17308
+ return (0, import_lib3.$EVENT)(ctx, state2, "ImplicitTypeArguments", ImplicitTypeArguments$0);
17309
+ }
17310
+ var TypeApplicationStart$0 = (0, import_lib3.$S)(IndentedApplicationAllowed, (0, import_lib3.$Y)((0, import_lib3.$S)(IndentedFurther, (0, import_lib3.$N)(ForbiddenImplicitTypeCalls))));
17311
+ var TypeApplicationStart$1 = (0, import_lib3.$S)((0, import_lib3.$N)(EOS), (0, import_lib3.$Y)((0, import_lib3.$S)(_, (0, import_lib3.$N)(ForbiddenImplicitTypeCalls))));
17312
+ var TypeApplicationStart$$ = [TypeApplicationStart$0, TypeApplicationStart$1];
17313
+ function TypeApplicationStart(ctx, state2) {
17314
+ return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeApplicationStart", TypeApplicationStart$$);
17315
+ }
17316
+ var ForbiddenImplicitTypeCalls$0 = ReservedBinary;
17317
+ var ForbiddenImplicitTypeCalls$1 = (0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($R90, "ForbiddenImplicitTypeCalls /[|&<!=\\-\u21D2\u2192]/"));
17318
+ var ForbiddenImplicitTypeCalls$2 = (0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($R91, "ForbiddenImplicitTypeCalls /(extends|not|is)(?!\\p{ID_Continue}|[\\u200C\\u200D$])/"));
17319
+ var ForbiddenImplicitTypeCalls$$ = [ForbiddenImplicitTypeCalls$0, ForbiddenImplicitTypeCalls$1, ForbiddenImplicitTypeCalls$2];
17320
+ function ForbiddenImplicitTypeCalls(ctx, state2) {
17321
+ return (0, import_lib3.$EVENT_C)(ctx, state2, "ForbiddenImplicitTypeCalls", ForbiddenImplicitTypeCalls$$);
17322
+ }
17323
+ var TypeArgumentList$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$N)(EOS), TypeArgument, (0, import_lib3.$Q)((0, import_lib3.$S)(CommaDelimiter, (0, import_lib3.$N)(EOS), (0, import_lib3.$E)(_), TypeArgument)), (0, import_lib3.$P)((0, import_lib3.$S)(CommaDelimiter, (0, import_lib3.$C)(NestedTypeBulletedTuple, NestedInterfaceBlock, NestedTypeArgumentList)))), function($skip, $loc, $0, $1, $2, $3, $4) {
17324
+ return [
17325
+ $2,
17326
+ ...$3.flatMap(([comma, eos, ws, arg]) => [comma, prepend(ws, arg)]),
17327
+ ...$4.flatMap(
17328
+ ([comma, args]) => Array.isArray(args) ? [comma, ...args] : [comma, args]
17329
+ )
17330
+ ];
17331
+ });
17332
+ var TypeArgumentList$1 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$C)(NestedTypeBulletedTuple, NestedInterfaceBlock), (0, import_lib3.$Q)((0, import_lib3.$S)(CommaDelimiter, (0, import_lib3.$C)(NestedTypeBulletedTuple, NestedInterfaceBlock, NestedTypeArgumentList)))), function($skip, $loc, $0, $1, $2) {
17333
+ return [
17334
+ trimFirstSpace($1),
17335
+ ...$2.flatMap(
17336
+ ([comma, args]) => Array.isArray(args) ? [comma, ...args] : [comma, args]
17337
+ )
17338
+ ];
17339
+ });
17340
+ var TypeArgumentList$2 = NestedTypeArgumentList;
17341
+ var TypeArgumentList$3 = (0, import_lib3.$TS)((0, import_lib3.$S)(TypeArgument, (0, import_lib3.$Q)((0, import_lib3.$S)(CommaDelimiter, (0, import_lib3.$E)(_), TypeArgument))), function($skip, $loc, $0, $1, $2) {
17342
+ return [
17343
+ $1,
17344
+ ...$2.flatMap(([comma, ws, arg]) => [comma, prepend(ws, arg)])
17345
+ ];
17346
+ });
17347
+ var TypeArgumentList$$ = [TypeArgumentList$0, TypeArgumentList$1, TypeArgumentList$2, TypeArgumentList$3];
17348
+ function TypeArgumentList(ctx, state2) {
17349
+ return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeArgumentList", TypeArgumentList$$);
17350
+ }
17351
+ var NestedTypeArgumentList$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(PushIndent, (0, import_lib3.$Q)(NestedTypeArgument), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
17352
+ var args = $2;
17353
+ if (!args.length)
17354
+ return $skip;
17355
+ return args.flat();
17356
+ });
17357
+ function NestedTypeArgumentList(ctx, state2) {
17358
+ return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeArgumentList", NestedTypeArgumentList$0);
17359
+ }
17360
+ var NestedTypeArgument$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Nested, SingleLineTypeArgumentList, TypeArgumentDelimiter), function($skip, $loc, $0, $1, $2, $3) {
17361
+ var indent = $1;
17362
+ var args = $2;
17363
+ var comma = $3;
17364
+ let [arg0, ...rest] = args;
17365
+ arg0 = prepend(indent, arg0);
17366
+ return [arg0, ...rest, comma];
17367
+ });
17368
+ function NestedTypeArgument(ctx, state2) {
17369
+ return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeArgument", NestedTypeArgument$0);
17370
+ }
17371
+ var SingleLineTypeArgumentList$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$S)((0, import_lib3.$E)(_), TypeArgument), (0, import_lib3.$Q)((0, import_lib3.$S)((0, import_lib3.$S)((0, import_lib3.$E)(_), Comma), (0, import_lib3.$S)((0, import_lib3.$E)(_), TypeArgument)))), function($skip, $loc, $0, $1, $2) {
17372
+ return [$1, ...$2.flat()];
17373
+ });
17374
+ function SingleLineTypeArgumentList(ctx, state2) {
17375
+ return (0, import_lib3.$EVENT)(ctx, state2, "SingleLineTypeArgumentList", SingleLineTypeArgumentList$0);
17376
+ }
17377
+ var TypeArgumentDelimited$0 = (0, import_lib3.$S)(TypeArgument, TypeArgumentDelimiter);
17378
+ function TypeArgumentDelimited(ctx, state2) {
17379
+ return (0, import_lib3.$EVENT)(ctx, state2, "TypeArgumentDelimited", TypeArgumentDelimited$0);
17380
+ }
17381
+ var TypeArgument$0 = Type;
16863
17382
  function TypeArgument(ctx, state2) {
16864
17383
  return (0, import_lib3.$EVENT)(ctx, state2, "TypeArgument", TypeArgument$0);
16865
17384
  }
@@ -16906,15 +17425,15 @@ var ThisType$0 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$E)(_),
16906
17425
  function ThisType(ctx, state2) {
16907
17426
  return (0, import_lib3.$EVENT)(ctx, state2, "ThisType", ThisType$0);
16908
17427
  }
16909
- var Shebang$0 = (0, import_lib3.$S)((0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($R90, "Shebang /#![^\\r\\n]*/")), EOL);
17428
+ var Shebang$0 = (0, import_lib3.$S)((0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($R92, "Shebang /#![^\\r\\n]*/")), EOL);
16910
17429
  function Shebang(ctx, state2) {
16911
17430
  return (0, import_lib3.$EVENT)(ctx, state2, "Shebang", Shebang$0);
16912
17431
  }
16913
- var CivetPrologue$0 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($R91, "CivetPrologue /[\\t ]*/"), DoubleQuote, CivetPrologueContent, DoubleQuote, SimpleStatementDelimiter, (0, import_lib3.$EXPECT)($R20, "CivetPrologue /[ \\t]*/"), (0, import_lib3.$C)(EOL, (0, import_lib3.$Y)(RestOfLine))), function(value) {
17432
+ var CivetPrologue$0 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($R93, "CivetPrologue /[\\t ]*/"), DoubleQuote, CivetPrologueContent, DoubleQuote, SimpleStatementDelimiter, (0, import_lib3.$EXPECT)($R20, "CivetPrologue /[ \\t]*/"), (0, import_lib3.$C)(EOL, (0, import_lib3.$Y)(RestOfLine))), function(value) {
16914
17433
  var content = value[2];
16915
17434
  return content;
16916
17435
  });
16917
- var CivetPrologue$1 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($R91, "CivetPrologue /[\\t ]*/"), SingleQuote, CivetPrologueContent, SingleQuote, SimpleStatementDelimiter, (0, import_lib3.$EXPECT)($R20, "CivetPrologue /[ \\t]*/"), (0, import_lib3.$C)(EOL, (0, import_lib3.$Y)(RestOfLine))), function(value) {
17436
+ var CivetPrologue$1 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($R93, "CivetPrologue /[\\t ]*/"), SingleQuote, CivetPrologueContent, SingleQuote, SimpleStatementDelimiter, (0, import_lib3.$EXPECT)($R20, "CivetPrologue /[ \\t]*/"), (0, import_lib3.$C)(EOL, (0, import_lib3.$Y)(RestOfLine))), function(value) {
16918
17437
  var content = value[2];
16919
17438
  return content;
16920
17439
  });
@@ -16922,7 +17441,7 @@ var CivetPrologue$$ = [CivetPrologue$0, CivetPrologue$1];
16922
17441
  function CivetPrologue(ctx, state2) {
16923
17442
  return (0, import_lib3.$EVENT_C)(ctx, state2, "CivetPrologue", CivetPrologue$$);
16924
17443
  }
16925
- var CivetPrologueContent$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($L238, 'CivetPrologueContent "civet"'), NonIdContinue, (0, import_lib3.$Q)(CivetOption), (0, import_lib3.$EXPECT)($R92, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3, $4) {
17444
+ var CivetPrologueContent$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($L238, 'CivetPrologueContent "civet"'), NonIdContinue, (0, import_lib3.$Q)(CivetOption), (0, import_lib3.$EXPECT)($R94, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3, $4) {
16926
17445
  var options = $3;
16927
17446
  return {
16928
17447
  type: "CivetPrologue",
@@ -16933,7 +17452,7 @@ var CivetPrologueContent$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import
16933
17452
  function CivetPrologueContent(ctx, state2) {
16934
17453
  return (0, import_lib3.$EVENT)(ctx, state2, "CivetPrologueContent", CivetPrologueContent$0);
16935
17454
  }
16936
- var CivetOption$0 = (0, import_lib3.$TR)((0, import_lib3.$EXPECT)($R93, "CivetOption /\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
17455
+ var CivetOption$0 = (0, import_lib3.$TR)((0, import_lib3.$EXPECT)($R95, "CivetOption /\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
16937
17456
  const optionName = $2.replace(/-+([a-z]?)/g, (_2, l) => {
16938
17457
  if (l)
16939
17458
  return l.toUpperCase();
@@ -16950,11 +17469,11 @@ var CivetOption$0 = (0, import_lib3.$TR)((0, import_lib3.$EXPECT)($R93, "CivetOp
16950
17469
  function CivetOption(ctx, state2) {
16951
17470
  return (0, import_lib3.$EVENT)(ctx, state2, "CivetOption", CivetOption$0);
16952
17471
  }
16953
- var UnknownPrologue$0 = (0, import_lib3.$S)((0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($R91, "UnknownPrologue /[\\t ]*/")), StringLiteral, (0, import_lib3.$TEXT)(SimpleStatementDelimiter), EOS);
17472
+ var UnknownPrologue$0 = (0, import_lib3.$S)((0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($R93, "UnknownPrologue /[\\t ]*/")), StringLiteral, (0, import_lib3.$TEXT)(SimpleStatementDelimiter), EOS);
16954
17473
  function UnknownPrologue(ctx, state2) {
16955
17474
  return (0, import_lib3.$EVENT)(ctx, state2, "UnknownPrologue", UnknownPrologue$0);
16956
17475
  }
16957
- var TripleSlashDirective$0 = (0, import_lib3.$S)((0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($R94, "TripleSlashDirective /\\/\\/\\/[^\\r\\n]*/")), (0, import_lib3.$E)(EOS));
17476
+ var TripleSlashDirective$0 = (0, import_lib3.$S)((0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($R96, "TripleSlashDirective /\\/\\/\\/[^\\r\\n]*/")), (0, import_lib3.$E)(EOS));
16958
17477
  function TripleSlashDirective(ctx, state2) {
16959
17478
  return (0, import_lib3.$EVENT)(ctx, state2, "TripleSlashDirective", TripleSlashDirective$0);
16960
17479
  }
@@ -16970,13 +17489,13 @@ var PrologueString$$ = [PrologueString$0, PrologueString$1];
16970
17489
  function PrologueString(ctx, state2) {
16971
17490
  return (0, import_lib3.$EVENT_C)(ctx, state2, "PrologueString", PrologueString$$);
16972
17491
  }
16973
- var EOS$0 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($R95, "EOS /(?=[ \\t\\r\\n\\/#]|$)/"), (0, import_lib3.$P)(RestOfLine)), function(value) {
17492
+ var EOS$0 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($R97, "EOS /(?=[ \\t\\r\\n\\/#]|$)/"), (0, import_lib3.$P)(RestOfLine)), function(value) {
16974
17493
  return value[1];
16975
17494
  });
16976
17495
  function EOS(ctx, state2) {
16977
17496
  return (0, import_lib3.$EVENT)(ctx, state2, "EOS", EOS$0);
16978
17497
  }
16979
- var EOL$0 = (0, import_lib3.$TR)((0, import_lib3.$EXPECT)($R96, "EOL /\\r\\n|\\n|\\r|$/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
17498
+ var EOL$0 = (0, import_lib3.$TR)((0, import_lib3.$EXPECT)($R98, "EOL /\\r\\n|\\n|\\r|$/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
16980
17499
  return { $loc, token: $0 };
16981
17500
  });
16982
17501
  function EOL(ctx, state2) {
@@ -17042,6 +17561,18 @@ var InsertCloseBracket$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'I
17042
17561
  function InsertCloseBracket(ctx, state2) {
17043
17562
  return (0, import_lib3.$EVENT)(ctx, state2, "InsertCloseBracket", InsertCloseBracket$0);
17044
17563
  }
17564
+ var InsertOpenAngleBracket$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'InsertOpenAngleBracket ""'), function($skip, $loc, $0, $1) {
17565
+ return { $loc, token: "<" };
17566
+ });
17567
+ function InsertOpenAngleBracket(ctx, state2) {
17568
+ return (0, import_lib3.$EVENT)(ctx, state2, "InsertOpenAngleBracket", InsertOpenAngleBracket$0);
17569
+ }
17570
+ var InsertCloseAngleBracket$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'InsertCloseAngleBracket ""'), function($skip, $loc, $0, $1) {
17571
+ return { $loc, token: ">" };
17572
+ });
17573
+ function InsertCloseAngleBracket(ctx, state2) {
17574
+ return (0, import_lib3.$EVENT)(ctx, state2, "InsertCloseAngleBracket", InsertCloseAngleBracket$0);
17575
+ }
17045
17576
  var InsertComma$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'InsertComma ""'), function($skip, $loc, $0, $1) {
17046
17577
  return { $loc, token: ",", implicit: true };
17047
17578
  });
@@ -17374,7 +17905,7 @@ var Prologue$0 = (0, import_lib3.$Q)((0, import_lib3.$C)(TripleSlashDirective, (
17374
17905
  function Prologue(ctx, state2) {
17375
17906
  return (0, import_lib3.$EVENT)(ctx, state2, "Prologue", Prologue$0);
17376
17907
  }
17377
- var ProloguePrefix$0 = (0, import_lib3.$S)(Prologue, (0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($R97, "ProloguePrefix /[^]*/")));
17908
+ var ProloguePrefix$0 = (0, import_lib3.$S)(Prologue, (0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($R99, "ProloguePrefix /[^]*/")));
17378
17909
  function ProloguePrefix(ctx, state2) {
17379
17910
  return (0, import_lib3.$EVENT)(ctx, state2, "ProloguePrefix", ProloguePrefix$0);
17380
17911
  }
@@ -17464,6 +17995,20 @@ var Dedented$0 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$N)(Ind
17464
17995
  function Dedented(ctx, state2) {
17465
17996
  return (0, import_lib3.$EVENT)(ctx, state2, "Dedented", Dedented$0);
17466
17997
  }
17998
+ var PushExtraIndent1$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'PushExtraIndent1 ""'), function($skip, $loc, $0, $1) {
17999
+ const indent = {
18000
+ token: "",
18001
+ $loc,
18002
+ level: state.currentIndent.level + 1
18003
+ };
18004
+ if (config.verbose)
18005
+ console.log("pushing bonus indent", indent);
18006
+ state.indentLevels.push(indent);
18007
+ return indent;
18008
+ });
18009
+ function PushExtraIndent1(ctx, state2) {
18010
+ return (0, import_lib3.$EVENT)(ctx, state2, "PushExtraIndent1", PushExtraIndent1$0);
18011
+ }
17467
18012
  var parser = function() {
17468
18013
  const { fail, validate, reset } = (0, import_lib3.Validator)();
17469
18014
  let ctx = { expectation: "", fail };
@@ -17923,6 +18468,7 @@ var uncacheable = /* @__PURE__ */ new Set([
17923
18468
  "PopIndent",
17924
18469
  "TrackIndented",
17925
18470
  "BulletIndent",
18471
+ "PushExtraIndent1",
17926
18472
  // JSX
17927
18473
  "PushJSXOpeningElement",
17928
18474
  "PushJSXOpeningFragment",