@danielx/civet 0.8.10 → 0.8.11

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
@@ -1825,17 +1825,14 @@ var declareHelper = {
1825
1825
  preludeVar,
1826
1826
  rsliceRef,
1827
1827
  ts([": <R, T extends string | ", RSliceable, "<R>>(a: T, start?: number, end?: number) => T extends string ? string : T extends ", RSliceable, "<infer R> ? R : never"]),
1828
- " = ((a, start, end) => {\n",
1828
+ " = ((a, start = -1, end = -1) => {\n",
1829
1829
  " const l = a.length\n",
1830
- " start = ",
1831
- getHelperRef("modulo"),
1832
- "(start ?? -1, l)\n",
1833
- " end = ",
1834
- getHelperRef("modulo"),
1835
- "((end ?? -1) + 1, l)\n",
1830
+ " if (start < 0) start += l\n",
1831
+ " if (++end < 0) end += l\n",
1836
1832
  " if (typeof a === 'string') {\n",
1837
- ` let r = ""
1838
- `,
1833
+ ' let r = ""\n',
1834
+ " if (start > l-1) start = l-1\n",
1835
+ " if (end < 0) end = 0\n",
1839
1836
  " for (let i = start; i >= end; --i) r += a[i]\n",
1840
1837
  " return r",
1841
1838
  asAny,
@@ -6203,7 +6200,7 @@ function processTryBlock($0) {
6203
6200
  let [t, , b, cs, e, f] = $0;
6204
6201
  let c;
6205
6202
  let m;
6206
- if (cs.some(($) => (m = $.binding?.parameter, typeof m === "object" && m != null && "type" in m && m.type === "CatchPattern"))) {
6203
+ if (cs.some(($3) => (m = $3.binding?.parameter, typeof m === "object" && m != null && "type" in m && m.type === "CatchPattern"))) {
6207
6204
  const ref = makeRef("e");
6208
6205
  const binding = {
6209
6206
  type: "CatchBinding",
@@ -6552,26 +6549,33 @@ function processCallMemberExpression(node) {
6552
6549
  ...glob.children.slice(1, -1)
6553
6550
  ];
6554
6551
  let ref3;
6555
- return makeNode({
6556
- ...node,
6552
+ const rsliceCall = makeNode({
6553
+ type: "CallExpression",
6554
+ implicit: true,
6557
6555
  children: [
6558
- {
6559
- type: "CallExpression",
6556
+ getHelperRef("rslice"),
6557
+ makeNode({
6558
+ type: "Call",
6559
+ args,
6560
6560
  children: [
6561
- getHelperRef("rslice"),
6562
- makeNode({
6563
- type: "Call",
6564
- args,
6565
- children: [
6566
- "(",
6567
- args,
6568
- (ref3 = glob.children)[ref3.length - 1]
6569
- ]
6570
- })
6561
+ "(",
6562
+ args,
6563
+ (ref3 = glob.children)[ref3.length - 1]
6571
6564
  ]
6572
- }
6565
+ })
6573
6566
  ]
6574
6567
  });
6568
+ if (i + 1 >= children.length) {
6569
+ return rsliceCall;
6570
+ }
6571
+ return processCallMemberExpression(makeNode({
6572
+ // in case there are more
6573
+ ...node,
6574
+ children: [
6575
+ rsliceCall,
6576
+ ...children.slice(i + 1)
6577
+ ]
6578
+ }));
6575
6579
  }
6576
6580
  }
6577
6581
  return node;
@@ -6796,7 +6800,7 @@ function processBindingPatternLHS(lhs, tail) {
6796
6800
  tail.push(...splices.map((s) => [", ", s]), ...thisAssignments.map((a) => [", ", a]));
6797
6801
  }
6798
6802
  function processAssignments(statements) {
6799
- for (let ref6 = gatherRecursiveAll(statements, ($3) => $3.type === "AssignmentExpression" || $3.type === "UpdateExpression"), i5 = 0, len4 = ref6.length; i5 < len4; i5++) {
6803
+ for (let ref6 = gatherRecursiveAll(statements, ($4) => $4.type === "AssignmentExpression" || $4.type === "UpdateExpression"), i5 = 0, len4 = ref6.length; i5 < len4; i5++) {
6800
6804
  let extractAssignment2 = function(lhs) {
6801
6805
  let expr = lhs;
6802
6806
  while (expr.type === "ParenthesizedExpression") {
@@ -6857,7 +6861,7 @@ function processAssignments(statements) {
6857
6861
  const { assigned } = exp;
6858
6862
  const ref = makeRef();
6859
6863
  const newMemberExp = unchainOptionalMemberExpression(assigned, ref, (children) => {
6860
- return exp.children.map(($4) => $4 === assigned ? children : $4);
6864
+ return exp.children.map(($5) => $5 === assigned ? children : $5);
6861
6865
  });
6862
6866
  if (newMemberExp !== assigned) {
6863
6867
  if (newMemberExp.usesRef) {
@@ -6871,7 +6875,7 @@ function processAssignments(statements) {
6871
6875
  }
6872
6876
  }
6873
6877
  }
6874
- for (let ref10 = gatherRecursiveAll(statements, ($5) => $5.type === "AssignmentExpression"), i7 = 0, len6 = ref10.length; i7 < len6; i7++) {
6878
+ for (let ref10 = gatherRecursiveAll(statements, ($6) => $6.type === "AssignmentExpression"), i7 = 0, len6 = ref10.length; i7 < len6; i7++) {
6875
6879
  const exp = ref10[i7];
6876
6880
  if (!(exp.names === null)) {
6877
6881
  continue;
@@ -6887,14 +6891,14 @@ function processAssignments(statements) {
6887
6891
  block
6888
6892
  )) {
6889
6893
  const ref = ref12;
6890
- exp.children = exp.children.map(($6) => $6 === $2 ? ref : $6);
6894
+ exp.children = exp.children.map(($7) => $7 === $2 ? ref : $7);
6891
6895
  $2 = ref;
6892
6896
  } else {
6893
6897
  block = void 0;
6894
6898
  }
6895
6899
  }
6896
6900
  let ref13;
6897
- if ($1.some(($7) => (ref13 = $7)[ref13.length - 1].special)) {
6901
+ if ($1.some(($8) => (ref13 = $8)[ref13.length - 1].special)) {
6898
6902
  if ($1.length !== 1)
6899
6903
  throw new Error("Only one assignment with id= is allowed");
6900
6904
  const [, lhs, , op] = $1[0];
@@ -6939,13 +6943,6 @@ function processAssignments(statements) {
6939
6943
  if (lhs.type === "MemberExpression") {
6940
6944
  const members = lhs.children;
6941
6945
  const lastMember = members[members.length - 1];
6942
- if (typeof lastMember === "object" && lastMember != null && "type" in lastMember && lastMember.type === "CallExpression" && "children" in lastMember && Array.isArray(lastMember.children) && lastMember.children.length >= 1 && lastMember.children[0] === peekHelperRef("rslice")) {
6943
- lastMember.children.push({
6944
- type: "Error",
6945
- message: "Slice range cannot be decreasing in assignment"
6946
- });
6947
- break;
6948
- }
6949
6946
  if (lastMember.type === "SliceExpression") {
6950
6947
  const { start, end, children: c } = lastMember;
6951
6948
  c[0].token = ".splice(";
@@ -6968,9 +6965,15 @@ function processAssignments(statements) {
6968
6965
  exp.names = [];
6969
6966
  break;
6970
6967
  }
6968
+ } else if (typeof lhs === "object" && lhs != null && "type" in lhs && lhs.type === "CallExpression" && "children" in lhs && Array.isArray(lhs.children) && lhs.children.length >= 1 && lhs.children[0] === peekHelperRef("rslice")) {
6969
+ lhs.children.push({
6970
+ type: "Error",
6971
+ message: "Slice range cannot be decreasing in assignment"
6972
+ });
6973
+ break;
6971
6974
  } else if (m3 = lhs.type, m3 === "ObjectBindingPattern" || m3 === "ArrayBindingPattern") {
6972
6975
  processBindingPatternLHS(lhs, tail);
6973
- gatherRecursiveAll(lhs, ($8) => $8.type === "Ref").forEach(refsToDeclare.add.bind(refsToDeclare));
6976
+ gatherRecursiveAll(lhs, ($9) => $9.type === "Ref").forEach(refsToDeclare.add.bind(refsToDeclare));
6974
6977
  }
6975
6978
  }
6976
6979
  i--;
@@ -7002,7 +7005,7 @@ function processAssignments(statements) {
7002
7005
  }
7003
7006
  if (refsToDeclare.size) {
7004
7007
  if (exp.hoistDec) {
7005
- exp.hoistDec.children.push([...refsToDeclare].map(($9) => [",", $9]));
7008
+ exp.hoistDec.children.push([...refsToDeclare].map(($10) => [",", $10]));
7006
7009
  } else {
7007
7010
  exp.hoistDec = {
7008
7011
  type: "Declaration",
@@ -7193,7 +7196,7 @@ function processTypes(node) {
7193
7196
  });
7194
7197
  }
7195
7198
  function processStatementExpressions(statements) {
7196
- for (let ref21 = gatherRecursiveAll(statements, ($10) => $10.type === "StatementExpression"), i8 = 0, len7 = ref21.length; i8 < len7; i8++) {
7199
+ for (let ref21 = gatherRecursiveAll(statements, ($11) => $11.type === "StatementExpression"), i8 = 0, len7 = ref21.length; i8 < len7; i8++) {
7197
7200
  const exp = ref21[i8];
7198
7201
  const { maybe, statement } = exp;
7199
7202
  if ((maybe || statement.type === "ThrowStatement") && blockContainingStatement(exp)) {
@@ -7275,7 +7278,7 @@ function processProgram(root) {
7275
7278
  if (config2.iife || config2.repl) {
7276
7279
  rootIIFE = wrapIIFE(root.expressions, root.topLevelAwait);
7277
7280
  const newExpressions = [["", rootIIFE]];
7278
- root.children = root.children.map(($11) => $11 === root.expressions ? newExpressions : $11);
7281
+ root.children = root.children.map(($12) => $12 === root.expressions ? newExpressions : $12);
7279
7282
  root.expressions = newExpressions;
7280
7283
  }
7281
7284
  addParentPointers(root);
@@ -7315,16 +7318,16 @@ async function processProgramAsync(root) {
7315
7318
  await processComptime(statements);
7316
7319
  }
7317
7320
  function processRepl(root, rootIIFE) {
7318
- const topBlock = gatherRecursive(rootIIFE, ($12) => $12.type === "BlockStatement")[0];
7321
+ const topBlock = gatherRecursive(rootIIFE, ($13) => $13.type === "BlockStatement")[0];
7319
7322
  let i = 0;
7320
- for (let ref23 = gatherRecursiveWithinFunction(topBlock, ($13) => $13.type === "Declaration"), i9 = 0, len8 = ref23.length; i9 < len8; i9++) {
7323
+ for (let ref23 = gatherRecursiveWithinFunction(topBlock, ($14) => $14.type === "Declaration"), i9 = 0, len8 = ref23.length; i9 < len8; i9++) {
7321
7324
  const decl = ref23[i9];
7322
7325
  if (decl.parent === topBlock || decl.decl === "var") {
7323
7326
  decl.children.shift();
7324
7327
  root.expressions.splice(i++, 0, ["", `var ${decl.names.join(",")};`]);
7325
7328
  }
7326
7329
  }
7327
- for (let ref24 = gatherRecursive(topBlock, ($14) => $14.type === "FunctionExpression"), i10 = 0, len9 = ref24.length; i10 < len9; i10++) {
7330
+ for (let ref24 = gatherRecursive(topBlock, ($15) => $15.type === "FunctionExpression"), i10 = 0, len9 = ref24.length; i10 < len9; i10++) {
7328
7331
  const func = ref24[i10];
7329
7332
  if (func.name && func.parent?.type === "BlockStatement") {
7330
7333
  if (func.parent === topBlock) {
@@ -7337,7 +7340,7 @@ function processRepl(root, rootIIFE) {
7337
7340
  }
7338
7341
  }
7339
7342
  }
7340
- for (let ref25 = gatherRecursiveWithinFunction(topBlock, ($15) => $15.type === "ClassExpression"), i11 = 0, len10 = ref25.length; i11 < len10; i11++) {
7343
+ for (let ref25 = gatherRecursiveWithinFunction(topBlock, ($16) => $16.type === "ClassExpression"), i11 = 0, len10 = ref25.length; i11 < len10; i11++) {
7341
7344
  const classExp = ref25[i11];
7342
7345
  let m5;
7343
7346
  if (classExp.name && classExp.parent === topBlock || (m5 = classExp.parent, typeof m5 === "object" && m5 != null && "type" in m5 && m5.type === "ReturnStatement" && "parent" in m5 && m5.parent === topBlock)) {
@@ -7347,7 +7350,7 @@ function processRepl(root, rootIIFE) {
7347
7350
  }
7348
7351
  }
7349
7352
  function populateRefs(statements) {
7350
- const refNodes = gatherRecursive(statements, ($16) => $16.type === "Ref");
7353
+ const refNodes = gatherRecursive(statements, ($17) => $17.type === "Ref");
7351
7354
  if (refNodes.length) {
7352
7355
  const ids = gatherRecursive(statements, (s) => s.type === "Identifier");
7353
7356
  const names = new Set(ids.flatMap(({ names: names2 }) => names2 || []));
@@ -7370,11 +7373,14 @@ function populateRefs(statements) {
7370
7373
  function processPlaceholders(statements) {
7371
7374
  const placeholderMap = /* @__PURE__ */ new Map();
7372
7375
  const liftedIfs = /* @__PURE__ */ new Set();
7373
- for (let ref26 = gatherRecursiveAll(statements, ($17) => $17.type === "Placeholder"), i12 = 0, len11 = ref26.length; i12 < len11; i12++) {
7376
+ for (let ref26 = gatherRecursiveAll(statements, ($18) => $18.type === "Placeholder"), i12 = 0, len11 = ref26.length; i12 < len11; i12++) {
7374
7377
  const exp = ref26[i12];
7375
7378
  let ancestor;
7376
7379
  if (exp.subtype === ".") {
7377
- ({ ancestor } = findAncestor(exp, ($18) => $18.type === "Call"));
7380
+ ({ ancestor } = findAncestor(
7381
+ exp,
7382
+ ($) => $.type === "Call" && !$.parent?.implicit
7383
+ ));
7378
7384
  ancestor = ancestor?.parent;
7379
7385
  let m6;
7380
7386
  while (ancestor?.parent != null && (m6 = ancestor.parent.type, m6 === "UnaryExpression" || m6 === "NewExpression" || m6 === "AwaitExpression" || m6 === "ThrowStatement" || m6 === "StatementExpression")) {
@@ -7396,7 +7402,7 @@ function processPlaceholders(statements) {
7396
7402
  }
7397
7403
  let m7;
7398
7404
  let m8;
7399
- return type === "Call" || // Block, except for if/else blocks when condition already lifted
7405
+ return type === "Call" && !ancestor2.parent?.implicit || // Block, except for if/else blocks when condition already lifted
7400
7406
  type === "BlockStatement" && !((m7 = ancestor2.parent, typeof m7 === "object" && m7 != null && "type" in m7 && m7.type === "IfStatement") && liftedIfs.has(ancestor2.parent)) && !((m8 = ancestor2.parent, typeof m8 === "object" && m8 != null && "type" in m8 && m8.type === "ElseClause" && "parent" in m8 && typeof m8.parent === "object" && m8.parent != null && "type" in m8.parent && m8.parent.type === "IfStatement") && liftedIfs.has(ancestor2.parent.parent)) || type === "PipelineExpression" || // Declaration
7401
7407
  type === "Initializer" || // Right-hand side of assignment
7402
7408
  type === "AssignmentExpression" && findChildIndex(ancestor2, child2) === ancestor2.children.indexOf(ancestor2.expression) || type === "ReturnStatement" || type === "YieldExpression";
@@ -7698,7 +7704,9 @@ var grammar = {
7698
7704
  TrailingCallExpressions,
7699
7705
  AllowedTrailingCallExpressions,
7700
7706
  CommaDelimiter,
7707
+ OptionalCommaDelimiter,
7701
7708
  ArgumentList,
7709
+ NestedArguments,
7702
7710
  NestedArgumentList,
7703
7711
  NestedArgument,
7704
7712
  SingleLineArgumentExpressions,
@@ -7896,6 +7904,7 @@ var grammar = {
7896
7904
  ArrayLiteral,
7897
7905
  _ArrayLiteral,
7898
7906
  RangeDots,
7907
+ OptionalRangeEnd,
7899
7908
  RangeEnd,
7900
7909
  RangeExpression,
7901
7910
  ArrayLiteralContent,
@@ -7912,6 +7921,7 @@ var grammar = {
7912
7921
  ArrayBullet,
7913
7922
  ArrayBulletDelimiter,
7914
7923
  BulletIndent,
7924
+ Bullet,
7915
7925
  BulletedArrayWithTrailing,
7916
7926
  ObjectLiteral,
7917
7927
  BracedObjectLiteral,
@@ -9004,7 +9014,6 @@ var ImplicitArguments$0 = (0, import_lib5.$TS)((0, import_lib5.$S)(ApplicationSt
9004
9014
  return $skip;
9005
9015
  if (skipImplicitArguments(args))
9006
9016
  return $skip;
9007
- args = stripTrailingImplicitComma(args);
9008
9017
  return {
9009
9018
  type: "Call",
9010
9019
  args,
@@ -9045,7 +9054,7 @@ function ApplicationStart(ctx, state2) {
9045
9054
  }
9046
9055
  var ForbiddenImplicitCalls$0 = ReservedBinary;
9047
9056
  var ForbiddenImplicitCalls$1 = (0, import_lib5.$EXPECT)($L2, 'ForbiddenImplicitCalls "/ "');
9048
- var ForbiddenImplicitCalls$2 = (0, import_lib5.$S)((0, import_lib5.$Y)((0, import_lib5.$S)((0, import_lib5.$R$0)((0, import_lib5.$EXPECT)($R1, "ForbiddenImplicitCalls /&(?=\\s)/")), (0, import_lib5.$N)((0, import_lib5.$S)(NotDedented, (0, import_lib5.$C)(Ampersand, ReservedBinary))), (0, import_lib5.$C)(IndentedFurther, (0, import_lib5.$N)(EOS)))), BinaryOpRHS);
9057
+ var ForbiddenImplicitCalls$2 = (0, import_lib5.$S)((0, import_lib5.$Y)((0, import_lib5.$S)((0, import_lib5.$R$0)((0, import_lib5.$EXPECT)($R1, "ForbiddenImplicitCalls /&(?=\\s)/")), (0, import_lib5.$N)((0, import_lib5.$S)(NotDedented, ReservedBinary)), (0, import_lib5.$N)((0, import_lib5.$S)((0, import_lib5.$Y)((0, import_lib5.$S)(NotDedented, Ampersand, (0, import_lib5.$C)(IndentedFurther, (0, import_lib5.$N)(EOS)))), BinaryOpRHS)), (0, import_lib5.$C)(IndentedFurther, (0, import_lib5.$N)(EOS)))), BinaryOpRHS);
9049
9058
  var ForbiddenImplicitCalls$3 = (0, import_lib5.$S)(ClassImplicitCallForbidden, (0, import_lib5.$C)(Class, AtAt));
9050
9059
  var ForbiddenImplicitCalls$4 = (0, import_lib5.$S)(Identifier, (0, import_lib5.$EXPECT)($L3, 'ForbiddenImplicitCalls "="'), Whitespace);
9051
9060
  var ForbiddenImplicitCalls$5 = (0, import_lib5.$TS)((0, import_lib5.$S)(Identifier, (0, import_lib5.$N)((0, import_lib5.$EXPECT)($L4, 'ForbiddenImplicitCalls "("'))), function($skip, $loc, $0, $1, $2) {
@@ -9114,47 +9123,64 @@ var CommaDelimiter$0 = (0, import_lib5.$S)(NotDedented, Comma);
9114
9123
  function CommaDelimiter(ctx, state2) {
9115
9124
  return (0, import_lib5.$EVENT)(ctx, state2, "CommaDelimiter", CommaDelimiter$0);
9116
9125
  }
9117
- var ArgumentList$0 = (0, import_lib5.$TS)((0, import_lib5.$S)((0, import_lib5.$N)(EOS), ArgumentPart, (0, import_lib5.$Q)((0, import_lib5.$S)(CommaDelimiter, (0, import_lib5.$N)(EOS), (0, import_lib5.$E)(_), ArgumentPart)), (0, import_lib5.$P)((0, import_lib5.$S)(CommaDelimiter, (0, import_lib5.$C)(NestedBulletedArray, NestedImplicitObjectLiteral, NestedArgumentList)))), function($skip, $loc, $0, $1, $2, $3, $4) {
9126
+ var OptionalCommaDelimiter$0 = CommaDelimiter;
9127
+ var OptionalCommaDelimiter$1 = (0, import_lib5.$T)((0, import_lib5.$S)((0, import_lib5.$Y)(EOS), InsertComma), function(value) {
9128
+ return value[1];
9129
+ });
9130
+ var OptionalCommaDelimiter$$ = [OptionalCommaDelimiter$0, OptionalCommaDelimiter$1];
9131
+ function OptionalCommaDelimiter(ctx, state2) {
9132
+ return (0, import_lib5.$EVENT_C)(ctx, state2, "OptionalCommaDelimiter", OptionalCommaDelimiter$$);
9133
+ }
9134
+ var ArgumentList$0 = (0, import_lib5.$TS)((0, import_lib5.$S)((0, import_lib5.$N)(EOS), ArgumentPart, (0, import_lib5.$Q)((0, import_lib5.$S)(CommaDelimiter, (0, import_lib5.$N)(EOS), (0, import_lib5.$E)(_), ArgumentPart)), (0, import_lib5.$S)(CommaDelimiter, NestedArguments), (0, import_lib5.$Q)((0, import_lib5.$S)(OptionalCommaDelimiter, NestedArguments))), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
9118
9135
  return [
9119
9136
  $2,
9120
9137
  ...$3.flatMap(([comma, eos, ws, arg]) => [comma, prepend(ws, arg)]),
9121
- ...$4.flatMap(
9138
+ ...Array.isArray($4[1]) ? [$4[0], ...$4[1]] : $4,
9139
+ ...$5.flatMap(
9122
9140
  ([comma, args]) => Array.isArray(args) ? [comma, ...args] : [comma, args]
9123
9141
  )
9124
9142
  ];
9125
9143
  });
9126
- var ArgumentList$1 = (0, import_lib5.$TS)((0, import_lib5.$S)((0, import_lib5.$C)(NestedBulletedArray, NestedImplicitObjectLiteral), (0, import_lib5.$Q)((0, import_lib5.$S)(CommaDelimiter, (0, import_lib5.$C)(NestedBulletedArray, NestedImplicitObjectLiteral, NestedArgumentList)))), function($skip, $loc, $0, $1, $2) {
9144
+ var ArgumentList$1 = (0, import_lib5.$TS)((0, import_lib5.$S)(NestedArguments, (0, import_lib5.$Q)((0, import_lib5.$S)(OptionalCommaDelimiter, NestedArguments))), function($skip, $loc, $0, $1, $2) {
9145
+ if (!Array.isArray($1))
9146
+ $1 = [$1];
9127
9147
  return [
9128
- trimFirstSpace($1),
9148
+ ...trimFirstSpace($1),
9129
9149
  ...$2.flatMap(
9130
9150
  ([comma, args]) => Array.isArray(args) ? [comma, ...args] : [comma, args]
9131
9151
  )
9132
9152
  ];
9133
9153
  });
9134
- var ArgumentList$2 = NestedArgumentList;
9135
- var ArgumentList$3 = (0, import_lib5.$TS)((0, import_lib5.$S)((0, import_lib5.$E)(_), ArgumentPart, (0, import_lib5.$Q)((0, import_lib5.$S)(CommaDelimiter, (0, import_lib5.$E)(_), ArgumentPart))), function($skip, $loc, $0, $1, $2, $3) {
9154
+ var ArgumentList$2 = (0, import_lib5.$TS)((0, import_lib5.$S)((0, import_lib5.$E)(_), ArgumentPart, (0, import_lib5.$Q)((0, import_lib5.$S)(CommaDelimiter, (0, import_lib5.$E)(_), ArgumentPart))), function($skip, $loc, $0, $1, $2, $3) {
9136
9155
  return [
9137
9156
  prepend($1, $2),
9138
9157
  ...$3.flatMap(([comma, ws, arg]) => [comma, prepend(ws, arg)])
9139
9158
  ];
9140
9159
  });
9141
- var ArgumentList$$ = [ArgumentList$0, ArgumentList$1, ArgumentList$2, ArgumentList$3];
9160
+ var ArgumentList$$ = [ArgumentList$0, ArgumentList$1, ArgumentList$2];
9142
9161
  function ArgumentList(ctx, state2) {
9143
9162
  return (0, import_lib5.$EVENT_C)(ctx, state2, "ArgumentList", ArgumentList$$);
9144
9163
  }
9164
+ var NestedArguments$0 = NestedBulletedArray;
9165
+ var NestedArguments$1 = NestedImplicitObjectLiteral;
9166
+ var NestedArguments$2 = NestedArgumentList;
9167
+ var NestedArguments$$ = [NestedArguments$0, NestedArguments$1, NestedArguments$2];
9168
+ function NestedArguments(ctx, state2) {
9169
+ return (0, import_lib5.$EVENT_C)(ctx, state2, "NestedArguments", NestedArguments$$);
9170
+ }
9145
9171
  var NestedArgumentList$0 = (0, import_lib5.$TS)((0, import_lib5.$S)(PushIndent, AllowPipeline, AllowTrailingMemberProperty, (0, import_lib5.$Q)(NestedArgument), RestoreTrailingMemberProperty, RestorePipeline, PopIndent), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
9146
9172
  var args = $4;
9147
9173
  if (!args.length)
9148
9174
  return $skip;
9149
- return args.flat();
9175
+ return stripTrailingImplicitComma(args.flat());
9150
9176
  });
9151
9177
  function NestedArgumentList(ctx, state2) {
9152
9178
  return (0, import_lib5.$EVENT)(ctx, state2, "NestedArgumentList", NestedArgumentList$0);
9153
9179
  }
9154
- var NestedArgument$0 = (0, import_lib5.$TS)((0, import_lib5.$S)(Nested, SingleLineArgumentExpressions, ParameterElementDelimiter), function($skip, $loc, $0, $1, $2, $3) {
9180
+ var NestedArgument$0 = (0, import_lib5.$TS)((0, import_lib5.$S)(Nested, (0, import_lib5.$N)(Bullet), SingleLineArgumentExpressions, ParameterElementDelimiter), function($skip, $loc, $0, $1, $2, $3, $4) {
9155
9181
  var indent = $1;
9156
- var args = $2;
9157
- var comma = $3;
9182
+ var args = $3;
9183
+ var comma = $4;
9158
9184
  let [arg0, ...rest] = args;
9159
9185
  arg0 = prepend(indent, arg0);
9160
9186
  return [arg0, ...rest, comma];
@@ -10505,8 +10531,38 @@ var SliceParameters$0 = (0, import_lib5.$TS)((0, import_lib5.$S)(Loc, (0, import
10505
10531
  children
10506
10532
  };
10507
10533
  });
10534
+ var SliceParameters$1 = (0, import_lib5.$TS)((0, import_lib5.$S)(Loc, RangeEnd, Expression), function($skip, $loc, $0, $1, $2, $3) {
10535
+ var l = $1;
10536
+ var rend = $2;
10537
+ var e = $3;
10538
+ let start, end, children;
10539
+ if (rend.increasing) {
10540
+ end = e;
10541
+ if (rend.inclusive) {
10542
+ end = [makeLeftHandSideExpression(end), ` + 1`];
10543
+ }
10544
+ start = {
10545
+ $loc: l.$loc,
10546
+ token: "0"
10547
+ };
10548
+ children = [start, ", ", end];
10549
+ } else {
10550
+ start = e;
10551
+ if (!rend.inclusive) {
10552
+ start = [makeLeftHandSideExpression(start), ` + 1`];
10553
+ }
10554
+ children = [start];
10555
+ }
10556
+ return {
10557
+ type: "SliceParameters",
10558
+ start,
10559
+ end,
10560
+ children
10561
+ };
10562
+ });
10563
+ var SliceParameters$$ = [SliceParameters$0, SliceParameters$1];
10508
10564
  function SliceParameters(ctx, state2) {
10509
- return (0, import_lib5.$EVENT)(ctx, state2, "SliceParameters", SliceParameters$0);
10565
+ return (0, import_lib5.$EVENT_C)(ctx, state2, "SliceParameters", SliceParameters$$);
10510
10566
  }
10511
10567
  var AccessStart$0 = (0, import_lib5.$TS)((0, import_lib5.$S)((0, import_lib5.$E)(PropertyAccessModifier), Dot, (0, import_lib5.$N)((0, import_lib5.$EXPECT)($R11, "AccessStart /[.\\s]/"))), function($skip, $loc, $0, $1, $2, $3) {
10512
10568
  var modifier = $1;
@@ -12230,7 +12286,7 @@ var RangeDots$0 = (0, import_lib5.$TS)((0, import_lib5.$S)(DotDotDot), function(
12230
12286
  children: []
12231
12287
  };
12232
12288
  });
12233
- var RangeDots$1 = (0, import_lib5.$TS)((0, import_lib5.$S)(RangeEnd, (0, import_lib5.$E)(_), DotDot, (0, import_lib5.$E)(_), RangeEnd), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
12289
+ var RangeDots$1 = (0, import_lib5.$TS)((0, import_lib5.$S)(OptionalRangeEnd, (0, import_lib5.$E)(_), DotDot, (0, import_lib5.$E)(_), OptionalRangeEnd), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
12234
12290
  var left = $1;
12235
12291
  var ws1 = $2;
12236
12292
  var dots = $3;
@@ -12266,6 +12322,14 @@ var RangeDots$$ = [RangeDots$0, RangeDots$1];
12266
12322
  function RangeDots(ctx, state2) {
12267
12323
  return (0, import_lib5.$EVENT_C)(ctx, state2, "RangeDots", RangeDots$$);
12268
12324
  }
12325
+ var OptionalRangeEnd$0 = RangeEnd;
12326
+ var OptionalRangeEnd$1 = (0, import_lib5.$T)((0, import_lib5.$EXPECT)($L0, 'OptionalRangeEnd ""'), function(value) {
12327
+ return { "increasing": void 0, "inclusive": true, "raw": "" };
12328
+ });
12329
+ var OptionalRangeEnd$$ = [OptionalRangeEnd$0, OptionalRangeEnd$1];
12330
+ function OptionalRangeEnd(ctx, state2) {
12331
+ return (0, import_lib5.$EVENT_C)(ctx, state2, "OptionalRangeEnd", OptionalRangeEnd$$);
12332
+ }
12269
12333
  var RangeEnd$0 = (0, import_lib5.$TR)((0, import_lib5.$EXPECT)($R20, "RangeEnd /([<>])(=?)|([\u2264\u2265])/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
12270
12334
  let dir = $1, equal = $2, unicode = $3;
12271
12335
  if (unicode) {
@@ -12282,12 +12346,8 @@ var RangeEnd$0 = (0, import_lib5.$TR)((0, import_lib5.$EXPECT)($R20, "RangeEnd /
12282
12346
  raw: $0
12283
12347
  };
12284
12348
  });
12285
- var RangeEnd$1 = (0, import_lib5.$T)((0, import_lib5.$EXPECT)($L0, 'RangeEnd ""'), function(value) {
12286
- return { "increasing": void 0, "inclusive": true, "raw": "" };
12287
- });
12288
- var RangeEnd$$ = [RangeEnd$0, RangeEnd$1];
12289
12349
  function RangeEnd(ctx, state2) {
12290
- return (0, import_lib5.$EVENT_C)(ctx, state2, "RangeEnd", RangeEnd$$);
12350
+ return (0, import_lib5.$EVENT)(ctx, state2, "RangeEnd", RangeEnd$0);
12291
12351
  }
12292
12352
  var RangeExpression$0 = (0, import_lib5.$TS)((0, import_lib5.$S)(Expression, __, RangeDots, Expression), function($skip, $loc, $0, $1, $2, $3, $4) {
12293
12353
  var start = $1;
@@ -12527,7 +12587,7 @@ var ArrayBulletDelimiter$$ = [ArrayBulletDelimiter$0, ArrayBulletDelimiter$1];
12527
12587
  function ArrayBulletDelimiter(ctx, state2) {
12528
12588
  return (0, import_lib5.$EVENT_C)(ctx, state2, "ArrayBulletDelimiter", ArrayBulletDelimiter$$);
12529
12589
  }
12530
- var BulletIndent$0 = (0, import_lib5.$TV)((0, import_lib5.$C)((0, import_lib5.$S)((0, import_lib5.$EXPECT)($L47, 'BulletIndent "\u2022"'), (0, import_lib5.$EXPECT)($R21, "BulletIndent /[ \\t]*/")), (0, import_lib5.$S)((0, import_lib5.$EXPECT)($L7, 'BulletIndent "."'), (0, import_lib5.$EXPECT)($R22, "BulletIndent /[ \\t]+/"))), function($skip, $loc, $0, $1) {
12590
+ var BulletIndent$0 = (0, import_lib5.$TS)((0, import_lib5.$S)(Bullet), function($skip, $loc, $0, $1) {
12531
12591
  const [bullet, ws] = $1;
12532
12592
  const indent = {
12533
12593
  token: " " + ws,
@@ -12542,6 +12602,12 @@ var BulletIndent$0 = (0, import_lib5.$TV)((0, import_lib5.$C)((0, import_lib5.$S
12542
12602
  function BulletIndent(ctx, state2) {
12543
12603
  return (0, import_lib5.$EVENT)(ctx, state2, "BulletIndent", BulletIndent$0);
12544
12604
  }
12605
+ var Bullet$0 = (0, import_lib5.$S)((0, import_lib5.$EXPECT)($L47, 'Bullet "\u2022"'), (0, import_lib5.$R$0)((0, import_lib5.$EXPECT)($R21, "Bullet /[ \\t]*/")));
12606
+ var Bullet$1 = (0, import_lib5.$S)((0, import_lib5.$EXPECT)($L7, 'Bullet "."'), (0, import_lib5.$R$0)((0, import_lib5.$EXPECT)($R22, "Bullet /[ \\t]+/")));
12607
+ var Bullet$$ = [Bullet$0, Bullet$1];
12608
+ function Bullet(ctx, state2) {
12609
+ return (0, import_lib5.$EVENT_C)(ctx, state2, "Bullet", Bullet$$);
12610
+ }
12545
12611
  var BulletedArrayWithTrailing$0 = (0, import_lib5.$TS)((0, import_lib5.$S)(BulletedArray, (0, import_lib5.$E)(AllowedTrailingCallExpressions), (0, import_lib5.$Q)((0, import_lib5.$S)(NotDedented, Pipe, __, PipelineTailItem))), function($skip, $loc, $0, $1, $2, $3) {
12546
12612
  var array = $1;
12547
12613
  var trailing = $2;
@@ -19399,6 +19465,7 @@ var Reset$0 = (0, import_lib5.$TV)((0, import_lib5.$EXPECT)($L0, 'Reset ""'), fu
19399
19465
  repl: false,
19400
19466
  rewriteTsImports: true,
19401
19467
  server: false,
19468
+ strict: false,
19402
19469
  symbols: wellKnownSymbols,
19403
19470
  tab: void 0,
19404
19471
  // default behavior = same as space
@@ -19459,6 +19526,9 @@ var Init$0 = (0, import_lib5.$TS)((0, import_lib5.$S)((0, import_lib5.$E)(Sheban
19459
19526
  Object.assign(config, directive.config);
19460
19527
  }
19461
19528
  });
19529
+ if (config.strict) {
19530
+ $0 = [...$0, '"use strict";\n'];
19531
+ }
19462
19532
  return $0;
19463
19533
  });
19464
19534
  function Init(ctx, state2) {