@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.mjs CHANGED
@@ -60,7 +60,7 @@ var require_machine = __commonJS({
60
60
  $N: () => $N2,
61
61
  $P: () => $P2,
62
62
  $Q: () => $Q2,
63
- $R: () => $R98,
63
+ $R: () => $R100,
64
64
  $R$0: () => $R$02,
65
65
  $S: () => $S2,
66
66
  $T: () => $T2,
@@ -97,7 +97,7 @@ var require_machine = __commonJS({
97
97
  return;
98
98
  };
99
99
  }
100
- function $R98(regExp) {
100
+ function $R100(regExp) {
101
101
  return function(_ctx, state2) {
102
102
  const { input, pos } = state2;
103
103
  regExp.lastIndex = state2.pos;
@@ -491,6 +491,7 @@ __export(lib_exports, {
491
491
  addPostfixStatement: () => addPostfixStatement,
492
492
  adjustBindingElements: () => adjustBindingElements,
493
493
  adjustIndexAccess: () => adjustIndexAccess,
494
+ append: () => append,
494
495
  attachPostfixStatementAsExpression: () => attachPostfixStatementAsExpression,
495
496
  blockWithPrefix: () => blockWithPrefix,
496
497
  convertNamedImportsToObject: () => convertNamedImportsToObject,
@@ -657,7 +658,7 @@ var statementTypes = /* @__PURE__ */ new Set([
657
658
  "ForStatement",
658
659
  "IfStatement",
659
660
  "IterationStatement",
660
- "LabeledStatement",
661
+ "LabelledStatement",
661
662
  "ReturnStatement",
662
663
  "SwitchStatement",
663
664
  "ThrowStatement",
@@ -702,13 +703,16 @@ function isExit(node) {
702
703
  return node.expressions.some((s) => isExit(s[1]));
703
704
  }
704
705
  case "IterationStatement": {
705
- return node.condition?.type === "ParenthesizedExpression" && node.condition.expression?.type === "Literal" && node.condition.expression?.raw === "true" && gatherRecursiveWithinFunction(node.block, ($) => $.type === "BreakStatement").length === 0;
706
+ return isLoopStatement(node) && gatherRecursiveWithinFunction(node.block, ($) => $.type === "BreakStatement").length === 0;
706
707
  }
707
708
  default: {
708
709
  return false;
709
710
  }
710
711
  }
711
712
  }
713
+ function isLoopStatement(node) {
714
+ return node.type === "IterationStatement" && node.condition?.type === "ParenthesizedExpression" && node.condition.expression?.type === "Literal" && node.condition.expression?.raw === "true";
715
+ }
712
716
  function isComma(node) {
713
717
  if (node?.token === ",") {
714
718
  return node;
@@ -779,7 +783,7 @@ function getTrimmingSpace(target) {
779
783
  return;
780
784
  }
781
785
  function prepend(prefix, node) {
782
- if (!(prefix && prefix.length)) {
786
+ if (!prefix || Array.isArray(prefix) && len(prefix, 0)) {
783
787
  return node;
784
788
  }
785
789
  if (Array.isArray(node)) {
@@ -793,6 +797,21 @@ function prepend(prefix, node) {
793
797
  return [prefix, node];
794
798
  }
795
799
  }
800
+ function append(node, suffix) {
801
+ if (!suffix || Array.isArray(suffix) && len(suffix, 0)) {
802
+ return node;
803
+ }
804
+ if (Array.isArray(node)) {
805
+ return [...node, suffix];
806
+ } else if (isParent(node)) {
807
+ return {
808
+ ...node,
809
+ children: [...node.children, suffix]
810
+ };
811
+ } else {
812
+ return [node, suffix];
813
+ }
814
+ }
796
815
  function inplacePrepend(prefix, node) {
797
816
  if (!prefix) {
798
817
  return;
@@ -1059,7 +1078,7 @@ function parenthesizeType(type) {
1059
1078
  }
1060
1079
  return ["(", type, ")"];
1061
1080
  }
1062
- function wrapIIFE(expressions, asyncFlag) {
1081
+ function wrapIIFE(expressions, asyncFlag, generator) {
1063
1082
  let prefix;
1064
1083
  const async = [];
1065
1084
  if (asyncFlag) {
@@ -1085,23 +1104,49 @@ function wrapIIFE(expressions, asyncFlag) {
1085
1104
  };
1086
1105
  const signature = {
1087
1106
  modifier: {
1088
- async: !!async.length
1107
+ async: !!async.length,
1108
+ generator: !!generator
1089
1109
  },
1090
1110
  returnType: void 0
1091
1111
  };
1092
- const fn = makeNode({
1093
- type: "ArrowFunction",
1094
- signature,
1095
- parameters,
1096
- returnType: void 0,
1097
- ts: false,
1098
- async,
1099
- block,
1100
- children: [async, parameters, "=>", block]
1101
- });
1112
+ let fn;
1113
+ if (generator) {
1114
+ fn = makeNode({
1115
+ type: "FunctionExpression",
1116
+ signature,
1117
+ parameters,
1118
+ returnType: void 0,
1119
+ ts: false,
1120
+ async,
1121
+ block,
1122
+ generator,
1123
+ children: [async, "function", generator, parameters, block]
1124
+ });
1125
+ } else {
1126
+ fn = makeNode({
1127
+ type: "ArrowFunction",
1128
+ signature,
1129
+ parameters,
1130
+ returnType: void 0,
1131
+ ts: false,
1132
+ async,
1133
+ block,
1134
+ children: [async, parameters, "=>", block]
1135
+ });
1136
+ }
1137
+ const children = [makeLeftHandSideExpression(fn), "()"];
1138
+ if (fn.type === "FunctionExpression") {
1139
+ if (gatherRecursiveWithinFunction(block, (a1) => typeof a1 === "object" && a1 != null && "token" in a1 && a1.token === "this").length) {
1140
+ children.splice(1, 0, ".bind(this)");
1141
+ }
1142
+ if (gatherRecursiveWithinFunction(block, (a2) => typeof a2 === "object" && a2 != null && "token" in a2 && a2.token === "arguments").length) {
1143
+ let ref2;
1144
+ children[children.length - 1] = (ref2 = parameters.children)[ref2.length - 1] = "(arguments)";
1145
+ }
1146
+ }
1102
1147
  const exp = makeNode({
1103
1148
  type: "CallExpression",
1104
- children: [makeLeftHandSideExpression(fn), "()"]
1149
+ children
1105
1150
  });
1106
1151
  if (prefix) {
1107
1152
  return makeLeftHandSideExpression([prefix, exp]);
@@ -1722,7 +1767,7 @@ function assignResults(node, collect) {
1722
1767
  ({ type } = exp);
1723
1768
  }
1724
1769
  let ref4;
1725
- switch (exp.type) {
1770
+ switch (type) {
1726
1771
  case "BreakStatement":
1727
1772
  case "ContinueStatement":
1728
1773
  case "DebuggerStatement":
@@ -1943,6 +1988,58 @@ function insertSwitchReturns(exp) {
1943
1988
  return insertReturn(clause);
1944
1989
  });
1945
1990
  }
1991
+ function processBreakContinueWith(statement) {
1992
+ let changed = false;
1993
+ for (const control of gatherRecursiveWithinFunction(
1994
+ statement.block,
1995
+ ($) => $.type === "BreakStatement" || $.type === "ContinueStatement"
1996
+ )) {
1997
+ let controlName2 = function() {
1998
+ switch (control.type) {
1999
+ case "BreakStatement": {
2000
+ return "break";
2001
+ }
2002
+ case "ContinueStatement": {
2003
+ return "continue";
2004
+ }
2005
+ }
2006
+ };
2007
+ var controlName = controlName2;
2008
+ if (control.with) {
2009
+ if (control.label) {
2010
+ let m1;
2011
+ 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)) {
2012
+ continue;
2013
+ }
2014
+ } else {
2015
+ const { ancestor } = findAncestor(
2016
+ control,
2017
+ (s) => s === statement || s.type === "IterationStatement" || s.type === "ForStatement" || s.type === "SwitchStatement" && control.type === "BreakStatement"
2018
+ );
2019
+ if (!(ancestor === statement)) {
2020
+ continue;
2021
+ }
2022
+ }
2023
+ control.children.unshift(
2024
+ control.type === "BreakStatement" ? (changed = true, [statement.resultsRef, " =", control.with, ";"]) : (
2025
+ // control.type is "ContinueStatement"
2026
+ [statement.resultsRef, ".push(", trimFirstSpace(control.with), ");"]
2027
+ )
2028
+ );
2029
+ updateParentPointers(control.with, control);
2030
+ const i = control.children.findIndex(($1) => $1?.type === "Error");
2031
+ if (i >= 0) {
2032
+ control.children.splice(i, 1);
2033
+ }
2034
+ const block = control.parent;
2035
+ if (!(block?.type === "BlockStatement")) {
2036
+ throw new Error(`Expected parent of ${controlName2()} to be BlockStatement`);
2037
+ }
2038
+ braceBlock(block);
2039
+ }
2040
+ }
2041
+ return changed;
2042
+ }
1946
2043
  function wrapIterationReturningResults(statement, outer, collect) {
1947
2044
  if (statement.type === "DoStatement" || statement.type === "ComptimeStatement") {
1948
2045
  if (collect) {
@@ -1958,14 +2055,37 @@ function wrapIterationReturningResults(statement, outer, collect) {
1958
2055
  "wrapIterationReturningResults should not be called twice on the same statement"
1959
2056
  );
1960
2057
  const resultsRef = statement.resultsRef = makeRef("results");
2058
+ let decl = "const";
2059
+ if (statement.type === "IterationStatement" || statement.type === "ForStatement") {
2060
+ if (processBreakContinueWith(statement)) {
2061
+ decl = "let";
2062
+ }
2063
+ }
2064
+ const breakWithOnly = decl === "let" && isLoopStatement(statement) && gatherRecursive(
2065
+ statement.block,
2066
+ (s) => s.type === "BreakStatement" && !s.with,
2067
+ (s) => isFunction(s) || s.type === "IterationStatement"
2068
+ ).length === 0;
1961
2069
  const declaration = {
1962
2070
  type: "Declaration",
1963
- children: ["const ", resultsRef, "=[]"]
2071
+ children: [decl, " ", resultsRef],
2072
+ decl,
2073
+ names: [],
2074
+ bindings: []
1964
2075
  };
2076
+ if (decl === "const") {
2077
+ declaration.children.push("=[]");
2078
+ } else {
2079
+ if (!breakWithOnly) {
2080
+ declaration.children.push(";", resultsRef, "=[]");
2081
+ }
2082
+ }
1965
2083
  outer.children.unshift(["", declaration, ";"]);
1966
- assignResults(statement.block, (node) => {
1967
- return [resultsRef, ".push(", node, ")"];
1968
- });
2084
+ if (!breakWithOnly) {
2085
+ assignResults(statement.block, (node) => {
2086
+ return [resultsRef, ".push(", node, ")"];
2087
+ });
2088
+ }
1969
2089
  if (collect) {
1970
2090
  statement.children.push(collect(resultsRef));
1971
2091
  } else {
@@ -2031,8 +2151,8 @@ function processSignature(f) {
2031
2151
  }
2032
2152
  if (hasYield(block) && !f.generator?.length) {
2033
2153
  if (f.type === "ArrowFunction") {
2034
- gatherRecursiveWithinFunction(block, ($) => $.type === "YieldExpression").forEach((y) => {
2035
- const i = y.children.findIndex(($1) => $1.type === "Yield");
2154
+ gatherRecursiveWithinFunction(block, ($2) => $2.type === "YieldExpression").forEach((y) => {
2155
+ const i = y.children.findIndex(($3) => $3.type === "Yield");
2036
2156
  return y.children.splice(i + 1, 0, {
2037
2157
  type: "Error",
2038
2158
  message: "Can't use yield inside of => arrow function"
@@ -2060,31 +2180,55 @@ function processFunctions(statements, config2) {
2060
2180
  });
2061
2181
  }
2062
2182
  function expressionizeIteration(exp) {
2063
- const { async, subtype, block, children, statement } = exp;
2183
+ const { async, generator, subtype, block, children, statement } = exp;
2064
2184
  const i = children.indexOf(statement);
2065
2185
  if (i < 0) {
2066
2186
  throw new Error("Could not find iteration statement in iteration expression");
2067
2187
  }
2068
2188
  if (subtype === "DoStatement" || subtype === "ComptimeStatement") {
2069
- children.splice(i, 1, wrapIIFE([["", statement, void 0]], async));
2189
+ children.splice(i, 1, wrapIIFE([["", statement, void 0]], async, generator));
2070
2190
  updateParentPointers(exp);
2071
2191
  return;
2072
2192
  }
2073
- exp.resultsRef ??= makeRef("results");
2074
- const { resultsRef } = exp;
2075
- assignResults(block, (node) => {
2076
- return [resultsRef, ".push(", node, ")"];
2077
- });
2078
- braceBlock(block);
2079
- children.splice(
2080
- i,
2081
- 1,
2082
- wrapIIFE([
2083
- ["", ["const ", resultsRef, "=[]"], ";"],
2084
- ...children.map((c) => ["", c, void 0]),
2085
- ["", wrapWithReturn(resultsRef)]
2086
- ], async)
2087
- );
2193
+ if (generator) {
2194
+ assignResults(block, (node) => {
2195
+ return {
2196
+ type: "YieldExpression",
2197
+ expression: node,
2198
+ children: ["yield ", node]
2199
+ };
2200
+ });
2201
+ braceBlock(block);
2202
+ children.splice(
2203
+ i,
2204
+ 1,
2205
+ wrapIIFE([
2206
+ ["", statement, void 0],
2207
+ // Prevent implicit return in generator, by adding an explicit return
2208
+ ["", {
2209
+ type: "ReturnStatement",
2210
+ expression: void 0,
2211
+ children: [";return"]
2212
+ }, void 0]
2213
+ ], async, generator)
2214
+ );
2215
+ } else {
2216
+ exp.resultsRef ??= makeRef("results");
2217
+ const { resultsRef } = exp;
2218
+ assignResults(block, (node) => {
2219
+ return [resultsRef, ".push(", node, ")"];
2220
+ });
2221
+ braceBlock(block);
2222
+ children.splice(
2223
+ i,
2224
+ 1,
2225
+ wrapIIFE([
2226
+ ["", ["const ", resultsRef, "=[]"], ";"],
2227
+ ["", statement, void 0],
2228
+ ["", wrapWithReturn(resultsRef)]
2229
+ ], async)
2230
+ );
2231
+ }
2088
2232
  updateParentPointers(exp);
2089
2233
  }
2090
2234
  function skipImplicitArguments(args) {
@@ -2098,7 +2242,7 @@ function skipImplicitArguments(args) {
2098
2242
  return false;
2099
2243
  }
2100
2244
  function processCoffeeDo(ws, expression) {
2101
- ws = insertTrimmingSpace(ws, "");
2245
+ ws = trimFirstSpace(ws);
2102
2246
  const args = [];
2103
2247
  if (typeof expression === "object" && expression != null && "type" in expression && expression.type === "ArrowFunction" || typeof expression === "object" && expression != null && "type" in expression && expression.type === "FunctionExpression") {
2104
2248
  const { parameters } = expression;
@@ -2132,7 +2276,7 @@ function processCoffeeDo(ws, expression) {
2132
2276
  expression = {
2133
2277
  ...expression,
2134
2278
  parameters: newParameters,
2135
- children: expression.children.map(($2) => $2 === parameters ? newParameters : $2)
2279
+ children: expression.children.map(($4) => $4 === parameters ? newParameters : $4)
2136
2280
  };
2137
2281
  }
2138
2282
  return {
@@ -2153,7 +2297,7 @@ function makeAmpersandFunction(rhs) {
2153
2297
  ref = makeRef("$");
2154
2298
  inplacePrepend(ref, body);
2155
2299
  }
2156
- if (startsWithPredicate(body, ($3) => $3.type === "ObjectExpression")) {
2300
+ if (startsWithPredicate(body, ($5) => $5.type === "ObjectExpression")) {
2157
2301
  body = makeLeftHandSideExpression(body);
2158
2302
  }
2159
2303
  const parameters = makeNode({
@@ -3257,26 +3401,24 @@ function nonMatcherBindings(pattern) {
3257
3401
  function aggregateDuplicateBindings(bindings) {
3258
3402
  const props = gatherRecursiveAll(bindings, ($10) => $10.type === "BindingProperty");
3259
3403
  const arrayBindings = gatherRecursiveAll(bindings, ($11) => $11.type === "ArrayBindingPattern");
3260
- arrayBindings.forEach((a) => {
3261
- const { elements } = a;
3262
- return elements.forEach((element) => {
3404
+ for (let i5 = 0, len4 = arrayBindings.length; i5 < len4; i5++) {
3405
+ const { elements } = arrayBindings[i5];
3406
+ for (let i6 = 0, len5 = elements.length; i6 < len5; i6++) {
3407
+ const element = elements[i6];
3263
3408
  if (Array.isArray(element)) {
3264
3409
  const [, e] = element;
3265
3410
  if (e.type === "Identifier") {
3266
- return props.push(e);
3411
+ props.push(e);
3267
3412
  } else if (e.type === "BindingRestElement") {
3268
- return props.push(e);
3413
+ props.push(e);
3269
3414
  }
3270
- ;
3271
- return;
3272
3415
  }
3273
- ;
3274
- return;
3275
- });
3276
- });
3416
+ }
3417
+ }
3277
3418
  const declarations = [];
3278
3419
  const propsGroupedByName = /* @__PURE__ */ new Map();
3279
- for (const p of props) {
3420
+ for (let i7 = 0, len6 = props.length; i7 < len6; i7++) {
3421
+ const p = props[i7];
3280
3422
  const { name, value } = p;
3281
3423
  let m1;
3282
3424
  if (m1 = value?.type, m1 === "ArrayBindingPattern" || m1 === "ObjectBindingPattern") {
@@ -3298,9 +3440,10 @@ function aggregateDuplicateBindings(bindings) {
3298
3440
  pos: 0,
3299
3441
  input: key
3300
3442
  })) {
3301
- shared.forEach((p) => {
3302
- return aliasBinding(p, makeRef(`_${key}`, key));
3303
- });
3443
+ for (let i8 = 0, len7 = shared.length; i8 < len7; i8++) {
3444
+ const p = shared[i8];
3445
+ aliasBinding(p, makeRef(`_${key}`, key));
3446
+ }
3304
3447
  return;
3305
3448
  }
3306
3449
  if (shared.length === 1) {
@@ -3415,7 +3558,7 @@ function prependStatementExpressionBlock(initializer, statement) {
3415
3558
  const blockStatement = ["", statementExp];
3416
3559
  let ref;
3417
3560
  if (statementExp.type === "IterationExpression") {
3418
- if (statementExp.async) {
3561
+ if (statementExp.async || statementExp.generator) {
3419
3562
  return;
3420
3563
  }
3421
3564
  const statement2 = statementExp.statement;
@@ -5178,9 +5321,8 @@ function expressionizeIfStatement(statement) {
5178
5321
  children
5179
5322
  });
5180
5323
  }
5181
- function expressionizeTypeIf([ws, ifOp, condition, t, e]) {
5324
+ function expressionizeTypeIf([ifOp, condition, t, e]) {
5182
5325
  const children = [
5183
- ws,
5184
5326
  "(",
5185
5327
  insertTrimmingSpace(condition, ""),
5186
5328
  "?"
@@ -5964,7 +6106,8 @@ function attachPostfixStatementAsExpression(exp, post) {
5964
6106
  type: "IterationExpression",
5965
6107
  children: [statement],
5966
6108
  block: statement.block,
5967
- statement
6109
+ statement,
6110
+ generator: statement.generator
5968
6111
  };
5969
6112
  }
5970
6113
  case "IfStatement": {
@@ -6491,6 +6634,7 @@ var grammar = {
6491
6634
  ReservedBinary,
6492
6635
  ArgumentsWithTrailingMemberExpressions,
6493
6636
  TrailingMemberExpressions,
6637
+ IndentedTrailingMemberExpression,
6494
6638
  AllowedTrailingMemberExpressions,
6495
6639
  TrailingCallExpressions,
6496
6640
  AllowedTrailingCallExpressions,
@@ -6759,6 +6903,7 @@ var grammar = {
6759
6903
  BlockStatement,
6760
6904
  LabelledStatement,
6761
6905
  Label,
6906
+ LabelIdentifier,
6762
6907
  LabelledItem,
6763
6908
  IfStatement,
6764
6909
  ElseClause,
@@ -7137,6 +7282,8 @@ var grammar = {
7137
7282
  TypePredicate,
7138
7283
  Type,
7139
7284
  TypeBinary,
7285
+ NestedTypeBinaryChain,
7286
+ NestedTypeBinary,
7140
7287
  TypeUnary,
7141
7288
  TypeUnarySuffix,
7142
7289
  TypeUnaryOp,
@@ -7145,13 +7292,21 @@ var grammar = {
7145
7292
  TypePrimary,
7146
7293
  ImportType,
7147
7294
  TypeTuple,
7148
- TypeList,
7295
+ TypeTupleContent,
7296
+ TypeElementListWithIndentedApplicationForbidden,
7297
+ TypeElementList,
7149
7298
  TypeElement,
7150
- NestedTypeList,
7151
- NestedType,
7299
+ NestedTypeElementList,
7300
+ NestedTypeElement,
7301
+ NestedTypeBulletedTuple,
7302
+ TypeBulletedTuple,
7303
+ NestedTypeBullet,
7304
+ TypeBullet,
7305
+ TypeWithPostfix,
7152
7306
  TypeConditional,
7153
7307
  TypeCondition,
7154
7308
  TypeIfThenElse,
7309
+ TypeIfClause,
7155
7310
  TypeElse,
7156
7311
  TypeBlock,
7157
7312
  TypeTemplateSubstitution,
@@ -7166,6 +7321,14 @@ var grammar = {
7166
7321
  TypeFunction,
7167
7322
  TypeArrowFunction,
7168
7323
  TypeArguments,
7324
+ ImplicitTypeArguments,
7325
+ TypeApplicationStart,
7326
+ ForbiddenImplicitTypeCalls,
7327
+ TypeArgumentList,
7328
+ NestedTypeArgumentList,
7329
+ NestedTypeArgument,
7330
+ SingleLineTypeArgumentList,
7331
+ TypeArgumentDelimited,
7169
7332
  TypeArgument,
7170
7333
  TypeArgumentDelimiter,
7171
7334
  TypeParameters,
@@ -7194,6 +7357,8 @@ var grammar = {
7194
7357
  InsertCloseBrace,
7195
7358
  InsertOpenBracket,
7196
7359
  InsertCloseBracket,
7360
+ InsertOpenAngleBracket,
7361
+ InsertCloseAngleBracket,
7197
7362
  InsertComma,
7198
7363
  InsertSpaceEquals,
7199
7364
  InsertConst,
@@ -7235,7 +7400,8 @@ var grammar = {
7235
7400
  IndentedFurther,
7236
7401
  IndentedAtLeast,
7237
7402
  NotDedented,
7238
- Dedented
7403
+ Dedented,
7404
+ PushExtraIndent1
7239
7405
  };
7240
7406
  var $L0 = (0, import_lib3.$L)("");
7241
7407
  var $L1 = (0, import_lib3.$L)("{");
@@ -7482,7 +7648,7 @@ var $R2 = (0, import_lib3.$R)(new RegExp("(as|of|satisfies|then|when|implements|
7482
7648
  var $R3 = (0, import_lib3.$R)(new RegExp("[0-9]", "suy"));
7483
7649
  var $R4 = (0, import_lib3.$R)(new RegExp("(?!\\p{ID_Start}|[_$0-9(\\[{])", "suy"));
7484
7650
  var $R5 = (0, import_lib3.$R)(new RegExp("[ \\t]", "suy"));
7485
- var $R6 = (0, import_lib3.$R)(new RegExp("\\p{ID_Continue}|[\\u200C\\u200D$.#{]", "suy"));
7651
+ var $R6 = (0, import_lib3.$R)(new RegExp("\\p{ID_Continue}|[\\u200C\\u200D$.#{=]", "suy"));
7486
7652
  var $R7 = (0, import_lib3.$R)(new RegExp("[&=]", "suy"));
7487
7653
  var $R8 = (0, import_lib3.$R)(new RegExp("(?=['\"`])", "suy"));
7488
7654
  var $R9 = (0, import_lib3.$R)(new RegExp("(?=[\\/?])", "suy"));
@@ -7566,14 +7732,16 @@ var $R86 = (0, import_lib3.$R)(new RegExp("(?:-[^-]|[^-]*)*", "suy"));
7566
7732
  var $R87 = (0, import_lib3.$R)(new RegExp("[^{}<>\\r\\n]+", "suy"));
7567
7733
  var $R88 = (0, import_lib3.$R)(new RegExp("[+-]?", "suy"));
7568
7734
  var $R89 = (0, import_lib3.$R)(new RegExp("(?=if|unless)", "suy"));
7569
- var $R90 = (0, import_lib3.$R)(new RegExp("#![^\\r\\n]*", "suy"));
7570
- var $R91 = (0, import_lib3.$R)(new RegExp("[\\t ]*", "suy"));
7571
- var $R92 = (0, import_lib3.$R)(new RegExp("[\\s]*", "suy"));
7572
- var $R93 = (0, import_lib3.$R)(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?", "suy"));
7573
- var $R94 = (0, import_lib3.$R)(new RegExp("\\/\\/\\/[^\\r\\n]*", "suy"));
7574
- var $R95 = (0, import_lib3.$R)(new RegExp("(?=[ \\t\\r\\n\\/#]|$)", "suy"));
7575
- var $R96 = (0, import_lib3.$R)(new RegExp("\\r\\n|\\n|\\r|$", "suy"));
7576
- var $R97 = (0, import_lib3.$R)(new RegExp("[^]*", "suy"));
7735
+ var $R90 = (0, import_lib3.$R)(new RegExp("[|&<!=\\-\u21D2\u2192]", "suy"));
7736
+ var $R91 = (0, import_lib3.$R)(new RegExp("(extends|not|is)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
7737
+ var $R92 = (0, import_lib3.$R)(new RegExp("#![^\\r\\n]*", "suy"));
7738
+ var $R93 = (0, import_lib3.$R)(new RegExp("[\\t ]*", "suy"));
7739
+ var $R94 = (0, import_lib3.$R)(new RegExp("[\\s]*", "suy"));
7740
+ var $R95 = (0, import_lib3.$R)(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?", "suy"));
7741
+ var $R96 = (0, import_lib3.$R)(new RegExp("\\/\\/\\/[^\\r\\n]*", "suy"));
7742
+ var $R97 = (0, import_lib3.$R)(new RegExp("(?=[ \\t\\r\\n\\/#]|$)", "suy"));
7743
+ var $R98 = (0, import_lib3.$R)(new RegExp("\\r\\n|\\n|\\r|$", "suy"));
7744
+ var $R99 = (0, import_lib3.$R)(new RegExp("[^]*", "suy"));
7577
7745
  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) {
7578
7746
  var reset = $1;
7579
7747
  var init = $2;
@@ -7760,6 +7928,9 @@ var ImplicitArguments$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(ApplicationSt
7760
7928
  var close = $5;
7761
7929
  if (skipImplicitArguments(args))
7762
7930
  return $skip;
7931
+ let last = args[args.length - 1];
7932
+ if (last?.token === "," && last.implicit)
7933
+ args = args.slice(0, -1);
7763
7934
  return {
7764
7935
  type: "Call",
7765
7936
  args,
@@ -7792,7 +7963,7 @@ var ExplicitArguments$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(OpenParen, (0
7792
7963
  function ExplicitArguments(ctx, state2) {
7793
7964
  return (0, import_lib3.$EVENT)(ctx, state2, "ExplicitArguments", ExplicitArguments$0);
7794
7965
  }
7795
- 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))));
7966
+ 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));
7796
7967
  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))));
7797
7968
  var ApplicationStart$$ = [ApplicationStart$0, ApplicationStart$1];
7798
7969
  function ApplicationStart(ctx, state2) {
@@ -7833,20 +8004,20 @@ var ArgumentsWithTrailingMemberExpressions$0 = (0, import_lib3.$TS)((0, import_l
7833
8004
  function ArgumentsWithTrailingMemberExpressions(ctx, state2) {
7834
8005
  return (0, import_lib3.$EVENT)(ctx, state2, "ArgumentsWithTrailingMemberExpressions", ArgumentsWithTrailingMemberExpressions$0);
7835
8006
  }
7836
- 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) {
7837
- return $1.concat($2.map(([ws, , memberExpressionRest]) => {
7838
- if (Array.isArray(memberExpressionRest)) {
7839
- return [ws, ...memberExpressionRest];
7840
- }
7841
- return {
7842
- ...memberExpressionRest,
7843
- children: [ws, ...memberExpressionRest.children]
7844
- };
7845
- }));
8007
+ 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) {
8008
+ return [...$1, ...$2];
7846
8009
  });
7847
8010
  function TrailingMemberExpressions(ctx, state2) {
7848
8011
  return (0, import_lib3.$EVENT)(ctx, state2, "TrailingMemberExpressions", TrailingMemberExpressions$0);
7849
8012
  }
8013
+ 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) {
8014
+ var ws = $1;
8015
+ var rest = $3;
8016
+ return prepend(ws, rest);
8017
+ });
8018
+ function IndentedTrailingMemberExpression(ctx, state2) {
8019
+ return (0, import_lib3.$EVENT)(ctx, state2, "IndentedTrailingMemberExpression", IndentedTrailingMemberExpression$0);
8020
+ }
7850
8021
  var AllowedTrailingMemberExpressions$0 = (0, import_lib3.$T)((0, import_lib3.$S)(TrailingMemberPropertyAllowed, TrailingMemberExpressions), function(value) {
7851
8022
  return value[1];
7852
8023
  });
@@ -8114,7 +8285,7 @@ var NWTypePostfix$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(As, _, Tuple), fu
8114
8285
  children: [{ $loc: $1.$loc, token: "satisfies" }, $2, $3]
8115
8286
  };
8116
8287
  });
8117
- 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) {
8288
+ 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) {
8118
8289
  var as = $1;
8119
8290
  var ex = $2;
8120
8291
  var type = $3;
@@ -8468,7 +8639,7 @@ var ParenthesizedExpression$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(OpenPar
8468
8639
  function ParenthesizedExpression(ctx, state2) {
8469
8640
  return (0, import_lib3.$EVENT)(ctx, state2, "ParenthesizedExpression", ParenthesizedExpression$0);
8470
8641
  }
8471
- 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) {
8642
+ 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) {
8472
8643
  var dot = $1;
8473
8644
  var typeSuffix = $3;
8474
8645
  return {
@@ -9421,18 +9592,18 @@ var NonEmptyParameters$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_l
9421
9592
  var params = $3;
9422
9593
  var close = $4;
9423
9594
  let tt, before = [], rest, after = [], errors = [];
9424
- function append(p) {
9595
+ function append2(p) {
9425
9596
  (rest ? after : before).push(p);
9426
9597
  }
9427
9598
  for (const param of params) {
9428
9599
  switch (param.type) {
9429
9600
  case "ThisType":
9430
9601
  if (tt) {
9431
- append({
9602
+ append2({
9432
9603
  type: "Error",
9433
9604
  message: "Only one typed this parameter is allowed"
9434
9605
  });
9435
- append(param);
9606
+ append2(param);
9436
9607
  } else {
9437
9608
  tt = trimFirstSpace(param);
9438
9609
  if (before.length || rest) {
@@ -9450,17 +9621,17 @@ var NonEmptyParameters$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_l
9450
9621
  break;
9451
9622
  case "FunctionRestParameter":
9452
9623
  if (rest) {
9453
- append({
9624
+ append2({
9454
9625
  type: "Error",
9455
9626
  message: "Only one rest parameter is allowed"
9456
9627
  });
9457
- append(param);
9628
+ append2(param);
9458
9629
  } else {
9459
9630
  rest = param;
9460
9631
  }
9461
9632
  break;
9462
9633
  default:
9463
- append(param);
9634
+ append2(param);
9464
9635
  }
9465
9636
  }
9466
9637
  const names = before.flatMap((p) => p.names);
@@ -10965,15 +11136,10 @@ var NestedElement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Nested, ElementLi
10965
11136
  if (!length)
10966
11137
  return $skip;
10967
11138
  return list.map((e, i) => {
10968
- if (i === 0 && i === length - 1) {
10969
- return { ...e, children: [indent, ...e.children, delimiter] };
10970
- }
10971
- if (i === 0) {
10972
- return { ...e, children: [indent, ...e.children] };
10973
- }
10974
- if (i === length - 1) {
10975
- return { ...e, children: [...e.children, delimiter] };
10976
- }
11139
+ if (i === 0)
11140
+ e = prepend(indent, e);
11141
+ if (i === length - 1)
11142
+ e = append(e, delimiter);
10977
11143
  return e;
10978
11144
  });
10979
11145
  });
@@ -11003,19 +11169,13 @@ var ElementList$0 = (0, import_lib3.$T)((0, import_lib3.$S)(BulletedArray), func
11003
11169
  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) {
11004
11170
  var first = $2;
11005
11171
  var rest = $3;
11006
- if (rest.length) {
11007
- return [{
11008
- ...first,
11009
- children: [...first.children, rest[0][0]]
11010
- }].concat(rest.map(([_2, e], i) => {
11011
- const delim = rest[i + 1]?.[0];
11012
- return {
11013
- ...e,
11014
- children: [...e.children, delim]
11015
- };
11016
- }));
11017
- }
11018
- return [first];
11172
+ if (!rest.length)
11173
+ return [first];
11174
+ return [
11175
+ append(first, rest[0][0])
11176
+ ].concat(
11177
+ rest.map(([_2, e], i) => append(e, rest[i + 1]?.[0]))
11178
+ );
11019
11179
  });
11020
11180
  var ElementList$$ = [ElementList$0, ElementList$1];
11021
11181
  function ElementList(ctx, state2) {
@@ -11076,9 +11236,10 @@ var NestedBulletedArray$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_
11076
11236
  if (!content.length)
11077
11237
  return $skip;
11078
11238
  content = content.flat();
11079
- const { children } = content[content.length - 1];
11080
- if (children.at(-1).implicit)
11081
- children.pop();
11239
+ const last = content[content.length - 1];
11240
+ if (last.children?.at(-1)?.implicit) {
11241
+ last.children = last.children.slice(0, -1);
11242
+ }
11082
11243
  return {
11083
11244
  type: "ArrayExpression",
11084
11245
  children: [...open, ...content, close]
@@ -11098,9 +11259,10 @@ var BulletedArray$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(InsertOpenBracket
11098
11259
  // replace first space with bracket
11099
11260
  ...content[1].flat()
11100
11261
  ];
11101
- const { children } = content[content.length - 1];
11102
- if (children.at(-1).implicit)
11103
- children.pop();
11262
+ const last = content[content.length - 1];
11263
+ if (last.children?.at(-1)?.implicit) {
11264
+ last.children = last.children.slice(0, -1);
11265
+ }
11104
11266
  return {
11105
11267
  type: "ArrayExpression",
11106
11268
  children: [open, ...content, close]
@@ -11112,7 +11274,7 @@ function BulletedArray(ctx, state2) {
11112
11274
  var NestedArrayBullet$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Nested, ArrayBullet), function($skip, $loc, $0, $1, $2) {
11113
11275
  var indent = $1;
11114
11276
  var list = $2;
11115
- return list.map((e, i) => i === 0 ? { ...e, children: [indent, ...e.children] } : e);
11277
+ return list.map((e, i) => i === 0 ? prepend(indent, e) : e);
11116
11278
  });
11117
11279
  function NestedArrayBullet(ctx, state2) {
11118
11280
  return (0, import_lib3.$EVENT)(ctx, state2, "NestedArrayBullet", NestedArrayBullet$0);
@@ -11123,15 +11285,13 @@ var ArrayBullet$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(BulletIndent, (0, i
11123
11285
  if (!content)
11124
11286
  return $skip;
11125
11287
  let [list, delimiter] = content;
11126
- if (list.type === "ArrayExpression")
11127
- list = [list];
11128
11288
  if (!list.length)
11129
11289
  return $skip;
11130
11290
  list = list.slice();
11131
- list[0] = { ...list[0], children: [bullet, ...list[0].children] };
11291
+ list[0] = prepend(bullet, list[0]);
11132
11292
  if (delimiter) {
11133
11293
  const last = list.length - 1;
11134
- list[last] = { ...list[last], children: [...list[last].children, delimiter] };
11294
+ list[last] = append(list[last], delimiter);
11135
11295
  }
11136
11296
  return list;
11137
11297
  });
@@ -12401,8 +12561,10 @@ var Statement$1 = VariableStatement;
12401
12561
  var Statement$2 = (0, import_lib3.$T)((0, import_lib3.$S)(IfStatement, (0, import_lib3.$N)(ShouldExpressionize)), function(value) {
12402
12562
  return value[0];
12403
12563
  });
12404
- var Statement$3 = (0, import_lib3.$T)((0, import_lib3.$S)(IterationStatement, (0, import_lib3.$N)(ShouldExpressionize)), function(value) {
12405
- return value[0];
12564
+ var Statement$3 = (0, import_lib3.$TS)((0, import_lib3.$S)(IterationStatement, (0, import_lib3.$N)(ShouldExpressionize)), function($skip, $loc, $0, $1, $2) {
12565
+ if ($1.generator)
12566
+ return $skip;
12567
+ return $1;
12406
12568
  });
12407
12569
  var Statement$4 = (0, import_lib3.$T)((0, import_lib3.$S)(SwitchStatement, (0, import_lib3.$N)(ShouldExpressionize)), function(value) {
12408
12570
  return value[0];
@@ -12473,11 +12635,22 @@ var Label$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Colon, Identifier, Whites
12473
12635
  var colon = $1;
12474
12636
  var id = $2;
12475
12637
  var w = $3;
12476
- return [id, colon, w];
12638
+ return {
12639
+ type: "Label",
12640
+ name: id.name,
12641
+ children: [id, colon, w]
12642
+ };
12477
12643
  });
12478
12644
  function Label(ctx, state2) {
12479
12645
  return (0, import_lib3.$EVENT)(ctx, state2, "Label", Label$0);
12480
12646
  }
12647
+ var LabelIdentifier$0 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$E)(Colon), Identifier), function(value) {
12648
+ var id = value[1];
12649
+ return id;
12650
+ });
12651
+ function LabelIdentifier(ctx, state2) {
12652
+ return (0, import_lib3.$EVENT)(ctx, state2, "LabelIdentifier", LabelIdentifier$0);
12653
+ }
12481
12654
  var LabelledItem$0 = Statement;
12482
12655
  var LabelledItem$1 = FunctionDeclaration;
12483
12656
  var LabelledItem$$ = [LabelledItem$0, LabelledItem$1];
@@ -12574,7 +12747,8 @@ var IterationExpression$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_
12574
12747
  children: [statement],
12575
12748
  block: statement.block,
12576
12749
  statement,
12577
- async
12750
+ async,
12751
+ generator: statement.generator
12578
12752
  };
12579
12753
  });
12580
12754
  function IterationExpression(ctx, state2) {
@@ -12593,8 +12767,9 @@ var LoopStatement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(LoopClause, Block
12593
12767
  function LoopStatement(ctx, state2) {
12594
12768
  return (0, import_lib3.$EVENT)(ctx, state2, "LoopStatement", LoopStatement$0);
12595
12769
  }
12596
- var LoopClause$0 = (0, import_lib3.$TV)(Loop, function($skip, $loc, $0, $1) {
12597
- var kind = $0;
12770
+ 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) {
12771
+ var kind = $1;
12772
+ var generator = $2;
12598
12773
  const expression = {
12599
12774
  type: "Literal",
12600
12775
  children: ["true"],
@@ -12609,33 +12784,41 @@ var LoopClause$0 = (0, import_lib3.$TV)(Loop, function($skip, $loc, $0, $1) {
12609
12784
  type: "IterationStatement",
12610
12785
  subtype: kind.token,
12611
12786
  children: [kind, condition],
12612
- condition
12787
+ condition,
12788
+ generator
12613
12789
  };
12614
12790
  });
12615
12791
  function LoopClause(ctx, state2) {
12616
12792
  return (0, import_lib3.$EVENT)(ctx, state2, "LoopClause", LoopClause$0);
12617
12793
  }
12618
- var DoWhileStatement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Do, NoPostfixBracedOrEmptyBlock, __, WhileClause), function($skip, $loc, $0, $1, $2, $3, $4) {
12619
- var block = $2;
12620
- var clause = $4;
12794
+ 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) {
12795
+ var d = $1;
12796
+ var generator = $2;
12797
+ var block = $3;
12798
+ var ws = $4;
12799
+ var clause = $5;
12621
12800
  return {
12622
12801
  ...clause,
12623
12802
  type: "IterationStatement",
12624
12803
  subtype: "do-while",
12625
- children: $0,
12626
- block
12804
+ children: [d, block, ws, clause],
12805
+ block,
12806
+ generator
12627
12807
  };
12628
12808
  });
12629
12809
  function DoWhileStatement(ctx, state2) {
12630
12810
  return (0, import_lib3.$EVENT)(ctx, state2, "DoWhileStatement", DoWhileStatement$0);
12631
12811
  }
12632
- var DoStatement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Do, NoPostfixBracedOrEmptyBlock), function($skip, $loc, $0, $1, $2) {
12633
- var block = $2;
12812
+ 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) {
12813
+ var d = $1;
12814
+ var generator = $2;
12815
+ var block = $3;
12634
12816
  block = trimFirstSpace(block);
12635
12817
  return {
12636
12818
  type: "DoStatement",
12637
12819
  children: [block],
12638
- block
12820
+ block,
12821
+ generator
12639
12822
  };
12640
12823
  });
12641
12824
  function DoStatement(ctx, state2) {
@@ -12670,10 +12853,11 @@ var WhileStatement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(WhileClause, Blo
12670
12853
  function WhileStatement(ctx, state2) {
12671
12854
  return (0, import_lib3.$EVENT)(ctx, state2, "WhileStatement", WhileStatement$0);
12672
12855
  }
12673
- 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) {
12856
+ 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) {
12674
12857
  var kind = $1;
12675
- var ws = $2;
12676
- var condition = $3;
12858
+ var generator = $2;
12859
+ var ws = $3;
12860
+ var condition = $4;
12677
12861
  if (kind.negated) {
12678
12862
  kind = { ...kind, token: "while" };
12679
12863
  condition = negateCondition(condition);
@@ -12683,6 +12867,7 @@ var WhileClause$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$C)
12683
12867
  subtype: kind.token,
12684
12868
  children: [kind, ws, condition],
12685
12869
  condition,
12870
+ generator,
12686
12871
  negated: kind.negated
12687
12872
  };
12688
12873
  });
@@ -12702,16 +12887,18 @@ var ForStatement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(ForClause, BlockOr
12702
12887
  function ForStatement(ctx, state2) {
12703
12888
  return (0, import_lib3.$EVENT)(ctx, state2, "ForStatement", ForStatement$0);
12704
12889
  }
12705
- var ForClause$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(For, __, ForStatementControl), function($skip, $loc, $0, $1, $2, $3) {
12706
- var c = $3;
12890
+ 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) {
12891
+ var generator = $2;
12892
+ var c = $4;
12707
12893
  const { children, declaration } = c;
12708
12894
  return {
12709
12895
  type: "ForStatement",
12710
- children: [$1, ...$2, ...children],
12896
+ children: [$1, ...$3, ...children],
12711
12897
  declaration,
12712
12898
  block: null,
12713
12899
  blockPrefix: c.blockPrefix,
12714
- hoistDec: c.hoistDec
12900
+ hoistDec: c.hoistDec,
12901
+ generator
12715
12902
  };
12716
12903
  });
12717
12904
  function ForClause(ctx, state2) {
@@ -13478,11 +13665,21 @@ var ExpressionStatement$$ = [ExpressionStatement$0, ExpressionStatement$1];
13478
13665
  function ExpressionStatement(ctx, state2) {
13479
13666
  return (0, import_lib3.$EVENT_C)(ctx, state2, "ExpressionStatement", ExpressionStatement$$);
13480
13667
  }
13481
- 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) {
13668
+ 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) {
13669
+ const children = [$1];
13670
+ if ($2)
13671
+ children.push($2);
13672
+ if ($3)
13673
+ children.push({
13674
+ type: "Error",
13675
+ subtype: "Warning",
13676
+ message: "'break with' outside of loop that returns a value"
13677
+ });
13482
13678
  return {
13483
13679
  type: "BreakStatement",
13484
- children: $2 ? [$1, $2[0], $2[2]] : [$1]
13485
- // omit colon
13680
+ label: $2?.[1],
13681
+ with: $3?.[2],
13682
+ children
13486
13683
  };
13487
13684
  });
13488
13685
  var KeywordStatement$1 = (0, import_lib3.$TS)((0, import_lib3.$S)(Continue, _, Switch), function($skip, $loc, $0, $1, $2, $3) {
@@ -13492,11 +13689,21 @@ var KeywordStatement$1 = (0, import_lib3.$TS)((0, import_lib3.$S)(Continue, _, S
13492
13689
  children: []
13493
13690
  };
13494
13691
  });
13495
- 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) {
13692
+ 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) {
13693
+ const children = [$1];
13694
+ if ($2)
13695
+ children.push($2);
13696
+ if ($3)
13697
+ children.push({
13698
+ type: "Error",
13699
+ subtype: "Warning",
13700
+ message: "'continue with' outside of loop that returns a value"
13701
+ });
13496
13702
  return {
13497
13703
  type: "ContinueStatement",
13498
- children: $2 ? [$1, $2[0], $2[2]] : [$1]
13499
- // omit colon
13704
+ label: $2?.[1],
13705
+ with: $3?.[2],
13706
+ children
13500
13707
  };
13501
13708
  });
13502
13709
  var KeywordStatement$3 = DebuggerStatement;
@@ -15924,9 +16131,42 @@ var JSXText$0 = (0, import_lib3.$TR)((0, import_lib3.$EXPECT)($R87, "JSXText /[^
15924
16131
  function JSXText(ctx, state2) {
15925
16132
  return (0, import_lib3.$EVENT)(ctx, state2, "JSXText", JSXText$0);
15926
16133
  }
15927
- 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);
16134
+ var JSXChildExpression$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(Whitespace), LexicalDeclaration), function($skip, $loc, $0, $1, $2) {
16135
+ var d = $2;
16136
+ let names = d.names.concat(
16137
+ d.thisAssignments.map((a) => a[1][1])
16138
+ );
16139
+ names.sort();
16140
+ names = names.filter((name, i) => i === 0 || name !== names[i - 1]);
16141
+ d = {
16142
+ ...d,
16143
+ hoistDec: {
16144
+ type: "Declaration",
16145
+ children: [
16146
+ "let ",
16147
+ names.map((n, i) => i === 0 ? [n] : [",", n]).flat()
16148
+ ]
16149
+ },
16150
+ children: d.children.slice(1)
16151
+ // drop LetOrConst
16152
+ };
16153
+ if (d.thisAssignments?.length) {
16154
+ d.children.push(...d.splices, ",", ...d.thisAssignments.map(
16155
+ (a, i) => a[a.length - 1] === ";" ? [
16156
+ ...a.slice(0, -1),
16157
+ i === d.thisAssignments.length - 1 ? "" : ","
16158
+ ] : a
16159
+ ));
16160
+ } else if (d.splices?.length) {
16161
+ d.children.push(...d.splices);
16162
+ }
16163
+ d.children.push(",void 0");
16164
+ return d;
16165
+ });
16166
+ 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);
16167
+ var JSXChildExpression$$ = [JSXChildExpression$0, JSXChildExpression$1];
15928
16168
  function JSXChildExpression(ctx, state2) {
15929
- return (0, import_lib3.$EVENT)(ctx, state2, "JSXChildExpression", JSXChildExpression$0);
16169
+ return (0, import_lib3.$EVENT_C)(ctx, state2, "JSXChildExpression", JSXChildExpression$$);
15930
16170
  }
15931
16171
  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) {
15932
16172
  if (!$2)
@@ -16423,14 +16663,16 @@ var TypeSuffix$$ = [TypeSuffix$0, TypeSuffix$1, TypeSuffix$2];
16423
16663
  function TypeSuffix(ctx, state2) {
16424
16664
  return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeSuffix", TypeSuffix$$);
16425
16665
  }
16426
- var MaybeNestedType$0 = NestedInterfaceBlock;
16427
- 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) {
16666
+ var MaybeNestedType$0 = NestedTypeBulletedTuple;
16667
+ var MaybeNestedType$1 = NestedInterfaceBlock;
16668
+ var MaybeNestedType$2 = NestedTypeBinaryChain;
16669
+ 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) {
16428
16670
  if (!$2)
16429
16671
  return $skip;
16430
16672
  return $2;
16431
16673
  });
16432
- var MaybeNestedType$2 = Type;
16433
- var MaybeNestedType$$ = [MaybeNestedType$0, MaybeNestedType$1, MaybeNestedType$2];
16674
+ var MaybeNestedType$4 = Type;
16675
+ var MaybeNestedType$$ = [MaybeNestedType$0, MaybeNestedType$1, MaybeNestedType$2, MaybeNestedType$3, MaybeNestedType$4];
16434
16676
  function MaybeNestedType(ctx, state2) {
16435
16677
  return (0, import_lib3.$EVENT_C)(ctx, state2, "MaybeNestedType", MaybeNestedType$$);
16436
16678
  }
@@ -16446,9 +16688,11 @@ var ReturnTypeSuffix$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib
16446
16688
  function ReturnTypeSuffix(ctx, state2) {
16447
16689
  return (0, import_lib3.$EVENT)(ctx, state2, "ReturnTypeSuffix", ReturnTypeSuffix$0);
16448
16690
  }
16449
- 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) {
16691
+ 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) {
16450
16692
  var asserts = $1;
16451
- var t = $2;
16693
+ var t = $3;
16694
+ if (!t)
16695
+ return $skip;
16452
16696
  if (asserts) {
16453
16697
  t = {
16454
16698
  type: "AssertsType",
@@ -16467,7 +16711,7 @@ var ReturnType$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(
16467
16711
  function ReturnType(ctx, state2) {
16468
16712
  return (0, import_lib3.$EVENT)(ctx, state2, "ReturnType", ReturnType$0);
16469
16713
  }
16470
- 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) {
16714
+ 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) {
16471
16715
  var lhs = $1;
16472
16716
  var rhs = $2;
16473
16717
  if (!rhs)
@@ -16482,11 +16726,11 @@ var TypePredicate$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(MaybeNestedType,
16482
16726
  function TypePredicate(ctx, state2) {
16483
16727
  return (0, import_lib3.$EVENT)(ctx, state2, "TypePredicate", TypePredicate$0);
16484
16728
  }
16485
- var Type$0 = TypeConditional;
16729
+ var Type$0 = TypeWithPostfix;
16486
16730
  function Type(ctx, state2) {
16487
16731
  return (0, import_lib3.$EVENT)(ctx, state2, "Type", Type$0);
16488
16732
  }
16489
- 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) {
16733
+ 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) {
16490
16734
  var optionalPrefix = $1;
16491
16735
  var t = $2;
16492
16736
  var ops = $3;
@@ -16501,6 +16745,25 @@ var TypeBinary$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(
16501
16745
  function TypeBinary(ctx, state2) {
16502
16746
  return (0, import_lib3.$EVENT)(ctx, state2, "TypeBinary", TypeBinary$0);
16503
16747
  }
16748
+ 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) {
16749
+ if (!$2.length)
16750
+ return $skip;
16751
+ return $2;
16752
+ });
16753
+ function NestedTypeBinaryChain(ctx, state2) {
16754
+ return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeBinaryChain", NestedTypeBinaryChain$0);
16755
+ }
16756
+ 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) {
16757
+ var indent = $1;
16758
+ var op = $2;
16759
+ var t = $4;
16760
+ if (!t)
16761
+ return $skip;
16762
+ return [indent, op, t];
16763
+ });
16764
+ function NestedTypeBinary(ctx, state2) {
16765
+ return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeBinary", NestedTypeBinary$0);
16766
+ }
16504
16767
  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) {
16505
16768
  var prefix = $1;
16506
16769
  var t = $2;
@@ -16570,7 +16833,7 @@ var TypePrimary$1 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)
16570
16833
  };
16571
16834
  });
16572
16835
  var TypePrimary$2 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_), TypeTuple), function($skip, $loc, $0, $1, $2) {
16573
- return { ...$2, children: [$1, ...$2.children] };
16836
+ return prepend($1, $2);
16574
16837
  });
16575
16838
  var TypePrimary$3 = InterfaceBlock;
16576
16839
  var TypePrimary$4 = (0, import_lib3.$S)((0, import_lib3.$E)(_), TypeFunction);
@@ -16599,7 +16862,7 @@ var TypePrimary$8 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)
16599
16862
  args: void 0
16600
16863
  };
16601
16864
  });
16602
- 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) {
16865
+ 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) {
16603
16866
  var args = $4;
16604
16867
  return {
16605
16868
  type: "IdentifierType",
@@ -16608,10 +16871,13 @@ var TypePrimary$9 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)
16608
16871
  args
16609
16872
  };
16610
16873
  });
16611
- 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) {
16874
+ 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) {
16875
+ if (!$4)
16876
+ return $skip;
16612
16877
  return {
16613
16878
  type: "ParenthesizedType",
16614
- children: $0
16879
+ children: [$1, $2, $4, $6, $7]
16880
+ // omit AllowAll/RestoreAll
16615
16881
  };
16616
16882
  });
16617
16883
  var TypePrimary$$ = [TypePrimary$0, TypePrimary$1, TypePrimary$2, TypePrimary$3, TypePrimary$4, TypePrimary$5, TypePrimary$6, TypePrimary$7, TypePrimary$8, TypePrimary$9, TypePrimary$10];
@@ -16624,18 +16890,58 @@ var ImportType$$ = [ImportType$0, ImportType$1];
16624
16890
  function ImportType(ctx, state2) {
16625
16891
  return (0, import_lib3.$EVENT_C)(ctx, state2, "ImportType", ImportType$$);
16626
16892
  }
16627
- 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) {
16893
+ 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) {
16894
+ if (!$3)
16895
+ return $skip;
16628
16896
  return {
16629
16897
  type: "TypeTuple",
16630
- children: $0
16898
+ children: [$1, ...$3]
16631
16899
  };
16632
16900
  });
16633
16901
  function TypeTuple(ctx, state2) {
16634
16902
  return (0, import_lib3.$EVENT)(ctx, state2, "TypeTuple", TypeTuple$0);
16635
16903
  }
16636
- var TypeList$0 = (0, import_lib3.$S)(TypeElement, (0, import_lib3.$Q)((0, import_lib3.$S)(__, Comma, TypeElement)));
16637
- function TypeList(ctx, state2) {
16638
- return (0, import_lib3.$EVENT)(ctx, state2, "TypeList", TypeList$0);
16904
+ var TypeTupleContent$0 = (0, import_lib3.$S)(NestedTypeElementList, (0, import_lib3.$Y)((0, import_lib3.$S)(__, CloseBracket)));
16905
+ 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) {
16906
+ var list = $1;
16907
+ var delimiter = $2;
16908
+ var nested = $3;
16909
+ if (!nested)
16910
+ return list;
16911
+ return [...list, delimiter, ...nested];
16912
+ });
16913
+ var TypeTupleContent$2 = (0, import_lib3.$TV)((0, import_lib3.$Q)((0, import_lib3.$S)(__, TypeElementListWithIndentedApplicationForbidden, ArrayElementDelimiter)), function($skip, $loc, $0, $1) {
16914
+ return $1.flat();
16915
+ });
16916
+ var TypeTupleContent$$ = [TypeTupleContent$0, TypeTupleContent$1, TypeTupleContent$2];
16917
+ function TypeTupleContent(ctx, state2) {
16918
+ return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeTupleContent", TypeTupleContent$$);
16919
+ }
16920
+ 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) {
16921
+ if ($2)
16922
+ return $2;
16923
+ return $skip;
16924
+ });
16925
+ function TypeElementListWithIndentedApplicationForbidden(ctx, state2) {
16926
+ return (0, import_lib3.$EVENT)(ctx, state2, "TypeElementListWithIndentedApplicationForbidden", TypeElementListWithIndentedApplicationForbidden$0);
16927
+ }
16928
+ var TypeElementList$0 = (0, import_lib3.$T)((0, import_lib3.$S)(TypeBulletedTuple), function(value) {
16929
+ return [value[0]];
16930
+ });
16931
+ 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) {
16932
+ var first = $2;
16933
+ var rest = $3;
16934
+ if (!rest.length)
16935
+ return [first];
16936
+ return [
16937
+ append(first, rest[0][0])
16938
+ ].concat(
16939
+ rest.map(([_2, e], i) => append(e, rest[i + 1]?.[0]))
16940
+ );
16941
+ });
16942
+ var TypeElementList$$ = [TypeElementList$0, TypeElementList$1];
16943
+ function TypeElementList(ctx, state2) {
16944
+ return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeElementList", TypeElementList$$);
16639
16945
  }
16640
16946
  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) {
16641
16947
  var ws = $1;
@@ -16669,21 +16975,129 @@ var TypeElement$$ = [TypeElement$0, TypeElement$1, TypeElement$2];
16669
16975
  function TypeElement(ctx, state2) {
16670
16976
  return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeElement", TypeElement$$);
16671
16977
  }
16672
- 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) {
16978
+ 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) {
16673
16979
  var types = $2;
16674
16980
  if (types.length)
16675
16981
  return types;
16676
16982
  return $skip;
16677
16983
  });
16678
- function NestedTypeList(ctx, state2) {
16679
- return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeList", NestedTypeList$0);
16984
+ function NestedTypeElementList(ctx, state2) {
16985
+ return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeElementList", NestedTypeElementList$0);
16680
16986
  }
16681
- var NestedType$0 = (0, import_lib3.$S)(Nested, TypeElement, ArrayElementDelimiter);
16682
- function NestedType(ctx, state2) {
16683
- return (0, import_lib3.$EVENT)(ctx, state2, "NestedType", NestedType$0);
16987
+ var NestedTypeElement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Nested, TypeElementList, ArrayElementDelimiter), function($skip, $loc, $0, $1, $2, $3) {
16988
+ var indent = $1;
16989
+ var list = $2;
16990
+ var delimiter = $3;
16991
+ const { length } = list;
16992
+ if (!length)
16993
+ return $skip;
16994
+ return list.map((e, i) => {
16995
+ if (i === 0)
16996
+ e = prepend(indent, e);
16997
+ if (i === length - 1)
16998
+ e = append(e, delimiter);
16999
+ return e;
17000
+ });
17001
+ });
17002
+ function NestedTypeElement(ctx, state2) {
17003
+ return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeElement", NestedTypeElement$0);
17004
+ }
17005
+ 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) {
17006
+ var open = $1;
17007
+ var content = $3;
17008
+ var close = $4;
17009
+ if (!content.length)
17010
+ return $skip;
17011
+ content = content.flat();
17012
+ const last = content[content.length - 1];
17013
+ let children = Array.isArray(last) ? last : last?.children;
17014
+ if (children?.at(-1).implicit) {
17015
+ children = children.slice(0, -1);
17016
+ if (Array.isArray(last)) {
17017
+ content[content.length - 1] = children;
17018
+ } else {
17019
+ content[content.length - 1] = { ...last, children };
17020
+ }
17021
+ }
17022
+ return {
17023
+ type: "TypeTuple",
17024
+ children: [...open, ...content, close]
17025
+ };
17026
+ });
17027
+ function NestedTypeBulletedTuple(ctx, state2) {
17028
+ return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeBulletedTuple", NestedTypeBulletedTuple$0);
17029
+ }
17030
+ 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) {
17031
+ var open = $1;
17032
+ var content = $2;
17033
+ var close = $3;
17034
+ if (!content)
17035
+ return $skip;
17036
+ content = [
17037
+ ...trimFirstSpace(content[0]),
17038
+ // replace first space with bracket
17039
+ ...content[1].flat()
17040
+ ];
17041
+ const last = content[content.length - 1];
17042
+ let children = Array.isArray(last) ? last : last?.children;
17043
+ if (children?.at(-1).implicit) {
17044
+ children = children.slice(0, -1);
17045
+ if (Array.isArray(last)) {
17046
+ content[content.length - 1] = children;
17047
+ } else {
17048
+ content[content.length - 1] = { ...last, children };
17049
+ }
17050
+ }
17051
+ return {
17052
+ type: "TypeTuple",
17053
+ children: [open, ...content, close]
17054
+ };
17055
+ });
17056
+ function TypeBulletedTuple(ctx, state2) {
17057
+ return (0, import_lib3.$EVENT)(ctx, state2, "TypeBulletedTuple", TypeBulletedTuple$0);
17058
+ }
17059
+ var NestedTypeBullet$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Nested, TypeBullet), function($skip, $loc, $0, $1, $2) {
17060
+ var indent = $1;
17061
+ var list = $2;
17062
+ return list.map((e, i) => i === 0 ? prepend(indent, e) : e);
17063
+ });
17064
+ function NestedTypeBullet(ctx, state2) {
17065
+ return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeBullet", NestedTypeBullet$0);
17066
+ }
17067
+ 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) {
17068
+ var bullet = $1;
17069
+ var content = $2;
17070
+ if (!content)
17071
+ return $skip;
17072
+ let [list, delimiter] = content;
17073
+ if (!list.length)
17074
+ return $skip;
17075
+ list = list.slice();
17076
+ list[0] = prepend(bullet, list[0]);
17077
+ if (delimiter) {
17078
+ const last = list.length - 1;
17079
+ list[last] = append(list[last], delimiter);
17080
+ }
17081
+ return list;
17082
+ });
17083
+ function TypeBullet(ctx, state2) {
17084
+ return (0, import_lib3.$EVENT)(ctx, state2, "TypeBullet", TypeBullet$0);
17085
+ }
17086
+ 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) {
17087
+ var t = $1;
17088
+ var postfix = $2;
17089
+ if (!postfix)
17090
+ return t;
17091
+ return prepend(
17092
+ postfix[0],
17093
+ expressionizeTypeIf([...postfix[1], $1, void 0])
17094
+ );
17095
+ });
17096
+ function TypeWithPostfix(ctx, state2) {
17097
+ return (0, import_lib3.$EVENT)(ctx, state2, "TypeWithPostfix", TypeWithPostfix$0);
16684
17098
  }
16685
17099
  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) {
16686
- return [$1, expressionizeTypeIf($3)];
17100
+ return prepend($1, expressionizeTypeIf($3));
16687
17101
  });
16688
17102
  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) {
16689
17103
  if ($1.negated)
@@ -16695,7 +17109,7 @@ var TypeConditional$$ = [TypeConditional$0, TypeConditional$1, TypeConditional$2
16695
17109
  function TypeConditional(ctx, state2) {
16696
17110
  return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeConditional", TypeConditional$$);
16697
17111
  }
16698
- 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) {
17112
+ 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) {
16699
17113
  return {
16700
17114
  type: "TypeCondition",
16701
17115
  negated: $3.negated,
@@ -16705,13 +17119,27 @@ var TypeCondition$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(TypeBinary, (0, i
16705
17119
  function TypeCondition(ctx, state2) {
16706
17120
  return (0, import_lib3.$EVENT)(ctx, state2, "TypeCondition", TypeCondition$0);
16707
17121
  }
16708
- 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) {
16709
- return [$1, $2, $3[1], $4, $5];
17122
+ 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) {
17123
+ return [...$1, $2, $3];
16710
17124
  });
16711
- var TypeIfThenElse$1 = (0, import_lib3.$S)((0, import_lib3.$E)(_), (0, import_lib3.$C)(If, Unless), TypeCondition, TypeBlock, (0, import_lib3.$E)(TypeElse));
16712
- var TypeIfThenElse$$ = [TypeIfThenElse$0, TypeIfThenElse$1];
16713
17125
  function TypeIfThenElse(ctx, state2) {
16714
- return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeIfThenElse", TypeIfThenElse$$);
17126
+ return (0, import_lib3.$EVENT)(ctx, state2, "TypeIfThenElse", TypeIfThenElse$0);
17127
+ }
17128
+ 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) {
17129
+ var condition = $4;
17130
+ if (!condition)
17131
+ return $skip;
17132
+ return [$1, condition];
17133
+ });
17134
+ 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) {
17135
+ var condition = $3;
17136
+ if (!condition)
17137
+ return $skip;
17138
+ return [$1, condition];
17139
+ });
17140
+ var TypeIfClause$$ = [TypeIfClause$0, TypeIfClause$1];
17141
+ function TypeIfClause(ctx, state2) {
17142
+ return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeIfClause", TypeIfClause$$);
16715
17143
  }
16716
17144
  var TypeElse$0 = (0, import_lib3.$S)(NotDedented, Else, TypeBlock);
16717
17145
  function TypeElse(ctx, state2) {
@@ -16811,12 +17239,18 @@ var TypeBinaryOp$$ = [TypeBinaryOp$0, TypeBinaryOp$1];
16811
17239
  function TypeBinaryOp(ctx, state2) {
16812
17240
  return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeBinaryOp", TypeBinaryOp$$);
16813
17241
  }
16814
- 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) {
16815
- var type = $5;
16816
- if (type) {
16817
- return $0;
17242
+ 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) {
17243
+ var type = $6;
17244
+ const ret = [...$0];
17245
+ if ($1 && !$2) {
17246
+ ret[1] = {
17247
+ type: "Error",
17248
+ message: "abstract function types must be constructors (abstract new)"
17249
+ };
16818
17250
  }
16819
- return [...$0, "void"];
17251
+ if (!type)
17252
+ ret.push("void");
17253
+ return ret;
16820
17254
  });
16821
17255
  function TypeFunction(ctx, state2) {
16822
17256
  return (0, import_lib3.$EVENT)(ctx, state2, "TypeFunction", TypeFunction$0);
@@ -16827,8 +17261,9 @@ var TypeArrowFunction$0 = (0, import_lib3.$TV)((0, import_lib3.$C)((0, import_li
16827
17261
  function TypeArrowFunction(ctx, state2) {
16828
17262
  return (0, import_lib3.$EVENT)(ctx, state2, "TypeArrowFunction", TypeArrowFunction$0);
16829
17263
  }
16830
- 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) {
17264
+ 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) {
16831
17265
  var args = $2;
17266
+ args = args.map(([ws, arg]) => [ws, ...arg]);
16832
17267
  return {
16833
17268
  type: "TypeArguments",
16834
17269
  ts: true,
@@ -16839,7 +17274,91 @@ var TypeArguments$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(OpenAngleBracket,
16839
17274
  function TypeArguments(ctx, state2) {
16840
17275
  return (0, import_lib3.$EVENT)(ctx, state2, "TypeArguments", TypeArguments$0);
16841
17276
  }
16842
- var TypeArgument$0 = (0, import_lib3.$S)(__, Type, TypeArgumentDelimiter);
17277
+ 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) {
17278
+ var open = $2;
17279
+ var ws = $3;
17280
+ var args = $4;
17281
+ var close = $5;
17282
+ let last = args[args.length - 1];
17283
+ if (last?.token === ",")
17284
+ args = args.slice(0, -1);
17285
+ return [open, ws, args, close];
17286
+ });
17287
+ function ImplicitTypeArguments(ctx, state2) {
17288
+ return (0, import_lib3.$EVENT)(ctx, state2, "ImplicitTypeArguments", ImplicitTypeArguments$0);
17289
+ }
17290
+ var TypeApplicationStart$0 = (0, import_lib3.$S)(IndentedApplicationAllowed, (0, import_lib3.$Y)((0, import_lib3.$S)(IndentedFurther, (0, import_lib3.$N)(ForbiddenImplicitTypeCalls))));
17291
+ 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))));
17292
+ var TypeApplicationStart$$ = [TypeApplicationStart$0, TypeApplicationStart$1];
17293
+ function TypeApplicationStart(ctx, state2) {
17294
+ return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeApplicationStart", TypeApplicationStart$$);
17295
+ }
17296
+ var ForbiddenImplicitTypeCalls$0 = ReservedBinary;
17297
+ var ForbiddenImplicitTypeCalls$1 = (0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($R90, "ForbiddenImplicitTypeCalls /[|&<!=\\-\u21D2\u2192]/"));
17298
+ var ForbiddenImplicitTypeCalls$2 = (0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($R91, "ForbiddenImplicitTypeCalls /(extends|not|is)(?!\\p{ID_Continue}|[\\u200C\\u200D$])/"));
17299
+ var ForbiddenImplicitTypeCalls$$ = [ForbiddenImplicitTypeCalls$0, ForbiddenImplicitTypeCalls$1, ForbiddenImplicitTypeCalls$2];
17300
+ function ForbiddenImplicitTypeCalls(ctx, state2) {
17301
+ return (0, import_lib3.$EVENT_C)(ctx, state2, "ForbiddenImplicitTypeCalls", ForbiddenImplicitTypeCalls$$);
17302
+ }
17303
+ 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) {
17304
+ return [
17305
+ $2,
17306
+ ...$3.flatMap(([comma, eos, ws, arg]) => [comma, prepend(ws, arg)]),
17307
+ ...$4.flatMap(
17308
+ ([comma, args]) => Array.isArray(args) ? [comma, ...args] : [comma, args]
17309
+ )
17310
+ ];
17311
+ });
17312
+ 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) {
17313
+ return [
17314
+ trimFirstSpace($1),
17315
+ ...$2.flatMap(
17316
+ ([comma, args]) => Array.isArray(args) ? [comma, ...args] : [comma, args]
17317
+ )
17318
+ ];
17319
+ });
17320
+ var TypeArgumentList$2 = NestedTypeArgumentList;
17321
+ 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) {
17322
+ return [
17323
+ $1,
17324
+ ...$2.flatMap(([comma, ws, arg]) => [comma, prepend(ws, arg)])
17325
+ ];
17326
+ });
17327
+ var TypeArgumentList$$ = [TypeArgumentList$0, TypeArgumentList$1, TypeArgumentList$2, TypeArgumentList$3];
17328
+ function TypeArgumentList(ctx, state2) {
17329
+ return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeArgumentList", TypeArgumentList$$);
17330
+ }
17331
+ 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) {
17332
+ var args = $2;
17333
+ if (!args.length)
17334
+ return $skip;
17335
+ return args.flat();
17336
+ });
17337
+ function NestedTypeArgumentList(ctx, state2) {
17338
+ return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeArgumentList", NestedTypeArgumentList$0);
17339
+ }
17340
+ var NestedTypeArgument$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Nested, SingleLineTypeArgumentList, TypeArgumentDelimiter), function($skip, $loc, $0, $1, $2, $3) {
17341
+ var indent = $1;
17342
+ var args = $2;
17343
+ var comma = $3;
17344
+ let [arg0, ...rest] = args;
17345
+ arg0 = prepend(indent, arg0);
17346
+ return [arg0, ...rest, comma];
17347
+ });
17348
+ function NestedTypeArgument(ctx, state2) {
17349
+ return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeArgument", NestedTypeArgument$0);
17350
+ }
17351
+ 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) {
17352
+ return [$1, ...$2.flat()];
17353
+ });
17354
+ function SingleLineTypeArgumentList(ctx, state2) {
17355
+ return (0, import_lib3.$EVENT)(ctx, state2, "SingleLineTypeArgumentList", SingleLineTypeArgumentList$0);
17356
+ }
17357
+ var TypeArgumentDelimited$0 = (0, import_lib3.$S)(TypeArgument, TypeArgumentDelimiter);
17358
+ function TypeArgumentDelimited(ctx, state2) {
17359
+ return (0, import_lib3.$EVENT)(ctx, state2, "TypeArgumentDelimited", TypeArgumentDelimited$0);
17360
+ }
17361
+ var TypeArgument$0 = Type;
16843
17362
  function TypeArgument(ctx, state2) {
16844
17363
  return (0, import_lib3.$EVENT)(ctx, state2, "TypeArgument", TypeArgument$0);
16845
17364
  }
@@ -16886,15 +17405,15 @@ var ThisType$0 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$E)(_),
16886
17405
  function ThisType(ctx, state2) {
16887
17406
  return (0, import_lib3.$EVENT)(ctx, state2, "ThisType", ThisType$0);
16888
17407
  }
16889
- var Shebang$0 = (0, import_lib3.$S)((0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($R90, "Shebang /#![^\\r\\n]*/")), EOL);
17408
+ var Shebang$0 = (0, import_lib3.$S)((0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($R92, "Shebang /#![^\\r\\n]*/")), EOL);
16890
17409
  function Shebang(ctx, state2) {
16891
17410
  return (0, import_lib3.$EVENT)(ctx, state2, "Shebang", Shebang$0);
16892
17411
  }
16893
- 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) {
17412
+ 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) {
16894
17413
  var content = value[2];
16895
17414
  return content;
16896
17415
  });
16897
- 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) {
17416
+ 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) {
16898
17417
  var content = value[2];
16899
17418
  return content;
16900
17419
  });
@@ -16902,7 +17421,7 @@ var CivetPrologue$$ = [CivetPrologue$0, CivetPrologue$1];
16902
17421
  function CivetPrologue(ctx, state2) {
16903
17422
  return (0, import_lib3.$EVENT_C)(ctx, state2, "CivetPrologue", CivetPrologue$$);
16904
17423
  }
16905
- 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) {
17424
+ 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) {
16906
17425
  var options = $3;
16907
17426
  return {
16908
17427
  type: "CivetPrologue",
@@ -16913,7 +17432,7 @@ var CivetPrologueContent$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import
16913
17432
  function CivetPrologueContent(ctx, state2) {
16914
17433
  return (0, import_lib3.$EVENT)(ctx, state2, "CivetPrologueContent", CivetPrologueContent$0);
16915
17434
  }
16916
- 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) {
17435
+ 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) {
16917
17436
  const optionName = $2.replace(/-+([a-z]?)/g, (_2, l) => {
16918
17437
  if (l)
16919
17438
  return l.toUpperCase();
@@ -16930,11 +17449,11 @@ var CivetOption$0 = (0, import_lib3.$TR)((0, import_lib3.$EXPECT)($R93, "CivetOp
16930
17449
  function CivetOption(ctx, state2) {
16931
17450
  return (0, import_lib3.$EVENT)(ctx, state2, "CivetOption", CivetOption$0);
16932
17451
  }
16933
- 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);
17452
+ 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);
16934
17453
  function UnknownPrologue(ctx, state2) {
16935
17454
  return (0, import_lib3.$EVENT)(ctx, state2, "UnknownPrologue", UnknownPrologue$0);
16936
17455
  }
16937
- 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));
17456
+ 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));
16938
17457
  function TripleSlashDirective(ctx, state2) {
16939
17458
  return (0, import_lib3.$EVENT)(ctx, state2, "TripleSlashDirective", TripleSlashDirective$0);
16940
17459
  }
@@ -16950,13 +17469,13 @@ var PrologueString$$ = [PrologueString$0, PrologueString$1];
16950
17469
  function PrologueString(ctx, state2) {
16951
17470
  return (0, import_lib3.$EVENT_C)(ctx, state2, "PrologueString", PrologueString$$);
16952
17471
  }
16953
- 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) {
17472
+ 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) {
16954
17473
  return value[1];
16955
17474
  });
16956
17475
  function EOS(ctx, state2) {
16957
17476
  return (0, import_lib3.$EVENT)(ctx, state2, "EOS", EOS$0);
16958
17477
  }
16959
- 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) {
17478
+ 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) {
16960
17479
  return { $loc, token: $0 };
16961
17480
  });
16962
17481
  function EOL(ctx, state2) {
@@ -17022,6 +17541,18 @@ var InsertCloseBracket$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'I
17022
17541
  function InsertCloseBracket(ctx, state2) {
17023
17542
  return (0, import_lib3.$EVENT)(ctx, state2, "InsertCloseBracket", InsertCloseBracket$0);
17024
17543
  }
17544
+ var InsertOpenAngleBracket$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'InsertOpenAngleBracket ""'), function($skip, $loc, $0, $1) {
17545
+ return { $loc, token: "<" };
17546
+ });
17547
+ function InsertOpenAngleBracket(ctx, state2) {
17548
+ return (0, import_lib3.$EVENT)(ctx, state2, "InsertOpenAngleBracket", InsertOpenAngleBracket$0);
17549
+ }
17550
+ var InsertCloseAngleBracket$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'InsertCloseAngleBracket ""'), function($skip, $loc, $0, $1) {
17551
+ return { $loc, token: ">" };
17552
+ });
17553
+ function InsertCloseAngleBracket(ctx, state2) {
17554
+ return (0, import_lib3.$EVENT)(ctx, state2, "InsertCloseAngleBracket", InsertCloseAngleBracket$0);
17555
+ }
17025
17556
  var InsertComma$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'InsertComma ""'), function($skip, $loc, $0, $1) {
17026
17557
  return { $loc, token: ",", implicit: true };
17027
17558
  });
@@ -17354,7 +17885,7 @@ var Prologue$0 = (0, import_lib3.$Q)((0, import_lib3.$C)(TripleSlashDirective, (
17354
17885
  function Prologue(ctx, state2) {
17355
17886
  return (0, import_lib3.$EVENT)(ctx, state2, "Prologue", Prologue$0);
17356
17887
  }
17357
- var ProloguePrefix$0 = (0, import_lib3.$S)(Prologue, (0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($R97, "ProloguePrefix /[^]*/")));
17888
+ var ProloguePrefix$0 = (0, import_lib3.$S)(Prologue, (0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($R99, "ProloguePrefix /[^]*/")));
17358
17889
  function ProloguePrefix(ctx, state2) {
17359
17890
  return (0, import_lib3.$EVENT)(ctx, state2, "ProloguePrefix", ProloguePrefix$0);
17360
17891
  }
@@ -17444,6 +17975,20 @@ var Dedented$0 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$N)(Ind
17444
17975
  function Dedented(ctx, state2) {
17445
17976
  return (0, import_lib3.$EVENT)(ctx, state2, "Dedented", Dedented$0);
17446
17977
  }
17978
+ var PushExtraIndent1$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'PushExtraIndent1 ""'), function($skip, $loc, $0, $1) {
17979
+ const indent = {
17980
+ token: "",
17981
+ $loc,
17982
+ level: state.currentIndent.level + 1
17983
+ };
17984
+ if (config.verbose)
17985
+ console.log("pushing bonus indent", indent);
17986
+ state.indentLevels.push(indent);
17987
+ return indent;
17988
+ });
17989
+ function PushExtraIndent1(ctx, state2) {
17990
+ return (0, import_lib3.$EVENT)(ctx, state2, "PushExtraIndent1", PushExtraIndent1$0);
17991
+ }
17447
17992
  var parser = function() {
17448
17993
  const { fail, validate, reset } = (0, import_lib3.Validator)();
17449
17994
  let ctx = { expectation: "", fail };
@@ -17903,6 +18448,7 @@ var uncacheable = /* @__PURE__ */ new Set([
17903
18448
  "PopIndent",
17904
18449
  "TrackIndented",
17905
18450
  "BulletIndent",
18451
+ "PushExtraIndent1",
17906
18452
  // JSX
17907
18453
  "PushJSXOpeningElement",
17908
18454
  "PushJSXOpeningFragment",