@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.js CHANGED
@@ -498,6 +498,7 @@ var require_lib = __commonJS({
498
498
  }
499
499
  return;
500
500
  }
501
+ node = node;
501
502
  node.parent = parent;
502
503
  if (node.children) {
503
504
  for (const child of node.children) {
@@ -516,6 +517,7 @@ var require_lib = __commonJS({
516
517
  }
517
518
  return;
518
519
  }
520
+ node = node;
519
521
  if (parent != null)
520
522
  node.parent = parent;
521
523
  if (depth && node.children) {
@@ -524,20 +526,24 @@ var require_lib = __commonJS({
524
526
  }
525
527
  }
526
528
  }
529
+ function makeNode(node) {
530
+ updateParentPointers(node);
531
+ return node;
532
+ }
527
533
  function addPostfixStatement(statement, ws, post) {
528
534
  const expressions = [
529
535
  ...post.blockPrefix || [],
530
536
  ["", statement]
531
537
  ];
532
- const block = {
538
+ const block = makeNode({
533
539
  type: "BlockStatement",
534
540
  children: [" { ", expressions, " }"],
535
541
  expressions
536
- };
542
+ });
537
543
  const children = [...post.children, block];
538
544
  if (!isWhitespaceOrEmpty(ws))
539
545
  children.push(ws);
540
- post = { ...post, children, block };
546
+ post = makeNode({ ...post, children, block });
541
547
  if (post.type === "IfStatement") {
542
548
  post.then = block;
543
549
  }
@@ -651,6 +657,7 @@ var require_lib = __commonJS({
651
657
  });
652
658
  }
653
659
  const expressions = [...prefixStatements, ...block.expressions];
660
+ addParentPointers(prefixStatements, block);
654
661
  block = {
655
662
  ...block,
656
663
  expressions,
@@ -660,6 +667,7 @@ var require_lib = __commonJS({
660
667
  block.children = [[" {"], ...block.children, "}"];
661
668
  block.bare = false;
662
669
  }
670
+ updateParentPointers(block);
663
671
  }
664
672
  return block;
665
673
  }
@@ -677,10 +685,11 @@ var require_lib = __commonJS({
677
685
  const { ref, body } = expr;
678
686
  ref.type = "PipedExpression";
679
687
  ref.children = [makeLeftHandSideExpression(arg)];
680
- return {
688
+ updateParentPointers(ref);
689
+ return makeNode({
681
690
  type: "UnwrappedExpression",
682
691
  children: [skipIfOnlyWS(fn.leadingComment), body, skipIfOnlyWS(fn.trailingComment)]
683
- };
692
+ });
684
693
  }
685
694
  expr = fn.expr;
686
695
  const lhs = makeLeftHandSideExpression(expr);
@@ -894,6 +903,7 @@ var require_lib = __commonJS({
894
903
  if (subtype === "DoStatement") {
895
904
  insertReturn(block);
896
905
  children.splice(i, 1, ...wrapIIFE(["", statement, void 0], async));
906
+ updateParentPointers(exp);
897
907
  return;
898
908
  }
899
909
  const resultsRef = makeRef("results");
@@ -908,6 +918,7 @@ var require_lib = __commonJS({
908
918
  ["", wrapWithReturn(resultsRef)]
909
919
  ], async)
910
920
  );
921
+ updateParentPointers(exp);
911
922
  }
912
923
  function processBinaryOpExpression($0) {
913
924
  const expandedOps = expandChainedComparisons($0);
@@ -1201,10 +1212,10 @@ var require_lib = __commonJS({
1201
1212
  }
1202
1213
  function wrapWithReturn(expression) {
1203
1214
  const children = expression ? ["return ", expression] : ["return"];
1204
- return {
1215
+ return makeNode({
1205
1216
  type: "ReturnStatement",
1206
1217
  children
1207
- };
1218
+ });
1208
1219
  }
1209
1220
  function isExistence(exp) {
1210
1221
  if (exp.type === "ParenthesizedExpression" && exp.implicit) {
@@ -1499,6 +1510,7 @@ var require_lib = __commonJS({
1499
1510
  const indent = expressions[index][0];
1500
1511
  expressions.splice(index, 0, [indent, dec, ";"]);
1501
1512
  }
1513
+ addParentPointers(dec, block);
1502
1514
  }
1503
1515
  function patternAsValue(pattern) {
1504
1516
  switch (pattern.type) {
@@ -1577,7 +1589,8 @@ var require_lib = __commonJS({
1577
1589
  case "Declaration":
1578
1590
  exp.children.push(["", {
1579
1591
  type: "ReturnStatement",
1580
- children: [";return ", patternAsValue(exp.bindings.at(-1).pattern)]
1592
+ children: [";return ", patternAsValue(exp.bindings.at(-1).pattern)],
1593
+ parent: exp
1581
1594
  }]);
1582
1595
  return;
1583
1596
  case "FunctionExpression":
@@ -1586,7 +1599,8 @@ var require_lib = __commonJS({
1586
1599
  "",
1587
1600
  {
1588
1601
  type: "ReturnStatement",
1589
- children: [";return ", exp.id]
1602
+ children: [";return ", exp.id],
1603
+ parent: exp
1590
1604
  }
1591
1605
  ]);
1592
1606
  return;
@@ -1608,7 +1622,8 @@ var require_lib = __commonJS({
1608
1622
  exp.children.push(["", {
1609
1623
  type: "ReturnStatement",
1610
1624
  // NOTE: add a prefixed semi-colon because the if block may not be braced
1611
- children: [";return"]
1625
+ children: [";return"],
1626
+ parent: exp
1612
1627
  }]);
1613
1628
  return;
1614
1629
  case "PatternMatchingStatement":
@@ -2028,13 +2043,26 @@ var require_lib = __commonJS({
2028
2043
  case "ThrowExpression":
2029
2044
  case "TryExpression":
2030
2045
  return expression;
2031
- default:
2032
- return {
2033
- type: "ParenthesizedExpression",
2034
- children: ["(", expression, ")"],
2035
- expression,
2036
- implicit: true
2037
- };
2046
+ }
2047
+ return makeNode({
2048
+ type: "ParenthesizedExpression",
2049
+ children: ["(", expression, ")"],
2050
+ expression,
2051
+ implicit: true
2052
+ });
2053
+ }
2054
+ function makeExpressionStatement(expression) {
2055
+ if (Array.isArray(expression) && expression[1]?.[0]?.[0]?.[1]?.token === ",") {
2056
+ return [
2057
+ makeExpressionStatement(expression[0]),
2058
+ expression[1].map(([comma, exp]) => {
2059
+ return [comma, makeExpressionStatement(exp)];
2060
+ })
2061
+ ];
2062
+ } else if (expression?.type === "ObjectExpression" || expression?.type === "FunctionExpression" && !expression.id) {
2063
+ return makeLeftHandSideExpression(expression);
2064
+ } else {
2065
+ return expression;
2038
2066
  }
2039
2067
  }
2040
2068
  function modifyString(str) {
@@ -2242,7 +2270,7 @@ var require_lib = __commonJS({
2242
2270
  splices = splices.map((s) => [", ", s]);
2243
2271
  thisAssignments = thisAssignments.map((a) => ["", a, ";"]);
2244
2272
  const initializer = [ws, assign, e];
2245
- const binding = {
2273
+ const binding = makeNode({
2246
2274
  type: "Binding",
2247
2275
  pattern: id,
2248
2276
  initializer,
@@ -2250,9 +2278,9 @@ var require_lib = __commonJS({
2250
2278
  suffix,
2251
2279
  thisAssignments,
2252
2280
  children: [id, suffix, initializer]
2253
- };
2281
+ });
2254
2282
  const children = [decl, binding];
2255
- return {
2283
+ return makeNode({
2256
2284
  type: "Declaration",
2257
2285
  names: id.names,
2258
2286
  decl,
@@ -2260,9 +2288,9 @@ var require_lib = __commonJS({
2260
2288
  splices,
2261
2289
  thisAssignments,
2262
2290
  children
2263
- };
2291
+ });
2264
2292
  }
2265
- function processDeclarationCondition(condition, rootCondition) {
2293
+ function processDeclarationCondition(condition, rootCondition, parent) {
2266
2294
  if (!(condition.type === "DeclarationCondition")) {
2267
2295
  return;
2268
2296
  }
@@ -2281,6 +2309,7 @@ var require_lib = __commonJS({
2281
2309
  pattern,
2282
2310
  ref
2283
2311
  });
2312
+ addParentPointers(condition, parent);
2284
2313
  Object.assign(rootCondition, {
2285
2314
  blockPrefix: [
2286
2315
  ["", [decl, pattern, suffix, " = ", ref, ...splices], ";"],
@@ -2304,7 +2333,7 @@ var require_lib = __commonJS({
2304
2333
  const type = [type1, type2];
2305
2334
  expression = expression2;
2306
2335
  }
2307
- processDeclarationCondition(expression, condition.expression);
2336
+ processDeclarationCondition(expression, condition.expression, s);
2308
2337
  const { ref, pattern } = expression;
2309
2338
  if (pattern) {
2310
2339
  let conditions = [];
@@ -2354,10 +2383,12 @@ var require_lib = __commonJS({
2354
2383
  parent: s
2355
2384
  };
2356
2385
  s.children[1] = s.condition;
2386
+ updateParentPointers(s);
2357
2387
  const block = blockWithPrefix([["", [{
2358
2388
  type: "Declaration",
2359
2389
  children: ["let ", ...condition.expression.children]
2360
2390
  }], ";"], ...blockPrefix], makeEmptyBlock());
2391
+ updateParentPointers(block, s.parent);
2361
2392
  replaceBlockExpression(s.parent, s, block);
2362
2393
  block.expressions.push(["", s]);
2363
2394
  s.parent = block;
@@ -3590,12 +3621,12 @@ var require_lib = __commonJS({
3590
3621
  children: ["await "]
3591
3622
  };
3592
3623
  }
3593
- const block = {
3624
+ const block = makeNode({
3594
3625
  type: "BlockStatement",
3595
3626
  expressions,
3596
3627
  children: ["{", expressions, "}"],
3597
3628
  bare: false
3598
- };
3629
+ });
3599
3630
  const parameters = {
3600
3631
  type: "Parameters",
3601
3632
  children: ["()"],
@@ -3607,7 +3638,7 @@ var require_lib = __commonJS({
3607
3638
  },
3608
3639
  returnType: void 0
3609
3640
  };
3610
- const fn = {
3641
+ const fn = makeNode({
3611
3642
  type: "ArrowFunction",
3612
3643
  signature,
3613
3644
  parameters,
@@ -3616,12 +3647,11 @@ var require_lib = __commonJS({
3616
3647
  async,
3617
3648
  block,
3618
3649
  children: [async, parameters, "=>", block]
3619
- };
3620
- updateParentPointers(block, fn);
3621
- const exp = {
3650
+ });
3651
+ const exp = makeNode({
3622
3652
  type: "CallExpression",
3623
3653
  children: [makeLeftHandSideExpression(fn), "()"]
3624
- };
3654
+ });
3625
3655
  if (prefix) {
3626
3656
  return [makeLeftHandSideExpression([prefix, exp])];
3627
3657
  }
@@ -3668,6 +3698,7 @@ var require_lib = __commonJS({
3668
3698
  literalValue,
3669
3699
  makeAsConst,
3670
3700
  makeEmptyBlock,
3701
+ makeExpressionStatement,
3671
3702
  makeGetterMethod,
3672
3703
  makeLeftHandSideExpression,
3673
3704
  makeRef,
@@ -3732,6 +3763,7 @@ var require_parser = __commonJS({
3732
3763
  NestedTopLevelStatements,
3733
3764
  TopLevelSingleLineStatements,
3734
3765
  TopLevelStatement,
3766
+ ExtendedCommaExpression,
3735
3767
  ExtendedExpression,
3736
3768
  SingleLineExtendedExpression,
3737
3769
  NonPipelineExtendedExpression,
@@ -3740,7 +3772,7 @@ var require_parser = __commonJS({
3740
3772
  ExpressionizedStatementWithTrailingCallExpressions,
3741
3773
  ExpressionizedStatement,
3742
3774
  _ExpressionizedStatement,
3743
- Expression,
3775
+ CommaExpression,
3744
3776
  Arguments,
3745
3777
  ImplicitArguments,
3746
3778
  ExplicitArguments,
@@ -3885,15 +3917,18 @@ var require_parser = __commonJS({
3885
3917
  BareBlock,
3886
3918
  ThenClause,
3887
3919
  BracedOrEmptyBlock,
3920
+ NoCommaBracedOrEmptyBlock,
3888
3921
  NoPostfixBracedOrEmptyBlock,
3889
3922
  EmptyBlock,
3890
3923
  EmptyBareBlock,
3891
3924
  BracedBlock,
3892
3925
  NoPostfixBracedBlock,
3926
+ NoCommaBracedBlock,
3893
3927
  NonSingleBracedBlock,
3894
3928
  DeclarationOrStatement,
3895
3929
  SingleLineStatements,
3896
3930
  PostfixedSingleLineStatements,
3931
+ PostfixedSingleLineNoCommaStatements,
3897
3932
  BracedContent,
3898
3933
  NestedBlockStatements,
3899
3934
  NestedBlockStatement,
@@ -3961,11 +3996,15 @@ var require_parser = __commonJS({
3961
3996
  ModuleItem,
3962
3997
  StatementListItem,
3963
3998
  PostfixedStatement,
3999
+ NoCommaStatementListItem,
4000
+ PostfixedNoCommaStatement,
3964
4001
  PostfixedExpression,
4002
+ PostfixedCommaExpression,
3965
4003
  NonPipelinePostfixedExpression,
3966
4004
  PostfixStatement,
3967
4005
  _PostfixStatement,
3968
4006
  Statement,
4007
+ NoCommaStatement,
3969
4008
  EmptyStatement,
3970
4009
  BlockStatement,
3971
4010
  LabelledStatement,
@@ -4049,6 +4088,7 @@ var require_parser = __commonJS({
4049
4088
  NewlineBinaryOpAllowed,
4050
4089
  AllowAll,
4051
4090
  RestoreAll,
4091
+ CommaExpressionStatement,
4052
4092
  ExpressionStatement,
4053
4093
  KeywordStatement,
4054
4094
  DebuggerStatement,
@@ -4785,6 +4825,12 @@ var require_parser = __commonJS({
4785
4825
  function TopLevelStatement(ctx, state) {
4786
4826
  return $EVENT(ctx, state, "TopLevelStatement", TopLevelStatement$0);
4787
4827
  }
4828
+ var ExtendedCommaExpression$0 = NonAssignmentExtendedExpression;
4829
+ var ExtendedCommaExpression$1 = CommaExpression;
4830
+ var ExtendedCommaExpression$$ = [ExtendedCommaExpression$0, ExtendedCommaExpression$1];
4831
+ function ExtendedCommaExpression(ctx, state) {
4832
+ return $EVENT_C(ctx, state, "ExtendedCommaExpression", ExtendedCommaExpression$$);
4833
+ }
4788
4834
  var ExtendedExpression$0 = NonAssignmentExtendedExpression;
4789
4835
  var ExtendedExpression$1 = AssignmentExpression;
4790
4836
  var ExtendedExpression$$ = [ExtendedExpression$0, ExtendedExpression$1];
@@ -4863,13 +4909,13 @@ var require_parser = __commonJS({
4863
4909
  function _ExpressionizedStatement(ctx, state) {
4864
4910
  return $EVENT_C(ctx, state, "_ExpressionizedStatement", _ExpressionizedStatement$$);
4865
4911
  }
4866
- var Expression$0 = $TS($S(AssignmentExpression, $Q($S(CommaDelimiter, AssignmentExpression))), function($skip, $loc, $0, $1, $2) {
4912
+ var CommaExpression$0 = $TS($S(AssignmentExpression, $Q($S(CommaDelimiter, AssignmentExpression))), function($skip, $loc, $0, $1, $2) {
4867
4913
  if ($2.length == 0)
4868
4914
  return $1;
4869
4915
  return $0;
4870
4916
  });
4871
- function Expression(ctx, state) {
4872
- return $EVENT(ctx, state, "Expression", Expression$0);
4917
+ function CommaExpression(ctx, state) {
4918
+ return $EVENT(ctx, state, "CommaExpression", CommaExpression$0);
4873
4919
  }
4874
4920
  var Arguments$0 = ExplicitArguments;
4875
4921
  var Arguments$1 = $TS($S(ForbidTrailingMemberProperty, $E(ImplicitArguments), RestoreTrailingMemberProperty), function($skip, $loc, $0, $1, $2, $3) {
@@ -5278,7 +5324,7 @@ var require_parser = __commonJS({
5278
5324
  var exp = value[1];
5279
5325
  return exp;
5280
5326
  });
5281
- var FatArrowBody$1 = BracedOrEmptyBlock;
5327
+ var FatArrowBody$1 = NoCommaBracedOrEmptyBlock;
5282
5328
  var FatArrowBody$$ = [FatArrowBody$0, FatArrowBody$1];
5283
5329
  function FatArrowBody(ctx, state) {
5284
5330
  return $EVENT_C(ctx, state, "FatArrowBody", FatArrowBody$$);
@@ -5390,7 +5436,7 @@ var require_parser = __commonJS({
5390
5436
  function PrimaryExpression(ctx, state) {
5391
5437
  return $EVENT_C(ctx, state, "PrimaryExpression", PrimaryExpression$$);
5392
5438
  }
5393
- var ParenthesizedExpression$0 = $TS($S(OpenParen, AllowAll, $E($S(PostfixedExpression, __, CloseParen)), RestoreAll), function($skip, $loc, $0, $1, $2, $3, $4) {
5439
+ var ParenthesizedExpression$0 = $TS($S(OpenParen, AllowAll, $E($S(PostfixedCommaExpression, __, CloseParen)), RestoreAll), function($skip, $loc, $0, $1, $2, $3, $4) {
5394
5440
  var open = $1;
5395
5441
  if (!$3)
5396
5442
  return $skip;
@@ -6784,7 +6830,7 @@ var require_parser = __commonJS({
6784
6830
  function AmpersandUnaryPrefix(ctx, state) {
6785
6831
  return $EVENT(ctx, state, "AmpersandUnaryPrefix", AmpersandUnaryPrefix$0);
6786
6832
  }
6787
- var ThinArrowFunction$0 = $TS($S($E($S(Async, _)), ArrowParameters, $E(ReturnTypeSuffix), $E(_), Arrow, BracedOrEmptyBlock), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
6833
+ var ThinArrowFunction$0 = $TS($S($E($S(Async, _)), ArrowParameters, $E(ReturnTypeSuffix), $E(_), Arrow, NoCommaBracedOrEmptyBlock), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
6788
6834
  var async = $1;
6789
6835
  var parameters = $2;
6790
6836
  var suffix = $3;
@@ -6926,6 +6972,12 @@ var require_parser = __commonJS({
6926
6972
  function BracedOrEmptyBlock(ctx, state) {
6927
6973
  return $EVENT_C(ctx, state, "BracedOrEmptyBlock", BracedOrEmptyBlock$$);
6928
6974
  }
6975
+ var NoCommaBracedOrEmptyBlock$0 = NoCommaBracedBlock;
6976
+ var NoCommaBracedOrEmptyBlock$1 = EmptyBlock;
6977
+ var NoCommaBracedOrEmptyBlock$$ = [NoCommaBracedOrEmptyBlock$0, NoCommaBracedOrEmptyBlock$1];
6978
+ function NoCommaBracedOrEmptyBlock(ctx, state) {
6979
+ return $EVENT_C(ctx, state, "NoCommaBracedOrEmptyBlock", NoCommaBracedOrEmptyBlock$$);
6980
+ }
6929
6981
  var NoPostfixBracedOrEmptyBlock$0 = NoPostfixBracedBlock;
6930
6982
  var NoPostfixBracedOrEmptyBlock$1 = EmptyBlock;
6931
6983
  var NoPostfixBracedOrEmptyBlock$$ = [NoPostfixBracedOrEmptyBlock$0, NoPostfixBracedOrEmptyBlock$1];
@@ -6995,6 +7047,25 @@ var require_parser = __commonJS({
6995
7047
  function NoPostfixBracedBlock(ctx, state) {
6996
7048
  return $EVENT_C(ctx, state, "NoPostfixBracedBlock", NoPostfixBracedBlock$$);
6997
7049
  }
7050
+ var NoCommaBracedBlock$0 = NonSingleBracedBlock;
7051
+ var NoCommaBracedBlock$1 = $TS($S(InsertOpenBrace, $N(EOS), PostfixedSingleLineNoCommaStatements, InsertSpace, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
7052
+ var o = $1;
7053
+ var s = $3;
7054
+ var ws = $4;
7055
+ var c = $5;
7056
+ if (!s.children.length)
7057
+ return $skip;
7058
+ return {
7059
+ type: "BlockStatement",
7060
+ expressions: s.expressions,
7061
+ // Remove !EOS assertion
7062
+ children: [o, s.children, ws, c]
7063
+ };
7064
+ });
7065
+ var NoCommaBracedBlock$$ = [NoCommaBracedBlock$0, NoCommaBracedBlock$1];
7066
+ function NoCommaBracedBlock(ctx, state) {
7067
+ return $EVENT_C(ctx, state, "NoCommaBracedBlock", NoCommaBracedBlock$$);
7068
+ }
6998
7069
  var NonSingleBracedBlock$0 = $TS($S($E(_), OpenBrace, AllowAll, $E($S(BracedContent, __, CloseBrace)), RestoreAll), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
6999
7070
  var ws1 = $1;
7000
7071
  var open = $2;
@@ -7062,6 +7133,22 @@ var require_parser = __commonJS({
7062
7133
  function PostfixedSingleLineStatements(ctx, state) {
7063
7134
  return $EVENT(ctx, state, "PostfixedSingleLineStatements", PostfixedSingleLineStatements$0);
7064
7135
  }
7136
+ 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) {
7137
+ var stmts = $1;
7138
+ var last = $2;
7139
+ const children = [...stmts];
7140
+ if (last)
7141
+ children.push(last);
7142
+ return {
7143
+ type: "BlockStatement",
7144
+ expressions: children,
7145
+ children,
7146
+ bare: true
7147
+ };
7148
+ });
7149
+ function PostfixedSingleLineNoCommaStatements(ctx, state) {
7150
+ return $EVENT(ctx, state, "PostfixedSingleLineNoCommaStatements", PostfixedSingleLineNoCommaStatements$0);
7151
+ }
7065
7152
  var BracedContent$0 = NestedBlockStatements;
7066
7153
  var BracedContent$1 = SingleLineStatements;
7067
7154
  var BracedContent$2 = $TV($Y($S(__, $EXPECT($L25, 'BracedContent "}"'))), function($skip, $loc, $0, $1) {
@@ -8456,6 +8543,22 @@ var require_parser = __commonJS({
8456
8543
  function PostfixedStatement(ctx, state) {
8457
8544
  return $EVENT(ctx, state, "PostfixedStatement", PostfixedStatement$0);
8458
8545
  }
8546
+ var NoCommaStatementListItem$0 = Declaration;
8547
+ var NoCommaStatementListItem$1 = PostfixedNoCommaStatement;
8548
+ var NoCommaStatementListItem$$ = [NoCommaStatementListItem$0, NoCommaStatementListItem$1];
8549
+ function NoCommaStatementListItem(ctx, state) {
8550
+ return $EVENT_C(ctx, state, "NoCommaStatementListItem", NoCommaStatementListItem$$);
8551
+ }
8552
+ var PostfixedNoCommaStatement$0 = $TS($S(NoCommaStatement, $E($S($E(_), PostfixStatement))), function($skip, $loc, $0, $1, $2) {
8553
+ var statement = $1;
8554
+ var post = $2;
8555
+ if (post)
8556
+ return addPostfixStatement(statement, ...post);
8557
+ return statement;
8558
+ });
8559
+ function PostfixedNoCommaStatement(ctx, state) {
8560
+ return $EVENT(ctx, state, "PostfixedNoCommaStatement", PostfixedNoCommaStatement$0);
8561
+ }
8459
8562
  var PostfixedExpression$0 = $TS($S(ExtendedExpression, $E($S($E(_), PostfixStatement))), function($skip, $loc, $0, $1, $2) {
8460
8563
  var expression = $1;
8461
8564
  var post = $2;
@@ -8466,6 +8569,19 @@ var require_parser = __commonJS({
8466
8569
  function PostfixedExpression(ctx, state) {
8467
8570
  return $EVENT(ctx, state, "PostfixedExpression", PostfixedExpression$0);
8468
8571
  }
8572
+ var PostfixedCommaExpression$0 = $TS($S(PostfixedExpression, $C($S($E(_), PostfixStatement), $Q($S(CommaDelimiter, AssignmentExpression)))), function($skip, $loc, $0, $1, $2) {
8573
+ var expression = $1;
8574
+ var post = $2;
8575
+ if (!post.length)
8576
+ return $1;
8577
+ if (post.length === 2 && !Array.isArray(post[1])) {
8578
+ return attachPostfixStatementAsExpression(expression, post);
8579
+ }
8580
+ return $0;
8581
+ });
8582
+ function PostfixedCommaExpression(ctx, state) {
8583
+ return $EVENT(ctx, state, "PostfixedCommaExpression", PostfixedCommaExpression$0);
8584
+ }
8469
8585
  var NonPipelinePostfixedExpression$0 = $TS($S(NonPipelineExtendedExpression, $E($S($E(_), PostfixStatement))), function($skip, $loc, $0, $1, $2) {
8470
8586
  var expression = $1;
8471
8587
  var post = $2;
@@ -8499,17 +8615,26 @@ var require_parser = __commonJS({
8499
8615
  var Statement$5 = TryStatement;
8500
8616
  var Statement$6 = EmptyStatement;
8501
8617
  var Statement$7 = LabelledStatement;
8502
- var Statement$8 = $TS($S(ExpressionStatement), function($skip, $loc, $0, $1) {
8503
- if ($1.type === "ObjectExpression" || $1.type === "FunctionExpression" && !$1.id) {
8504
- return makeLeftHandSideExpression($1);
8505
- }
8506
- return $1;
8507
- });
8618
+ var Statement$8 = CommaExpressionStatement;
8508
8619
  var Statement$9 = BlockStatement;
8509
8620
  var Statement$$ = [Statement$0, Statement$1, Statement$2, Statement$3, Statement$4, Statement$5, Statement$6, Statement$7, Statement$8, Statement$9];
8510
8621
  function Statement(ctx, state) {
8511
8622
  return $EVENT_C(ctx, state, "Statement", Statement$$);
8512
8623
  }
8624
+ var NoCommaStatement$0 = KeywordStatement;
8625
+ var NoCommaStatement$1 = VariableStatement;
8626
+ var NoCommaStatement$2 = IfStatement;
8627
+ var NoCommaStatement$3 = IterationStatement;
8628
+ var NoCommaStatement$4 = SwitchStatement;
8629
+ var NoCommaStatement$5 = TryStatement;
8630
+ var NoCommaStatement$6 = EmptyStatement;
8631
+ var NoCommaStatement$7 = LabelledStatement;
8632
+ var NoCommaStatement$8 = ExpressionStatement;
8633
+ var NoCommaStatement$9 = BlockStatement;
8634
+ var NoCommaStatement$$ = [NoCommaStatement$0, NoCommaStatement$1, NoCommaStatement$2, NoCommaStatement$3, NoCommaStatement$4, NoCommaStatement$5, NoCommaStatement$6, NoCommaStatement$7, NoCommaStatement$8, NoCommaStatement$9];
8635
+ function NoCommaStatement(ctx, state) {
8636
+ return $EVENT_C(ctx, state, "NoCommaStatement", NoCommaStatement$$);
8637
+ }
8513
8638
  var EmptyStatement$0 = $TS($S($E(_), $Y($EXPECT($L99, 'EmptyStatement ";"'))), function($skip, $loc, $0, $1, $2) {
8514
8639
  return { type: "EmptyStatement", children: $1 || [] };
8515
8640
  });
@@ -8988,14 +9113,14 @@ var require_parser = __commonJS({
8988
9113
  function CoffeeForDeclaration(ctx, state) {
8989
9114
  return $EVENT(ctx, state, "CoffeeForDeclaration", CoffeeForDeclaration$0);
8990
9115
  }
8991
- 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) {
9116
+ 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) {
8992
9117
  var declaration = $3;
8993
9118
  return {
8994
9119
  declaration,
8995
9120
  children: $0
8996
9121
  };
8997
9122
  });
8998
- 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) {
9123
+ 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) {
8999
9124
  var declaration = $3;
9000
9125
  return {
9001
9126
  declaration,
@@ -9571,8 +9696,18 @@ var require_parser = __commonJS({
9571
9696
  function RestoreAll(ctx, state) {
9572
9697
  return $EVENT(ctx, state, "RestoreAll", RestoreAll$0);
9573
9698
  }
9699
+ var CommaExpressionStatement$0 = IterationExpression;
9700
+ var CommaExpressionStatement$1 = $TS($S(CommaExpression), function($skip, $loc, $0, $1) {
9701
+ return makeExpressionStatement($1);
9702
+ });
9703
+ var CommaExpressionStatement$$ = [CommaExpressionStatement$0, CommaExpressionStatement$1];
9704
+ function CommaExpressionStatement(ctx, state) {
9705
+ return $EVENT_C(ctx, state, "CommaExpressionStatement", CommaExpressionStatement$$);
9706
+ }
9574
9707
  var ExpressionStatement$0 = IterationExpression;
9575
- var ExpressionStatement$1 = Expression;
9708
+ var ExpressionStatement$1 = $TS($S(AssignmentExpression), function($skip, $loc, $0, $1) {
9709
+ return makeExpressionStatement($1);
9710
+ });
9576
9711
  var ExpressionStatement$$ = [ExpressionStatement$0, ExpressionStatement$1];
9577
9712
  function ExpressionStatement(ctx, state) {
9578
9713
  return $EVENT_C(ctx, state, "ExpressionStatement", ExpressionStatement$$);
@@ -12206,7 +12341,7 @@ var require_parser = __commonJS({
12206
12341
  args
12207
12342
  };
12208
12343
  });
12209
- var TypePrimary$8 = $S(__, OpenParen, $C(Type, $S(EOS, Type)), __, CloseParen);
12344
+ var TypePrimary$8 = $S($E(_), OpenParen, $C(Type, $S(EOS, Type)), __, CloseParen);
12210
12345
  var TypePrimary$$ = [TypePrimary$0, TypePrimary$1, TypePrimary$2, TypePrimary$3, TypePrimary$4, TypePrimary$5, TypePrimary$6, TypePrimary$7, TypePrimary$8];
12211
12346
  function TypePrimary(ctx, state) {
12212
12347
  return $EVENT_C(ctx, state, "TypePrimary", TypePrimary$$);
@@ -13095,6 +13230,7 @@ var require_parser = __commonJS({
13095
13230
  exports.NestedTopLevelStatements = NestedTopLevelStatements;
13096
13231
  exports.TopLevelSingleLineStatements = TopLevelSingleLineStatements;
13097
13232
  exports.TopLevelStatement = TopLevelStatement;
13233
+ exports.ExtendedCommaExpression = ExtendedCommaExpression;
13098
13234
  exports.ExtendedExpression = ExtendedExpression;
13099
13235
  exports.SingleLineExtendedExpression = SingleLineExtendedExpression;
13100
13236
  exports.NonPipelineExtendedExpression = NonPipelineExtendedExpression;
@@ -13103,7 +13239,7 @@ var require_parser = __commonJS({
13103
13239
  exports.ExpressionizedStatementWithTrailingCallExpressions = ExpressionizedStatementWithTrailingCallExpressions;
13104
13240
  exports.ExpressionizedStatement = ExpressionizedStatement;
13105
13241
  exports._ExpressionizedStatement = _ExpressionizedStatement;
13106
- exports.Expression = Expression;
13242
+ exports.CommaExpression = CommaExpression;
13107
13243
  exports.Arguments = Arguments;
13108
13244
  exports.ImplicitArguments = ImplicitArguments;
13109
13245
  exports.ExplicitArguments = ExplicitArguments;
@@ -13248,15 +13384,18 @@ var require_parser = __commonJS({
13248
13384
  exports.BareBlock = BareBlock;
13249
13385
  exports.ThenClause = ThenClause;
13250
13386
  exports.BracedOrEmptyBlock = BracedOrEmptyBlock;
13387
+ exports.NoCommaBracedOrEmptyBlock = NoCommaBracedOrEmptyBlock;
13251
13388
  exports.NoPostfixBracedOrEmptyBlock = NoPostfixBracedOrEmptyBlock;
13252
13389
  exports.EmptyBlock = EmptyBlock;
13253
13390
  exports.EmptyBareBlock = EmptyBareBlock;
13254
13391
  exports.BracedBlock = BracedBlock;
13255
13392
  exports.NoPostfixBracedBlock = NoPostfixBracedBlock;
13393
+ exports.NoCommaBracedBlock = NoCommaBracedBlock;
13256
13394
  exports.NonSingleBracedBlock = NonSingleBracedBlock;
13257
13395
  exports.DeclarationOrStatement = DeclarationOrStatement;
13258
13396
  exports.SingleLineStatements = SingleLineStatements;
13259
13397
  exports.PostfixedSingleLineStatements = PostfixedSingleLineStatements;
13398
+ exports.PostfixedSingleLineNoCommaStatements = PostfixedSingleLineNoCommaStatements;
13260
13399
  exports.BracedContent = BracedContent;
13261
13400
  exports.NestedBlockStatements = NestedBlockStatements;
13262
13401
  exports.NestedBlockStatement = NestedBlockStatement;
@@ -13324,11 +13463,15 @@ var require_parser = __commonJS({
13324
13463
  exports.ModuleItem = ModuleItem;
13325
13464
  exports.StatementListItem = StatementListItem;
13326
13465
  exports.PostfixedStatement = PostfixedStatement;
13466
+ exports.NoCommaStatementListItem = NoCommaStatementListItem;
13467
+ exports.PostfixedNoCommaStatement = PostfixedNoCommaStatement;
13327
13468
  exports.PostfixedExpression = PostfixedExpression;
13469
+ exports.PostfixedCommaExpression = PostfixedCommaExpression;
13328
13470
  exports.NonPipelinePostfixedExpression = NonPipelinePostfixedExpression;
13329
13471
  exports.PostfixStatement = PostfixStatement;
13330
13472
  exports._PostfixStatement = _PostfixStatement;
13331
13473
  exports.Statement = Statement;
13474
+ exports.NoCommaStatement = NoCommaStatement;
13332
13475
  exports.EmptyStatement = EmptyStatement;
13333
13476
  exports.BlockStatement = BlockStatement;
13334
13477
  exports.LabelledStatement = LabelledStatement;
@@ -13412,6 +13555,7 @@ var require_parser = __commonJS({
13412
13555
  exports.NewlineBinaryOpAllowed = NewlineBinaryOpAllowed;
13413
13556
  exports.AllowAll = AllowAll;
13414
13557
  exports.RestoreAll = RestoreAll;
13558
+ exports.CommaExpressionStatement = CommaExpressionStatement;
13415
13559
  exports.ExpressionStatement = ExpressionStatement;
13416
13560
  exports.KeywordStatement = KeywordStatement;
13417
13561
  exports.DebuggerStatement = DebuggerStatement;
@@ -13801,6 +13945,7 @@ var require_parser = __commonJS({
13801
13945
  lastAccessInCallExpression,
13802
13946
  literalValue,
13803
13947
  makeEmptyBlock,
13948
+ makeExpressionStatement,
13804
13949
  makeGetterMethod,
13805
13950
  makeLeftHandSideExpression,
13806
13951
  makeRef,