@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.mjs CHANGED
@@ -1805,17 +1805,14 @@ var declareHelper = {
1805
1805
  preludeVar,
1806
1806
  rsliceRef,
1807
1807
  ts([": <R, T extends string | ", RSliceable, "<R>>(a: T, start?: number, end?: number) => T extends string ? string : T extends ", RSliceable, "<infer R> ? R : never"]),
1808
- " = ((a, start, end) => {\n",
1808
+ " = ((a, start = -1, end = -1) => {\n",
1809
1809
  " const l = a.length\n",
1810
- " start = ",
1811
- getHelperRef("modulo"),
1812
- "(start ?? -1, l)\n",
1813
- " end = ",
1814
- getHelperRef("modulo"),
1815
- "((end ?? -1) + 1, l)\n",
1810
+ " if (start < 0) start += l\n",
1811
+ " if (++end < 0) end += l\n",
1816
1812
  " if (typeof a === 'string') {\n",
1817
- ` let r = ""
1818
- `,
1813
+ ' let r = ""\n',
1814
+ " if (start > l-1) start = l-1\n",
1815
+ " if (end < 0) end = 0\n",
1819
1816
  " for (let i = start; i >= end; --i) r += a[i]\n",
1820
1817
  " return r",
1821
1818
  asAny,
@@ -6183,7 +6180,7 @@ function processTryBlock($0) {
6183
6180
  let [t, , b, cs, e, f] = $0;
6184
6181
  let c;
6185
6182
  let m;
6186
- if (cs.some(($) => (m = $.binding?.parameter, typeof m === "object" && m != null && "type" in m && m.type === "CatchPattern"))) {
6183
+ if (cs.some(($3) => (m = $3.binding?.parameter, typeof m === "object" && m != null && "type" in m && m.type === "CatchPattern"))) {
6187
6184
  const ref = makeRef("e");
6188
6185
  const binding = {
6189
6186
  type: "CatchBinding",
@@ -6532,26 +6529,33 @@ function processCallMemberExpression(node) {
6532
6529
  ...glob.children.slice(1, -1)
6533
6530
  ];
6534
6531
  let ref3;
6535
- return makeNode({
6536
- ...node,
6532
+ const rsliceCall = makeNode({
6533
+ type: "CallExpression",
6534
+ implicit: true,
6537
6535
  children: [
6538
- {
6539
- type: "CallExpression",
6536
+ getHelperRef("rslice"),
6537
+ makeNode({
6538
+ type: "Call",
6539
+ args,
6540
6540
  children: [
6541
- getHelperRef("rslice"),
6542
- makeNode({
6543
- type: "Call",
6544
- args,
6545
- children: [
6546
- "(",
6547
- args,
6548
- (ref3 = glob.children)[ref3.length - 1]
6549
- ]
6550
- })
6541
+ "(",
6542
+ args,
6543
+ (ref3 = glob.children)[ref3.length - 1]
6551
6544
  ]
6552
- }
6545
+ })
6553
6546
  ]
6554
6547
  });
6548
+ if (i + 1 >= children.length) {
6549
+ return rsliceCall;
6550
+ }
6551
+ return processCallMemberExpression(makeNode({
6552
+ // in case there are more
6553
+ ...node,
6554
+ children: [
6555
+ rsliceCall,
6556
+ ...children.slice(i + 1)
6557
+ ]
6558
+ }));
6555
6559
  }
6556
6560
  }
6557
6561
  return node;
@@ -6776,7 +6780,7 @@ function processBindingPatternLHS(lhs, tail) {
6776
6780
  tail.push(...splices.map((s) => [", ", s]), ...thisAssignments.map((a) => [", ", a]));
6777
6781
  }
6778
6782
  function processAssignments(statements) {
6779
- for (let ref6 = gatherRecursiveAll(statements, ($3) => $3.type === "AssignmentExpression" || $3.type === "UpdateExpression"), i5 = 0, len4 = ref6.length; i5 < len4; i5++) {
6783
+ for (let ref6 = gatherRecursiveAll(statements, ($4) => $4.type === "AssignmentExpression" || $4.type === "UpdateExpression"), i5 = 0, len4 = ref6.length; i5 < len4; i5++) {
6780
6784
  let extractAssignment2 = function(lhs) {
6781
6785
  let expr = lhs;
6782
6786
  while (expr.type === "ParenthesizedExpression") {
@@ -6837,7 +6841,7 @@ function processAssignments(statements) {
6837
6841
  const { assigned } = exp;
6838
6842
  const ref = makeRef();
6839
6843
  const newMemberExp = unchainOptionalMemberExpression(assigned, ref, (children) => {
6840
- return exp.children.map(($4) => $4 === assigned ? children : $4);
6844
+ return exp.children.map(($5) => $5 === assigned ? children : $5);
6841
6845
  });
6842
6846
  if (newMemberExp !== assigned) {
6843
6847
  if (newMemberExp.usesRef) {
@@ -6851,7 +6855,7 @@ function processAssignments(statements) {
6851
6855
  }
6852
6856
  }
6853
6857
  }
6854
- for (let ref10 = gatherRecursiveAll(statements, ($5) => $5.type === "AssignmentExpression"), i7 = 0, len6 = ref10.length; i7 < len6; i7++) {
6858
+ for (let ref10 = gatherRecursiveAll(statements, ($6) => $6.type === "AssignmentExpression"), i7 = 0, len6 = ref10.length; i7 < len6; i7++) {
6855
6859
  const exp = ref10[i7];
6856
6860
  if (!(exp.names === null)) {
6857
6861
  continue;
@@ -6867,14 +6871,14 @@ function processAssignments(statements) {
6867
6871
  block
6868
6872
  )) {
6869
6873
  const ref = ref12;
6870
- exp.children = exp.children.map(($6) => $6 === $2 ? ref : $6);
6874
+ exp.children = exp.children.map(($7) => $7 === $2 ? ref : $7);
6871
6875
  $2 = ref;
6872
6876
  } else {
6873
6877
  block = void 0;
6874
6878
  }
6875
6879
  }
6876
6880
  let ref13;
6877
- if ($1.some(($7) => (ref13 = $7)[ref13.length - 1].special)) {
6881
+ if ($1.some(($8) => (ref13 = $8)[ref13.length - 1].special)) {
6878
6882
  if ($1.length !== 1)
6879
6883
  throw new Error("Only one assignment with id= is allowed");
6880
6884
  const [, lhs, , op] = $1[0];
@@ -6919,13 +6923,6 @@ function processAssignments(statements) {
6919
6923
  if (lhs.type === "MemberExpression") {
6920
6924
  const members = lhs.children;
6921
6925
  const lastMember = members[members.length - 1];
6922
- 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")) {
6923
- lastMember.children.push({
6924
- type: "Error",
6925
- message: "Slice range cannot be decreasing in assignment"
6926
- });
6927
- break;
6928
- }
6929
6926
  if (lastMember.type === "SliceExpression") {
6930
6927
  const { start, end, children: c } = lastMember;
6931
6928
  c[0].token = ".splice(";
@@ -6948,9 +6945,15 @@ function processAssignments(statements) {
6948
6945
  exp.names = [];
6949
6946
  break;
6950
6947
  }
6948
+ } 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")) {
6949
+ lhs.children.push({
6950
+ type: "Error",
6951
+ message: "Slice range cannot be decreasing in assignment"
6952
+ });
6953
+ break;
6951
6954
  } else if (m3 = lhs.type, m3 === "ObjectBindingPattern" || m3 === "ArrayBindingPattern") {
6952
6955
  processBindingPatternLHS(lhs, tail);
6953
- gatherRecursiveAll(lhs, ($8) => $8.type === "Ref").forEach(refsToDeclare.add.bind(refsToDeclare));
6956
+ gatherRecursiveAll(lhs, ($9) => $9.type === "Ref").forEach(refsToDeclare.add.bind(refsToDeclare));
6954
6957
  }
6955
6958
  }
6956
6959
  i--;
@@ -6982,7 +6985,7 @@ function processAssignments(statements) {
6982
6985
  }
6983
6986
  if (refsToDeclare.size) {
6984
6987
  if (exp.hoistDec) {
6985
- exp.hoistDec.children.push([...refsToDeclare].map(($9) => [",", $9]));
6988
+ exp.hoistDec.children.push([...refsToDeclare].map(($10) => [",", $10]));
6986
6989
  } else {
6987
6990
  exp.hoistDec = {
6988
6991
  type: "Declaration",
@@ -7173,7 +7176,7 @@ function processTypes(node) {
7173
7176
  });
7174
7177
  }
7175
7178
  function processStatementExpressions(statements) {
7176
- for (let ref21 = gatherRecursiveAll(statements, ($10) => $10.type === "StatementExpression"), i8 = 0, len7 = ref21.length; i8 < len7; i8++) {
7179
+ for (let ref21 = gatherRecursiveAll(statements, ($11) => $11.type === "StatementExpression"), i8 = 0, len7 = ref21.length; i8 < len7; i8++) {
7177
7180
  const exp = ref21[i8];
7178
7181
  const { maybe, statement } = exp;
7179
7182
  if ((maybe || statement.type === "ThrowStatement") && blockContainingStatement(exp)) {
@@ -7255,7 +7258,7 @@ function processProgram(root) {
7255
7258
  if (config2.iife || config2.repl) {
7256
7259
  rootIIFE = wrapIIFE(root.expressions, root.topLevelAwait);
7257
7260
  const newExpressions = [["", rootIIFE]];
7258
- root.children = root.children.map(($11) => $11 === root.expressions ? newExpressions : $11);
7261
+ root.children = root.children.map(($12) => $12 === root.expressions ? newExpressions : $12);
7259
7262
  root.expressions = newExpressions;
7260
7263
  }
7261
7264
  addParentPointers(root);
@@ -7295,16 +7298,16 @@ async function processProgramAsync(root) {
7295
7298
  await processComptime(statements);
7296
7299
  }
7297
7300
  function processRepl(root, rootIIFE) {
7298
- const topBlock = gatherRecursive(rootIIFE, ($12) => $12.type === "BlockStatement")[0];
7301
+ const topBlock = gatherRecursive(rootIIFE, ($13) => $13.type === "BlockStatement")[0];
7299
7302
  let i = 0;
7300
- for (let ref23 = gatherRecursiveWithinFunction(topBlock, ($13) => $13.type === "Declaration"), i9 = 0, len8 = ref23.length; i9 < len8; i9++) {
7303
+ for (let ref23 = gatherRecursiveWithinFunction(topBlock, ($14) => $14.type === "Declaration"), i9 = 0, len8 = ref23.length; i9 < len8; i9++) {
7301
7304
  const decl = ref23[i9];
7302
7305
  if (decl.parent === topBlock || decl.decl === "var") {
7303
7306
  decl.children.shift();
7304
7307
  root.expressions.splice(i++, 0, ["", `var ${decl.names.join(",")};`]);
7305
7308
  }
7306
7309
  }
7307
- for (let ref24 = gatherRecursive(topBlock, ($14) => $14.type === "FunctionExpression"), i10 = 0, len9 = ref24.length; i10 < len9; i10++) {
7310
+ for (let ref24 = gatherRecursive(topBlock, ($15) => $15.type === "FunctionExpression"), i10 = 0, len9 = ref24.length; i10 < len9; i10++) {
7308
7311
  const func = ref24[i10];
7309
7312
  if (func.name && func.parent?.type === "BlockStatement") {
7310
7313
  if (func.parent === topBlock) {
@@ -7317,7 +7320,7 @@ function processRepl(root, rootIIFE) {
7317
7320
  }
7318
7321
  }
7319
7322
  }
7320
- for (let ref25 = gatherRecursiveWithinFunction(topBlock, ($15) => $15.type === "ClassExpression"), i11 = 0, len10 = ref25.length; i11 < len10; i11++) {
7323
+ for (let ref25 = gatherRecursiveWithinFunction(topBlock, ($16) => $16.type === "ClassExpression"), i11 = 0, len10 = ref25.length; i11 < len10; i11++) {
7321
7324
  const classExp = ref25[i11];
7322
7325
  let m5;
7323
7326
  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)) {
@@ -7327,7 +7330,7 @@ function processRepl(root, rootIIFE) {
7327
7330
  }
7328
7331
  }
7329
7332
  function populateRefs(statements) {
7330
- const refNodes = gatherRecursive(statements, ($16) => $16.type === "Ref");
7333
+ const refNodes = gatherRecursive(statements, ($17) => $17.type === "Ref");
7331
7334
  if (refNodes.length) {
7332
7335
  const ids = gatherRecursive(statements, (s) => s.type === "Identifier");
7333
7336
  const names = new Set(ids.flatMap(({ names: names2 }) => names2 || []));
@@ -7350,11 +7353,14 @@ function populateRefs(statements) {
7350
7353
  function processPlaceholders(statements) {
7351
7354
  const placeholderMap = /* @__PURE__ */ new Map();
7352
7355
  const liftedIfs = /* @__PURE__ */ new Set();
7353
- for (let ref26 = gatherRecursiveAll(statements, ($17) => $17.type === "Placeholder"), i12 = 0, len11 = ref26.length; i12 < len11; i12++) {
7356
+ for (let ref26 = gatherRecursiveAll(statements, ($18) => $18.type === "Placeholder"), i12 = 0, len11 = ref26.length; i12 < len11; i12++) {
7354
7357
  const exp = ref26[i12];
7355
7358
  let ancestor;
7356
7359
  if (exp.subtype === ".") {
7357
- ({ ancestor } = findAncestor(exp, ($18) => $18.type === "Call"));
7360
+ ({ ancestor } = findAncestor(
7361
+ exp,
7362
+ ($) => $.type === "Call" && !$.parent?.implicit
7363
+ ));
7358
7364
  ancestor = ancestor?.parent;
7359
7365
  let m6;
7360
7366
  while (ancestor?.parent != null && (m6 = ancestor.parent.type, m6 === "UnaryExpression" || m6 === "NewExpression" || m6 === "AwaitExpression" || m6 === "ThrowStatement" || m6 === "StatementExpression")) {
@@ -7376,7 +7382,7 @@ function processPlaceholders(statements) {
7376
7382
  }
7377
7383
  let m7;
7378
7384
  let m8;
7379
- return type === "Call" || // Block, except for if/else blocks when condition already lifted
7385
+ return type === "Call" && !ancestor2.parent?.implicit || // Block, except for if/else blocks when condition already lifted
7380
7386
  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
7381
7387
  type === "Initializer" || // Right-hand side of assignment
7382
7388
  type === "AssignmentExpression" && findChildIndex(ancestor2, child2) === ancestor2.children.indexOf(ancestor2.expression) || type === "ReturnStatement" || type === "YieldExpression";
@@ -7678,7 +7684,9 @@ var grammar = {
7678
7684
  TrailingCallExpressions,
7679
7685
  AllowedTrailingCallExpressions,
7680
7686
  CommaDelimiter,
7687
+ OptionalCommaDelimiter,
7681
7688
  ArgumentList,
7689
+ NestedArguments,
7682
7690
  NestedArgumentList,
7683
7691
  NestedArgument,
7684
7692
  SingleLineArgumentExpressions,
@@ -7876,6 +7884,7 @@ var grammar = {
7876
7884
  ArrayLiteral,
7877
7885
  _ArrayLiteral,
7878
7886
  RangeDots,
7887
+ OptionalRangeEnd,
7879
7888
  RangeEnd,
7880
7889
  RangeExpression,
7881
7890
  ArrayLiteralContent,
@@ -7892,6 +7901,7 @@ var grammar = {
7892
7901
  ArrayBullet,
7893
7902
  ArrayBulletDelimiter,
7894
7903
  BulletIndent,
7904
+ Bullet,
7895
7905
  BulletedArrayWithTrailing,
7896
7906
  ObjectLiteral,
7897
7907
  BracedObjectLiteral,
@@ -8984,7 +8994,6 @@ var ImplicitArguments$0 = (0, import_lib5.$TS)((0, import_lib5.$S)(ApplicationSt
8984
8994
  return $skip;
8985
8995
  if (skipImplicitArguments(args))
8986
8996
  return $skip;
8987
- args = stripTrailingImplicitComma(args);
8988
8997
  return {
8989
8998
  type: "Call",
8990
8999
  args,
@@ -9025,7 +9034,7 @@ function ApplicationStart(ctx, state2) {
9025
9034
  }
9026
9035
  var ForbiddenImplicitCalls$0 = ReservedBinary;
9027
9036
  var ForbiddenImplicitCalls$1 = (0, import_lib5.$EXPECT)($L2, 'ForbiddenImplicitCalls "/ "');
9028
- 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);
9037
+ 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);
9029
9038
  var ForbiddenImplicitCalls$3 = (0, import_lib5.$S)(ClassImplicitCallForbidden, (0, import_lib5.$C)(Class, AtAt));
9030
9039
  var ForbiddenImplicitCalls$4 = (0, import_lib5.$S)(Identifier, (0, import_lib5.$EXPECT)($L3, 'ForbiddenImplicitCalls "="'), Whitespace);
9031
9040
  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) {
@@ -9094,47 +9103,64 @@ var CommaDelimiter$0 = (0, import_lib5.$S)(NotDedented, Comma);
9094
9103
  function CommaDelimiter(ctx, state2) {
9095
9104
  return (0, import_lib5.$EVENT)(ctx, state2, "CommaDelimiter", CommaDelimiter$0);
9096
9105
  }
9097
- 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) {
9106
+ var OptionalCommaDelimiter$0 = CommaDelimiter;
9107
+ var OptionalCommaDelimiter$1 = (0, import_lib5.$T)((0, import_lib5.$S)((0, import_lib5.$Y)(EOS), InsertComma), function(value) {
9108
+ return value[1];
9109
+ });
9110
+ var OptionalCommaDelimiter$$ = [OptionalCommaDelimiter$0, OptionalCommaDelimiter$1];
9111
+ function OptionalCommaDelimiter(ctx, state2) {
9112
+ return (0, import_lib5.$EVENT_C)(ctx, state2, "OptionalCommaDelimiter", OptionalCommaDelimiter$$);
9113
+ }
9114
+ 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) {
9098
9115
  return [
9099
9116
  $2,
9100
9117
  ...$3.flatMap(([comma, eos, ws, arg]) => [comma, prepend(ws, arg)]),
9101
- ...$4.flatMap(
9118
+ ...Array.isArray($4[1]) ? [$4[0], ...$4[1]] : $4,
9119
+ ...$5.flatMap(
9102
9120
  ([comma, args]) => Array.isArray(args) ? [comma, ...args] : [comma, args]
9103
9121
  )
9104
9122
  ];
9105
9123
  });
9106
- 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) {
9124
+ 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) {
9125
+ if (!Array.isArray($1))
9126
+ $1 = [$1];
9107
9127
  return [
9108
- trimFirstSpace($1),
9128
+ ...trimFirstSpace($1),
9109
9129
  ...$2.flatMap(
9110
9130
  ([comma, args]) => Array.isArray(args) ? [comma, ...args] : [comma, args]
9111
9131
  )
9112
9132
  ];
9113
9133
  });
9114
- var ArgumentList$2 = NestedArgumentList;
9115
- 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) {
9134
+ 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) {
9116
9135
  return [
9117
9136
  prepend($1, $2),
9118
9137
  ...$3.flatMap(([comma, ws, arg]) => [comma, prepend(ws, arg)])
9119
9138
  ];
9120
9139
  });
9121
- var ArgumentList$$ = [ArgumentList$0, ArgumentList$1, ArgumentList$2, ArgumentList$3];
9140
+ var ArgumentList$$ = [ArgumentList$0, ArgumentList$1, ArgumentList$2];
9122
9141
  function ArgumentList(ctx, state2) {
9123
9142
  return (0, import_lib5.$EVENT_C)(ctx, state2, "ArgumentList", ArgumentList$$);
9124
9143
  }
9144
+ var NestedArguments$0 = NestedBulletedArray;
9145
+ var NestedArguments$1 = NestedImplicitObjectLiteral;
9146
+ var NestedArguments$2 = NestedArgumentList;
9147
+ var NestedArguments$$ = [NestedArguments$0, NestedArguments$1, NestedArguments$2];
9148
+ function NestedArguments(ctx, state2) {
9149
+ return (0, import_lib5.$EVENT_C)(ctx, state2, "NestedArguments", NestedArguments$$);
9150
+ }
9125
9151
  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) {
9126
9152
  var args = $4;
9127
9153
  if (!args.length)
9128
9154
  return $skip;
9129
- return args.flat();
9155
+ return stripTrailingImplicitComma(args.flat());
9130
9156
  });
9131
9157
  function NestedArgumentList(ctx, state2) {
9132
9158
  return (0, import_lib5.$EVENT)(ctx, state2, "NestedArgumentList", NestedArgumentList$0);
9133
9159
  }
9134
- var NestedArgument$0 = (0, import_lib5.$TS)((0, import_lib5.$S)(Nested, SingleLineArgumentExpressions, ParameterElementDelimiter), function($skip, $loc, $0, $1, $2, $3) {
9160
+ 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) {
9135
9161
  var indent = $1;
9136
- var args = $2;
9137
- var comma = $3;
9162
+ var args = $3;
9163
+ var comma = $4;
9138
9164
  let [arg0, ...rest] = args;
9139
9165
  arg0 = prepend(indent, arg0);
9140
9166
  return [arg0, ...rest, comma];
@@ -10485,8 +10511,38 @@ var SliceParameters$0 = (0, import_lib5.$TS)((0, import_lib5.$S)(Loc, (0, import
10485
10511
  children
10486
10512
  };
10487
10513
  });
10514
+ var SliceParameters$1 = (0, import_lib5.$TS)((0, import_lib5.$S)(Loc, RangeEnd, Expression), function($skip, $loc, $0, $1, $2, $3) {
10515
+ var l = $1;
10516
+ var rend = $2;
10517
+ var e = $3;
10518
+ let start, end, children;
10519
+ if (rend.increasing) {
10520
+ end = e;
10521
+ if (rend.inclusive) {
10522
+ end = [makeLeftHandSideExpression(end), ` + 1`];
10523
+ }
10524
+ start = {
10525
+ $loc: l.$loc,
10526
+ token: "0"
10527
+ };
10528
+ children = [start, ", ", end];
10529
+ } else {
10530
+ start = e;
10531
+ if (!rend.inclusive) {
10532
+ start = [makeLeftHandSideExpression(start), ` + 1`];
10533
+ }
10534
+ children = [start];
10535
+ }
10536
+ return {
10537
+ type: "SliceParameters",
10538
+ start,
10539
+ end,
10540
+ children
10541
+ };
10542
+ });
10543
+ var SliceParameters$$ = [SliceParameters$0, SliceParameters$1];
10488
10544
  function SliceParameters(ctx, state2) {
10489
- return (0, import_lib5.$EVENT)(ctx, state2, "SliceParameters", SliceParameters$0);
10545
+ return (0, import_lib5.$EVENT_C)(ctx, state2, "SliceParameters", SliceParameters$$);
10490
10546
  }
10491
10547
  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) {
10492
10548
  var modifier = $1;
@@ -12210,7 +12266,7 @@ var RangeDots$0 = (0, import_lib5.$TS)((0, import_lib5.$S)(DotDotDot), function(
12210
12266
  children: []
12211
12267
  };
12212
12268
  });
12213
- 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) {
12269
+ 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) {
12214
12270
  var left = $1;
12215
12271
  var ws1 = $2;
12216
12272
  var dots = $3;
@@ -12246,6 +12302,14 @@ var RangeDots$$ = [RangeDots$0, RangeDots$1];
12246
12302
  function RangeDots(ctx, state2) {
12247
12303
  return (0, import_lib5.$EVENT_C)(ctx, state2, "RangeDots", RangeDots$$);
12248
12304
  }
12305
+ var OptionalRangeEnd$0 = RangeEnd;
12306
+ var OptionalRangeEnd$1 = (0, import_lib5.$T)((0, import_lib5.$EXPECT)($L0, 'OptionalRangeEnd ""'), function(value) {
12307
+ return { "increasing": void 0, "inclusive": true, "raw": "" };
12308
+ });
12309
+ var OptionalRangeEnd$$ = [OptionalRangeEnd$0, OptionalRangeEnd$1];
12310
+ function OptionalRangeEnd(ctx, state2) {
12311
+ return (0, import_lib5.$EVENT_C)(ctx, state2, "OptionalRangeEnd", OptionalRangeEnd$$);
12312
+ }
12249
12313
  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) {
12250
12314
  let dir = $1, equal = $2, unicode = $3;
12251
12315
  if (unicode) {
@@ -12262,12 +12326,8 @@ var RangeEnd$0 = (0, import_lib5.$TR)((0, import_lib5.$EXPECT)($R20, "RangeEnd /
12262
12326
  raw: $0
12263
12327
  };
12264
12328
  });
12265
- var RangeEnd$1 = (0, import_lib5.$T)((0, import_lib5.$EXPECT)($L0, 'RangeEnd ""'), function(value) {
12266
- return { "increasing": void 0, "inclusive": true, "raw": "" };
12267
- });
12268
- var RangeEnd$$ = [RangeEnd$0, RangeEnd$1];
12269
12329
  function RangeEnd(ctx, state2) {
12270
- return (0, import_lib5.$EVENT_C)(ctx, state2, "RangeEnd", RangeEnd$$);
12330
+ return (0, import_lib5.$EVENT)(ctx, state2, "RangeEnd", RangeEnd$0);
12271
12331
  }
12272
12332
  var RangeExpression$0 = (0, import_lib5.$TS)((0, import_lib5.$S)(Expression, __, RangeDots, Expression), function($skip, $loc, $0, $1, $2, $3, $4) {
12273
12333
  var start = $1;
@@ -12507,7 +12567,7 @@ var ArrayBulletDelimiter$$ = [ArrayBulletDelimiter$0, ArrayBulletDelimiter$1];
12507
12567
  function ArrayBulletDelimiter(ctx, state2) {
12508
12568
  return (0, import_lib5.$EVENT_C)(ctx, state2, "ArrayBulletDelimiter", ArrayBulletDelimiter$$);
12509
12569
  }
12510
- 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) {
12570
+ var BulletIndent$0 = (0, import_lib5.$TS)((0, import_lib5.$S)(Bullet), function($skip, $loc, $0, $1) {
12511
12571
  const [bullet, ws] = $1;
12512
12572
  const indent = {
12513
12573
  token: " " + ws,
@@ -12522,6 +12582,12 @@ var BulletIndent$0 = (0, import_lib5.$TV)((0, import_lib5.$C)((0, import_lib5.$S
12522
12582
  function BulletIndent(ctx, state2) {
12523
12583
  return (0, import_lib5.$EVENT)(ctx, state2, "BulletIndent", BulletIndent$0);
12524
12584
  }
12585
+ 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]*/")));
12586
+ 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]+/")));
12587
+ var Bullet$$ = [Bullet$0, Bullet$1];
12588
+ function Bullet(ctx, state2) {
12589
+ return (0, import_lib5.$EVENT_C)(ctx, state2, "Bullet", Bullet$$);
12590
+ }
12525
12591
  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) {
12526
12592
  var array = $1;
12527
12593
  var trailing = $2;
@@ -19379,6 +19445,7 @@ var Reset$0 = (0, import_lib5.$TV)((0, import_lib5.$EXPECT)($L0, 'Reset ""'), fu
19379
19445
  repl: false,
19380
19446
  rewriteTsImports: true,
19381
19447
  server: false,
19448
+ strict: false,
19382
19449
  symbols: wellKnownSymbols,
19383
19450
  tab: void 0,
19384
19451
  // default behavior = same as space
@@ -19439,6 +19506,9 @@ var Init$0 = (0, import_lib5.$TS)((0, import_lib5.$S)((0, import_lib5.$E)(Sheban
19439
19506
  Object.assign(config, directive.config);
19440
19507
  }
19441
19508
  });
19509
+ if (config.strict) {
19510
+ $0 = [...$0, '"use strict";\n'];
19511
+ }
19442
19512
  return $0;
19443
19513
  });
19444
19514
  function Init(ctx, state2) {
package/dist/types.d.ts CHANGED
@@ -30,6 +30,7 @@ declare module "@danielx/civet" {
30
30
  rewriteCivetImports: string
31
31
  rewriteTsImports: boolean
32
32
  server: boolean
33
+ strict: boolean
33
34
  symbols: string[]
34
35
  tab: number
35
36
  verbose: boolean
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@danielx/civet",
3
3
  "type": "commonjs",
4
- "version": "0.8.10",
4
+ "version": "0.8.11",
5
5
  "description": "CoffeeScript style syntax for TypeScript",
6
6
  "main": "dist/main.js",
7
7
  "module": "dist/main.mjs",