@danielx/civet 0.6.48 → 0.6.50

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
@@ -496,6 +496,7 @@ var require_lib = __commonJS({
496
496
  }
497
497
  return;
498
498
  }
499
+ node = node;
499
500
  node.parent = parent;
500
501
  if (node.children) {
501
502
  for (const child of node.children) {
@@ -514,6 +515,7 @@ var require_lib = __commonJS({
514
515
  }
515
516
  return;
516
517
  }
518
+ node = node;
517
519
  if (parent != null)
518
520
  node.parent = parent;
519
521
  if (depth && node.children) {
@@ -522,20 +524,24 @@ var require_lib = __commonJS({
522
524
  }
523
525
  }
524
526
  }
527
+ function makeNode(node) {
528
+ updateParentPointers(node);
529
+ return node;
530
+ }
525
531
  function addPostfixStatement(statement, ws, post) {
526
532
  const expressions = [
527
533
  ...post.blockPrefix || [],
528
534
  ["", statement]
529
535
  ];
530
- const block = {
536
+ const block = makeNode({
531
537
  type: "BlockStatement",
532
538
  children: [" { ", expressions, " }"],
533
539
  expressions
534
- };
540
+ });
535
541
  const children = [...post.children, block];
536
542
  if (!isWhitespaceOrEmpty(ws))
537
543
  children.push(ws);
538
- post = { ...post, children, block };
544
+ post = makeNode({ ...post, children, block });
539
545
  if (post.type === "IfStatement") {
540
546
  post.then = block;
541
547
  }
@@ -649,6 +655,7 @@ var require_lib = __commonJS({
649
655
  });
650
656
  }
651
657
  const expressions = [...prefixStatements, ...block.expressions];
658
+ addParentPointers(prefixStatements, block);
652
659
  block = {
653
660
  ...block,
654
661
  expressions,
@@ -658,6 +665,7 @@ var require_lib = __commonJS({
658
665
  block.children = [[" {"], ...block.children, "}"];
659
666
  block.bare = false;
660
667
  }
668
+ updateParentPointers(block);
661
669
  }
662
670
  return block;
663
671
  }
@@ -675,10 +683,11 @@ var require_lib = __commonJS({
675
683
  const { ref, body } = expr;
676
684
  ref.type = "PipedExpression";
677
685
  ref.children = [makeLeftHandSideExpression(arg)];
678
- return {
686
+ updateParentPointers(ref);
687
+ return makeNode({
679
688
  type: "UnwrappedExpression",
680
689
  children: [skipIfOnlyWS(fn.leadingComment), body, skipIfOnlyWS(fn.trailingComment)]
681
- };
690
+ });
682
691
  }
683
692
  expr = fn.expr;
684
693
  const lhs = makeLeftHandSideExpression(expr);
@@ -892,6 +901,7 @@ var require_lib = __commonJS({
892
901
  if (subtype === "DoStatement") {
893
902
  insertReturn(block);
894
903
  children.splice(i, 1, ...wrapIIFE(["", statement, void 0], async));
904
+ updateParentPointers(exp);
895
905
  return;
896
906
  }
897
907
  const resultsRef = makeRef("results");
@@ -906,6 +916,7 @@ var require_lib = __commonJS({
906
916
  ["", wrapWithReturn(resultsRef)]
907
917
  ], async)
908
918
  );
919
+ updateParentPointers(exp);
909
920
  }
910
921
  function processBinaryOpExpression($0) {
911
922
  const expandedOps = expandChainedComparisons($0);
@@ -1199,10 +1210,10 @@ var require_lib = __commonJS({
1199
1210
  }
1200
1211
  function wrapWithReturn(expression) {
1201
1212
  const children = expression ? ["return ", expression] : ["return"];
1202
- return {
1213
+ return makeNode({
1203
1214
  type: "ReturnStatement",
1204
1215
  children
1205
- };
1216
+ });
1206
1217
  }
1207
1218
  function isExistence(exp) {
1208
1219
  if (exp.type === "ParenthesizedExpression" && exp.implicit) {
@@ -1497,6 +1508,7 @@ var require_lib = __commonJS({
1497
1508
  const indent = expressions[index][0];
1498
1509
  expressions.splice(index, 0, [indent, dec, ";"]);
1499
1510
  }
1511
+ addParentPointers(dec, block);
1500
1512
  }
1501
1513
  function patternAsValue(pattern) {
1502
1514
  switch (pattern.type) {
@@ -1575,7 +1587,8 @@ var require_lib = __commonJS({
1575
1587
  case "Declaration":
1576
1588
  exp.children.push(["", {
1577
1589
  type: "ReturnStatement",
1578
- children: [";return ", patternAsValue(exp.bindings.at(-1).pattern)]
1590
+ children: [";return ", patternAsValue(exp.bindings.at(-1).pattern)],
1591
+ parent: exp
1579
1592
  }]);
1580
1593
  return;
1581
1594
  case "FunctionExpression":
@@ -1584,7 +1597,8 @@ var require_lib = __commonJS({
1584
1597
  "",
1585
1598
  {
1586
1599
  type: "ReturnStatement",
1587
- children: [";return ", exp.id]
1600
+ children: [";return ", exp.id],
1601
+ parent: exp
1588
1602
  }
1589
1603
  ]);
1590
1604
  return;
@@ -1606,7 +1620,8 @@ var require_lib = __commonJS({
1606
1620
  exp.children.push(["", {
1607
1621
  type: "ReturnStatement",
1608
1622
  // NOTE: add a prefixed semi-colon because the if block may not be braced
1609
- children: [";return"]
1623
+ children: [";return"],
1624
+ parent: exp
1610
1625
  }]);
1611
1626
  return;
1612
1627
  case "PatternMatchingStatement":
@@ -2026,13 +2041,26 @@ var require_lib = __commonJS({
2026
2041
  case "ThrowExpression":
2027
2042
  case "TryExpression":
2028
2043
  return expression;
2029
- default:
2030
- return {
2031
- type: "ParenthesizedExpression",
2032
- children: ["(", expression, ")"],
2033
- expression,
2034
- implicit: true
2035
- };
2044
+ }
2045
+ return makeNode({
2046
+ type: "ParenthesizedExpression",
2047
+ children: ["(", expression, ")"],
2048
+ expression,
2049
+ implicit: true
2050
+ });
2051
+ }
2052
+ function makeExpressionStatement(expression) {
2053
+ if (Array.isArray(expression) && expression[1]?.[0]?.[0]?.[1]?.token === ",") {
2054
+ return [
2055
+ makeExpressionStatement(expression[0]),
2056
+ expression[1].map(([comma, exp]) => {
2057
+ return [comma, makeExpressionStatement(exp)];
2058
+ })
2059
+ ];
2060
+ } else if (expression?.type === "ObjectExpression" || expression?.type === "FunctionExpression" && !expression.id) {
2061
+ return makeLeftHandSideExpression(expression);
2062
+ } else {
2063
+ return expression;
2036
2064
  }
2037
2065
  }
2038
2066
  function modifyString(str) {
@@ -2240,7 +2268,7 @@ var require_lib = __commonJS({
2240
2268
  splices = splices.map((s) => [", ", s]);
2241
2269
  thisAssignments = thisAssignments.map((a) => ["", a, ";"]);
2242
2270
  const initializer = [ws, assign, e];
2243
- const binding = {
2271
+ const binding = makeNode({
2244
2272
  type: "Binding",
2245
2273
  pattern: id,
2246
2274
  initializer,
@@ -2248,9 +2276,9 @@ var require_lib = __commonJS({
2248
2276
  suffix,
2249
2277
  thisAssignments,
2250
2278
  children: [id, suffix, initializer]
2251
- };
2279
+ });
2252
2280
  const children = [decl, binding];
2253
- return {
2281
+ return makeNode({
2254
2282
  type: "Declaration",
2255
2283
  names: id.names,
2256
2284
  decl,
@@ -2258,9 +2286,9 @@ var require_lib = __commonJS({
2258
2286
  splices,
2259
2287
  thisAssignments,
2260
2288
  children
2261
- };
2289
+ });
2262
2290
  }
2263
- function processDeclarationCondition(condition, rootCondition) {
2291
+ function processDeclarationCondition(condition, rootCondition, parent) {
2264
2292
  if (!(condition.type === "DeclarationCondition")) {
2265
2293
  return;
2266
2294
  }
@@ -2279,6 +2307,7 @@ var require_lib = __commonJS({
2279
2307
  pattern,
2280
2308
  ref
2281
2309
  });
2310
+ addParentPointers(condition, parent);
2282
2311
  Object.assign(rootCondition, {
2283
2312
  blockPrefix: [
2284
2313
  ["", [decl, pattern, suffix, " = ", ref, ...splices], ";"],
@@ -2302,7 +2331,7 @@ var require_lib = __commonJS({
2302
2331
  const type = [type1, type2];
2303
2332
  expression = expression2;
2304
2333
  }
2305
- processDeclarationCondition(expression, condition.expression);
2334
+ processDeclarationCondition(expression, condition.expression, s);
2306
2335
  const { ref, pattern } = expression;
2307
2336
  if (pattern) {
2308
2337
  let conditions = [];
@@ -2352,10 +2381,12 @@ var require_lib = __commonJS({
2352
2381
  parent: s
2353
2382
  };
2354
2383
  s.children[1] = s.condition;
2384
+ updateParentPointers(s);
2355
2385
  const block = blockWithPrefix([["", [{
2356
2386
  type: "Declaration",
2357
2387
  children: ["let ", ...condition.expression.children]
2358
2388
  }], ";"], ...blockPrefix], makeEmptyBlock());
2389
+ updateParentPointers(block, s.parent);
2359
2390
  replaceBlockExpression(s.parent, s, block);
2360
2391
  block.expressions.push(["", s]);
2361
2392
  s.parent = block;
@@ -3588,12 +3619,12 @@ var require_lib = __commonJS({
3588
3619
  children: ["await "]
3589
3620
  };
3590
3621
  }
3591
- const block = {
3622
+ const block = makeNode({
3592
3623
  type: "BlockStatement",
3593
3624
  expressions,
3594
3625
  children: ["{", expressions, "}"],
3595
3626
  bare: false
3596
- };
3627
+ });
3597
3628
  const parameters = {
3598
3629
  type: "Parameters",
3599
3630
  children: ["()"],
@@ -3605,7 +3636,7 @@ var require_lib = __commonJS({
3605
3636
  },
3606
3637
  returnType: void 0
3607
3638
  };
3608
- const fn = {
3639
+ const fn = makeNode({
3609
3640
  type: "ArrowFunction",
3610
3641
  signature,
3611
3642
  parameters,
@@ -3614,12 +3645,11 @@ var require_lib = __commonJS({
3614
3645
  async,
3615
3646
  block,
3616
3647
  children: [async, parameters, "=>", block]
3617
- };
3618
- updateParentPointers(block, fn);
3619
- const exp = {
3648
+ });
3649
+ const exp = makeNode({
3620
3650
  type: "CallExpression",
3621
3651
  children: [makeLeftHandSideExpression(fn), "()"]
3622
- };
3652
+ });
3623
3653
  if (prefix) {
3624
3654
  return [makeLeftHandSideExpression([prefix, exp])];
3625
3655
  }
@@ -3666,6 +3696,7 @@ var require_lib = __commonJS({
3666
3696
  literalValue,
3667
3697
  makeAsConst,
3668
3698
  makeEmptyBlock,
3699
+ makeExpressionStatement,
3669
3700
  makeGetterMethod,
3670
3701
  makeLeftHandSideExpression,
3671
3702
  makeRef,
@@ -3730,6 +3761,7 @@ var require_parser = __commonJS({
3730
3761
  NestedTopLevelStatements,
3731
3762
  TopLevelSingleLineStatements,
3732
3763
  TopLevelStatement,
3764
+ ExtendedCommaExpression,
3733
3765
  ExtendedExpression,
3734
3766
  SingleLineExtendedExpression,
3735
3767
  NonPipelineExtendedExpression,
@@ -3738,7 +3770,7 @@ var require_parser = __commonJS({
3738
3770
  ExpressionizedStatementWithTrailingCallExpressions,
3739
3771
  ExpressionizedStatement,
3740
3772
  _ExpressionizedStatement,
3741
- Expression,
3773
+ CommaExpression,
3742
3774
  Arguments,
3743
3775
  ImplicitArguments,
3744
3776
  ExplicitArguments,
@@ -3883,15 +3915,18 @@ var require_parser = __commonJS({
3883
3915
  BareBlock,
3884
3916
  ThenClause,
3885
3917
  BracedOrEmptyBlock,
3918
+ NoCommaBracedOrEmptyBlock,
3886
3919
  NoPostfixBracedOrEmptyBlock,
3887
3920
  EmptyBlock,
3888
3921
  EmptyBareBlock,
3889
3922
  BracedBlock,
3890
3923
  NoPostfixBracedBlock,
3924
+ NoCommaBracedBlock,
3891
3925
  NonSingleBracedBlock,
3892
3926
  DeclarationOrStatement,
3893
3927
  SingleLineStatements,
3894
3928
  PostfixedSingleLineStatements,
3929
+ PostfixedSingleLineNoCommaStatements,
3895
3930
  BracedContent,
3896
3931
  NestedBlockStatements,
3897
3932
  NestedBlockStatement,
@@ -3959,11 +3994,15 @@ var require_parser = __commonJS({
3959
3994
  ModuleItem,
3960
3995
  StatementListItem,
3961
3996
  PostfixedStatement,
3997
+ NoCommaStatementListItem,
3998
+ PostfixedNoCommaStatement,
3962
3999
  PostfixedExpression,
4000
+ PostfixedCommaExpression,
3963
4001
  NonPipelinePostfixedExpression,
3964
4002
  PostfixStatement,
3965
4003
  _PostfixStatement,
3966
4004
  Statement,
4005
+ NoCommaStatement,
3967
4006
  EmptyStatement,
3968
4007
  BlockStatement,
3969
4008
  LabelledStatement,
@@ -4047,6 +4086,7 @@ var require_parser = __commonJS({
4047
4086
  NewlineBinaryOpAllowed,
4048
4087
  AllowAll,
4049
4088
  RestoreAll,
4089
+ CommaExpressionStatement,
4050
4090
  ExpressionStatement,
4051
4091
  KeywordStatement,
4052
4092
  DebuggerStatement,
@@ -4783,6 +4823,12 @@ var require_parser = __commonJS({
4783
4823
  function TopLevelStatement(ctx, state) {
4784
4824
  return $EVENT(ctx, state, "TopLevelStatement", TopLevelStatement$0);
4785
4825
  }
4826
+ var ExtendedCommaExpression$0 = NonAssignmentExtendedExpression;
4827
+ var ExtendedCommaExpression$1 = CommaExpression;
4828
+ var ExtendedCommaExpression$$ = [ExtendedCommaExpression$0, ExtendedCommaExpression$1];
4829
+ function ExtendedCommaExpression(ctx, state) {
4830
+ return $EVENT_C(ctx, state, "ExtendedCommaExpression", ExtendedCommaExpression$$);
4831
+ }
4786
4832
  var ExtendedExpression$0 = NonAssignmentExtendedExpression;
4787
4833
  var ExtendedExpression$1 = AssignmentExpression;
4788
4834
  var ExtendedExpression$$ = [ExtendedExpression$0, ExtendedExpression$1];
@@ -4861,13 +4907,13 @@ var require_parser = __commonJS({
4861
4907
  function _ExpressionizedStatement(ctx, state) {
4862
4908
  return $EVENT_C(ctx, state, "_ExpressionizedStatement", _ExpressionizedStatement$$);
4863
4909
  }
4864
- var Expression$0 = $TS($S(AssignmentExpression, $Q($S(CommaDelimiter, AssignmentExpression))), function($skip, $loc, $0, $1, $2) {
4910
+ var CommaExpression$0 = $TS($S(AssignmentExpression, $Q($S(CommaDelimiter, AssignmentExpression))), function($skip, $loc, $0, $1, $2) {
4865
4911
  if ($2.length == 0)
4866
4912
  return $1;
4867
4913
  return $0;
4868
4914
  });
4869
- function Expression(ctx, state) {
4870
- return $EVENT(ctx, state, "Expression", Expression$0);
4915
+ function CommaExpression(ctx, state) {
4916
+ return $EVENT(ctx, state, "CommaExpression", CommaExpression$0);
4871
4917
  }
4872
4918
  var Arguments$0 = ExplicitArguments;
4873
4919
  var Arguments$1 = $TS($S(ForbidTrailingMemberProperty, $E(ImplicitArguments), RestoreTrailingMemberProperty), function($skip, $loc, $0, $1, $2, $3) {
@@ -5276,7 +5322,7 @@ var require_parser = __commonJS({
5276
5322
  var exp = value[1];
5277
5323
  return exp;
5278
5324
  });
5279
- var FatArrowBody$1 = BracedOrEmptyBlock;
5325
+ var FatArrowBody$1 = NoCommaBracedOrEmptyBlock;
5280
5326
  var FatArrowBody$$ = [FatArrowBody$0, FatArrowBody$1];
5281
5327
  function FatArrowBody(ctx, state) {
5282
5328
  return $EVENT_C(ctx, state, "FatArrowBody", FatArrowBody$$);
@@ -5388,7 +5434,7 @@ var require_parser = __commonJS({
5388
5434
  function PrimaryExpression(ctx, state) {
5389
5435
  return $EVENT_C(ctx, state, "PrimaryExpression", PrimaryExpression$$);
5390
5436
  }
5391
- var ParenthesizedExpression$0 = $TS($S(OpenParen, AllowAll, $E($S(PostfixedExpression, __, CloseParen)), RestoreAll), function($skip, $loc, $0, $1, $2, $3, $4) {
5437
+ var ParenthesizedExpression$0 = $TS($S(OpenParen, AllowAll, $E($S(PostfixedCommaExpression, __, CloseParen)), RestoreAll), function($skip, $loc, $0, $1, $2, $3, $4) {
5392
5438
  var open = $1;
5393
5439
  if (!$3)
5394
5440
  return $skip;
@@ -6782,7 +6828,7 @@ var require_parser = __commonJS({
6782
6828
  function AmpersandUnaryPrefix(ctx, state) {
6783
6829
  return $EVENT(ctx, state, "AmpersandUnaryPrefix", AmpersandUnaryPrefix$0);
6784
6830
  }
6785
- var ThinArrowFunction$0 = $TS($S($E($S(Async, _)), ArrowParameters, $E(ReturnTypeSuffix), $E(_), Arrow, BracedOrEmptyBlock), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
6831
+ var ThinArrowFunction$0 = $TS($S($E($S(Async, _)), ArrowParameters, $E(ReturnTypeSuffix), $E(_), Arrow, NoCommaBracedOrEmptyBlock), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
6786
6832
  var async = $1;
6787
6833
  var parameters = $2;
6788
6834
  var suffix = $3;
@@ -6924,6 +6970,12 @@ var require_parser = __commonJS({
6924
6970
  function BracedOrEmptyBlock(ctx, state) {
6925
6971
  return $EVENT_C(ctx, state, "BracedOrEmptyBlock", BracedOrEmptyBlock$$);
6926
6972
  }
6973
+ var NoCommaBracedOrEmptyBlock$0 = NoCommaBracedBlock;
6974
+ var NoCommaBracedOrEmptyBlock$1 = EmptyBlock;
6975
+ var NoCommaBracedOrEmptyBlock$$ = [NoCommaBracedOrEmptyBlock$0, NoCommaBracedOrEmptyBlock$1];
6976
+ function NoCommaBracedOrEmptyBlock(ctx, state) {
6977
+ return $EVENT_C(ctx, state, "NoCommaBracedOrEmptyBlock", NoCommaBracedOrEmptyBlock$$);
6978
+ }
6927
6979
  var NoPostfixBracedOrEmptyBlock$0 = NoPostfixBracedBlock;
6928
6980
  var NoPostfixBracedOrEmptyBlock$1 = EmptyBlock;
6929
6981
  var NoPostfixBracedOrEmptyBlock$$ = [NoPostfixBracedOrEmptyBlock$0, NoPostfixBracedOrEmptyBlock$1];
@@ -6993,6 +7045,25 @@ var require_parser = __commonJS({
6993
7045
  function NoPostfixBracedBlock(ctx, state) {
6994
7046
  return $EVENT_C(ctx, state, "NoPostfixBracedBlock", NoPostfixBracedBlock$$);
6995
7047
  }
7048
+ var NoCommaBracedBlock$0 = NonSingleBracedBlock;
7049
+ var NoCommaBracedBlock$1 = $TS($S(InsertOpenBrace, $N(EOS), PostfixedSingleLineNoCommaStatements, InsertSpace, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
7050
+ var o = $1;
7051
+ var s = $3;
7052
+ var ws = $4;
7053
+ var c = $5;
7054
+ if (!s.children.length)
7055
+ return $skip;
7056
+ return {
7057
+ type: "BlockStatement",
7058
+ expressions: s.expressions,
7059
+ // Remove !EOS assertion
7060
+ children: [o, s.children, ws, c]
7061
+ };
7062
+ });
7063
+ var NoCommaBracedBlock$$ = [NoCommaBracedBlock$0, NoCommaBracedBlock$1];
7064
+ function NoCommaBracedBlock(ctx, state) {
7065
+ return $EVENT_C(ctx, state, "NoCommaBracedBlock", NoCommaBracedBlock$$);
7066
+ }
6996
7067
  var NonSingleBracedBlock$0 = $TS($S($E(_), OpenBrace, AllowAll, $E($S(BracedContent, __, CloseBrace)), RestoreAll), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
6997
7068
  var ws1 = $1;
6998
7069
  var open = $2;
@@ -7060,6 +7131,22 @@ var require_parser = __commonJS({
7060
7131
  function PostfixedSingleLineStatements(ctx, state) {
7061
7132
  return $EVENT(ctx, state, "PostfixedSingleLineStatements", PostfixedSingleLineStatements$0);
7062
7133
  }
7134
+ var PostfixedSingleLineNoCommaStatements$0 = $TS($S($Q($S($S($E(_), $N(EOS)), NoCommaStatementListItem, SemicolonDelimiter)), $E($S($S($E(_), $N(EOS)), NoCommaStatementListItem, $E(SemicolonDelimiter)))), function($skip, $loc, $0, $1, $2) {
7135
+ var stmts = $1;
7136
+ var last = $2;
7137
+ const children = [...stmts];
7138
+ if (last)
7139
+ children.push(last);
7140
+ return {
7141
+ type: "BlockStatement",
7142
+ expressions: children,
7143
+ children,
7144
+ bare: true
7145
+ };
7146
+ });
7147
+ function PostfixedSingleLineNoCommaStatements(ctx, state) {
7148
+ return $EVENT(ctx, state, "PostfixedSingleLineNoCommaStatements", PostfixedSingleLineNoCommaStatements$0);
7149
+ }
7063
7150
  var BracedContent$0 = NestedBlockStatements;
7064
7151
  var BracedContent$1 = SingleLineStatements;
7065
7152
  var BracedContent$2 = $TV($Y($S(__, $EXPECT($L25, 'BracedContent "}"'))), function($skip, $loc, $0, $1) {
@@ -8454,6 +8541,22 @@ var require_parser = __commonJS({
8454
8541
  function PostfixedStatement(ctx, state) {
8455
8542
  return $EVENT(ctx, state, "PostfixedStatement", PostfixedStatement$0);
8456
8543
  }
8544
+ var NoCommaStatementListItem$0 = Declaration;
8545
+ var NoCommaStatementListItem$1 = PostfixedNoCommaStatement;
8546
+ var NoCommaStatementListItem$$ = [NoCommaStatementListItem$0, NoCommaStatementListItem$1];
8547
+ function NoCommaStatementListItem(ctx, state) {
8548
+ return $EVENT_C(ctx, state, "NoCommaStatementListItem", NoCommaStatementListItem$$);
8549
+ }
8550
+ var PostfixedNoCommaStatement$0 = $TS($S(NoCommaStatement, $E($S($E(_), PostfixStatement))), function($skip, $loc, $0, $1, $2) {
8551
+ var statement = $1;
8552
+ var post = $2;
8553
+ if (post)
8554
+ return addPostfixStatement(statement, ...post);
8555
+ return statement;
8556
+ });
8557
+ function PostfixedNoCommaStatement(ctx, state) {
8558
+ return $EVENT(ctx, state, "PostfixedNoCommaStatement", PostfixedNoCommaStatement$0);
8559
+ }
8457
8560
  var PostfixedExpression$0 = $TS($S(ExtendedExpression, $E($S($E(_), PostfixStatement))), function($skip, $loc, $0, $1, $2) {
8458
8561
  var expression = $1;
8459
8562
  var post = $2;
@@ -8464,6 +8567,19 @@ var require_parser = __commonJS({
8464
8567
  function PostfixedExpression(ctx, state) {
8465
8568
  return $EVENT(ctx, state, "PostfixedExpression", PostfixedExpression$0);
8466
8569
  }
8570
+ var PostfixedCommaExpression$0 = $TS($S(PostfixedExpression, $C($S($E(_), PostfixStatement), $Q($S(CommaDelimiter, AssignmentExpression)))), function($skip, $loc, $0, $1, $2) {
8571
+ var expression = $1;
8572
+ var post = $2;
8573
+ if (!post.length)
8574
+ return $1;
8575
+ if (post.length === 2 && !Array.isArray(post[1])) {
8576
+ return attachPostfixStatementAsExpression(expression, post);
8577
+ }
8578
+ return $0;
8579
+ });
8580
+ function PostfixedCommaExpression(ctx, state) {
8581
+ return $EVENT(ctx, state, "PostfixedCommaExpression", PostfixedCommaExpression$0);
8582
+ }
8467
8583
  var NonPipelinePostfixedExpression$0 = $TS($S(NonPipelineExtendedExpression, $E($S($E(_), PostfixStatement))), function($skip, $loc, $0, $1, $2) {
8468
8584
  var expression = $1;
8469
8585
  var post = $2;
@@ -8497,17 +8613,26 @@ var require_parser = __commonJS({
8497
8613
  var Statement$5 = TryStatement;
8498
8614
  var Statement$6 = EmptyStatement;
8499
8615
  var Statement$7 = LabelledStatement;
8500
- var Statement$8 = $TS($S(ExpressionStatement), function($skip, $loc, $0, $1) {
8501
- if ($1.type === "ObjectExpression" || $1.type === "FunctionExpression" && !$1.id) {
8502
- return makeLeftHandSideExpression($1);
8503
- }
8504
- return $1;
8505
- });
8616
+ var Statement$8 = CommaExpressionStatement;
8506
8617
  var Statement$9 = BlockStatement;
8507
8618
  var Statement$$ = [Statement$0, Statement$1, Statement$2, Statement$3, Statement$4, Statement$5, Statement$6, Statement$7, Statement$8, Statement$9];
8508
8619
  function Statement(ctx, state) {
8509
8620
  return $EVENT_C(ctx, state, "Statement", Statement$$);
8510
8621
  }
8622
+ var NoCommaStatement$0 = KeywordStatement;
8623
+ var NoCommaStatement$1 = VariableStatement;
8624
+ var NoCommaStatement$2 = IfStatement;
8625
+ var NoCommaStatement$3 = IterationStatement;
8626
+ var NoCommaStatement$4 = SwitchStatement;
8627
+ var NoCommaStatement$5 = TryStatement;
8628
+ var NoCommaStatement$6 = EmptyStatement;
8629
+ var NoCommaStatement$7 = LabelledStatement;
8630
+ var NoCommaStatement$8 = ExpressionStatement;
8631
+ var NoCommaStatement$9 = BlockStatement;
8632
+ var NoCommaStatement$$ = [NoCommaStatement$0, NoCommaStatement$1, NoCommaStatement$2, NoCommaStatement$3, NoCommaStatement$4, NoCommaStatement$5, NoCommaStatement$6, NoCommaStatement$7, NoCommaStatement$8, NoCommaStatement$9];
8633
+ function NoCommaStatement(ctx, state) {
8634
+ return $EVENT_C(ctx, state, "NoCommaStatement", NoCommaStatement$$);
8635
+ }
8511
8636
  var EmptyStatement$0 = $TS($S($E(_), $Y($EXPECT($L99, 'EmptyStatement ";"'))), function($skip, $loc, $0, $1, $2) {
8512
8637
  return { type: "EmptyStatement", children: $1 || [] };
8513
8638
  });
@@ -8986,14 +9111,14 @@ var require_parser = __commonJS({
8986
9111
  function CoffeeForDeclaration(ctx, state) {
8987
9112
  return $EVENT(ctx, state, "CoffeeForDeclaration", CoffeeForDeclaration$0);
8988
9113
  }
8989
- var ForStatementParameters$0 = $TS($S(OpenParen, __, $C(LexicalDeclaration, VariableStatement, $E(Expression)), __, Semicolon, $E(Expression), Semicolon, $E(Expression), __, CloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10) {
9114
+ var ForStatementParameters$0 = $TS($S(OpenParen, __, $C(LexicalDeclaration, VariableStatement, $E(CommaExpression)), __, Semicolon, $E(CommaExpression), Semicolon, $E(CommaExpression), __, CloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10) {
8990
9115
  var declaration = $3;
8991
9116
  return {
8992
9117
  declaration,
8993
9118
  children: $0
8994
9119
  };
8995
9120
  });
8996
- var ForStatementParameters$1 = $TS($S(InsertOpenParen, __, $C(LexicalDeclaration, VariableStatement, $E(Expression)), __, Semicolon, $E(Expression), Semicolon, $E($S($N(EOS), ExpressionWithIndentedApplicationForbidden)), InsertCloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
9121
+ var ForStatementParameters$1 = $TS($S(InsertOpenParen, __, $C(LexicalDeclaration, VariableStatement, $E(CommaExpression)), __, Semicolon, $E(CommaExpression), Semicolon, $E($S($N(EOS), ExpressionWithIndentedApplicationForbidden)), InsertCloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
8997
9122
  var declaration = $3;
8998
9123
  return {
8999
9124
  declaration,
@@ -9569,8 +9694,18 @@ var require_parser = __commonJS({
9569
9694
  function RestoreAll(ctx, state) {
9570
9695
  return $EVENT(ctx, state, "RestoreAll", RestoreAll$0);
9571
9696
  }
9697
+ var CommaExpressionStatement$0 = IterationExpression;
9698
+ var CommaExpressionStatement$1 = $TS($S(CommaExpression), function($skip, $loc, $0, $1) {
9699
+ return makeExpressionStatement($1);
9700
+ });
9701
+ var CommaExpressionStatement$$ = [CommaExpressionStatement$0, CommaExpressionStatement$1];
9702
+ function CommaExpressionStatement(ctx, state) {
9703
+ return $EVENT_C(ctx, state, "CommaExpressionStatement", CommaExpressionStatement$$);
9704
+ }
9572
9705
  var ExpressionStatement$0 = IterationExpression;
9573
- var ExpressionStatement$1 = Expression;
9706
+ var ExpressionStatement$1 = $TS($S(AssignmentExpression), function($skip, $loc, $0, $1) {
9707
+ return makeExpressionStatement($1);
9708
+ });
9574
9709
  var ExpressionStatement$$ = [ExpressionStatement$0, ExpressionStatement$1];
9575
9710
  function ExpressionStatement(ctx, state) {
9576
9711
  return $EVENT_C(ctx, state, "ExpressionStatement", ExpressionStatement$$);
@@ -12204,7 +12339,7 @@ var require_parser = __commonJS({
12204
12339
  args
12205
12340
  };
12206
12341
  });
12207
- var TypePrimary$8 = $S(__, OpenParen, $C(Type, $S(EOS, Type)), __, CloseParen);
12342
+ var TypePrimary$8 = $S($E(_), OpenParen, $C(Type, $S(EOS, Type)), __, CloseParen);
12208
12343
  var TypePrimary$$ = [TypePrimary$0, TypePrimary$1, TypePrimary$2, TypePrimary$3, TypePrimary$4, TypePrimary$5, TypePrimary$6, TypePrimary$7, TypePrimary$8];
12209
12344
  function TypePrimary(ctx, state) {
12210
12345
  return $EVENT_C(ctx, state, "TypePrimary", TypePrimary$$);
@@ -13093,6 +13228,7 @@ var require_parser = __commonJS({
13093
13228
  exports.NestedTopLevelStatements = NestedTopLevelStatements;
13094
13229
  exports.TopLevelSingleLineStatements = TopLevelSingleLineStatements;
13095
13230
  exports.TopLevelStatement = TopLevelStatement;
13231
+ exports.ExtendedCommaExpression = ExtendedCommaExpression;
13096
13232
  exports.ExtendedExpression = ExtendedExpression;
13097
13233
  exports.SingleLineExtendedExpression = SingleLineExtendedExpression;
13098
13234
  exports.NonPipelineExtendedExpression = NonPipelineExtendedExpression;
@@ -13101,7 +13237,7 @@ var require_parser = __commonJS({
13101
13237
  exports.ExpressionizedStatementWithTrailingCallExpressions = ExpressionizedStatementWithTrailingCallExpressions;
13102
13238
  exports.ExpressionizedStatement = ExpressionizedStatement;
13103
13239
  exports._ExpressionizedStatement = _ExpressionizedStatement;
13104
- exports.Expression = Expression;
13240
+ exports.CommaExpression = CommaExpression;
13105
13241
  exports.Arguments = Arguments;
13106
13242
  exports.ImplicitArguments = ImplicitArguments;
13107
13243
  exports.ExplicitArguments = ExplicitArguments;
@@ -13246,15 +13382,18 @@ var require_parser = __commonJS({
13246
13382
  exports.BareBlock = BareBlock;
13247
13383
  exports.ThenClause = ThenClause;
13248
13384
  exports.BracedOrEmptyBlock = BracedOrEmptyBlock;
13385
+ exports.NoCommaBracedOrEmptyBlock = NoCommaBracedOrEmptyBlock;
13249
13386
  exports.NoPostfixBracedOrEmptyBlock = NoPostfixBracedOrEmptyBlock;
13250
13387
  exports.EmptyBlock = EmptyBlock;
13251
13388
  exports.EmptyBareBlock = EmptyBareBlock;
13252
13389
  exports.BracedBlock = BracedBlock;
13253
13390
  exports.NoPostfixBracedBlock = NoPostfixBracedBlock;
13391
+ exports.NoCommaBracedBlock = NoCommaBracedBlock;
13254
13392
  exports.NonSingleBracedBlock = NonSingleBracedBlock;
13255
13393
  exports.DeclarationOrStatement = DeclarationOrStatement;
13256
13394
  exports.SingleLineStatements = SingleLineStatements;
13257
13395
  exports.PostfixedSingleLineStatements = PostfixedSingleLineStatements;
13396
+ exports.PostfixedSingleLineNoCommaStatements = PostfixedSingleLineNoCommaStatements;
13258
13397
  exports.BracedContent = BracedContent;
13259
13398
  exports.NestedBlockStatements = NestedBlockStatements;
13260
13399
  exports.NestedBlockStatement = NestedBlockStatement;
@@ -13322,11 +13461,15 @@ var require_parser = __commonJS({
13322
13461
  exports.ModuleItem = ModuleItem;
13323
13462
  exports.StatementListItem = StatementListItem;
13324
13463
  exports.PostfixedStatement = PostfixedStatement;
13464
+ exports.NoCommaStatementListItem = NoCommaStatementListItem;
13465
+ exports.PostfixedNoCommaStatement = PostfixedNoCommaStatement;
13325
13466
  exports.PostfixedExpression = PostfixedExpression;
13467
+ exports.PostfixedCommaExpression = PostfixedCommaExpression;
13326
13468
  exports.NonPipelinePostfixedExpression = NonPipelinePostfixedExpression;
13327
13469
  exports.PostfixStatement = PostfixStatement;
13328
13470
  exports._PostfixStatement = _PostfixStatement;
13329
13471
  exports.Statement = Statement;
13472
+ exports.NoCommaStatement = NoCommaStatement;
13330
13473
  exports.EmptyStatement = EmptyStatement;
13331
13474
  exports.BlockStatement = BlockStatement;
13332
13475
  exports.LabelledStatement = LabelledStatement;
@@ -13410,6 +13553,7 @@ var require_parser = __commonJS({
13410
13553
  exports.NewlineBinaryOpAllowed = NewlineBinaryOpAllowed;
13411
13554
  exports.AllowAll = AllowAll;
13412
13555
  exports.RestoreAll = RestoreAll;
13556
+ exports.CommaExpressionStatement = CommaExpressionStatement;
13413
13557
  exports.ExpressionStatement = ExpressionStatement;
13414
13558
  exports.KeywordStatement = KeywordStatement;
13415
13559
  exports.DebuggerStatement = DebuggerStatement;
@@ -13799,6 +13943,7 @@ var require_parser = __commonJS({
13799
13943
  lastAccessInCallExpression,
13800
13944
  literalValue,
13801
13945
  makeEmptyBlock,
13946
+ makeExpressionStatement,
13802
13947
  makeGetterMethod,
13803
13948
  makeLeftHandSideExpression,
13804
13949
  makeRef,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@danielx/civet",
3
3
  "type": "commonjs",
4
- "version": "0.6.48",
4
+ "version": "0.6.50",
5
5
  "description": "CoffeeScript style syntax for TypeScript",
6
6
  "main": "dist/main.js",
7
7
  "module": "dist/main.mjs",