@danielx/civet 0.6.88 → 0.6.90

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
@@ -227,6 +227,9 @@ function hasAwait(exp) {
227
227
  function hasYield(exp) {
228
228
  return gatherRecursiveWithinFunction(exp, ({ type }) => type === "Yield").length > 0;
229
229
  }
230
+ function hasImportDeclaration(exp) {
231
+ return gatherRecursiveWithinFunction(exp, ({ type }) => type === "ImportDeclaration").length > 0;
232
+ }
230
233
  function deepCopy(node) {
231
234
  if (node == null)
232
235
  return node;
@@ -388,9 +391,10 @@ function parenthesizeType(type) {
388
391
  }
389
392
  return ["(", type, ")"];
390
393
  }
391
- function wrapIIFE(expressions, async) {
394
+ function wrapIIFE(expressions, asyncFlag) {
392
395
  let prefix;
393
- if (async) {
396
+ let async;
397
+ if (asyncFlag) {
394
398
  async = "async ";
395
399
  } else if (hasAwait(expressions)) {
396
400
  async = "async ";
@@ -578,16 +582,16 @@ function blockWithPrefix(prefixStatements, block) {
578
582
  expressions,
579
583
  children: block.children === block.expressions ? expressions : block.children.map((c) => c === block.expressions ? expressions : c)
580
584
  };
581
- if (block.bare) {
582
- block.children = [[" {"], ...block.children, "}"];
583
- block.bare = false;
584
- }
585
+ braceBlock(block);
585
586
  updateParentPointers(block);
586
587
  }
587
588
  return block;
588
589
  }
589
590
  function braceBlock(block) {
590
591
  if (block.bare) {
592
+ if (block.children === block.expressions) {
593
+ block.children = [block.expressions];
594
+ }
591
595
  block.children.unshift(" {");
592
596
  block.children.push("}");
593
597
  return block.bare = false;
@@ -597,8 +601,13 @@ function braceBlock(block) {
597
601
  }
598
602
  function duplicateBlock(block) {
599
603
  const expressions = [...block.expressions];
600
- const children = [...block.children];
601
- children.splice(children.indexOf(block.expressions), 1, expressions);
604
+ let children;
605
+ if (block.children === block.expressions) {
606
+ children = expressions;
607
+ } else {
608
+ children = [...block.children];
609
+ children.splice(children.indexOf(block.expressions), 1, expressions);
610
+ }
602
611
  return {
603
612
  ...block,
604
613
  expressions,
@@ -1883,7 +1892,7 @@ function insertReturn(node, outerNode = node) {
1883
1892
  return;
1884
1893
  case "IfStatement":
1885
1894
  insertReturn(exp.then);
1886
- if (exp.else)
1895
+ if (exp.else && exp.else.length !== 0)
1887
1896
  insertReturn(exp.else[2]);
1888
1897
  else
1889
1898
  exp.children.push(["", {
@@ -2015,8 +2024,7 @@ function expressionizeIteration(exp) {
2015
2024
  throw new Error("Could not find iteration statement in iteration expression");
2016
2025
  }
2017
2026
  if (subtype === "DoStatement") {
2018
- insertReturn(block);
2019
- children.splice(i, 1, ...wrapIIFE(["", statement, void 0], async));
2027
+ children.splice(i, 1, ...wrapIIFE([["", statement, void 0]], async));
2020
2028
  updateParentPointers(exp);
2021
2029
  return;
2022
2030
  }
@@ -2177,7 +2185,8 @@ function processDeclarationCondition(condition, rootCondition, parent) {
2177
2185
  }
2178
2186
  const { decl, bindings } = condition.declaration;
2179
2187
  const binding = bindings[0];
2180
- const { pattern, suffix, initializer, splices, thisAssignments } = binding;
2188
+ let { pattern, suffix, initializer, splices, thisAssignments } = binding;
2189
+ const nullCheck = suffix?.optional && !suffix.t && !suffix.nonnull;
2181
2190
  let ref = prependStatementExpressionBlock(initializer, parent);
2182
2191
  if (ref) {
2183
2192
  Object.assign(condition, {
@@ -2191,11 +2200,16 @@ function processDeclarationCondition(condition, rootCondition, parent) {
2191
2200
  ref = makeRef();
2192
2201
  const grandparent = condition.parent?.parent;
2193
2202
  const children = (
2194
- // Check that the declaration is a plain assignment (no pattern-matching) and the immediate grandchild of an `if` or `while`
2203
+ // Wrap declaration that is a plain assignment (no pattern-matching) and the immediate grandchild of an `if` or `while`
2204
+ // to satisfy eslint's no-cond-assign rule
2195
2205
  // More complex conditions (triggered by pattern matching or `until`/`unless`) don't need double parens
2196
- // @ts-ignore Just because pattern might not have a type at runtime doesn't mean it's unsafe
2197
- pattern.type === "Identifier" && (grandparent?.type === "IfStatement" || grandparent?.type === "WhileStatement") ? ["(", ref, initializer, ")"] : [ref, initializer]
2206
+ pattern.type === "Identifier" && (grandparent?.type === "IfStatement" || grandparent?.type === "IterationStatement") && !nullCheck ? ["(", ref, initializer, ")"] : [ref, initializer]
2198
2207
  );
2208
+ if (nullCheck) {
2209
+ children.unshift("(");
2210
+ children.push(") != null");
2211
+ suffix = void 0;
2212
+ }
2199
2213
  Object.assign(condition, {
2200
2214
  type: "AssignmentExpression",
2201
2215
  children,
@@ -3258,13 +3272,17 @@ __export(lib_exports, {
3258
3272
  forRange: () => forRange,
3259
3273
  gatherBindingCode: () => gatherBindingCode,
3260
3274
  gatherRecursive: () => gatherRecursive,
3275
+ gatherRecursiveAll: () => gatherRecursiveAll,
3276
+ gatherRecursiveWithinFunction: () => gatherRecursiveWithinFunction,
3261
3277
  getIndentLevel: () => getIndentLevel,
3262
3278
  getPrecedence: () => getPrecedence,
3263
3279
  getTrimmingSpace: () => getTrimmingSpace,
3264
3280
  hasAwait: () => hasAwait,
3281
+ hasImportDeclaration: () => hasImportDeclaration,
3265
3282
  hasYield: () => hasYield,
3266
3283
  insertTrimmingSpace: () => insertTrimmingSpace,
3267
3284
  isEmptyBareBlock: () => isEmptyBareBlock,
3285
+ isFunction: () => isFunction,
3268
3286
  isWhitespaceOrEmpty: () => isWhitespaceOrEmpty,
3269
3287
  lastAccessInCallExpression: () => lastAccessInCallExpression,
3270
3288
  literalValue: () => literalValue,
@@ -5061,6 +5079,7 @@ var require_parser = __commonJS({
5061
5079
  MemberBracketContent,
5062
5080
  SliceParameters,
5063
5081
  AccessStart,
5082
+ ImplicitAccessStart,
5064
5083
  PropertyAccessModifier,
5065
5084
  PropertyAccess,
5066
5085
  PropertyGlob,
@@ -5195,6 +5214,7 @@ var require_parser = __commonJS({
5195
5214
  BinaryOp,
5196
5215
  _BinaryOp,
5197
5216
  BinaryOpSymbol,
5217
+ ActualIn,
5198
5218
  CoffeeOfOp,
5199
5219
  NotOp,
5200
5220
  Xor,
@@ -5907,7 +5927,7 @@ var require_parser = __commonJS({
5907
5927
  var $R4 = $R(new RegExp("[ \\t]", "suy"));
5908
5928
  var $R5 = $R(new RegExp("(?=['\"`])", "suy"));
5909
5929
  var $R6 = $R(new RegExp("(?=[\\/?])", "suy"));
5910
- var $R7 = $R(new RegExp("(?=[\\/\\[{?.!@'\u2019:])", "suy"));
5930
+ var $R7 = $R(new RegExp("(?=[\\/\\[{?.!@#'\u2019:])", "suy"));
5911
5931
  var $R8 = $R(new RegExp("[)}]", "suy"));
5912
5932
  var $R9 = $R(new RegExp("\\+\\+|--|[\\+-]\\S", "suy"));
5913
5933
  var $R10 = $R(new RegExp("[&]", "suy"));
@@ -5969,29 +5989,30 @@ var require_parser = __commonJS({
5969
5989
  var $R66 = $R(new RegExp("[ \\t]+", "suy"));
5970
5990
  var $R67 = $R(new RegExp("(?=\\s|\\/|#)", "suy"));
5971
5991
  var $R68 = $R(new RegExp("(?!\\p{ID_Continue})", "suy"));
5972
- var $R69 = $R(new RegExp("['\u2019]s", "suy"));
5973
- var $R70 = $R(new RegExp("\\s", "suy"));
5974
- var $R71 = $R(new RegExp("(?=[<])", "suy"));
5975
- var $R72 = $R(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*", "suy"));
5976
- var $R73 = $R(new RegExp("[!+-]", "suy"));
5977
- var $R74 = $R(new RegExp("[\\s>]|\\/>", "suy"));
5978
- var $R75 = $R(new RegExp("(?:[\\w\\-:]+|\\([^()]*\\)|\\[[^\\[\\]]*\\])+", "suy"));
5979
- var $R76 = $R(new RegExp(`"[^"]*"|'[^']*'`, "suy"));
5980
- var $R77 = $R(new RegExp("[<>]", "suy"));
5981
- var $R78 = $R(new RegExp("[!~+-](?!\\s|[!~+-]*&)", "suy"));
5982
- var $R79 = $R(new RegExp("(?:-[^-]|[^-]*)*", "suy"));
5983
- var $R80 = $R(new RegExp("[^{}<>\\r\\n]+", "suy"));
5984
- var $R81 = $R(new RegExp("[+-]?", "suy"));
5985
- var $R82 = $R(new RegExp("(?=if|unless)", "suy"));
5986
- var $R83 = $R(new RegExp("#![^\\r\\n]*", "suy"));
5987
- var $R84 = $R(new RegExp("[\\t ]*", "suy"));
5988
- var $R85 = $R(new RegExp("[ \\t]*", "suy"));
5989
- var $R86 = $R(new RegExp("[\\s]*", "suy"));
5990
- var $R87 = $R(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?", "suy"));
5991
- var $R88 = $R(new RegExp("\\/\\/\\/[^\\r\\n]*", "suy"));
5992
- var $R89 = $R(new RegExp("(?=[ \\t\\r\\n\\/#]|$)", "suy"));
5993
- var $R90 = $R(new RegExp("\\r\\n|\\n|\\r|$", "suy"));
5994
- var $R91 = $R(new RegExp("[^]*", "suy"));
5992
+ var $R69 = $R(new RegExp("[=:]", "suy"));
5993
+ var $R70 = $R(new RegExp("['\u2019]s", "suy"));
5994
+ var $R71 = $R(new RegExp("\\s", "suy"));
5995
+ var $R72 = $R(new RegExp("(?=[<])", "suy"));
5996
+ var $R73 = $R(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*", "suy"));
5997
+ var $R74 = $R(new RegExp("[!+-]", "suy"));
5998
+ var $R75 = $R(new RegExp("[\\s>]|\\/>", "suy"));
5999
+ var $R76 = $R(new RegExp("(?:[\\w\\-:]+|\\([^()]*\\)|\\[[^\\[\\]]*\\])+", "suy"));
6000
+ var $R77 = $R(new RegExp(`"[^"]*"|'[^']*'`, "suy"));
6001
+ var $R78 = $R(new RegExp("[<>]", "suy"));
6002
+ var $R79 = $R(new RegExp("[!~+-](?!\\s|[!~+-]*&)", "suy"));
6003
+ var $R80 = $R(new RegExp("(?:-[^-]|[^-]*)*", "suy"));
6004
+ var $R81 = $R(new RegExp("[^{}<>\\r\\n]+", "suy"));
6005
+ var $R82 = $R(new RegExp("[+-]?", "suy"));
6006
+ var $R83 = $R(new RegExp("(?=if|unless)", "suy"));
6007
+ var $R84 = $R(new RegExp("#![^\\r\\n]*", "suy"));
6008
+ var $R85 = $R(new RegExp("[\\t ]*", "suy"));
6009
+ var $R86 = $R(new RegExp("[ \\t]*", "suy"));
6010
+ var $R87 = $R(new RegExp("[\\s]*", "suy"));
6011
+ var $R88 = $R(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?", "suy"));
6012
+ var $R89 = $R(new RegExp("\\/\\/\\/[^\\r\\n]*", "suy"));
6013
+ var $R90 = $R(new RegExp("(?=[ \\t\\r\\n\\/#]|$)", "suy"));
6014
+ var $R91 = $R(new RegExp("\\r\\n|\\n|\\r|$", "suy"));
6015
+ var $R92 = $R(new RegExp("[^]*", "suy"));
5995
6016
  var Program$0 = $TS($S(Reset, Init, $E(EOS), TopLevelStatements, __), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
5996
6017
  var statements = $4;
5997
6018
  processProgram({
@@ -7107,7 +7128,8 @@ var require_parser = __commonJS({
7107
7128
  return $EVENT_C(ctx, state, "FieldDefinition", FieldDefinition$$);
7108
7129
  }
7109
7130
  var ThisLiteral$0 = This;
7110
- var ThisLiteral$1 = $TS($S(AtThis, $TEXT($S($E(Hash), IdentifierName))), function($skip, $loc, $0, $1, $2) {
7131
+ var ThisLiteral$1 = HashThis;
7132
+ var ThisLiteral$2 = $TS($S(AtThis, $TEXT($S($E(Hash), IdentifierName))), function($skip, $loc, $0, $1, $2) {
7111
7133
  var at = $1;
7112
7134
  var id = $2;
7113
7135
  return {
@@ -7120,20 +7142,20 @@ var require_parser = __commonJS({
7120
7142
  thisShorthand: true
7121
7143
  };
7122
7144
  });
7123
- var ThisLiteral$2 = AtThis;
7124
- var ThisLiteral$3 = HashThis;
7145
+ var ThisLiteral$3 = AtThis;
7125
7146
  var ThisLiteral$$ = [ThisLiteral$0, ThisLiteral$1, ThisLiteral$2, ThisLiteral$3];
7126
7147
  function ThisLiteral(ctx, state) {
7127
7148
  return $EVENT_C(ctx, state, "ThisLiteral", ThisLiteral$$);
7128
7149
  }
7129
- var HashThis$0 = $TS($S(LengthShorthand, $E($S($Y($S($P(_), $C($S(Not, __, In), In))), $EXPECT($L0, 'HashThis ""')))), function($skip, $loc, $0, $1, $2) {
7130
- var id = $1;
7131
- var beforeIn = $2;
7132
- if (beforeIn != null)
7150
+ var HashThis$0 = $TS($S($E(AtThis), LengthShorthand, $E($S($Y($S(_, $E($S(Not, __)), ActualIn)), $EXPECT($L0, 'HashThis ""')))), function($skip, $loc, $0, $1, $2, $3) {
7151
+ var at = $1;
7152
+ var id = $2;
7153
+ var beforeIn = $3;
7154
+ if (beforeIn != null && at == null)
7133
7155
  return ['"', id.name, '"'];
7134
7156
  return {
7135
7157
  type: "MemberExpression",
7136
- children: ["this", {
7158
+ children: [at ?? "this", {
7137
7159
  type: "PropertyAccess",
7138
7160
  name: id.name,
7139
7161
  children: [".", id]
@@ -7141,7 +7163,7 @@ var require_parser = __commonJS({
7141
7163
  thisShorthand: true
7142
7164
  };
7143
7165
  });
7144
- var HashThis$1 = $TS($S(PrivateIdentifier, $Y($S($P(_), $C($S(Not, __, In), In)))), function($skip, $loc, $0, $1, $2) {
7166
+ var HashThis$1 = $TS($S(PrivateIdentifier, $Y($S(_, $E($S(Not, __)), ActualIn))), function($skip, $loc, $0, $1, $2) {
7145
7167
  var id = $1;
7146
7168
  return id;
7147
7169
  });
@@ -7312,7 +7334,7 @@ var require_parser = __commonJS({
7312
7334
  function MemberBase(ctx, state) {
7313
7335
  return $EVENT_C(ctx, state, "MemberBase", MemberBase$$);
7314
7336
  }
7315
- var MemberExpressionRest$0 = $TS($S($EXPECT($R7, "MemberExpressionRest /(?=[\\/\\[{?.!@'\u2019:])/"), $Q(InlineComment), MemberExpressionRestBody), function($skip, $loc, $0, $1, $2, $3) {
7337
+ var MemberExpressionRest$0 = $TS($S($EXPECT($R7, "MemberExpressionRest /(?=[\\/\\[{?.!@#'\u2019:])/"), $Q(InlineComment), MemberExpressionRestBody), function($skip, $loc, $0, $1, $2, $3) {
7316
7338
  var comments = $2;
7317
7339
  var body = $3;
7318
7340
  if (Array.isArray(body))
@@ -7445,16 +7467,27 @@ var require_parser = __commonJS({
7445
7467
  var AccessStart$0 = $TS($S($E(PropertyAccessModifier), Dot, $N(Dot)), function($skip, $loc, $0, $1, $2, $3) {
7446
7468
  var modifier = $1;
7447
7469
  var dot = $2;
7448
- let children = modifier ? [modifier, dot] : [dot];
7449
7470
  return {
7450
7471
  type: "AccessStart",
7451
- children,
7472
+ children: modifier ? [modifier, dot] : [dot],
7452
7473
  optional: modifier?.token === "?"
7453
7474
  };
7454
7475
  });
7455
7476
  function AccessStart(ctx, state) {
7456
7477
  return $EVENT(ctx, state, "AccessStart", AccessStart$0);
7457
7478
  }
7479
+ var ImplicitAccessStart$0 = $TS($S($E(PropertyAccessModifier), InsertDot, $N(Dot)), function($skip, $loc, $0, $1, $2, $3) {
7480
+ var modifier = $1;
7481
+ var dot = $2;
7482
+ return {
7483
+ type: "AccessStart",
7484
+ children: modifier ? [modifier, dot] : [dot],
7485
+ optional: modifier?.token === "?"
7486
+ };
7487
+ });
7488
+ function ImplicitAccessStart(ctx, state) {
7489
+ return $EVENT(ctx, state, "ImplicitAccessStart", ImplicitAccessStart$0);
7490
+ }
7458
7491
  var PropertyAccessModifier$0 = QuestionMark;
7459
7492
  var PropertyAccessModifier$1 = NonNullAssertion;
7460
7493
  var PropertyAccessModifier$$ = [PropertyAccessModifier$0, PropertyAccessModifier$1];
@@ -7496,15 +7529,24 @@ var require_parser = __commonJS({
7496
7529
  var dot = $1;
7497
7530
  var comments = $2;
7498
7531
  var id = $3;
7499
- const children = [dot, ...comments, ...id.children];
7500
7532
  return {
7501
7533
  type: "PropertyAccess",
7502
7534
  name: id.name,
7503
7535
  dot,
7504
- children
7536
+ children: [dot, ...comments, ...id.children]
7505
7537
  };
7506
7538
  });
7507
- var PropertyAccess$3 = $TS($S(CoffeePrototypeEnabled, DoubleColon, $E(IdentifierName)), function($skip, $loc, $0, $1, $2, $3) {
7539
+ var PropertyAccess$3 = $TS($S(ImplicitAccessStart, $C(PrivateIdentifier, LengthShorthand)), function($skip, $loc, $0, $1, $2) {
7540
+ var dot = $1;
7541
+ var id = $2;
7542
+ return {
7543
+ type: "PropertyAccess",
7544
+ name: id.name,
7545
+ dot,
7546
+ children: [dot, ...id.children]
7547
+ };
7548
+ });
7549
+ var PropertyAccess$4 = $TS($S(CoffeePrototypeEnabled, DoubleColon, $E(IdentifierName)), function($skip, $loc, $0, $1, $2, $3) {
7508
7550
  var p = $2;
7509
7551
  var id = $3;
7510
7552
  if (id) {
@@ -7525,7 +7567,7 @@ var require_parser = __commonJS({
7525
7567
  };
7526
7568
  }
7527
7569
  });
7528
- var PropertyAccess$$ = [PropertyAccess$0, PropertyAccess$1, PropertyAccess$2, PropertyAccess$3];
7570
+ var PropertyAccess$$ = [PropertyAccess$0, PropertyAccess$1, PropertyAccess$2, PropertyAccess$3, PropertyAccess$4];
7529
7571
  function PropertyAccess(ctx, state) {
7530
7572
  return $EVENT_C(ctx, state, "PropertyAccess", PropertyAccess$$);
7531
7573
  }
@@ -8809,11 +8851,14 @@ var require_parser = __commonJS({
8809
8851
  });
8810
8852
  var NonSingleBracedBlock$1 = ImplicitNestedBlock;
8811
8853
  var NonSingleBracedBlock$2 = $TS($S(InsertOpenBrace, NestedImplicitObjectLiteral, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3) {
8854
+ var o = $1;
8812
8855
  var s = $2;
8856
+ var c = $3;
8857
+ const expressions = [s];
8813
8858
  return {
8814
8859
  type: "BlockStatement",
8815
- expressions: [s],
8816
- children: $0
8860
+ expressions,
8861
+ children: [o, expressions, c]
8817
8862
  };
8818
8863
  });
8819
8864
  var NonSingleBracedBlock$$ = [NonSingleBracedBlock$0, NonSingleBracedBlock$1, NonSingleBracedBlock$2];
@@ -9214,7 +9259,7 @@ var require_parser = __commonJS({
9214
9259
  var ArrayElementExpression$1 = $T($S(ImplicitObjectLiteral, $Y(ArrayElementDelimiter)), function(value) {
9215
9260
  return value[0];
9216
9261
  });
9217
- var ArrayElementExpression$2 = $TS($S($E(ExtendedExpression), __, DotDotDot, $Y(ArrayElementDelimiter)), function($skip, $loc, $0, $1, $2, $3, $4) {
9262
+ var ArrayElementExpression$2 = $TS($S(ExtendedExpression, $E(_), DotDotDot, $Y(ArrayElementDelimiter)), function($skip, $loc, $0, $1, $2, $3, $4) {
9218
9263
  var exp = $1;
9219
9264
  var ws = $2;
9220
9265
  var dots = $3;
@@ -9223,7 +9268,7 @@ var require_parser = __commonJS({
9223
9268
  }
9224
9269
  return {
9225
9270
  type: "SpreadElement",
9226
- children: [...ws, dots, exp],
9271
+ children: [ws, dots, exp],
9227
9272
  names: exp.names
9228
9273
  };
9229
9274
  });
@@ -10233,6 +10278,16 @@ var require_parser = __commonJS({
10233
10278
  function BinaryOpSymbol(ctx, state) {
10234
10279
  return $EVENT_C(ctx, state, "BinaryOpSymbol", BinaryOpSymbol$$);
10235
10280
  }
10281
+ var ActualIn$0 = $T($S(CoffeeOfEnabled, Of), function(value) {
10282
+ return value[1];
10283
+ });
10284
+ var ActualIn$1 = $T($S($N(CoffeeOfEnabled), In), function(value) {
10285
+ return value[1];
10286
+ });
10287
+ var ActualIn$$ = [ActualIn$0, ActualIn$1];
10288
+ function ActualIn(ctx, state) {
10289
+ return $EVENT_C(ctx, state, "ActualIn", ActualIn$$);
10290
+ }
10236
10291
  var CoffeeOfOp$0 = $T($S(Of), function(value) {
10237
10292
  return "in";
10238
10293
  });
@@ -12546,7 +12601,7 @@ var require_parser = __commonJS({
12546
12601
  function CoffeeSubstitutionStart(ctx, state) {
12547
12602
  return $EVENT(ctx, state, "CoffeeSubstitutionStart", CoffeeSubstitutionStart$0);
12548
12603
  }
12549
- var Colon$0 = $TS($S($EXPECT($L15, 'Colon ":"'), $N($EXPECT($L3, 'Colon "="'))), function($skip, $loc, $0, $1, $2) {
12604
+ var Colon$0 = $TS($S($EXPECT($L15, 'Colon ":"'), $N($EXPECT($R69, "Colon /[=:]/"))), function($skip, $loc, $0, $1, $2) {
12550
12605
  return { $loc, token: $1 };
12551
12606
  });
12552
12607
  function Colon(ctx, state) {
@@ -12591,7 +12646,7 @@ var require_parser = __commonJS({
12591
12646
  var Dot$0 = $TV($EXPECT($L7, 'Dot "."'), function($skip, $loc, $0, $1) {
12592
12647
  return { $loc, token: $1 };
12593
12648
  });
12594
- var Dot$1 = $TS($S($EXPECT($R69, "Dot /['\u2019]s/"), _), function($skip, $loc, $0, $1, $2) {
12649
+ var Dot$1 = $TS($S($EXPECT($R70, "Dot /['\u2019]s/"), _), function($skip, $loc, $0, $1, $2) {
12595
12650
  var ws = $2;
12596
12651
  return [
12597
12652
  { $loc, token: "." },
@@ -12712,7 +12767,7 @@ var require_parser = __commonJS({
12712
12767
  function If(ctx, state) {
12713
12768
  return $EVENT(ctx, state, "If", If$0);
12714
12769
  }
12715
- var Import$0 = $TS($S($EXPECT($L20, 'Import "import"'), $Y($EXPECT($R70, "Import /\\s/"))), function($skip, $loc, $0, $1, $2) {
12770
+ var Import$0 = $TS($S($EXPECT($L20, 'Import "import"'), $Y($EXPECT($R71, "Import /\\s/"))), function($skip, $loc, $0, $1, $2) {
12716
12771
  return { $loc, token: $1 };
12717
12772
  });
12718
12773
  function Import(ctx, state) {
@@ -13052,7 +13107,7 @@ var require_parser = __commonJS({
13052
13107
  function JSXImplicitFragment(ctx, state) {
13053
13108
  return $EVENT(ctx, state, "JSXImplicitFragment", JSXImplicitFragment$0);
13054
13109
  }
13055
- var JSXTag$0 = $T($S($EXPECT($R71, "JSXTag /(?=[<])/"), _JSXTag), function(value) {
13110
+ var JSXTag$0 = $T($S($EXPECT($R72, "JSXTag /(?=[<])/"), _JSXTag), function(value) {
13056
13111
  return value[1];
13057
13112
  });
13058
13113
  function JSXTag(ctx, state) {
@@ -13199,7 +13254,7 @@ var require_parser = __commonJS({
13199
13254
  function JSXElementName(ctx, state) {
13200
13255
  return $EVENT_C(ctx, state, "JSXElementName", JSXElementName$$);
13201
13256
  }
13202
- var JSXIdentifierName$0 = $R$0($EXPECT($R72, "JSXIdentifierName /(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*/"));
13257
+ var JSXIdentifierName$0 = $R$0($EXPECT($R73, "JSXIdentifierName /(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*/"));
13203
13258
  function JSXIdentifierName(ctx, state) {
13204
13259
  return $EVENT(ctx, state, "JSXIdentifierName", JSXIdentifierName$0);
13205
13260
  }
@@ -13378,7 +13433,7 @@ var require_parser = __commonJS({
13378
13433
  class: $2
13379
13434
  };
13380
13435
  });
13381
- var JSXAttribute$7 = $TS($S($TEXT($EXPECT($R73, "JSXAttribute /[!+-]/")), JSXAttributeName, $Y(JSXAttributeSpace)), function($skip, $loc, $0, $1, $2, $3) {
13436
+ var JSXAttribute$7 = $TS($S($TEXT($EXPECT($R74, "JSXAttribute /[!+-]/")), JSXAttributeName, $Y(JSXAttributeSpace)), function($skip, $loc, $0, $1, $2, $3) {
13382
13437
  var toggle = $1;
13383
13438
  var id = $2;
13384
13439
  const value = toggle === "+" ? "true" : "false";
@@ -13388,11 +13443,11 @@ var require_parser = __commonJS({
13388
13443
  function JSXAttribute(ctx, state) {
13389
13444
  return $EVENT_C(ctx, state, "JSXAttribute", JSXAttribute$$);
13390
13445
  }
13391
- var JSXAttributeSpace$0 = $R$0($EXPECT($R74, "JSXAttributeSpace /[\\s>]|\\/>/"));
13446
+ var JSXAttributeSpace$0 = $R$0($EXPECT($R75, "JSXAttributeSpace /[\\s>]|\\/>/"));
13392
13447
  function JSXAttributeSpace(ctx, state) {
13393
13448
  return $EVENT(ctx, state, "JSXAttributeSpace", JSXAttributeSpace$0);
13394
13449
  }
13395
- var JSXShorthandString$0 = $TR($EXPECT($R75, "JSXShorthandString /(?:[\\w\\-:]+|\\([^()]*\\)|\\[[^\\[\\]]*\\])+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
13450
+ var JSXShorthandString$0 = $TR($EXPECT($R76, "JSXShorthandString /(?:[\\w\\-:]+|\\([^()]*\\)|\\[[^\\[\\]]*\\])+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
13396
13451
  return quoteString($0);
13397
13452
  });
13398
13453
  var JSXShorthandString$1 = $TS($S(TemplateLiteral), function($skip, $loc, $0, $1) {
@@ -13426,7 +13481,7 @@ var require_parser = __commonJS({
13426
13481
  }
13427
13482
  return [open, value, close];
13428
13483
  });
13429
- var JSXAttributeValue$4 = $R$0($EXPECT($R76, `JSXAttributeValue /"[^"]*"|'[^']*'/`));
13484
+ var JSXAttributeValue$4 = $R$0($EXPECT($R77, `JSXAttributeValue /"[^"]*"|'[^']*'/`));
13430
13485
  var JSXAttributeValue$$ = [JSXAttributeValue$0, JSXAttributeValue$1, JSXAttributeValue$2, JSXAttributeValue$3, JSXAttributeValue$4];
13431
13486
  function JSXAttributeValue(ctx, state) {
13432
13487
  return $EVENT_C(ctx, state, "JSXAttributeValue", JSXAttributeValue$$);
@@ -13439,7 +13494,7 @@ var require_parser = __commonJS({
13439
13494
  function InlineJSXAttributeValue(ctx, state) {
13440
13495
  return $EVENT(ctx, state, "InlineJSXAttributeValue", InlineJSXAttributeValue$0);
13441
13496
  }
13442
- var InlineJSXBinaryOpRHS$0 = $TS($S($N($EXPECT($R77, "InlineJSXBinaryOpRHS /[<>]/")), BinaryOp, InlineJSXUnaryExpression), function($skip, $loc, $0, $1, $2, $3) {
13497
+ var InlineJSXBinaryOpRHS$0 = $TS($S($N($EXPECT($R78, "InlineJSXBinaryOpRHS /[<>]/")), BinaryOp, InlineJSXUnaryExpression), function($skip, $loc, $0, $1, $2, $3) {
13443
13498
  var op = $2;
13444
13499
  var rhs = $3;
13445
13500
  return [[], op, [], rhs];
@@ -13456,7 +13511,7 @@ var require_parser = __commonJS({
13456
13511
  function InlineJSXUnaryExpression(ctx, state) {
13457
13512
  return $EVENT(ctx, state, "InlineJSXUnaryExpression", InlineJSXUnaryExpression$0);
13458
13513
  }
13459
- var InlineJSXUnaryOp$0 = $TR($EXPECT($R78, "InlineJSXUnaryOp /[!~+-](?!\\s|[!~+-]*&)/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
13514
+ var InlineJSXUnaryOp$0 = $TR($EXPECT($R79, "InlineJSXUnaryOp /[!~+-](?!\\s|[!~+-]*&)/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
13460
13515
  return { $loc, token: $0 };
13461
13516
  });
13462
13517
  function InlineJSXUnaryOp(ctx, state) {
@@ -13672,13 +13727,13 @@ var require_parser = __commonJS({
13672
13727
  function JSXComment(ctx, state) {
13673
13728
  return $EVENT(ctx, state, "JSXComment", JSXComment$0);
13674
13729
  }
13675
- var JSXCommentContent$0 = $TR($EXPECT($R79, "JSXCommentContent /(?:-[^-]|[^-]*)*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
13730
+ var JSXCommentContent$0 = $TR($EXPECT($R80, "JSXCommentContent /(?:-[^-]|[^-]*)*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
13676
13731
  return { $loc, token: $0.replace(/\*\//g, "* /") };
13677
13732
  });
13678
13733
  function JSXCommentContent(ctx, state) {
13679
13734
  return $EVENT(ctx, state, "JSXCommentContent", JSXCommentContent$0);
13680
13735
  }
13681
- var JSXText$0 = $TR($EXPECT($R80, "JSXText /[^{}<>\\r\\n]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
13736
+ var JSXText$0 = $TR($EXPECT($R81, "JSXText /[^{}<>\\r\\n]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
13682
13737
  return {
13683
13738
  type: "JSXText",
13684
13739
  token: $0,
@@ -14099,7 +14154,7 @@ var require_parser = __commonJS({
14099
14154
  function TypeProperty(ctx, state) {
14100
14155
  return $EVENT(ctx, state, "TypeProperty", TypeProperty$0);
14101
14156
  }
14102
- var TypeIndexSignature$0 = $S($E($S($R$0($EXPECT($R81, "TypeIndexSignature /[+-]?/")), Readonly, NotDedented)), OpenBracket, TypeIndex, CloseBracket, $E($S(__, $R$0($EXPECT($R17, "TypeIndexSignature /[+-]/")), $Y($S($E(_), QuestionMark)))));
14157
+ var TypeIndexSignature$0 = $S($E($S($R$0($EXPECT($R82, "TypeIndexSignature /[+-]?/")), Readonly, NotDedented)), OpenBracket, TypeIndex, CloseBracket, $E($S(__, $R$0($EXPECT($R17, "TypeIndexSignature /[+-]/")), $Y($S($E(_), QuestionMark)))));
14103
14158
  function TypeIndexSignature(ctx, state) {
14104
14159
  return $EVENT(ctx, state, "TypeIndexSignature", TypeIndexSignature$0);
14105
14160
  }
@@ -14119,11 +14174,13 @@ var require_parser = __commonJS({
14119
14174
  return { "type": "TypeSuffix", "ts": true, "optional": optional, "children": value };
14120
14175
  });
14121
14176
  var TypeSuffix$2 = $TS($S(NonNullAssertion, $E(_), $E($S(Colon, MaybeIndentedType))), function($skip, $loc, $0, $1, $2, $3) {
14177
+ var nonnull = $1;
14122
14178
  var ct = $3;
14123
14179
  const [colon, t] = ct ?? [];
14124
14180
  return {
14125
14181
  type: "TypeSuffix",
14126
14182
  ts: true,
14183
+ nonnull,
14127
14184
  t,
14128
14185
  children: [$1, $2, colon, t]
14129
14186
  };
@@ -14393,7 +14450,7 @@ var require_parser = __commonJS({
14393
14450
  function NestedType(ctx, state) {
14394
14451
  return $EVENT(ctx, state, "NestedType", NestedType$0);
14395
14452
  }
14396
- var TypeConditional$0 = $TS($S($E(_), $EXPECT($R82, "TypeConditional /(?=if|unless)/"), TypeIfThenElse), function($skip, $loc, $0, $1, $2, $3) {
14453
+ var TypeConditional$0 = $TS($S($E(_), $EXPECT($R83, "TypeConditional /(?=if|unless)/"), TypeIfThenElse), function($skip, $loc, $0, $1, $2, $3) {
14397
14454
  return [$1, expressionizeTypeIf($3)];
14398
14455
  });
14399
14456
  var TypeConditional$1 = $TS($S(TypeCondition, NotDedented, QuestionMark, Type, __, Colon, Type), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
@@ -14593,15 +14650,15 @@ var require_parser = __commonJS({
14593
14650
  function ThisType(ctx, state) {
14594
14651
  return $EVENT(ctx, state, "ThisType", ThisType$0);
14595
14652
  }
14596
- var Shebang$0 = $S($R$0($EXPECT($R83, "Shebang /#![^\\r\\n]*/")), EOL);
14653
+ var Shebang$0 = $S($R$0($EXPECT($R84, "Shebang /#![^\\r\\n]*/")), EOL);
14597
14654
  function Shebang(ctx, state) {
14598
14655
  return $EVENT(ctx, state, "Shebang", Shebang$0);
14599
14656
  }
14600
- var CivetPrologue$0 = $T($S($EXPECT($R84, "CivetPrologue /[\\t ]*/"), DoubleQuote, CivetPrologueContent, DoubleQuote, SimpleStatementDelimiter, $EXPECT($R85, "CivetPrologue /[ \\t]*/"), $C(EOL, $Y(RestOfLine))), function(value) {
14657
+ var CivetPrologue$0 = $T($S($EXPECT($R85, "CivetPrologue /[\\t ]*/"), DoubleQuote, CivetPrologueContent, DoubleQuote, SimpleStatementDelimiter, $EXPECT($R86, "CivetPrologue /[ \\t]*/"), $C(EOL, $Y(RestOfLine))), function(value) {
14601
14658
  var content = value[2];
14602
14659
  return content;
14603
14660
  });
14604
- var CivetPrologue$1 = $T($S($EXPECT($R84, "CivetPrologue /[\\t ]*/"), SingleQuote, CivetPrologueContent, SingleQuote, SimpleStatementDelimiter, $EXPECT($R85, "CivetPrologue /[ \\t]*/"), $C(EOL, $Y(RestOfLine))), function(value) {
14661
+ var CivetPrologue$1 = $T($S($EXPECT($R85, "CivetPrologue /[\\t ]*/"), SingleQuote, CivetPrologueContent, SingleQuote, SimpleStatementDelimiter, $EXPECT($R86, "CivetPrologue /[ \\t]*/"), $C(EOL, $Y(RestOfLine))), function(value) {
14605
14662
  var content = value[2];
14606
14663
  return content;
14607
14664
  });
@@ -14609,7 +14666,7 @@ var require_parser = __commonJS({
14609
14666
  function CivetPrologue(ctx, state) {
14610
14667
  return $EVENT_C(ctx, state, "CivetPrologue", CivetPrologue$$);
14611
14668
  }
14612
- var CivetPrologueContent$0 = $TS($S($EXPECT($L226, 'CivetPrologueContent "civet"'), NonIdContinue, $Q(CivetOption), $EXPECT($R86, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3, $4) {
14669
+ var CivetPrologueContent$0 = $TS($S($EXPECT($L226, 'CivetPrologueContent "civet"'), NonIdContinue, $Q(CivetOption), $EXPECT($R87, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3, $4) {
14613
14670
  var options = $3;
14614
14671
  return {
14615
14672
  type: "CivetPrologue",
@@ -14620,7 +14677,7 @@ var require_parser = __commonJS({
14620
14677
  function CivetPrologueContent(ctx, state) {
14621
14678
  return $EVENT(ctx, state, "CivetPrologueContent", CivetPrologueContent$0);
14622
14679
  }
14623
- var CivetOption$0 = $TR($EXPECT($R87, "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) {
14680
+ var CivetOption$0 = $TR($EXPECT($R88, "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) {
14624
14681
  const optionName = $2.replace(/-+([a-z]?)/g, (_2, l) => {
14625
14682
  if (l)
14626
14683
  return l.toUpperCase();
@@ -14637,11 +14694,11 @@ var require_parser = __commonJS({
14637
14694
  function CivetOption(ctx, state) {
14638
14695
  return $EVENT(ctx, state, "CivetOption", CivetOption$0);
14639
14696
  }
14640
- var UnknownPrologue$0 = $S($R$0($EXPECT($R84, "UnknownPrologue /[\\t ]*/")), StringLiteral, $TEXT(SimpleStatementDelimiter), EOS);
14697
+ var UnknownPrologue$0 = $S($R$0($EXPECT($R85, "UnknownPrologue /[\\t ]*/")), StringLiteral, $TEXT(SimpleStatementDelimiter), EOS);
14641
14698
  function UnknownPrologue(ctx, state) {
14642
14699
  return $EVENT(ctx, state, "UnknownPrologue", UnknownPrologue$0);
14643
14700
  }
14644
- var TripleSlashDirective$0 = $S($R$0($EXPECT($R88, "TripleSlashDirective /\\/\\/\\/[^\\r\\n]*/")), $E(EOS));
14701
+ var TripleSlashDirective$0 = $S($R$0($EXPECT($R89, "TripleSlashDirective /\\/\\/\\/[^\\r\\n]*/")), $E(EOS));
14645
14702
  function TripleSlashDirective(ctx, state) {
14646
14703
  return $EVENT(ctx, state, "TripleSlashDirective", TripleSlashDirective$0);
14647
14704
  }
@@ -14657,13 +14714,13 @@ var require_parser = __commonJS({
14657
14714
  function PrologueString(ctx, state) {
14658
14715
  return $EVENT_C(ctx, state, "PrologueString", PrologueString$$);
14659
14716
  }
14660
- var EOS$0 = $T($S($EXPECT($R89, "EOS /(?=[ \\t\\r\\n\\/#]|$)/"), $P(RestOfLine)), function(value) {
14717
+ var EOS$0 = $T($S($EXPECT($R90, "EOS /(?=[ \\t\\r\\n\\/#]|$)/"), $P(RestOfLine)), function(value) {
14661
14718
  return value[1];
14662
14719
  });
14663
14720
  function EOS(ctx, state) {
14664
14721
  return $EVENT(ctx, state, "EOS", EOS$0);
14665
14722
  }
14666
- var EOL$0 = $TR($EXPECT($R90, "EOL /\\r\\n|\\n|\\r|$/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
14723
+ var EOL$0 = $TR($EXPECT($R91, "EOL /\\r\\n|\\n|\\r|$/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
14667
14724
  return { $loc, token: $0 };
14668
14725
  });
14669
14726
  function EOL(ctx, state) {
@@ -15235,11 +15292,11 @@ var require_parser = __commonJS({
15235
15292
  function Prologue(ctx, state) {
15236
15293
  return $EVENT(ctx, state, "Prologue", Prologue$0);
15237
15294
  }
15238
- var ProloguePrefix$0 = $S(Prologue, $R$0($EXPECT($R91, "ProloguePrefix /[^]*/")));
15295
+ var ProloguePrefix$0 = $S(Prologue, $R$0($EXPECT($R92, "ProloguePrefix /[^]*/")));
15239
15296
  function ProloguePrefix(ctx, state) {
15240
15297
  return $EVENT(ctx, state, "ProloguePrefix", ProloguePrefix$0);
15241
15298
  }
15242
- var Indent$0 = $TR($EXPECT($R85, "Indent /[ \\t]*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
15299
+ var Indent$0 = $TR($EXPECT($R86, "Indent /[ \\t]*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
15243
15300
  const level = getIndentLevel($0, module2.config.tab);
15244
15301
  return {
15245
15302
  $loc,
@@ -15463,6 +15520,7 @@ var require_parser = __commonJS({
15463
15520
  exports2.MemberBracketContent = MemberBracketContent;
15464
15521
  exports2.SliceParameters = SliceParameters;
15465
15522
  exports2.AccessStart = AccessStart;
15523
+ exports2.ImplicitAccessStart = ImplicitAccessStart;
15466
15524
  exports2.PropertyAccessModifier = PropertyAccessModifier;
15467
15525
  exports2.PropertyAccess = PropertyAccess;
15468
15526
  exports2.PropertyGlob = PropertyGlob;
@@ -15597,6 +15655,7 @@ var require_parser = __commonJS({
15597
15655
  exports2.BinaryOp = BinaryOp;
15598
15656
  exports2._BinaryOp = _BinaryOp;
15599
15657
  exports2.BinaryOpSymbol = BinaryOpSymbol;
15658
+ exports2.ActualIn = ActualIn;
15600
15659
  exports2.CoffeeOfOp = CoffeeOfOp;
15601
15660
  exports2.NotOp = NotOp;
15602
15661
  exports2.Xor = Xor;
@@ -16613,10 +16672,13 @@ function compile(src, options) {
16613
16672
  let ast;
16614
16673
  try {
16615
16674
  import_parser.parse.config = options.parseOptions || {};
16616
- ast = prune((0, import_parser.parse)(src, {
16675
+ ast = (0, import_parser.parse)(src, {
16617
16676
  filename,
16618
16677
  events
16619
- }));
16678
+ });
16679
+ if (!(options.ast === "raw")) {
16680
+ ast = prune(ast);
16681
+ }
16620
16682
  } finally {
16621
16683
  if (hits || trace) {
16622
16684
  import("fs").then(function({ writeFileSync }) {