@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/browser.js CHANGED
@@ -235,6 +235,9 @@ var Civet = (() => {
235
235
  function hasYield(exp) {
236
236
  return gatherRecursiveWithinFunction(exp, ({ type }) => type === "Yield").length > 0;
237
237
  }
238
+ function hasImportDeclaration(exp) {
239
+ return gatherRecursiveWithinFunction(exp, ({ type }) => type === "ImportDeclaration").length > 0;
240
+ }
238
241
  function deepCopy(node) {
239
242
  if (node == null)
240
243
  return node;
@@ -396,9 +399,10 @@ var Civet = (() => {
396
399
  }
397
400
  return ["(", type, ")"];
398
401
  }
399
- function wrapIIFE(expressions, async) {
402
+ function wrapIIFE(expressions, asyncFlag) {
400
403
  let prefix;
401
- if (async) {
404
+ let async;
405
+ if (asyncFlag) {
402
406
  async = "async ";
403
407
  } else if (hasAwait(expressions)) {
404
408
  async = "async ";
@@ -586,16 +590,16 @@ var Civet = (() => {
586
590
  expressions,
587
591
  children: block.children === block.expressions ? expressions : block.children.map((c) => c === block.expressions ? expressions : c)
588
592
  };
589
- if (block.bare) {
590
- block.children = [[" {"], ...block.children, "}"];
591
- block.bare = false;
592
- }
593
+ braceBlock(block);
593
594
  updateParentPointers(block);
594
595
  }
595
596
  return block;
596
597
  }
597
598
  function braceBlock(block) {
598
599
  if (block.bare) {
600
+ if (block.children === block.expressions) {
601
+ block.children = [block.expressions];
602
+ }
599
603
  block.children.unshift(" {");
600
604
  block.children.push("}");
601
605
  return block.bare = false;
@@ -605,8 +609,13 @@ var Civet = (() => {
605
609
  }
606
610
  function duplicateBlock(block) {
607
611
  const expressions = [...block.expressions];
608
- const children = [...block.children];
609
- children.splice(children.indexOf(block.expressions), 1, expressions);
612
+ let children;
613
+ if (block.children === block.expressions) {
614
+ children = expressions;
615
+ } else {
616
+ children = [...block.children];
617
+ children.splice(children.indexOf(block.expressions), 1, expressions);
618
+ }
610
619
  return {
611
620
  ...block,
612
621
  expressions,
@@ -1891,7 +1900,7 @@ var Civet = (() => {
1891
1900
  return;
1892
1901
  case "IfStatement":
1893
1902
  insertReturn(exp.then);
1894
- if (exp.else)
1903
+ if (exp.else && exp.else.length !== 0)
1895
1904
  insertReturn(exp.else[2]);
1896
1905
  else
1897
1906
  exp.children.push(["", {
@@ -2023,8 +2032,7 @@ var Civet = (() => {
2023
2032
  throw new Error("Could not find iteration statement in iteration expression");
2024
2033
  }
2025
2034
  if (subtype === "DoStatement") {
2026
- insertReturn(block);
2027
- children.splice(i, 1, ...wrapIIFE(["", statement, void 0], async));
2035
+ children.splice(i, 1, ...wrapIIFE([["", statement, void 0]], async));
2028
2036
  updateParentPointers(exp);
2029
2037
  return;
2030
2038
  }
@@ -2185,7 +2193,8 @@ var Civet = (() => {
2185
2193
  }
2186
2194
  const { decl, bindings } = condition.declaration;
2187
2195
  const binding = bindings[0];
2188
- const { pattern, suffix, initializer, splices, thisAssignments } = binding;
2196
+ let { pattern, suffix, initializer, splices, thisAssignments } = binding;
2197
+ const nullCheck = suffix?.optional && !suffix.t && !suffix.nonnull;
2189
2198
  let ref = prependStatementExpressionBlock(initializer, parent);
2190
2199
  if (ref) {
2191
2200
  Object.assign(condition, {
@@ -2199,11 +2208,16 @@ var Civet = (() => {
2199
2208
  ref = makeRef();
2200
2209
  const grandparent = condition.parent?.parent;
2201
2210
  const children = (
2202
- // Check that the declaration is a plain assignment (no pattern-matching) and the immediate grandchild of an `if` or `while`
2211
+ // Wrap declaration that is a plain assignment (no pattern-matching) and the immediate grandchild of an `if` or `while`
2212
+ // to satisfy eslint's no-cond-assign rule
2203
2213
  // More complex conditions (triggered by pattern matching or `until`/`unless`) don't need double parens
2204
- // @ts-ignore Just because pattern might not have a type at runtime doesn't mean it's unsafe
2205
- pattern.type === "Identifier" && (grandparent?.type === "IfStatement" || grandparent?.type === "WhileStatement") ? ["(", ref, initializer, ")"] : [ref, initializer]
2214
+ pattern.type === "Identifier" && (grandparent?.type === "IfStatement" || grandparent?.type === "IterationStatement") && !nullCheck ? ["(", ref, initializer, ")"] : [ref, initializer]
2206
2215
  );
2216
+ if (nullCheck) {
2217
+ children.unshift("(");
2218
+ children.push(") != null");
2219
+ suffix = void 0;
2220
+ }
2207
2221
  Object.assign(condition, {
2208
2222
  type: "AssignmentExpression",
2209
2223
  children,
@@ -3266,13 +3280,17 @@ var Civet = (() => {
3266
3280
  forRange: () => forRange,
3267
3281
  gatherBindingCode: () => gatherBindingCode,
3268
3282
  gatherRecursive: () => gatherRecursive,
3283
+ gatherRecursiveAll: () => gatherRecursiveAll,
3284
+ gatherRecursiveWithinFunction: () => gatherRecursiveWithinFunction,
3269
3285
  getIndentLevel: () => getIndentLevel,
3270
3286
  getPrecedence: () => getPrecedence,
3271
3287
  getTrimmingSpace: () => getTrimmingSpace,
3272
3288
  hasAwait: () => hasAwait,
3289
+ hasImportDeclaration: () => hasImportDeclaration,
3273
3290
  hasYield: () => hasYield,
3274
3291
  insertTrimmingSpace: () => insertTrimmingSpace,
3275
3292
  isEmptyBareBlock: () => isEmptyBareBlock,
3293
+ isFunction: () => isFunction,
3276
3294
  isWhitespaceOrEmpty: () => isWhitespaceOrEmpty,
3277
3295
  lastAccessInCallExpression: () => lastAccessInCallExpression,
3278
3296
  literalValue: () => literalValue,
@@ -5069,6 +5087,7 @@ ${input.slice(result.pos)}
5069
5087
  MemberBracketContent,
5070
5088
  SliceParameters,
5071
5089
  AccessStart,
5090
+ ImplicitAccessStart,
5072
5091
  PropertyAccessModifier,
5073
5092
  PropertyAccess,
5074
5093
  PropertyGlob,
@@ -5203,6 +5222,7 @@ ${input.slice(result.pos)}
5203
5222
  BinaryOp,
5204
5223
  _BinaryOp,
5205
5224
  BinaryOpSymbol,
5225
+ ActualIn,
5206
5226
  CoffeeOfOp,
5207
5227
  NotOp,
5208
5228
  Xor,
@@ -5915,7 +5935,7 @@ ${input.slice(result.pos)}
5915
5935
  var $R4 = $R(new RegExp("[ \\t]", "suy"));
5916
5936
  var $R5 = $R(new RegExp("(?=['\"`])", "suy"));
5917
5937
  var $R6 = $R(new RegExp("(?=[\\/?])", "suy"));
5918
- var $R7 = $R(new RegExp("(?=[\\/\\[{?.!@'\u2019:])", "suy"));
5938
+ var $R7 = $R(new RegExp("(?=[\\/\\[{?.!@#'\u2019:])", "suy"));
5919
5939
  var $R8 = $R(new RegExp("[)}]", "suy"));
5920
5940
  var $R9 = $R(new RegExp("\\+\\+|--|[\\+-]\\S", "suy"));
5921
5941
  var $R10 = $R(new RegExp("[&]", "suy"));
@@ -5977,29 +5997,30 @@ ${input.slice(result.pos)}
5977
5997
  var $R66 = $R(new RegExp("[ \\t]+", "suy"));
5978
5998
  var $R67 = $R(new RegExp("(?=\\s|\\/|#)", "suy"));
5979
5999
  var $R68 = $R(new RegExp("(?!\\p{ID_Continue})", "suy"));
5980
- var $R69 = $R(new RegExp("['\u2019]s", "suy"));
5981
- var $R70 = $R(new RegExp("\\s", "suy"));
5982
- var $R71 = $R(new RegExp("(?=[<])", "suy"));
5983
- var $R72 = $R(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*", "suy"));
5984
- var $R73 = $R(new RegExp("[!+-]", "suy"));
5985
- var $R74 = $R(new RegExp("[\\s>]|\\/>", "suy"));
5986
- var $R75 = $R(new RegExp("(?:[\\w\\-:]+|\\([^()]*\\)|\\[[^\\[\\]]*\\])+", "suy"));
5987
- var $R76 = $R(new RegExp(`"[^"]*"|'[^']*'`, "suy"));
5988
- var $R77 = $R(new RegExp("[<>]", "suy"));
5989
- var $R78 = $R(new RegExp("[!~+-](?!\\s|[!~+-]*&)", "suy"));
5990
- var $R79 = $R(new RegExp("(?:-[^-]|[^-]*)*", "suy"));
5991
- var $R80 = $R(new RegExp("[^{}<>\\r\\n]+", "suy"));
5992
- var $R81 = $R(new RegExp("[+-]?", "suy"));
5993
- var $R82 = $R(new RegExp("(?=if|unless)", "suy"));
5994
- var $R83 = $R(new RegExp("#![^\\r\\n]*", "suy"));
5995
- var $R84 = $R(new RegExp("[\\t ]*", "suy"));
5996
- var $R85 = $R(new RegExp("[ \\t]*", "suy"));
5997
- var $R86 = $R(new RegExp("[\\s]*", "suy"));
5998
- var $R87 = $R(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?", "suy"));
5999
- var $R88 = $R(new RegExp("\\/\\/\\/[^\\r\\n]*", "suy"));
6000
- var $R89 = $R(new RegExp("(?=[ \\t\\r\\n\\/#]|$)", "suy"));
6001
- var $R90 = $R(new RegExp("\\r\\n|\\n|\\r|$", "suy"));
6002
- var $R91 = $R(new RegExp("[^]*", "suy"));
6000
+ var $R69 = $R(new RegExp("[=:]", "suy"));
6001
+ var $R70 = $R(new RegExp("['\u2019]s", "suy"));
6002
+ var $R71 = $R(new RegExp("\\s", "suy"));
6003
+ var $R72 = $R(new RegExp("(?=[<])", "suy"));
6004
+ var $R73 = $R(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*", "suy"));
6005
+ var $R74 = $R(new RegExp("[!+-]", "suy"));
6006
+ var $R75 = $R(new RegExp("[\\s>]|\\/>", "suy"));
6007
+ var $R76 = $R(new RegExp("(?:[\\w\\-:]+|\\([^()]*\\)|\\[[^\\[\\]]*\\])+", "suy"));
6008
+ var $R77 = $R(new RegExp(`"[^"]*"|'[^']*'`, "suy"));
6009
+ var $R78 = $R(new RegExp("[<>]", "suy"));
6010
+ var $R79 = $R(new RegExp("[!~+-](?!\\s|[!~+-]*&)", "suy"));
6011
+ var $R80 = $R(new RegExp("(?:-[^-]|[^-]*)*", "suy"));
6012
+ var $R81 = $R(new RegExp("[^{}<>\\r\\n]+", "suy"));
6013
+ var $R82 = $R(new RegExp("[+-]?", "suy"));
6014
+ var $R83 = $R(new RegExp("(?=if|unless)", "suy"));
6015
+ var $R84 = $R(new RegExp("#![^\\r\\n]*", "suy"));
6016
+ var $R85 = $R(new RegExp("[\\t ]*", "suy"));
6017
+ var $R86 = $R(new RegExp("[ \\t]*", "suy"));
6018
+ var $R87 = $R(new RegExp("[\\s]*", "suy"));
6019
+ var $R88 = $R(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?", "suy"));
6020
+ var $R89 = $R(new RegExp("\\/\\/\\/[^\\r\\n]*", "suy"));
6021
+ var $R90 = $R(new RegExp("(?=[ \\t\\r\\n\\/#]|$)", "suy"));
6022
+ var $R91 = $R(new RegExp("\\r\\n|\\n|\\r|$", "suy"));
6023
+ var $R92 = $R(new RegExp("[^]*", "suy"));
6003
6024
  var Program$0 = $TS($S(Reset, Init, $E(EOS), TopLevelStatements, __), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
6004
6025
  var statements = $4;
6005
6026
  processProgram({
@@ -7115,7 +7136,8 @@ ${input.slice(result.pos)}
7115
7136
  return $EVENT_C(ctx, state, "FieldDefinition", FieldDefinition$$);
7116
7137
  }
7117
7138
  var ThisLiteral$0 = This;
7118
- var ThisLiteral$1 = $TS($S(AtThis, $TEXT($S($E(Hash), IdentifierName))), function($skip, $loc, $0, $1, $2) {
7139
+ var ThisLiteral$1 = HashThis;
7140
+ var ThisLiteral$2 = $TS($S(AtThis, $TEXT($S($E(Hash), IdentifierName))), function($skip, $loc, $0, $1, $2) {
7119
7141
  var at = $1;
7120
7142
  var id = $2;
7121
7143
  return {
@@ -7128,20 +7150,20 @@ ${input.slice(result.pos)}
7128
7150
  thisShorthand: true
7129
7151
  };
7130
7152
  });
7131
- var ThisLiteral$2 = AtThis;
7132
- var ThisLiteral$3 = HashThis;
7153
+ var ThisLiteral$3 = AtThis;
7133
7154
  var ThisLiteral$$ = [ThisLiteral$0, ThisLiteral$1, ThisLiteral$2, ThisLiteral$3];
7134
7155
  function ThisLiteral(ctx, state) {
7135
7156
  return $EVENT_C(ctx, state, "ThisLiteral", ThisLiteral$$);
7136
7157
  }
7137
- 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) {
7138
- var id = $1;
7139
- var beforeIn = $2;
7140
- if (beforeIn != null)
7158
+ 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) {
7159
+ var at = $1;
7160
+ var id = $2;
7161
+ var beforeIn = $3;
7162
+ if (beforeIn != null && at == null)
7141
7163
  return ['"', id.name, '"'];
7142
7164
  return {
7143
7165
  type: "MemberExpression",
7144
- children: ["this", {
7166
+ children: [at ?? "this", {
7145
7167
  type: "PropertyAccess",
7146
7168
  name: id.name,
7147
7169
  children: [".", id]
@@ -7149,7 +7171,7 @@ ${input.slice(result.pos)}
7149
7171
  thisShorthand: true
7150
7172
  };
7151
7173
  });
7152
- var HashThis$1 = $TS($S(PrivateIdentifier, $Y($S($P(_), $C($S(Not, __, In), In)))), function($skip, $loc, $0, $1, $2) {
7174
+ var HashThis$1 = $TS($S(PrivateIdentifier, $Y($S(_, $E($S(Not, __)), ActualIn))), function($skip, $loc, $0, $1, $2) {
7153
7175
  var id = $1;
7154
7176
  return id;
7155
7177
  });
@@ -7320,7 +7342,7 @@ ${input.slice(result.pos)}
7320
7342
  function MemberBase(ctx, state) {
7321
7343
  return $EVENT_C(ctx, state, "MemberBase", MemberBase$$);
7322
7344
  }
7323
- var MemberExpressionRest$0 = $TS($S($EXPECT($R7, "MemberExpressionRest /(?=[\\/\\[{?.!@'\u2019:])/"), $Q(InlineComment), MemberExpressionRestBody), function($skip, $loc, $0, $1, $2, $3) {
7345
+ var MemberExpressionRest$0 = $TS($S($EXPECT($R7, "MemberExpressionRest /(?=[\\/\\[{?.!@#'\u2019:])/"), $Q(InlineComment), MemberExpressionRestBody), function($skip, $loc, $0, $1, $2, $3) {
7324
7346
  var comments = $2;
7325
7347
  var body = $3;
7326
7348
  if (Array.isArray(body))
@@ -7453,16 +7475,27 @@ ${input.slice(result.pos)}
7453
7475
  var AccessStart$0 = $TS($S($E(PropertyAccessModifier), Dot, $N(Dot)), function($skip, $loc, $0, $1, $2, $3) {
7454
7476
  var modifier = $1;
7455
7477
  var dot = $2;
7456
- let children = modifier ? [modifier, dot] : [dot];
7457
7478
  return {
7458
7479
  type: "AccessStart",
7459
- children,
7480
+ children: modifier ? [modifier, dot] : [dot],
7460
7481
  optional: modifier?.token === "?"
7461
7482
  };
7462
7483
  });
7463
7484
  function AccessStart(ctx, state) {
7464
7485
  return $EVENT(ctx, state, "AccessStart", AccessStart$0);
7465
7486
  }
7487
+ var ImplicitAccessStart$0 = $TS($S($E(PropertyAccessModifier), InsertDot, $N(Dot)), function($skip, $loc, $0, $1, $2, $3) {
7488
+ var modifier = $1;
7489
+ var dot = $2;
7490
+ return {
7491
+ type: "AccessStart",
7492
+ children: modifier ? [modifier, dot] : [dot],
7493
+ optional: modifier?.token === "?"
7494
+ };
7495
+ });
7496
+ function ImplicitAccessStart(ctx, state) {
7497
+ return $EVENT(ctx, state, "ImplicitAccessStart", ImplicitAccessStart$0);
7498
+ }
7466
7499
  var PropertyAccessModifier$0 = QuestionMark;
7467
7500
  var PropertyAccessModifier$1 = NonNullAssertion;
7468
7501
  var PropertyAccessModifier$$ = [PropertyAccessModifier$0, PropertyAccessModifier$1];
@@ -7504,15 +7537,24 @@ ${input.slice(result.pos)}
7504
7537
  var dot = $1;
7505
7538
  var comments = $2;
7506
7539
  var id = $3;
7507
- const children = [dot, ...comments, ...id.children];
7508
7540
  return {
7509
7541
  type: "PropertyAccess",
7510
7542
  name: id.name,
7511
7543
  dot,
7512
- children
7544
+ children: [dot, ...comments, ...id.children]
7513
7545
  };
7514
7546
  });
7515
- var PropertyAccess$3 = $TS($S(CoffeePrototypeEnabled, DoubleColon, $E(IdentifierName)), function($skip, $loc, $0, $1, $2, $3) {
7547
+ var PropertyAccess$3 = $TS($S(ImplicitAccessStart, $C(PrivateIdentifier, LengthShorthand)), function($skip, $loc, $0, $1, $2) {
7548
+ var dot = $1;
7549
+ var id = $2;
7550
+ return {
7551
+ type: "PropertyAccess",
7552
+ name: id.name,
7553
+ dot,
7554
+ children: [dot, ...id.children]
7555
+ };
7556
+ });
7557
+ var PropertyAccess$4 = $TS($S(CoffeePrototypeEnabled, DoubleColon, $E(IdentifierName)), function($skip, $loc, $0, $1, $2, $3) {
7516
7558
  var p = $2;
7517
7559
  var id = $3;
7518
7560
  if (id) {
@@ -7533,7 +7575,7 @@ ${input.slice(result.pos)}
7533
7575
  };
7534
7576
  }
7535
7577
  });
7536
- var PropertyAccess$$ = [PropertyAccess$0, PropertyAccess$1, PropertyAccess$2, PropertyAccess$3];
7578
+ var PropertyAccess$$ = [PropertyAccess$0, PropertyAccess$1, PropertyAccess$2, PropertyAccess$3, PropertyAccess$4];
7537
7579
  function PropertyAccess(ctx, state) {
7538
7580
  return $EVENT_C(ctx, state, "PropertyAccess", PropertyAccess$$);
7539
7581
  }
@@ -8817,11 +8859,14 @@ ${input.slice(result.pos)}
8817
8859
  });
8818
8860
  var NonSingleBracedBlock$1 = ImplicitNestedBlock;
8819
8861
  var NonSingleBracedBlock$2 = $TS($S(InsertOpenBrace, NestedImplicitObjectLiteral, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3) {
8862
+ var o = $1;
8820
8863
  var s = $2;
8864
+ var c = $3;
8865
+ const expressions = [s];
8821
8866
  return {
8822
8867
  type: "BlockStatement",
8823
- expressions: [s],
8824
- children: $0
8868
+ expressions,
8869
+ children: [o, expressions, c]
8825
8870
  };
8826
8871
  });
8827
8872
  var NonSingleBracedBlock$$ = [NonSingleBracedBlock$0, NonSingleBracedBlock$1, NonSingleBracedBlock$2];
@@ -9222,7 +9267,7 @@ ${input.slice(result.pos)}
9222
9267
  var ArrayElementExpression$1 = $T($S(ImplicitObjectLiteral, $Y(ArrayElementDelimiter)), function(value) {
9223
9268
  return value[0];
9224
9269
  });
9225
- var ArrayElementExpression$2 = $TS($S($E(ExtendedExpression), __, DotDotDot, $Y(ArrayElementDelimiter)), function($skip, $loc, $0, $1, $2, $3, $4) {
9270
+ var ArrayElementExpression$2 = $TS($S(ExtendedExpression, $E(_), DotDotDot, $Y(ArrayElementDelimiter)), function($skip, $loc, $0, $1, $2, $3, $4) {
9226
9271
  var exp = $1;
9227
9272
  var ws = $2;
9228
9273
  var dots = $3;
@@ -9231,7 +9276,7 @@ ${input.slice(result.pos)}
9231
9276
  }
9232
9277
  return {
9233
9278
  type: "SpreadElement",
9234
- children: [...ws, dots, exp],
9279
+ children: [ws, dots, exp],
9235
9280
  names: exp.names
9236
9281
  };
9237
9282
  });
@@ -10241,6 +10286,16 @@ ${input.slice(result.pos)}
10241
10286
  function BinaryOpSymbol(ctx, state) {
10242
10287
  return $EVENT_C(ctx, state, "BinaryOpSymbol", BinaryOpSymbol$$);
10243
10288
  }
10289
+ var ActualIn$0 = $T($S(CoffeeOfEnabled, Of), function(value) {
10290
+ return value[1];
10291
+ });
10292
+ var ActualIn$1 = $T($S($N(CoffeeOfEnabled), In), function(value) {
10293
+ return value[1];
10294
+ });
10295
+ var ActualIn$$ = [ActualIn$0, ActualIn$1];
10296
+ function ActualIn(ctx, state) {
10297
+ return $EVENT_C(ctx, state, "ActualIn", ActualIn$$);
10298
+ }
10244
10299
  var CoffeeOfOp$0 = $T($S(Of), function(value) {
10245
10300
  return "in";
10246
10301
  });
@@ -12554,7 +12609,7 @@ ${input.slice(result.pos)}
12554
12609
  function CoffeeSubstitutionStart(ctx, state) {
12555
12610
  return $EVENT(ctx, state, "CoffeeSubstitutionStart", CoffeeSubstitutionStart$0);
12556
12611
  }
12557
- var Colon$0 = $TS($S($EXPECT($L15, 'Colon ":"'), $N($EXPECT($L3, 'Colon "="'))), function($skip, $loc, $0, $1, $2) {
12612
+ var Colon$0 = $TS($S($EXPECT($L15, 'Colon ":"'), $N($EXPECT($R69, "Colon /[=:]/"))), function($skip, $loc, $0, $1, $2) {
12558
12613
  return { $loc, token: $1 };
12559
12614
  });
12560
12615
  function Colon(ctx, state) {
@@ -12599,7 +12654,7 @@ ${input.slice(result.pos)}
12599
12654
  var Dot$0 = $TV($EXPECT($L7, 'Dot "."'), function($skip, $loc, $0, $1) {
12600
12655
  return { $loc, token: $1 };
12601
12656
  });
12602
- var Dot$1 = $TS($S($EXPECT($R69, "Dot /['\u2019]s/"), _), function($skip, $loc, $0, $1, $2) {
12657
+ var Dot$1 = $TS($S($EXPECT($R70, "Dot /['\u2019]s/"), _), function($skip, $loc, $0, $1, $2) {
12603
12658
  var ws = $2;
12604
12659
  return [
12605
12660
  { $loc, token: "." },
@@ -12720,7 +12775,7 @@ ${input.slice(result.pos)}
12720
12775
  function If(ctx, state) {
12721
12776
  return $EVENT(ctx, state, "If", If$0);
12722
12777
  }
12723
- var Import$0 = $TS($S($EXPECT($L20, 'Import "import"'), $Y($EXPECT($R70, "Import /\\s/"))), function($skip, $loc, $0, $1, $2) {
12778
+ var Import$0 = $TS($S($EXPECT($L20, 'Import "import"'), $Y($EXPECT($R71, "Import /\\s/"))), function($skip, $loc, $0, $1, $2) {
12724
12779
  return { $loc, token: $1 };
12725
12780
  });
12726
12781
  function Import(ctx, state) {
@@ -13060,7 +13115,7 @@ ${input.slice(result.pos)}
13060
13115
  function JSXImplicitFragment(ctx, state) {
13061
13116
  return $EVENT(ctx, state, "JSXImplicitFragment", JSXImplicitFragment$0);
13062
13117
  }
13063
- var JSXTag$0 = $T($S($EXPECT($R71, "JSXTag /(?=[<])/"), _JSXTag), function(value) {
13118
+ var JSXTag$0 = $T($S($EXPECT($R72, "JSXTag /(?=[<])/"), _JSXTag), function(value) {
13064
13119
  return value[1];
13065
13120
  });
13066
13121
  function JSXTag(ctx, state) {
@@ -13207,7 +13262,7 @@ ${input.slice(result.pos)}
13207
13262
  function JSXElementName(ctx, state) {
13208
13263
  return $EVENT_C(ctx, state, "JSXElementName", JSXElementName$$);
13209
13264
  }
13210
- var JSXIdentifierName$0 = $R$0($EXPECT($R72, "JSXIdentifierName /(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*/"));
13265
+ var JSXIdentifierName$0 = $R$0($EXPECT($R73, "JSXIdentifierName /(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*/"));
13211
13266
  function JSXIdentifierName(ctx, state) {
13212
13267
  return $EVENT(ctx, state, "JSXIdentifierName", JSXIdentifierName$0);
13213
13268
  }
@@ -13386,7 +13441,7 @@ ${input.slice(result.pos)}
13386
13441
  class: $2
13387
13442
  };
13388
13443
  });
13389
- var JSXAttribute$7 = $TS($S($TEXT($EXPECT($R73, "JSXAttribute /[!+-]/")), JSXAttributeName, $Y(JSXAttributeSpace)), function($skip, $loc, $0, $1, $2, $3) {
13444
+ var JSXAttribute$7 = $TS($S($TEXT($EXPECT($R74, "JSXAttribute /[!+-]/")), JSXAttributeName, $Y(JSXAttributeSpace)), function($skip, $loc, $0, $1, $2, $3) {
13390
13445
  var toggle = $1;
13391
13446
  var id = $2;
13392
13447
  const value = toggle === "+" ? "true" : "false";
@@ -13396,11 +13451,11 @@ ${input.slice(result.pos)}
13396
13451
  function JSXAttribute(ctx, state) {
13397
13452
  return $EVENT_C(ctx, state, "JSXAttribute", JSXAttribute$$);
13398
13453
  }
13399
- var JSXAttributeSpace$0 = $R$0($EXPECT($R74, "JSXAttributeSpace /[\\s>]|\\/>/"));
13454
+ var JSXAttributeSpace$0 = $R$0($EXPECT($R75, "JSXAttributeSpace /[\\s>]|\\/>/"));
13400
13455
  function JSXAttributeSpace(ctx, state) {
13401
13456
  return $EVENT(ctx, state, "JSXAttributeSpace", JSXAttributeSpace$0);
13402
13457
  }
13403
- var JSXShorthandString$0 = $TR($EXPECT($R75, "JSXShorthandString /(?:[\\w\\-:]+|\\([^()]*\\)|\\[[^\\[\\]]*\\])+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
13458
+ var JSXShorthandString$0 = $TR($EXPECT($R76, "JSXShorthandString /(?:[\\w\\-:]+|\\([^()]*\\)|\\[[^\\[\\]]*\\])+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
13404
13459
  return quoteString($0);
13405
13460
  });
13406
13461
  var JSXShorthandString$1 = $TS($S(TemplateLiteral), function($skip, $loc, $0, $1) {
@@ -13434,7 +13489,7 @@ ${input.slice(result.pos)}
13434
13489
  }
13435
13490
  return [open, value, close];
13436
13491
  });
13437
- var JSXAttributeValue$4 = $R$0($EXPECT($R76, `JSXAttributeValue /"[^"]*"|'[^']*'/`));
13492
+ var JSXAttributeValue$4 = $R$0($EXPECT($R77, `JSXAttributeValue /"[^"]*"|'[^']*'/`));
13438
13493
  var JSXAttributeValue$$ = [JSXAttributeValue$0, JSXAttributeValue$1, JSXAttributeValue$2, JSXAttributeValue$3, JSXAttributeValue$4];
13439
13494
  function JSXAttributeValue(ctx, state) {
13440
13495
  return $EVENT_C(ctx, state, "JSXAttributeValue", JSXAttributeValue$$);
@@ -13447,7 +13502,7 @@ ${input.slice(result.pos)}
13447
13502
  function InlineJSXAttributeValue(ctx, state) {
13448
13503
  return $EVENT(ctx, state, "InlineJSXAttributeValue", InlineJSXAttributeValue$0);
13449
13504
  }
13450
- var InlineJSXBinaryOpRHS$0 = $TS($S($N($EXPECT($R77, "InlineJSXBinaryOpRHS /[<>]/")), BinaryOp, InlineJSXUnaryExpression), function($skip, $loc, $0, $1, $2, $3) {
13505
+ var InlineJSXBinaryOpRHS$0 = $TS($S($N($EXPECT($R78, "InlineJSXBinaryOpRHS /[<>]/")), BinaryOp, InlineJSXUnaryExpression), function($skip, $loc, $0, $1, $2, $3) {
13451
13506
  var op = $2;
13452
13507
  var rhs = $3;
13453
13508
  return [[], op, [], rhs];
@@ -13464,7 +13519,7 @@ ${input.slice(result.pos)}
13464
13519
  function InlineJSXUnaryExpression(ctx, state) {
13465
13520
  return $EVENT(ctx, state, "InlineJSXUnaryExpression", InlineJSXUnaryExpression$0);
13466
13521
  }
13467
- var InlineJSXUnaryOp$0 = $TR($EXPECT($R78, "InlineJSXUnaryOp /[!~+-](?!\\s|[!~+-]*&)/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
13522
+ var InlineJSXUnaryOp$0 = $TR($EXPECT($R79, "InlineJSXUnaryOp /[!~+-](?!\\s|[!~+-]*&)/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
13468
13523
  return { $loc, token: $0 };
13469
13524
  });
13470
13525
  function InlineJSXUnaryOp(ctx, state) {
@@ -13680,13 +13735,13 @@ ${input.slice(result.pos)}
13680
13735
  function JSXComment(ctx, state) {
13681
13736
  return $EVENT(ctx, state, "JSXComment", JSXComment$0);
13682
13737
  }
13683
- var JSXCommentContent$0 = $TR($EXPECT($R79, "JSXCommentContent /(?:-[^-]|[^-]*)*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
13738
+ var JSXCommentContent$0 = $TR($EXPECT($R80, "JSXCommentContent /(?:-[^-]|[^-]*)*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
13684
13739
  return { $loc, token: $0.replace(/\*\//g, "* /") };
13685
13740
  });
13686
13741
  function JSXCommentContent(ctx, state) {
13687
13742
  return $EVENT(ctx, state, "JSXCommentContent", JSXCommentContent$0);
13688
13743
  }
13689
- var JSXText$0 = $TR($EXPECT($R80, "JSXText /[^{}<>\\r\\n]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
13744
+ var JSXText$0 = $TR($EXPECT($R81, "JSXText /[^{}<>\\r\\n]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
13690
13745
  return {
13691
13746
  type: "JSXText",
13692
13747
  token: $0,
@@ -14107,7 +14162,7 @@ ${input.slice(result.pos)}
14107
14162
  function TypeProperty(ctx, state) {
14108
14163
  return $EVENT(ctx, state, "TypeProperty", TypeProperty$0);
14109
14164
  }
14110
- 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)))));
14165
+ 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)))));
14111
14166
  function TypeIndexSignature(ctx, state) {
14112
14167
  return $EVENT(ctx, state, "TypeIndexSignature", TypeIndexSignature$0);
14113
14168
  }
@@ -14127,11 +14182,13 @@ ${input.slice(result.pos)}
14127
14182
  return { "type": "TypeSuffix", "ts": true, "optional": optional, "children": value };
14128
14183
  });
14129
14184
  var TypeSuffix$2 = $TS($S(NonNullAssertion, $E(_), $E($S(Colon, MaybeIndentedType))), function($skip, $loc, $0, $1, $2, $3) {
14185
+ var nonnull = $1;
14130
14186
  var ct = $3;
14131
14187
  const [colon, t] = ct ?? [];
14132
14188
  return {
14133
14189
  type: "TypeSuffix",
14134
14190
  ts: true,
14191
+ nonnull,
14135
14192
  t,
14136
14193
  children: [$1, $2, colon, t]
14137
14194
  };
@@ -14401,7 +14458,7 @@ ${input.slice(result.pos)}
14401
14458
  function NestedType(ctx, state) {
14402
14459
  return $EVENT(ctx, state, "NestedType", NestedType$0);
14403
14460
  }
14404
- var TypeConditional$0 = $TS($S($E(_), $EXPECT($R82, "TypeConditional /(?=if|unless)/"), TypeIfThenElse), function($skip, $loc, $0, $1, $2, $3) {
14461
+ var TypeConditional$0 = $TS($S($E(_), $EXPECT($R83, "TypeConditional /(?=if|unless)/"), TypeIfThenElse), function($skip, $loc, $0, $1, $2, $3) {
14405
14462
  return [$1, expressionizeTypeIf($3)];
14406
14463
  });
14407
14464
  var TypeConditional$1 = $TS($S(TypeCondition, NotDedented, QuestionMark, Type, __, Colon, Type), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
@@ -14601,15 +14658,15 @@ ${input.slice(result.pos)}
14601
14658
  function ThisType(ctx, state) {
14602
14659
  return $EVENT(ctx, state, "ThisType", ThisType$0);
14603
14660
  }
14604
- var Shebang$0 = $S($R$0($EXPECT($R83, "Shebang /#![^\\r\\n]*/")), EOL);
14661
+ var Shebang$0 = $S($R$0($EXPECT($R84, "Shebang /#![^\\r\\n]*/")), EOL);
14605
14662
  function Shebang(ctx, state) {
14606
14663
  return $EVENT(ctx, state, "Shebang", Shebang$0);
14607
14664
  }
14608
- var CivetPrologue$0 = $T($S($EXPECT($R84, "CivetPrologue /[\\t ]*/"), DoubleQuote, CivetPrologueContent, DoubleQuote, SimpleStatementDelimiter, $EXPECT($R85, "CivetPrologue /[ \\t]*/"), $C(EOL, $Y(RestOfLine))), function(value) {
14665
+ var CivetPrologue$0 = $T($S($EXPECT($R85, "CivetPrologue /[\\t ]*/"), DoubleQuote, CivetPrologueContent, DoubleQuote, SimpleStatementDelimiter, $EXPECT($R86, "CivetPrologue /[ \\t]*/"), $C(EOL, $Y(RestOfLine))), function(value) {
14609
14666
  var content = value[2];
14610
14667
  return content;
14611
14668
  });
14612
- var CivetPrologue$1 = $T($S($EXPECT($R84, "CivetPrologue /[\\t ]*/"), SingleQuote, CivetPrologueContent, SingleQuote, SimpleStatementDelimiter, $EXPECT($R85, "CivetPrologue /[ \\t]*/"), $C(EOL, $Y(RestOfLine))), function(value) {
14669
+ var CivetPrologue$1 = $T($S($EXPECT($R85, "CivetPrologue /[\\t ]*/"), SingleQuote, CivetPrologueContent, SingleQuote, SimpleStatementDelimiter, $EXPECT($R86, "CivetPrologue /[ \\t]*/"), $C(EOL, $Y(RestOfLine))), function(value) {
14613
14670
  var content = value[2];
14614
14671
  return content;
14615
14672
  });
@@ -14617,7 +14674,7 @@ ${input.slice(result.pos)}
14617
14674
  function CivetPrologue(ctx, state) {
14618
14675
  return $EVENT_C(ctx, state, "CivetPrologue", CivetPrologue$$);
14619
14676
  }
14620
- var CivetPrologueContent$0 = $TS($S($EXPECT($L226, 'CivetPrologueContent "civet"'), NonIdContinue, $Q(CivetOption), $EXPECT($R86, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3, $4) {
14677
+ var CivetPrologueContent$0 = $TS($S($EXPECT($L226, 'CivetPrologueContent "civet"'), NonIdContinue, $Q(CivetOption), $EXPECT($R87, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3, $4) {
14621
14678
  var options = $3;
14622
14679
  return {
14623
14680
  type: "CivetPrologue",
@@ -14628,7 +14685,7 @@ ${input.slice(result.pos)}
14628
14685
  function CivetPrologueContent(ctx, state) {
14629
14686
  return $EVENT(ctx, state, "CivetPrologueContent", CivetPrologueContent$0);
14630
14687
  }
14631
- 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) {
14688
+ 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) {
14632
14689
  const optionName = $2.replace(/-+([a-z]?)/g, (_2, l) => {
14633
14690
  if (l)
14634
14691
  return l.toUpperCase();
@@ -14645,11 +14702,11 @@ ${input.slice(result.pos)}
14645
14702
  function CivetOption(ctx, state) {
14646
14703
  return $EVENT(ctx, state, "CivetOption", CivetOption$0);
14647
14704
  }
14648
- var UnknownPrologue$0 = $S($R$0($EXPECT($R84, "UnknownPrologue /[\\t ]*/")), StringLiteral, $TEXT(SimpleStatementDelimiter), EOS);
14705
+ var UnknownPrologue$0 = $S($R$0($EXPECT($R85, "UnknownPrologue /[\\t ]*/")), StringLiteral, $TEXT(SimpleStatementDelimiter), EOS);
14649
14706
  function UnknownPrologue(ctx, state) {
14650
14707
  return $EVENT(ctx, state, "UnknownPrologue", UnknownPrologue$0);
14651
14708
  }
14652
- var TripleSlashDirective$0 = $S($R$0($EXPECT($R88, "TripleSlashDirective /\\/\\/\\/[^\\r\\n]*/")), $E(EOS));
14709
+ var TripleSlashDirective$0 = $S($R$0($EXPECT($R89, "TripleSlashDirective /\\/\\/\\/[^\\r\\n]*/")), $E(EOS));
14653
14710
  function TripleSlashDirective(ctx, state) {
14654
14711
  return $EVENT(ctx, state, "TripleSlashDirective", TripleSlashDirective$0);
14655
14712
  }
@@ -14665,13 +14722,13 @@ ${input.slice(result.pos)}
14665
14722
  function PrologueString(ctx, state) {
14666
14723
  return $EVENT_C(ctx, state, "PrologueString", PrologueString$$);
14667
14724
  }
14668
- var EOS$0 = $T($S($EXPECT($R89, "EOS /(?=[ \\t\\r\\n\\/#]|$)/"), $P(RestOfLine)), function(value) {
14725
+ var EOS$0 = $T($S($EXPECT($R90, "EOS /(?=[ \\t\\r\\n\\/#]|$)/"), $P(RestOfLine)), function(value) {
14669
14726
  return value[1];
14670
14727
  });
14671
14728
  function EOS(ctx, state) {
14672
14729
  return $EVENT(ctx, state, "EOS", EOS$0);
14673
14730
  }
14674
- var EOL$0 = $TR($EXPECT($R90, "EOL /\\r\\n|\\n|\\r|$/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
14731
+ var EOL$0 = $TR($EXPECT($R91, "EOL /\\r\\n|\\n|\\r|$/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
14675
14732
  return { $loc, token: $0 };
14676
14733
  });
14677
14734
  function EOL(ctx, state) {
@@ -15243,11 +15300,11 @@ ${input.slice(result.pos)}
15243
15300
  function Prologue(ctx, state) {
15244
15301
  return $EVENT(ctx, state, "Prologue", Prologue$0);
15245
15302
  }
15246
- var ProloguePrefix$0 = $S(Prologue, $R$0($EXPECT($R91, "ProloguePrefix /[^]*/")));
15303
+ var ProloguePrefix$0 = $S(Prologue, $R$0($EXPECT($R92, "ProloguePrefix /[^]*/")));
15247
15304
  function ProloguePrefix(ctx, state) {
15248
15305
  return $EVENT(ctx, state, "ProloguePrefix", ProloguePrefix$0);
15249
15306
  }
15250
- var Indent$0 = $TR($EXPECT($R85, "Indent /[ \\t]*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
15307
+ var Indent$0 = $TR($EXPECT($R86, "Indent /[ \\t]*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
15251
15308
  const level = getIndentLevel($0, module.config.tab);
15252
15309
  return {
15253
15310
  $loc,
@@ -15471,6 +15528,7 @@ ${input.slice(result.pos)}
15471
15528
  exports.MemberBracketContent = MemberBracketContent;
15472
15529
  exports.SliceParameters = SliceParameters;
15473
15530
  exports.AccessStart = AccessStart;
15531
+ exports.ImplicitAccessStart = ImplicitAccessStart;
15474
15532
  exports.PropertyAccessModifier = PropertyAccessModifier;
15475
15533
  exports.PropertyAccess = PropertyAccess;
15476
15534
  exports.PropertyGlob = PropertyGlob;
@@ -15605,6 +15663,7 @@ ${input.slice(result.pos)}
15605
15663
  exports.BinaryOp = BinaryOp;
15606
15664
  exports._BinaryOp = _BinaryOp;
15607
15665
  exports.BinaryOpSymbol = BinaryOpSymbol;
15666
+ exports.ActualIn = ActualIn;
15608
15667
  exports.CoffeeOfOp = CoffeeOfOp;
15609
15668
  exports.NotOp = NotOp;
15610
15669
  exports.Xor = Xor;
@@ -16620,10 +16679,13 @@ ${input.slice(result.pos)}
16620
16679
  let ast;
16621
16680
  try {
16622
16681
  import_parser.parse.config = options.parseOptions || {};
16623
- ast = prune((0, import_parser.parse)(src, {
16682
+ ast = (0, import_parser.parse)(src, {
16624
16683
  filename,
16625
16684
  events
16626
- }));
16685
+ });
16686
+ if (!(options.ast === "raw")) {
16687
+ ast = prune(ast);
16688
+ }
16627
16689
  } finally {
16628
16690
  if (hits || trace) {
16629
16691
  import("fs").then(function({ writeFileSync }) {