@danielx/civet 0.4.5 → 0.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/browser.js CHANGED
@@ -535,6 +535,7 @@ var Civet = (() => {
535
535
  NestedCaseClause,
536
536
  CaseClause,
537
537
  CaseExpressionList,
538
+ NoExpressions,
538
539
  ImpliedColon,
539
540
  TryStatement,
540
541
  CatchClause,
@@ -586,6 +587,9 @@ var Civet = (() => {
586
587
  TripleDoubleStringCharacters,
587
588
  TripleSingleStringCharacters,
588
589
  CoffeeStringSubstitution,
590
+ CoffeeCompat,
591
+ CoffeeCompatDoubleQuotedString,
592
+ CoffeeCompatDoubleQuotedStringCharacters,
589
593
  RegularExpressionLiteral,
590
594
  RegularExpressionBody,
591
595
  RegExpCharacter,
@@ -652,6 +656,7 @@ var Civet = (() => {
652
656
  SubstitutionStart,
653
657
  Switch,
654
658
  Target,
659
+ Throw,
655
660
  TripleDoubleQuote,
656
661
  TripleSingleQuote,
657
662
  TripleTick,
@@ -728,6 +733,7 @@ var Civet = (() => {
728
733
  InsertSpace,
729
734
  InsertDot,
730
735
  InsertBreak,
736
+ Reset,
731
737
  Init,
732
738
  Indent,
733
739
  TrackIndent,
@@ -817,46 +823,46 @@ var Civet = (() => {
817
823
  var $L77 = $L("break");
818
824
  var $L78 = $L("continue");
819
825
  var $L79 = $L("debugger");
820
- var $L80 = $L("throw");
821
- var $L81 = $L("import type");
822
- var $L82 = $L("default");
823
- var $L83 = $L(":=");
824
- var $L84 = $L("/*");
825
- var $L85 = $L("*/");
826
- var $L86 = $L("###");
827
- var $L87 = $L("as");
828
- var $L88 = $L("async");
829
- var $L89 = $L("await");
830
- var $L90 = $L("case");
831
- var $L91 = $L("catch");
832
- var $L92 = $L("class");
833
- var $L93 = $L("#{");
834
- var $L94 = $L(":");
835
- var $L95 = $L(".");
836
- var $L96 = $L('"');
837
- var $L97 = $L("else");
838
- var $L98 = $L("export");
839
- var $L99 = $L("for");
840
- var $L100 = $L("from");
841
- var $L101 = $L("function");
842
- var $L102 = $L("get");
843
- var $L103 = $L("set");
844
- var $L104 = $L("if");
845
- var $L105 = $L("let");
846
- var $L106 = $L("const");
847
- var $L107 = $L("loop");
848
- var $L108 = $L("new");
849
- var $L109 = $L("of");
850
- var $L110 = $L("{");
851
- var $L111 = $L("[");
852
- var $L112 = $L("(");
853
- var $L113 = $L("?");
854
- var $L114 = $L("return");
855
- var $L115 = $L("'");
856
- var $L116 = $L("static");
857
- var $L117 = $L("${");
858
- var $L118 = $L("switch");
859
- var $L119 = $L("target");
826
+ var $L80 = $L("import type");
827
+ var $L81 = $L("default");
828
+ var $L82 = $L(":=");
829
+ var $L83 = $L("/*");
830
+ var $L84 = $L("*/");
831
+ var $L85 = $L("###");
832
+ var $L86 = $L("as");
833
+ var $L87 = $L("async");
834
+ var $L88 = $L("await");
835
+ var $L89 = $L("case");
836
+ var $L90 = $L("catch");
837
+ var $L91 = $L("class");
838
+ var $L92 = $L("#{");
839
+ var $L93 = $L(":");
840
+ var $L94 = $L(".");
841
+ var $L95 = $L('"');
842
+ var $L96 = $L("else");
843
+ var $L97 = $L("export");
844
+ var $L98 = $L("for");
845
+ var $L99 = $L("from");
846
+ var $L100 = $L("function");
847
+ var $L101 = $L("get");
848
+ var $L102 = $L("set");
849
+ var $L103 = $L("if");
850
+ var $L104 = $L("let");
851
+ var $L105 = $L("const");
852
+ var $L106 = $L("loop");
853
+ var $L107 = $L("new");
854
+ var $L108 = $L("of");
855
+ var $L109 = $L("{");
856
+ var $L110 = $L("[");
857
+ var $L111 = $L("(");
858
+ var $L112 = $L("?");
859
+ var $L113 = $L("return");
860
+ var $L114 = $L("'");
861
+ var $L115 = $L("static");
862
+ var $L116 = $L("${");
863
+ var $L117 = $L("switch");
864
+ var $L118 = $L("target");
865
+ var $L119 = $L("throw");
860
866
  var $L120 = $L('"""');
861
867
  var $L121 = $L("'''");
862
868
  var $L122 = $L("```");
@@ -893,31 +899,32 @@ var Civet = (() => {
893
899
  var $R10 = $R(new RegExp("(?:\\\\.|[^'])*", "suy"));
894
900
  var $R11 = $R(new RegExp('(?:"(?!"")|#(?!\\{)|\\\\.|[^#"])+', "suy"));
895
901
  var $R12 = $R(new RegExp("(?:'(?!'')|\\\\.|[^'])*", "suy"));
896
- var $R13 = $R(new RegExp("[*\\/\\r\\n]", "suy"));
897
- var $R14 = $R(new RegExp("(?:\\\\.|[^\\/\\r\\n])+", "suy"));
898
- var $R15 = $R(new RegExp("(?:\\p{ID_Continue}|[\\u200C\\u200D$])*", "suy"));
899
- var $R16 = $R(new RegExp("(?:\\$(?!\\{)|\\\\.|[^$`])+", "suy"));
900
- var $R17 = $R(new RegExp("(?:\\$(?!\\{)|`(?!``)|\\\\.|[^$`])+", "suy"));
901
- var $R18 = $R(new RegExp("(?:and|as|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|function|if|import|in|instanceof|interface|is|new|null|or|return|static|super|switch|this|throw|true|try|typeof|unless|var|void|while|with|yield)(?!\\p{ID_Continue})", "suy"));
902
- var $R19 = $R(new RegExp("\\/\\/[^\\r\\n]*", "suy"));
903
- var $R20 = $R(new RegExp(".", "suy"));
904
- var $R21 = $R(new RegExp("#([^\\r\\n]*)", "suy"));
905
- var $R22 = $R(new RegExp("[^\\r\\n]", "suy"));
906
- var $R23 = $R(new RegExp("[ \\t]+", "suy"));
907
- var $R24 = $R(new RegExp("[\\s]+", "suy"));
908
- var $R25 = $R(new RegExp("(?!\\p{ID_Continue})", "suy"));
909
- var $R26 = $R(new RegExp("\\s", "suy"));
910
- var $R27 = $R(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*", "suy"));
911
- var $R28 = $R(new RegExp('"[^"]*"', "suy"));
912
- var $R29 = $R(new RegExp("'[^']*'", "suy"));
913
- var $R30 = $R(new RegExp("[^{}<>]+", "suy"));
914
- var $R31 = $R(new RegExp("[+-]?", "suy"));
915
- var $R32 = $R(new RegExp("[+-]", "suy"));
916
- var $R33 = $R(new RegExp("#![^\\r\\n]*", "suy"));
917
- var $R34 = $R(new RegExp("[\\t ]*", "suy"));
918
- var $R35 = $R(new RegExp("\\r\\n|\\n|\\r|$", "suy"));
919
- var $R36 = $R(new RegExp("$", "suy"));
920
- var Program$0 = $S(Init, __, $Q(TopLevelStatement), __);
902
+ var $R13 = $R(new RegExp('(?:\\\\.|#(?!\\{)|[^"#])+', "suy"));
903
+ var $R14 = $R(new RegExp("[*\\/\\r\\n]", "suy"));
904
+ var $R15 = $R(new RegExp("(?:\\\\.|[^\\/\\r\\n])+", "suy"));
905
+ var $R16 = $R(new RegExp("(?:\\p{ID_Continue}|[\\u200C\\u200D$])*", "suy"));
906
+ var $R17 = $R(new RegExp("(?:\\$(?!\\{)|\\\\.|[^$`])+", "suy"));
907
+ var $R18 = $R(new RegExp("(?:\\$(?!\\{)|`(?!``)|\\\\.|[^$`])+", "suy"));
908
+ var $R19 = $R(new RegExp("(?:and|as|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|function|if|import|in|instanceof|interface|is|new|null|or|return|static|super|switch|this|throw|true|try|typeof|unless|var|void|while|with|yield)(?!\\p{ID_Continue})", "suy"));
909
+ var $R20 = $R(new RegExp("\\/\\/[^\\r\\n]*", "suy"));
910
+ var $R21 = $R(new RegExp(".", "suy"));
911
+ var $R22 = $R(new RegExp("#([^\\r\\n]*)", "suy"));
912
+ var $R23 = $R(new RegExp("[^\\r\\n]", "suy"));
913
+ var $R24 = $R(new RegExp("[ \\t]+", "suy"));
914
+ var $R25 = $R(new RegExp("[\\s]+", "suy"));
915
+ var $R26 = $R(new RegExp("(?!\\p{ID_Continue})", "suy"));
916
+ var $R27 = $R(new RegExp("\\s", "suy"));
917
+ var $R28 = $R(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*", "suy"));
918
+ var $R29 = $R(new RegExp('"[^"]*"', "suy"));
919
+ var $R30 = $R(new RegExp("'[^']*'", "suy"));
920
+ var $R31 = $R(new RegExp("[^{}<>]+", "suy"));
921
+ var $R32 = $R(new RegExp("[+-]?", "suy"));
922
+ var $R33 = $R(new RegExp("[+-]", "suy"));
923
+ var $R34 = $R(new RegExp("#![^\\r\\n]*", "suy"));
924
+ var $R35 = $R(new RegExp("[\\t ]*", "suy"));
925
+ var $R36 = $R(new RegExp("\\r\\n|\\n|\\r|$", "suy"));
926
+ var $R37 = $R(new RegExp("$", "suy"));
927
+ var Program$0 = $S(Reset, Init, __, $Q(TopLevelStatement), __);
921
928
  function Program(state) {
922
929
  if (state.verbose)
923
930
  console.log("ENTER:", "Program");
@@ -937,7 +944,11 @@ var Civet = (() => {
937
944
  return TopLevelStatement$0(state);
938
945
  }
939
946
  }
940
- var Expression$0 = $S(AssignmentExpression, $Q($S(__, Comma, AssignmentExpression)));
947
+ var Expression$0 = $TS($S(AssignmentExpression, $Q($S(__, Comma, AssignmentExpression))), function($skip, $loc, $0, $1, $2) {
948
+ if ($2.length == 0)
949
+ return $1;
950
+ return $0;
951
+ });
941
952
  function Expression(state) {
942
953
  if (state.verbose)
943
954
  console.log("ENTER:", "Expression");
@@ -1018,7 +1029,9 @@ var Civet = (() => {
1018
1029
  var spacing = $2;
1019
1030
  return module.insertTrimmingSpace(spacing, "(");
1020
1031
  });
1021
- var ApplicationStart$1 = $S(IndentedApplicationAllowed, $Y(NestedObjectLiteral), InsertOpenParen);
1032
+ var ApplicationStart$1 = $T($S(IndentedApplicationAllowed, $Y(NestedObjectLiteral), InsertOpenParen), function(value) {
1033
+ return value[2];
1034
+ });
1022
1035
  function ApplicationStart(state) {
1023
1036
  if (state.tokenize) {
1024
1037
  return $TOKEN("ApplicationStart", state, ApplicationStart$0(state) || ApplicationStart$1(state));
@@ -1050,7 +1063,11 @@ var Civet = (() => {
1050
1063
  return CommaExpression$0(state);
1051
1064
  }
1052
1065
  }
1053
- var BinaryOpExpression$0 = $S(UnaryExpression, $Q($S(__, BinaryOp, __, UnaryExpression)));
1066
+ var BinaryOpExpression$0 = $TS($S(UnaryExpression, $Q($S(__, BinaryOp, __, UnaryExpression))), function($skip, $loc, $0, $1, $2) {
1067
+ if ($2.length)
1068
+ return $0;
1069
+ return $1;
1070
+ });
1054
1071
  function BinaryOpExpression(state) {
1055
1072
  if (state.verbose)
1056
1073
  console.log("ENTER:", "BinaryOpExpression");
@@ -1090,7 +1107,11 @@ var Civet = (() => {
1090
1107
  }
1091
1108
  }
1092
1109
  var UpdateExpression$0 = $S(UpdateExpressionSymbol, UnaryExpression);
1093
- var UpdateExpression$1 = $S(LeftHandSideExpression, $E(UpdateExpressionSymbol));
1110
+ var UpdateExpression$1 = $TS($S(LeftHandSideExpression, $E(UpdateExpressionSymbol)), function($skip, $loc, $0, $1, $2) {
1111
+ if ($2)
1112
+ return $0;
1113
+ return $1;
1114
+ });
1094
1115
  function UpdateExpression(state) {
1095
1116
  if (state.tokenize) {
1096
1117
  return $TOKEN("UpdateExpression", state, UpdateExpression$0(state) || UpdateExpression$1(state));
@@ -1110,7 +1131,11 @@ var Civet = (() => {
1110
1131
  return UpdateExpressionSymbol$0(state);
1111
1132
  }
1112
1133
  }
1113
- var AssignmentExpression$0 = $S($Q(TrailingComment), AssignmentExpressionRest);
1134
+ var AssignmentExpression$0 = $TS($S($Q(TrailingComment), AssignmentExpressionRest), function($skip, $loc, $0, $1, $2) {
1135
+ if ($1.length)
1136
+ return $0;
1137
+ return $2;
1138
+ });
1114
1139
  var AssignmentExpression$1 = $S(__, AssignmentExpressionRest);
1115
1140
  function AssignmentExpression(state) {
1116
1141
  if (state.tokenize) {
@@ -1122,7 +1147,9 @@ var Civet = (() => {
1122
1147
  var AssignmentExpressionRest$0 = AwaitExpression;
1123
1148
  var AssignmentExpressionRest$1 = YieldExpression;
1124
1149
  var AssignmentExpressionRest$2 = $S($E($S(Async, __)), ArrowFunction);
1125
- var AssignmentExpressionRest$3 = $S($P($S(__, LeftHandSideExpression, __, AssignmentOp)), Expression);
1150
+ var AssignmentExpressionRest$3 = $T($S($P($S(__, LeftHandSideExpression, __, AssignmentOp)), Expression), function(value) {
1151
+ return { "type": "AssignmentExpression", "children": value };
1152
+ });
1126
1153
  var AssignmentExpressionRest$4 = ConditionalExpression;
1127
1154
  function AssignmentExpressionRest(state) {
1128
1155
  if (state.tokenize) {
@@ -1187,7 +1214,11 @@ var Civet = (() => {
1187
1214
  return FatArrowBody$0(state) || FatArrowBody$1(state) || FatArrowBody$2(state) || FatArrowBody$3(state) || FatArrowBody$4(state);
1188
1215
  }
1189
1216
  }
1190
- var ConditionalExpression$0 = $S(ShortCircuitExpression, $E($S(__, QuestionMark, AssignmentExpression, __, Colon, AssignmentExpression)));
1217
+ var ConditionalExpression$0 = $TS($S(ShortCircuitExpression, $E($S(__, QuestionMark, AssignmentExpression, __, Colon, AssignmentExpression))), function($skip, $loc, $0, $1, $2) {
1218
+ if ($2)
1219
+ return $0;
1220
+ return $1;
1221
+ });
1191
1222
  function ConditionalExpression(state) {
1192
1223
  if (state.verbose)
1193
1224
  console.log("ENTER:", "ConditionalExpression");
@@ -1376,7 +1407,11 @@ var Civet = (() => {
1376
1407
  }
1377
1408
  var CallExpression$0 = $S($EXPECT($L10, fail, 'CallExpression "super"'), ArgumentsWithTrailingCallExpressions);
1378
1409
  var CallExpression$1 = $S($EXPECT($L11, fail, 'CallExpression "import"'), __, OpenParen, AssignmentExpression, __, CloseParen);
1379
- var CallExpression$2 = $S(MemberExpression, $Q(CallExpressionRest));
1410
+ var CallExpression$2 = $TS($S(MemberExpression, $Q(CallExpressionRest)), function($skip, $loc, $0, $1, $2) {
1411
+ if ($2.length)
1412
+ return $0;
1413
+ return $1;
1414
+ });
1380
1415
  function CallExpression(state) {
1381
1416
  if (state.tokenize) {
1382
1417
  return $TOKEN("CallExpression", state, CallExpression$0(state) || CallExpression$1(state) || CallExpression$2(state));
@@ -1426,7 +1461,11 @@ var Civet = (() => {
1426
1461
  return AdditionalReservedWords$0(state);
1427
1462
  }
1428
1463
  }
1429
- var MemberExpression$0 = $S(PrimaryExpression, $Q(MemberExpressionRest));
1464
+ var MemberExpression$0 = $TS($S(PrimaryExpression, $Q(MemberExpressionRest)), function($skip, $loc, $0, $1, $2) {
1465
+ if ($2.length)
1466
+ return $0;
1467
+ return $1;
1468
+ });
1430
1469
  var MemberExpression$1 = $S($Q(TrailingComment), SuperProperty);
1431
1470
  var MemberExpression$2 = $S($Q(TrailingComment), MetaProperty);
1432
1471
  function MemberExpression(state) {
@@ -1662,7 +1701,9 @@ var Civet = (() => {
1662
1701
  }
1663
1702
  }
1664
1703
  var FunctionExpression$0 = ThinArrowFunction;
1665
- var FunctionExpression$1 = $S($E($S(Async, __)), Function, $E($S(Star, __)), $E(BindingIdentifier), __, Parameters, $E(ReturnTypeSuffix), BracedBlock);
1704
+ var FunctionExpression$1 = $T($S($E($S(Async, __)), Function, $E($S(Star, __)), $E(BindingIdentifier), __, Parameters, $E(ReturnTypeSuffix), BracedBlock), function(value) {
1705
+ return { "type": "FunctionExpression", "children": value };
1706
+ });
1666
1707
  function FunctionExpression(state) {
1667
1708
  if (state.tokenize) {
1668
1709
  return $TOKEN("FunctionExpression", state, FunctionExpression$0(state) || FunctionExpression$1(state));
@@ -1670,17 +1711,23 @@ var Civet = (() => {
1670
1711
  return FunctionExpression$0(state) || FunctionExpression$1(state);
1671
1712
  }
1672
1713
  }
1673
- var ThinArrowFunction$0 = $TS($S(Parameters, $E(ReturnTypeSuffix), __, Arrow, BracedOrEmptyBlock), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
1714
+ var ThinArrowFunction$0 = $TS($S(Parameters, $E(ReturnTypeSuffix), $Q(_), Arrow, BracedOrEmptyBlock), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
1674
1715
  var params = $1;
1675
1716
  var suffix = $2;
1676
1717
  var arrow = $4;
1677
1718
  var block = $5;
1678
- return [
1679
- { $loc: arrow.$loc, token: "function" },
1680
- params,
1681
- suffix,
1682
- block
1683
- ];
1719
+ if (module.implicitReturns && suffix?.children[3] !== "void") {
1720
+ block = module.addImplicitReturns(block);
1721
+ }
1722
+ return {
1723
+ type: "FunctionExpression",
1724
+ children: [
1725
+ { $loc: arrow.$loc, token: "function" },
1726
+ params,
1727
+ suffix,
1728
+ block
1729
+ ]
1730
+ };
1684
1731
  });
1685
1732
  function ThinArrowFunction(state) {
1686
1733
  if (state.verbose)
@@ -1703,8 +1750,14 @@ var Civet = (() => {
1703
1750
  return Arrow$0(state);
1704
1751
  }
1705
1752
  }
1706
- var Block$0 = $S(__, OpenBrace, EOS, NestedBlockExpressions, __, CloseBrace);
1707
- var Block$1 = $S(InsertOpenBrace, EOS, NestedBlockExpressions, InsertNewline, InsertIndent, InsertCloseBrace);
1753
+ var Block$0 = $T($S(__, OpenBrace, EOS, NestedBlockExpressions, __, CloseBrace), function(value) {
1754
+ var exps = value[3];
1755
+ return { "type": "BlockStatement", "expressions": exps, "children": value };
1756
+ });
1757
+ var Block$1 = $T($S(InsertOpenBrace, EOS, NestedBlockExpressions, InsertNewline, InsertIndent, InsertCloseBrace), function(value) {
1758
+ var exps = value[2];
1759
+ return { "type": "BlockStatement", "expressions": exps, "children": value };
1760
+ });
1708
1761
  var Block$2 = Statement;
1709
1762
  var Block$3 = $S(__, Statement);
1710
1763
  function Block(state) {
@@ -1715,7 +1768,9 @@ var Civet = (() => {
1715
1768
  }
1716
1769
  }
1717
1770
  var BracedOrEmptyBlock$0 = BracedBlock;
1718
- var BracedOrEmptyBlock$1 = $S(InsertOpenBrace, InsertCloseBrace);
1771
+ var BracedOrEmptyBlock$1 = $T($S(InsertOpenBrace, InsertCloseBrace), function(value) {
1772
+ return { "type": "BlockStatement", "expressions": [], "children": value };
1773
+ });
1719
1774
  function BracedOrEmptyBlock(state) {
1720
1775
  if (state.tokenize) {
1721
1776
  return $TOKEN("BracedOrEmptyBlock", state, BracedOrEmptyBlock$0(state) || BracedOrEmptyBlock$1(state));
@@ -1723,9 +1778,22 @@ var Civet = (() => {
1723
1778
  return BracedOrEmptyBlock$0(state) || BracedOrEmptyBlock$1(state);
1724
1779
  }
1725
1780
  }
1726
- var BracedBlock$0 = $S(__, OpenBrace, EOS, NestedBlockExpressions, __, CloseBrace);
1727
- var BracedBlock$1 = $S(InsertOpenBrace, EOS, NestedBlockExpressions, InsertNewline, InsertIndent, InsertCloseBrace);
1728
- var BracedBlock$2 = $S(InsertOpenBrace, $N(EOS), __, Statement, InsertSpace, InsertCloseBrace);
1781
+ var BracedBlock$0 = $T($S(__, OpenBrace, EOS, NestedBlockExpressions, __, CloseBrace), function(value) {
1782
+ var exps = value[3];
1783
+ return { "type": "BlockStatement", "expressions": exps, "children": value };
1784
+ });
1785
+ var BracedBlock$1 = $T($S(InsertOpenBrace, EOS, NestedBlockExpressions, InsertNewline, InsertIndent, InsertCloseBrace), function(value) {
1786
+ var exps = value[2];
1787
+ return { "type": "BlockStatement", "expressions": exps, "children": value };
1788
+ });
1789
+ var BracedBlock$2 = $TS($S(InsertOpenBrace, $N(EOS), __, Statement, InsertSpace, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
1790
+ var s = $4;
1791
+ return {
1792
+ type: "BlockStatement",
1793
+ expressions: [s],
1794
+ children: $0
1795
+ };
1796
+ });
1729
1797
  function BracedBlock(state) {
1730
1798
  if (state.tokenize) {
1731
1799
  return $TOKEN("BracedBlock", state, BracedBlock$0(state) || BracedBlock$1(state) || BracedBlock$2(state));
@@ -1820,7 +1888,9 @@ var Civet = (() => {
1820
1888
  return Comma$0(state);
1821
1889
  }
1822
1890
  }
1823
- var Identifier$0 = $S($N(ReservedWord), IdentifierName);
1891
+ var Identifier$0 = $T($S($N(ReservedWord), IdentifierName), function(value) {
1892
+ return value[1];
1893
+ });
1824
1894
  function Identifier(state) {
1825
1895
  if (state.verbose)
1826
1896
  console.log("ENTER:", "Identifier");
@@ -2208,8 +2278,7 @@ var Civet = (() => {
2208
2278
  var l = $3;
2209
2279
  if (cond)
2210
2280
  return [cond, statement, { $loc: l.$loc, token: "}" }];
2211
- $0.pop();
2212
- return $0;
2281
+ return statement;
2213
2282
  });
2214
2283
  function StatementListItem(state) {
2215
2284
  if (state.verbose)
@@ -2264,7 +2333,9 @@ var Civet = (() => {
2264
2333
  return Statement$0(state) || Statement$1(state) || Statement$2(state) || Statement$3(state) || Statement$4(state) || Statement$5(state) || Statement$6(state) || Statement$7(state) || Statement$8(state);
2265
2334
  }
2266
2335
  }
2267
- var EmptyStatement$0 = $S($Q(TrailingComment), $Y($EXPECT($L72, fail, 'EmptyStatement ";"')));
2336
+ var EmptyStatement$0 = $T($S($Q(TrailingComment), $Y($EXPECT($L72, fail, 'EmptyStatement ";"'))), function(value) {
2337
+ return { "type": "EmptyStatement", "children": value[0] };
2338
+ });
2268
2339
  function EmptyStatement(state) {
2269
2340
  if (state.verbose)
2270
2341
  console.log("ENTER:", "EmptyStatement");
@@ -2284,7 +2355,9 @@ var Civet = (() => {
2284
2355
  return BlockStatement$0(state);
2285
2356
  }
2286
2357
  }
2287
- var IfStatement$0 = $S(If, Condition, Block, $E($S(__, Else, Block)));
2358
+ var IfStatement$0 = $T($S(If, Condition, Block, $E($S(__, Else, Block))), function(value) {
2359
+ return { "type": "IfStatement", "children": value };
2360
+ });
2288
2361
  var IfStatement$1 = $TS($S(Unless, Condition, Block), function($skip, $loc, $0, $1, $2, $3) {
2289
2362
  var kind = $1;
2290
2363
  var condition = $2;
@@ -2298,7 +2371,10 @@ var Civet = (() => {
2298
2371
  c.token = "))";
2299
2372
  });
2300
2373
  kind.token = "if";
2301
- return [kind, condition, block];
2374
+ return {
2375
+ type: "IfStatement",
2376
+ children: [kind, condition, block]
2377
+ };
2302
2378
  });
2303
2379
  function IfStatement(state) {
2304
2380
  if (state.tokenize) {
@@ -2310,8 +2386,12 @@ var Civet = (() => {
2310
2386
  var IterationStatement$0 = LoopStatement;
2311
2387
  var IterationStatement$1 = DoWhileStatement;
2312
2388
  var IterationStatement$2 = WhileStatement;
2313
- var IterationStatement$3 = ForStatement;
2314
- var IterationStatement$4 = ForInOfStatement;
2389
+ var IterationStatement$3 = $T($S(ForStatement), function(value) {
2390
+ return { "type": "IterationStatement", "children": value };
2391
+ });
2392
+ var IterationStatement$4 = $T($S(ForInOfStatement), function(value) {
2393
+ return { "type": "IterationStatement", "children": value };
2394
+ });
2315
2395
  function IterationStatement(state) {
2316
2396
  if (state.tokenize) {
2317
2397
  return $TOKEN("IterationStatement", state, IterationStatement$0(state) || IterationStatement$1(state) || IterationStatement$2(state) || IterationStatement$3(state) || IterationStatement$4(state));
@@ -2319,7 +2399,9 @@ var Civet = (() => {
2319
2399
  return IterationStatement$0(state) || IterationStatement$1(state) || IterationStatement$2(state) || IterationStatement$3(state) || IterationStatement$4(state);
2320
2400
  }
2321
2401
  }
2322
- var LoopStatement$0 = $S(Loop, Block);
2402
+ var LoopStatement$0 = $T($S(Loop, Block), function(value) {
2403
+ return { "type": "IterationStatement", "children": value };
2404
+ });
2323
2405
  function LoopStatement(state) {
2324
2406
  if (state.verbose)
2325
2407
  console.log("ENTER:", "LoopStatement");
@@ -2329,7 +2411,9 @@ var Civet = (() => {
2329
2411
  return LoopStatement$0(state);
2330
2412
  }
2331
2413
  }
2332
- var DoWhileStatement$0 = $S($EXPECT($L73, fail, 'DoWhileStatement "do"'), NonIdContinue, Block, __, WhileClause);
2414
+ var DoWhileStatement$0 = $T($S($EXPECT($L73, fail, 'DoWhileStatement "do"'), NonIdContinue, Block, __, WhileClause), function(value) {
2415
+ return { "type": "IterationStatement", "children": value };
2416
+ });
2333
2417
  function DoWhileStatement(state) {
2334
2418
  if (state.verbose)
2335
2419
  console.log("ENTER:", "DoWhileStatement");
@@ -2339,7 +2423,9 @@ var Civet = (() => {
2339
2423
  return DoWhileStatement$0(state);
2340
2424
  }
2341
2425
  }
2342
- var WhileStatement$0 = $S(WhileClause, Block);
2426
+ var WhileStatement$0 = $T($S(WhileClause, Block), function(value) {
2427
+ return { "type": "IterationStatement", "children": value };
2428
+ });
2343
2429
  function WhileStatement(state) {
2344
2430
  if (state.verbose)
2345
2431
  console.log("ENTER:", "WhileStatement");
@@ -2408,7 +2494,9 @@ var Civet = (() => {
2408
2494
  return ForBinding$0(state) || ForBinding$1(state);
2409
2495
  }
2410
2496
  }
2411
- var SwitchStatement$0 = $S(Switch, Condition, CaseBlock);
2497
+ var SwitchStatement$0 = $T($S(Switch, Condition, CaseBlock), function(value) {
2498
+ return { "type": "SwitchStatement", "children": value };
2499
+ });
2412
2500
  function SwitchStatement(state) {
2413
2501
  if (state.verbose)
2414
2502
  console.log("ENTER:", "SwitchStatement");
@@ -2418,8 +2506,24 @@ var Civet = (() => {
2418
2506
  return SwitchStatement$0(state);
2419
2507
  }
2420
2508
  }
2421
- var CaseBlock$0 = $S(__, OpenBrace, $Y(EOS), NestedCaseClauses, __, CloseBrace);
2422
- var CaseBlock$1 = $S($Y(EOS), InsertOpenBrace, NestedCaseClauses, InsertNewline, InsertCloseBrace);
2509
+ var CaseBlock$0 = $TS($S(__, OpenBrace, $Y(EOS), NestedCaseClauses, __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
2510
+ var clauses = $4;
2511
+ $0.splice(2, 1);
2512
+ return {
2513
+ type: "CaseBlock",
2514
+ clauses,
2515
+ children: $0
2516
+ };
2517
+ });
2518
+ var CaseBlock$1 = $TS($S($Y(EOS), InsertOpenBrace, NestedCaseClauses, InsertNewline, InsertIndent, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
2519
+ var clauses = $3;
2520
+ $0.shift();
2521
+ return {
2522
+ type: "CaseBlock",
2523
+ clauses,
2524
+ children: $0
2525
+ };
2526
+ });
2423
2527
  function CaseBlock(state) {
2424
2528
  if (state.tokenize) {
2425
2529
  return $TOKEN("CaseBlock", state, CaseBlock$0(state) || CaseBlock$1(state));
@@ -2442,7 +2546,10 @@ var Civet = (() => {
2442
2546
  return NestedCaseClauses$0(state);
2443
2547
  }
2444
2548
  }
2445
- var NestedCaseClause$0 = $S(Nested, CaseClause);
2549
+ var NestedCaseClause$0 = $TS($S(Nested, CaseClause), function($skip, $loc, $0, $1, $2) {
2550
+ $2.children.unshift($1);
2551
+ return $2;
2552
+ });
2446
2553
  function NestedCaseClause(state) {
2447
2554
  if (state.verbose)
2448
2555
  console.log("ENTER:", "NestedCaseClause");
@@ -2452,14 +2559,32 @@ var Civet = (() => {
2452
2559
  return NestedCaseClause$0(state);
2453
2560
  }
2454
2561
  }
2455
- var CaseClause$0 = $S(Case, CaseExpressionList, NestedBlockExpressions);
2456
- var CaseClause$1 = $S(When, CaseExpressionList, NestedBlockExpressions, InsertBreak);
2457
- var CaseClause$2 = $S(Default, ImpliedColon, NestedBlockExpressions);
2562
+ var CaseClause$0 = $T($S(Case, CaseExpressionList, $C(NestedBlockExpressions, NoExpressions)), function(value) {
2563
+ var exps = value[2];
2564
+ return { "type": "CaseClause", "expressions": exps, "children": value };
2565
+ });
2566
+ var CaseClause$1 = $T($S(When, CaseExpressionList, NestedBlockExpressions, InsertBreak), function(value) {
2567
+ var exps = value[2];
2568
+ return { "type": "WhenClause", "expressions": exps, "children": value };
2569
+ });
2570
+ var CaseClause$2 = $T($S(Default, ImpliedColon, $C(NestedBlockExpressions, NoExpressions)), function(value) {
2571
+ var exps = value[2];
2572
+ return { "type": "DefaultClause", "expressions": exps, "children": value };
2573
+ });
2574
+ var CaseClause$3 = $TS($S(Else, ImpliedColon, NestedBlockExpressions), function($skip, $loc, $0, $1, $2, $3) {
2575
+ var exps = $3;
2576
+ $1.token = "default";
2577
+ return {
2578
+ type: "DefaultClause",
2579
+ expressions: exps,
2580
+ children: $0
2581
+ };
2582
+ });
2458
2583
  function CaseClause(state) {
2459
2584
  if (state.tokenize) {
2460
- return $TOKEN("CaseClause", state, CaseClause$0(state) || CaseClause$1(state) || CaseClause$2(state));
2585
+ return $TOKEN("CaseClause", state, CaseClause$0(state) || CaseClause$1(state) || CaseClause$2(state) || CaseClause$3(state));
2461
2586
  } else {
2462
- return CaseClause$0(state) || CaseClause$1(state) || CaseClause$2(state);
2587
+ return CaseClause$0(state) || CaseClause$1(state) || CaseClause$2(state) || CaseClause$3(state);
2463
2588
  }
2464
2589
  }
2465
2590
  var CaseExpressionList$0 = $TS($S($S($Q(_), ExpressionWithIndentedApplicationSuppressed, ImpliedColon), $Q($S(__, Comma, ExpressionWithIndentedApplicationSuppressed, ImpliedColon))), function($skip, $loc, $0, $1, $2) {
@@ -2481,6 +2606,18 @@ var Civet = (() => {
2481
2606
  return CaseExpressionList$0(state);
2482
2607
  }
2483
2608
  }
2609
+ var NoExpressions$0 = $T($EXPECT($L1, fail, 'NoExpressions ""'), function(value) {
2610
+ return [];
2611
+ });
2612
+ function NoExpressions(state) {
2613
+ if (state.verbose)
2614
+ console.log("ENTER:", "NoExpressions");
2615
+ if (state.tokenize) {
2616
+ return $TOKEN("NoExpressions", state, NoExpressions$0(state));
2617
+ } else {
2618
+ return NoExpressions$0(state);
2619
+ }
2620
+ }
2484
2621
  var ImpliedColon$0 = $S(__, Colon);
2485
2622
  var ImpliedColon$1 = $TV($EXPECT($L1, fail, 'ImpliedColon ""'), function($skip, $loc, $0, $1) {
2486
2623
  return { $loc, token: ":" };
@@ -2493,12 +2630,20 @@ var Civet = (() => {
2493
2630
  }
2494
2631
  }
2495
2632
  var TryStatement$0 = $TS($S(Try, BracedBlock, $E(CatchClause), $E(Finally)), function($skip, $loc, $0, $1, $2, $3, $4) {
2633
+ var t = $1;
2634
+ var b = $2;
2496
2635
  var c = $3;
2497
2636
  var f = $4;
2498
2637
  if (!c && !f) {
2499
- return [$1, $2, " catch {}"];
2638
+ return {
2639
+ type: "TryStatement",
2640
+ children: [t, b, " catch(e) {}"]
2641
+ };
2500
2642
  }
2501
- return [$1, $2, c, f];
2643
+ return {
2644
+ type: "TryStatement",
2645
+ children: [t, b, c, f]
2646
+ };
2502
2647
  });
2503
2648
  function TryStatement(state) {
2504
2649
  if (state.verbose)
@@ -2520,7 +2665,7 @@ var Civet = (() => {
2520
2665
  }
2521
2666
  }
2522
2667
  var CatchBind$0 = $S(__, OpenParen, __, CatchParameter, __, CloseParen);
2523
- var CatchBind$1 = $S(__, InsertOpenParen, CatchParameter, InsertCloseParen);
2668
+ var CatchBind$1 = $S($N(EOS), $Q(TrailingComment), InsertOpenParen, CatchParameter, InsertCloseParen);
2524
2669
  function CatchBind(state) {
2525
2670
  if (state.tokenize) {
2526
2671
  return $TOKEN("CatchBind", state, CatchBind$0(state) || CatchBind$1(state));
@@ -2594,11 +2739,21 @@ var Civet = (() => {
2594
2739
  return ExpressionStatement$0(state);
2595
2740
  }
2596
2741
  }
2597
- var KeywordStatement$0 = $S($EXPECT($L77, fail, 'KeywordStatement "break"'), NonIdContinue);
2598
- var KeywordStatement$1 = $S($EXPECT($L78, fail, 'KeywordStatement "continue"'), NonIdContinue);
2599
- var KeywordStatement$2 = $S($EXPECT($L79, fail, 'KeywordStatement "debugger"'), NonIdContinue);
2600
- var KeywordStatement$3 = $S(Return, $E(MaybeNestedExpression));
2601
- var KeywordStatement$4 = $S($EXPECT($L80, fail, 'KeywordStatement "throw"'), NonIdContinue, Expression);
2742
+ var KeywordStatement$0 = $T($S($EXPECT($L77, fail, 'KeywordStatement "break"'), NonIdContinue), function(value) {
2743
+ return { "type": "BreakStatement", "children": value };
2744
+ });
2745
+ var KeywordStatement$1 = $T($S($EXPECT($L78, fail, 'KeywordStatement "continue"'), NonIdContinue), function(value) {
2746
+ return { "type": "ContinueStatement", "children": value };
2747
+ });
2748
+ var KeywordStatement$2 = $T($S($EXPECT($L79, fail, 'KeywordStatement "debugger"'), NonIdContinue), function(value) {
2749
+ return { "type": "DebuggerStatement", "children": value };
2750
+ });
2751
+ var KeywordStatement$3 = $T($S(Return, $E(MaybeNestedExpression)), function(value) {
2752
+ return { "type": "ReturnStatement", "children": value };
2753
+ });
2754
+ var KeywordStatement$4 = $T($S(Throw, Expression), function(value) {
2755
+ return { "type": "ThrowStatement", "children": value };
2756
+ });
2602
2757
  function KeywordStatement(state) {
2603
2758
  if (state.tokenize) {
2604
2759
  return $TOKEN("KeywordStatement", state, KeywordStatement$0(state) || KeywordStatement$1(state) || KeywordStatement$2(state) || KeywordStatement$3(state) || KeywordStatement$4(state));
@@ -2615,7 +2770,7 @@ var Civet = (() => {
2615
2770
  return MaybeNestedExpression$0(state) || MaybeNestedExpression$1(state);
2616
2771
  }
2617
2772
  }
2618
- var ImportDeclaration$0 = $T($S($EXPECT($L81, fail, 'ImportDeclaration "import type"'), NonIdContinue, __, ImportClause, __, FromClause), function(value) {
2773
+ var ImportDeclaration$0 = $T($S($EXPECT($L80, fail, 'ImportDeclaration "import type"'), NonIdContinue, __, ImportClause, __, FromClause), function(value) {
2619
2774
  return { "ts": true, "children": value };
2620
2775
  });
2621
2776
  var ImportDeclaration$1 = $S(Import, __, ImportClause, __, FromClause);
@@ -2753,7 +2908,7 @@ var Civet = (() => {
2753
2908
  return ImportedBinding$0(state);
2754
2909
  }
2755
2910
  }
2756
- var ExportDeclaration$0 = $S(Export, __, $EXPECT($L82, fail, 'ExportDeclaration "default"'), NonIdContinue, __, $C(HoistableDeclaration, ClassDeclaration, AssignmentExpression));
2911
+ var ExportDeclaration$0 = $S(Export, __, $EXPECT($L81, fail, 'ExportDeclaration "default"'), NonIdContinue, __, $C(HoistableDeclaration, ClassDeclaration, AssignmentExpression));
2757
2912
  var ExportDeclaration$1 = $S(Export, __, ExportFromClause, __, FromClause);
2758
2913
  var ExportDeclaration$2 = $S(Export, __, $C(NamedExports, VariableStatement, Declaration));
2759
2914
  function ExportDeclaration(state) {
@@ -2813,7 +2968,9 @@ var Civet = (() => {
2813
2968
  return HoistableDeclaration$0(state);
2814
2969
  }
2815
2970
  }
2816
- var LexicalDeclaration$0 = $S(LetOrConst, __, LexicalBinding, $Q($S(__, Comma, __, LexicalBinding)));
2971
+ var LexicalDeclaration$0 = $T($S(LetOrConst, __, LexicalBinding, $Q($S(__, Comma, __, LexicalBinding))), function(value) {
2972
+ return { "type": "VariableDeclaration", "children": value };
2973
+ });
2817
2974
  var LexicalDeclaration$1 = $TS($S(InsertConst, $C(BindingPattern, BindingIdentifier), $E(TypeSuffix), __, ConstAssignment, AssignmentExpression), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
2818
2975
  var c = $1;
2819
2976
  var ca = $5;
@@ -2821,7 +2978,10 @@ var Civet = (() => {
2821
2978
  pos: ca.$loc.pos - 1,
2822
2979
  length: ca.$loc.length + 1
2823
2980
  };
2824
- return $0;
2981
+ return {
2982
+ type: "VariableDeclaration",
2983
+ children: $0
2984
+ };
2825
2985
  });
2826
2986
  function LexicalDeclaration(state) {
2827
2987
  if (state.tokenize) {
@@ -2830,7 +2990,7 @@ var Civet = (() => {
2830
2990
  return LexicalDeclaration$0(state) || LexicalDeclaration$1(state);
2831
2991
  }
2832
2992
  }
2833
- var ConstAssignment$0 = $TV($EXPECT($L83, fail, 'ConstAssignment ":="'), function($skip, $loc, $0, $1) {
2993
+ var ConstAssignment$0 = $TV($EXPECT($L82, fail, 'ConstAssignment ":="'), function($skip, $loc, $0, $1) {
2834
2994
  return { $loc, token: "=" };
2835
2995
  });
2836
2996
  function ConstAssignment(state) {
@@ -2861,7 +3021,9 @@ var Civet = (() => {
2861
3021
  return Initializer$0(state);
2862
3022
  }
2863
3023
  }
2864
- var VariableStatement$0 = $S(Var, __, VariableDeclarationList);
3024
+ var VariableStatement$0 = $T($S(Var, __, VariableDeclarationList), function(value) {
3025
+ return { "type": "VariableDeclaration", "children": value };
3026
+ });
2865
3027
  function VariableStatement(state) {
2866
3028
  if (state.verbose)
2867
3029
  console.log("ENTER:", "VariableStatement");
@@ -2973,12 +3135,13 @@ var Civet = (() => {
2973
3135
  var e = $3;
2974
3136
  return [s, module.dedentBlockString(str), e];
2975
3137
  });
2976
- var StringLiteral$2 = BasicStringLiteral;
3138
+ var StringLiteral$2 = CoffeeCompatDoubleQuotedString;
3139
+ var StringLiteral$3 = BasicStringLiteral;
2977
3140
  function StringLiteral(state) {
2978
3141
  if (state.tokenize) {
2979
- return $TOKEN("StringLiteral", state, StringLiteral$0(state) || StringLiteral$1(state) || StringLiteral$2(state));
3142
+ return $TOKEN("StringLiteral", state, StringLiteral$0(state) || StringLiteral$1(state) || StringLiteral$2(state) || StringLiteral$3(state));
2980
3143
  } else {
2981
- return StringLiteral$0(state) || StringLiteral$1(state) || StringLiteral$2(state);
3144
+ return StringLiteral$0(state) || StringLiteral$1(state) || StringLiteral$2(state) || StringLiteral$3(state);
2982
3145
  }
2983
3146
  }
2984
3147
  var BasicStringLiteral$0 = $TS($S(DoubleQuote, DoubleStringCharacters, DoubleQuote), function($skip, $loc, $0, $1, $2, $3) {
@@ -3060,6 +3223,61 @@ var Civet = (() => {
3060
3223
  return CoffeeStringSubstitution$0(state);
3061
3224
  }
3062
3225
  }
3226
+ var CoffeeCompat$0 = $TV($EXPECT($L1, fail, 'CoffeeCompat ""'), function($skip, $loc, $0, $1) {
3227
+ if (module.coffeeCompat)
3228
+ return;
3229
+ return $skip;
3230
+ });
3231
+ function CoffeeCompat(state) {
3232
+ if (state.verbose)
3233
+ console.log("ENTER:", "CoffeeCompat");
3234
+ if (state.tokenize) {
3235
+ return $TOKEN("CoffeeCompat", state, CoffeeCompat$0(state));
3236
+ } else {
3237
+ return CoffeeCompat$0(state);
3238
+ }
3239
+ }
3240
+ var CoffeeCompatDoubleQuotedString$0 = $TS($S(CoffeeCompat, DoubleQuote, $Q($C(CoffeeCompatDoubleQuotedStringCharacters, CoffeeStringSubstitution)), DoubleQuote), function($skip, $loc, $0, $1, $2, $3, $4) {
3241
+ var s = $2;
3242
+ var parts = $3;
3243
+ var e = $4;
3244
+ const noInterpolations = parts.length === 1 && parts[0].token != null;
3245
+ if (noInterpolations) {
3246
+ return {
3247
+ token: `"${module.modifyString(parts[0].token)}"`,
3248
+ $loc
3249
+ };
3250
+ }
3251
+ parts.forEach((part) => {
3252
+ if (part.token) {
3253
+ const str = part.token.replace(/(`|\$\{)/g, "\\$1");
3254
+ part.token = module.modifyString(str);
3255
+ }
3256
+ });
3257
+ s.token = e.token = "`";
3258
+ return [s, parts, e];
3259
+ });
3260
+ function CoffeeCompatDoubleQuotedString(state) {
3261
+ if (state.verbose)
3262
+ console.log("ENTER:", "CoffeeCompatDoubleQuotedString");
3263
+ if (state.tokenize) {
3264
+ return $TOKEN("CoffeeCompatDoubleQuotedString", state, CoffeeCompatDoubleQuotedString$0(state));
3265
+ } else {
3266
+ return CoffeeCompatDoubleQuotedString$0(state);
3267
+ }
3268
+ }
3269
+ var CoffeeCompatDoubleQuotedStringCharacters$0 = $TR($EXPECT($R13, fail, 'CoffeeCompatDoubleQuotedStringCharacters /(?:\\\\.|#(?!\\{)|[^"#])+/'), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
3270
+ return { $loc, token: $0 };
3271
+ });
3272
+ function CoffeeCompatDoubleQuotedStringCharacters(state) {
3273
+ if (state.verbose)
3274
+ console.log("ENTER:", "CoffeeCompatDoubleQuotedStringCharacters");
3275
+ if (state.tokenize) {
3276
+ return $TOKEN("CoffeeCompatDoubleQuotedStringCharacters", state, CoffeeCompatDoubleQuotedStringCharacters$0(state));
3277
+ } else {
3278
+ return CoffeeCompatDoubleQuotedStringCharacters$0(state);
3279
+ }
3280
+ }
3063
3281
  var RegularExpressionLiteral$0 = $TV($TEXT($S($EXPECT($L44, fail, 'RegularExpressionLiteral "/"'), RegularExpressionBody, $EXPECT($L44, fail, 'RegularExpressionLiteral "/"'), RegularExpressionFlags)), function($skip, $loc, $0, $1) {
3064
3282
  return { $loc, token: $1 };
3065
3283
  });
@@ -3072,7 +3290,7 @@ var Civet = (() => {
3072
3290
  return RegularExpressionLiteral$0(state);
3073
3291
  }
3074
3292
  }
3075
- var RegularExpressionBody$0 = $S($N($R$0($EXPECT($R13, fail, "RegularExpressionBody /[*\\/\\r\\n]/"))), $Q(RegExpCharacter));
3293
+ var RegularExpressionBody$0 = $S($N($R$0($EXPECT($R14, fail, "RegularExpressionBody /[*\\/\\r\\n]/"))), $Q(RegExpCharacter));
3076
3294
  function RegularExpressionBody(state) {
3077
3295
  if (state.verbose)
3078
3296
  console.log("ENTER:", "RegularExpressionBody");
@@ -3082,7 +3300,7 @@ var Civet = (() => {
3082
3300
  return RegularExpressionBody$0(state);
3083
3301
  }
3084
3302
  }
3085
- var RegExpCharacter$0 = $R$0($EXPECT($R14, fail, "RegExpCharacter /(?:\\\\.|[^\\/\\r\\n])+/"));
3303
+ var RegExpCharacter$0 = $R$0($EXPECT($R15, fail, "RegExpCharacter /(?:\\\\.|[^\\/\\r\\n])+/"));
3086
3304
  function RegExpCharacter(state) {
3087
3305
  if (state.verbose)
3088
3306
  console.log("ENTER:", "RegExpCharacter");
@@ -3092,7 +3310,7 @@ var Civet = (() => {
3092
3310
  return RegExpCharacter$0(state);
3093
3311
  }
3094
3312
  }
3095
- var RegularExpressionFlags$0 = $R$0($EXPECT($R15, fail, "RegularExpressionFlags /(?:\\p{ID_Continue}|[\\u200C\\u200D$])*/"));
3313
+ var RegularExpressionFlags$0 = $R$0($EXPECT($R16, fail, "RegularExpressionFlags /(?:\\p{ID_Continue}|[\\u200C\\u200D$])*/"));
3096
3314
  function RegularExpressionFlags(state) {
3097
3315
  if (state.verbose)
3098
3316
  console.log("ENTER:", "RegularExpressionFlags");
@@ -3123,7 +3341,7 @@ var Civet = (() => {
3123
3341
  return TemplateSubstitution$0(state);
3124
3342
  }
3125
3343
  }
3126
- var TemplateCharacters$0 = $TR($EXPECT($R16, fail, "TemplateCharacters /(?:\\$(?!\\{)|\\\\.|[^$`])+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
3344
+ var TemplateCharacters$0 = $TR($EXPECT($R17, fail, "TemplateCharacters /(?:\\$(?!\\{)|\\\\.|[^$`])+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
3127
3345
  return { $loc, token: $0 };
3128
3346
  });
3129
3347
  function TemplateCharacters(state) {
@@ -3135,7 +3353,7 @@ var Civet = (() => {
3135
3353
  return TemplateCharacters$0(state);
3136
3354
  }
3137
3355
  }
3138
- var TemplateBlockCharacters$0 = $TR($EXPECT($R17, fail, "TemplateBlockCharacters /(?:\\$(?!\\{)|`(?!``)|\\\\.|[^$`])+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
3356
+ var TemplateBlockCharacters$0 = $TR($EXPECT($R18, fail, "TemplateBlockCharacters /(?:\\$(?!\\{)|`(?!``)|\\\\.|[^$`])+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
3139
3357
  return { $loc, token: $0 };
3140
3358
  });
3141
3359
  function TemplateBlockCharacters(state) {
@@ -3147,7 +3365,7 @@ var Civet = (() => {
3147
3365
  return TemplateBlockCharacters$0(state);
3148
3366
  }
3149
3367
  }
3150
- var ReservedWord$0 = $R$0($EXPECT($R18, fail, "ReservedWord /(?:and|as|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|function|if|import|in|instanceof|interface|is|new|null|or|return|static|super|switch|this|throw|true|try|typeof|unless|var|void|while|with|yield)(?!\\p{ID_Continue})/"));
3368
+ var ReservedWord$0 = $R$0($EXPECT($R19, fail, "ReservedWord /(?:and|as|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|function|if|import|in|instanceof|interface|is|new|null|or|return|static|super|switch|this|throw|true|try|typeof|unless|var|void|while|with|yield)(?!\\p{ID_Continue})/"));
3151
3369
  function ReservedWord(state) {
3152
3370
  if (state.verbose)
3153
3371
  console.log("ENTER:", "ReservedWord");
@@ -3166,10 +3384,10 @@ var Civet = (() => {
3166
3384
  return Comment$0(state) || Comment$1(state);
3167
3385
  }
3168
3386
  }
3169
- var SingleLineComment$0 = $TR($EXPECT($R19, fail, "SingleLineComment /\\/\\/[^\\r\\n]*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
3387
+ var SingleLineComment$0 = $TR($EXPECT($R20, fail, "SingleLineComment /\\/\\/[^\\r\\n]*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
3170
3388
  return { $loc, token: $0 };
3171
3389
  });
3172
- var SingleLineComment$1 = CoffeeSingleLineComment;
3390
+ var SingleLineComment$1 = $S(CoffeeCompat, CoffeeSingleLineComment);
3173
3391
  function SingleLineComment(state) {
3174
3392
  if (state.tokenize) {
3175
3393
  return $TOKEN("SingleLineComment", state, SingleLineComment$0(state) || SingleLineComment$1(state));
@@ -3186,7 +3404,7 @@ var Civet = (() => {
3186
3404
  return MultiLineComment$0(state) || MultiLineComment$1(state);
3187
3405
  }
3188
3406
  }
3189
- var JSMultiLineComment$0 = $TV($TEXT($S($EXPECT($L84, fail, 'JSMultiLineComment "/*"'), $Q($S($N($EXPECT($L85, fail, 'JSMultiLineComment "*/"')), $EXPECT($R20, fail, "JSMultiLineComment /./"))), $EXPECT($L85, fail, 'JSMultiLineComment "*/"'))), function($skip, $loc, $0, $1) {
3407
+ var JSMultiLineComment$0 = $TV($TEXT($S($EXPECT($L83, fail, 'JSMultiLineComment "/*"'), $Q($S($N($EXPECT($L84, fail, 'JSMultiLineComment "*/"')), $EXPECT($R21, fail, "JSMultiLineComment /./"))), $EXPECT($L84, fail, 'JSMultiLineComment "*/"'))), function($skip, $loc, $0, $1) {
3190
3408
  return { $loc, token: $1 };
3191
3409
  });
3192
3410
  function JSMultiLineComment(state) {
@@ -3198,9 +3416,7 @@ var Civet = (() => {
3198
3416
  return JSMultiLineComment$0(state);
3199
3417
  }
3200
3418
  }
3201
- var CoffeeSingleLineComment$0 = $TR($EXPECT($R21, fail, "CoffeeSingleLineComment /#([^\\r\\n]*)/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
3202
- if (!module.coffeeCompat)
3203
- return $skip;
3419
+ var CoffeeSingleLineComment$0 = $TR($EXPECT($R22, fail, "CoffeeSingleLineComment /#([^\\r\\n]*)/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
3204
3420
  return { $loc, token: `//${$1}` };
3205
3421
  });
3206
3422
  function CoffeeSingleLineComment(state) {
@@ -3212,7 +3428,7 @@ var Civet = (() => {
3212
3428
  return CoffeeSingleLineComment$0(state);
3213
3429
  }
3214
3430
  }
3215
- var CoffeeMultiLineComment$0 = $TS($S($EXPECT($L86, fail, 'CoffeeMultiLineComment "###"'), $TEXT($Q($S($N($C($EXPECT($L86, fail, 'CoffeeMultiLineComment "###"'), $EXPECT($L85, fail, 'CoffeeMultiLineComment "*/"'))), $EXPECT($R20, fail, "CoffeeMultiLineComment /./")))), $EXPECT($L86, fail, 'CoffeeMultiLineComment "###"')), function($skip, $loc, $0, $1, $2, $3) {
3431
+ var CoffeeMultiLineComment$0 = $TS($S($EXPECT($L85, fail, 'CoffeeMultiLineComment "###"'), $TEXT($Q($S($N($C($EXPECT($L85, fail, 'CoffeeMultiLineComment "###"'), $EXPECT($L84, fail, 'CoffeeMultiLineComment "*/"'))), $EXPECT($R21, fail, "CoffeeMultiLineComment /./")))), $EXPECT($L85, fail, 'CoffeeMultiLineComment "###"')), function($skip, $loc, $0, $1, $2, $3) {
3216
3432
  return { $loc, token: `/*${$2}*/` };
3217
3433
  });
3218
3434
  function CoffeeMultiLineComment(state) {
@@ -3224,7 +3440,7 @@ var Civet = (() => {
3224
3440
  return CoffeeMultiLineComment$0(state);
3225
3441
  }
3226
3442
  }
3227
- var InlineComment$0 = $TV($TEXT($S($EXPECT($L84, fail, 'InlineComment "/*"'), $TEXT($Q($S($N($EXPECT($L85, fail, 'InlineComment "*/"')), $EXPECT($R22, fail, "InlineComment /[^\\r\\n]/")))), $EXPECT($L85, fail, 'InlineComment "*/"'))), function($skip, $loc, $0, $1) {
3443
+ var InlineComment$0 = $TV($TEXT($S($EXPECT($L83, fail, 'InlineComment "/*"'), $TEXT($Q($S($N($EXPECT($L84, fail, 'InlineComment "*/"')), $EXPECT($R23, fail, "InlineComment /[^\\r\\n]/")))), $EXPECT($L84, fail, 'InlineComment "*/"'))), function($skip, $loc, $0, $1) {
3228
3444
  return { $loc, token: $1 };
3229
3445
  });
3230
3446
  function InlineComment(state) {
@@ -3266,7 +3482,7 @@ var Civet = (() => {
3266
3482
  return _$0(state);
3267
3483
  }
3268
3484
  }
3269
- var NonNewlineWhitespace$0 = $TR($EXPECT($R23, fail, "NonNewlineWhitespace /[ \\t]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
3485
+ var NonNewlineWhitespace$0 = $TR($EXPECT($R24, fail, "NonNewlineWhitespace /[ \\t]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
3270
3486
  return { $loc, token: $0 };
3271
3487
  });
3272
3488
  function NonNewlineWhitespace(state) {
@@ -3288,7 +3504,7 @@ var Civet = (() => {
3288
3504
  return __$0(state);
3289
3505
  }
3290
3506
  }
3291
- var Whitespace$0 = $TR($EXPECT($R24, fail, "Whitespace /[\\s]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
3507
+ var Whitespace$0 = $TR($EXPECT($R25, fail, "Whitespace /[\\s]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
3292
3508
  return { $loc, token: $0 };
3293
3509
  });
3294
3510
  function Whitespace(state) {
@@ -3311,7 +3527,7 @@ var Civet = (() => {
3311
3527
  return StatementDelimiter$0(state) || StatementDelimiter$1(state);
3312
3528
  }
3313
3529
  }
3314
- var NonIdContinue$0 = $R$0($EXPECT($R25, fail, "NonIdContinue /(?!\\p{ID_Continue})/"));
3530
+ var NonIdContinue$0 = $R$0($EXPECT($R26, fail, "NonIdContinue /(?!\\p{ID_Continue})/"));
3315
3531
  function NonIdContinue(state) {
3316
3532
  if (state.verbose)
3317
3533
  console.log("ENTER:", "NonIdContinue");
@@ -3333,7 +3549,7 @@ var Civet = (() => {
3333
3549
  return Loc$0(state);
3334
3550
  }
3335
3551
  }
3336
- var As$0 = $TS($S($EXPECT($L87, fail, 'As "as"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
3552
+ var As$0 = $TS($S($EXPECT($L86, fail, 'As "as"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
3337
3553
  return { $loc, token: $1 };
3338
3554
  });
3339
3555
  function As(state) {
@@ -3345,7 +3561,7 @@ var Civet = (() => {
3345
3561
  return As$0(state);
3346
3562
  }
3347
3563
  }
3348
- var Async$0 = $TV($EXPECT($L88, fail, 'Async "async"'), function($skip, $loc, $0, $1) {
3564
+ var Async$0 = $TV($EXPECT($L87, fail, 'Async "async"'), function($skip, $loc, $0, $1) {
3349
3565
  return { $loc, token: $1 };
3350
3566
  });
3351
3567
  function Async(state) {
@@ -3357,7 +3573,7 @@ var Civet = (() => {
3357
3573
  return Async$0(state);
3358
3574
  }
3359
3575
  }
3360
- var Await$0 = $TS($S($EXPECT($L89, fail, 'Await "await"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
3576
+ var Await$0 = $TS($S($EXPECT($L88, fail, 'Await "await"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
3361
3577
  return { $loc, token: $1 };
3362
3578
  });
3363
3579
  function Await(state) {
@@ -3369,7 +3585,7 @@ var Civet = (() => {
3369
3585
  return Await$0(state);
3370
3586
  }
3371
3587
  }
3372
- var Case$0 = $TS($S($EXPECT($L90, fail, 'Case "case"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
3588
+ var Case$0 = $TS($S($EXPECT($L89, fail, 'Case "case"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
3373
3589
  return { $loc, token: $1 };
3374
3590
  });
3375
3591
  function Case(state) {
@@ -3381,7 +3597,7 @@ var Civet = (() => {
3381
3597
  return Case$0(state);
3382
3598
  }
3383
3599
  }
3384
- var Catch$0 = $TV($EXPECT($L91, fail, 'Catch "catch"'), function($skip, $loc, $0, $1) {
3600
+ var Catch$0 = $TV($EXPECT($L90, fail, 'Catch "catch"'), function($skip, $loc, $0, $1) {
3385
3601
  return { $loc, token: $1 };
3386
3602
  });
3387
3603
  function Catch(state) {
@@ -3393,7 +3609,7 @@ var Civet = (() => {
3393
3609
  return Catch$0(state);
3394
3610
  }
3395
3611
  }
3396
- var Class$0 = $TV($EXPECT($L92, fail, 'Class "class"'), function($skip, $loc, $0, $1) {
3612
+ var Class$0 = $TV($EXPECT($L91, fail, 'Class "class"'), function($skip, $loc, $0, $1) {
3397
3613
  return { $loc, token: $1 };
3398
3614
  });
3399
3615
  function Class(state) {
@@ -3441,7 +3657,7 @@ var Civet = (() => {
3441
3657
  return CloseParen$0(state);
3442
3658
  }
3443
3659
  }
3444
- var CoffeeSubstitutionStart$0 = $TV($EXPECT($L93, fail, 'CoffeeSubstitutionStart "#{"'), function($skip, $loc, $0, $1) {
3660
+ var CoffeeSubstitutionStart$0 = $TV($EXPECT($L92, fail, 'CoffeeSubstitutionStart "#{"'), function($skip, $loc, $0, $1) {
3445
3661
  return { $loc, token: "${" };
3446
3662
  });
3447
3663
  function CoffeeSubstitutionStart(state) {
@@ -3453,7 +3669,7 @@ var Civet = (() => {
3453
3669
  return CoffeeSubstitutionStart$0(state);
3454
3670
  }
3455
3671
  }
3456
- var Colon$0 = $TV($EXPECT($L94, fail, 'Colon ":"'), function($skip, $loc, $0, $1) {
3672
+ var Colon$0 = $TV($EXPECT($L93, fail, 'Colon ":"'), function($skip, $loc, $0, $1) {
3457
3673
  return { $loc, token: $1 };
3458
3674
  });
3459
3675
  function Colon(state) {
@@ -3477,7 +3693,7 @@ var Civet = (() => {
3477
3693
  return ConstructorShorthand$0(state);
3478
3694
  }
3479
3695
  }
3480
- var Default$0 = $TS($S($EXPECT($L82, fail, 'Default "default"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
3696
+ var Default$0 = $TS($S($EXPECT($L81, fail, 'Default "default"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
3481
3697
  return { $loc, token: $1 };
3482
3698
  });
3483
3699
  function Default(state) {
@@ -3489,7 +3705,7 @@ var Civet = (() => {
3489
3705
  return Default$0(state);
3490
3706
  }
3491
3707
  }
3492
- var Dot$0 = $TV($EXPECT($L95, fail, 'Dot "."'), function($skip, $loc, $0, $1) {
3708
+ var Dot$0 = $TV($EXPECT($L94, fail, 'Dot "."'), function($skip, $loc, $0, $1) {
3493
3709
  return { $loc, token: $1 };
3494
3710
  });
3495
3711
  function Dot(state) {
@@ -3501,7 +3717,7 @@ var Civet = (() => {
3501
3717
  return Dot$0(state);
3502
3718
  }
3503
3719
  }
3504
- var DoubleQuote$0 = $TV($EXPECT($L96, fail, 'DoubleQuote "\\\\\\""'), function($skip, $loc, $0, $1) {
3720
+ var DoubleQuote$0 = $TV($EXPECT($L95, fail, 'DoubleQuote "\\\\\\""'), function($skip, $loc, $0, $1) {
3505
3721
  return { $loc, token: $1 };
3506
3722
  });
3507
3723
  function DoubleQuote(state) {
@@ -3513,7 +3729,7 @@ var Civet = (() => {
3513
3729
  return DoubleQuote$0(state);
3514
3730
  }
3515
3731
  }
3516
- var Else$0 = $TV($EXPECT($L97, fail, 'Else "else"'), function($skip, $loc, $0, $1) {
3732
+ var Else$0 = $TV($EXPECT($L96, fail, 'Else "else"'), function($skip, $loc, $0, $1) {
3517
3733
  return { $loc, token: $1 };
3518
3734
  });
3519
3735
  function Else(state) {
@@ -3537,7 +3753,7 @@ var Civet = (() => {
3537
3753
  return Equals$0(state);
3538
3754
  }
3539
3755
  }
3540
- var Export$0 = $TS($S($EXPECT($L98, fail, 'Export "export"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
3756
+ var Export$0 = $TS($S($EXPECT($L97, fail, 'Export "export"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
3541
3757
  return { $loc, token: $1 };
3542
3758
  });
3543
3759
  function Export(state) {
@@ -3549,7 +3765,7 @@ var Civet = (() => {
3549
3765
  return Export$0(state);
3550
3766
  }
3551
3767
  }
3552
- var For$0 = $TS($S($EXPECT($L99, fail, 'For "for"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
3768
+ var For$0 = $TS($S($EXPECT($L98, fail, 'For "for"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
3553
3769
  return { $loc, token: $1 };
3554
3770
  });
3555
3771
  function For(state) {
@@ -3561,7 +3777,7 @@ var Civet = (() => {
3561
3777
  return For$0(state);
3562
3778
  }
3563
3779
  }
3564
- var From$0 = $TS($S($EXPECT($L100, fail, 'From "from"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
3780
+ var From$0 = $TS($S($EXPECT($L99, fail, 'From "from"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
3565
3781
  return { $loc, token: $1 };
3566
3782
  });
3567
3783
  function From(state) {
@@ -3573,7 +3789,7 @@ var Civet = (() => {
3573
3789
  return From$0(state);
3574
3790
  }
3575
3791
  }
3576
- var Function$0 = $TV($EXPECT($L101, fail, 'Function "function"'), function($skip, $loc, $0, $1) {
3792
+ var Function$0 = $TV($EXPECT($L100, fail, 'Function "function"'), function($skip, $loc, $0, $1) {
3577
3793
  return { $loc, token: $1 };
3578
3794
  });
3579
3795
  function Function(state) {
@@ -3585,7 +3801,7 @@ var Civet = (() => {
3585
3801
  return Function$0(state);
3586
3802
  }
3587
3803
  }
3588
- var GetOrSet$0 = $TS($S($C($EXPECT($L102, fail, 'GetOrSet "get"'), $EXPECT($L103, fail, 'GetOrSet "set"')), NonIdContinue), function($skip, $loc, $0, $1, $2) {
3804
+ var GetOrSet$0 = $TS($S($C($EXPECT($L101, fail, 'GetOrSet "get"'), $EXPECT($L102, fail, 'GetOrSet "set"')), NonIdContinue), function($skip, $loc, $0, $1, $2) {
3589
3805
  return { $loc, token: $1 };
3590
3806
  });
3591
3807
  function GetOrSet(state) {
@@ -3597,7 +3813,7 @@ var Civet = (() => {
3597
3813
  return GetOrSet$0(state);
3598
3814
  }
3599
3815
  }
3600
- var If$0 = $TV($EXPECT($L104, fail, 'If "if"'), function($skip, $loc, $0, $1) {
3816
+ var If$0 = $TV($EXPECT($L103, fail, 'If "if"'), function($skip, $loc, $0, $1) {
3601
3817
  return { $loc, token: $1 };
3602
3818
  });
3603
3819
  function If(state) {
@@ -3609,7 +3825,7 @@ var Civet = (() => {
3609
3825
  return If$0(state);
3610
3826
  }
3611
3827
  }
3612
- var Import$0 = $TS($S($EXPECT($L11, fail, 'Import "import"'), $Y($EXPECT($R26, fail, "Import /\\s/"))), function($skip, $loc, $0, $1, $2) {
3828
+ var Import$0 = $TS($S($EXPECT($L11, fail, 'Import "import"'), $Y($EXPECT($R27, fail, "Import /\\s/"))), function($skip, $loc, $0, $1, $2) {
3613
3829
  return { $loc, token: $1 };
3614
3830
  });
3615
3831
  function Import(state) {
@@ -3633,7 +3849,7 @@ var Civet = (() => {
3633
3849
  return In$0(state);
3634
3850
  }
3635
3851
  }
3636
- var LetOrConst$0 = $TV($C($EXPECT($L105, fail, 'LetOrConst "let"'), $EXPECT($L106, fail, 'LetOrConst "const"')), function($skip, $loc, $0, $1) {
3852
+ var LetOrConst$0 = $TV($C($EXPECT($L104, fail, 'LetOrConst "let"'), $EXPECT($L105, fail, 'LetOrConst "const"')), function($skip, $loc, $0, $1) {
3637
3853
  return { $loc, token: $1 };
3638
3854
  });
3639
3855
  function LetOrConst(state) {
@@ -3645,7 +3861,7 @@ var Civet = (() => {
3645
3861
  return LetOrConst$0(state);
3646
3862
  }
3647
3863
  }
3648
- var Loop$0 = $TS($S($EXPECT($L107, fail, 'Loop "loop"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
3864
+ var Loop$0 = $TS($S($EXPECT($L106, fail, 'Loop "loop"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
3649
3865
  return { $loc, token: "while(true)" };
3650
3866
  });
3651
3867
  function Loop(state) {
@@ -3657,7 +3873,7 @@ var Civet = (() => {
3657
3873
  return Loop$0(state);
3658
3874
  }
3659
3875
  }
3660
- var New$0 = $TV($EXPECT($L108, fail, 'New "new"'), function($skip, $loc, $0, $1) {
3876
+ var New$0 = $TV($EXPECT($L107, fail, 'New "new"'), function($skip, $loc, $0, $1) {
3661
3877
  return { $loc, token: $1 };
3662
3878
  });
3663
3879
  function New(state) {
@@ -3669,7 +3885,7 @@ var Civet = (() => {
3669
3885
  return New$0(state);
3670
3886
  }
3671
3887
  }
3672
- var Of$0 = $TV($EXPECT($L109, fail, 'Of "of"'), function($skip, $loc, $0, $1) {
3888
+ var Of$0 = $TV($EXPECT($L108, fail, 'Of "of"'), function($skip, $loc, $0, $1) {
3673
3889
  return { $loc, token: $1 };
3674
3890
  });
3675
3891
  function Of(state) {
@@ -3681,7 +3897,7 @@ var Civet = (() => {
3681
3897
  return Of$0(state);
3682
3898
  }
3683
3899
  }
3684
- var OpenBrace$0 = $TV($EXPECT($L110, fail, 'OpenBrace "{"'), function($skip, $loc, $0, $1) {
3900
+ var OpenBrace$0 = $TV($EXPECT($L109, fail, 'OpenBrace "{"'), function($skip, $loc, $0, $1) {
3685
3901
  return { $loc, token: $1 };
3686
3902
  });
3687
3903
  function OpenBrace(state) {
@@ -3693,7 +3909,7 @@ var Civet = (() => {
3693
3909
  return OpenBrace$0(state);
3694
3910
  }
3695
3911
  }
3696
- var OpenBracket$0 = $TV($EXPECT($L111, fail, 'OpenBracket "["'), function($skip, $loc, $0, $1) {
3912
+ var OpenBracket$0 = $TV($EXPECT($L110, fail, 'OpenBracket "["'), function($skip, $loc, $0, $1) {
3697
3913
  return { $loc, token: $1 };
3698
3914
  });
3699
3915
  function OpenBracket(state) {
@@ -3705,7 +3921,7 @@ var Civet = (() => {
3705
3921
  return OpenBracket$0(state);
3706
3922
  }
3707
3923
  }
3708
- var OpenParen$0 = $TV($EXPECT($L112, fail, 'OpenParen "("'), function($skip, $loc, $0, $1) {
3924
+ var OpenParen$0 = $TV($EXPECT($L111, fail, 'OpenParen "("'), function($skip, $loc, $0, $1) {
3709
3925
  return { $loc, token: $1 };
3710
3926
  });
3711
3927
  function OpenParen(state) {
@@ -3717,7 +3933,7 @@ var Civet = (() => {
3717
3933
  return OpenParen$0(state);
3718
3934
  }
3719
3935
  }
3720
- var QuestionMark$0 = $TV($EXPECT($L113, fail, 'QuestionMark "?"'), function($skip, $loc, $0, $1) {
3936
+ var QuestionMark$0 = $TV($EXPECT($L112, fail, 'QuestionMark "?"'), function($skip, $loc, $0, $1) {
3721
3937
  return { $loc, token: $1 };
3722
3938
  });
3723
3939
  function QuestionMark(state) {
@@ -3729,7 +3945,7 @@ var Civet = (() => {
3729
3945
  return QuestionMark$0(state);
3730
3946
  }
3731
3947
  }
3732
- var Return$0 = $TS($S($EXPECT($L114, fail, 'Return "return"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
3948
+ var Return$0 = $TS($S($EXPECT($L113, fail, 'Return "return"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
3733
3949
  return { $loc, token: $1 };
3734
3950
  });
3735
3951
  function Return(state) {
@@ -3753,7 +3969,7 @@ var Civet = (() => {
3753
3969
  return Semicolon$0(state);
3754
3970
  }
3755
3971
  }
3756
- var SingleQuote$0 = $TV($EXPECT($L115, fail, `SingleQuote "'"`), function($skip, $loc, $0, $1) {
3972
+ var SingleQuote$0 = $TV($EXPECT($L114, fail, `SingleQuote "'"`), function($skip, $loc, $0, $1) {
3757
3973
  return { $loc, token: $1 };
3758
3974
  });
3759
3975
  function SingleQuote(state) {
@@ -3777,10 +3993,10 @@ var Civet = (() => {
3777
3993
  return Star$0(state);
3778
3994
  }
3779
3995
  }
3780
- var Static$0 = $TV($EXPECT($L116, fail, 'Static "static"'), function($skip, $loc, $0, $1) {
3996
+ var Static$0 = $TV($EXPECT($L115, fail, 'Static "static"'), function($skip, $loc, $0, $1) {
3781
3997
  return { $loc, token: $1 };
3782
3998
  });
3783
- var Static$1 = $TS($S($EXPECT($L9, fail, 'Static "@"'), $N($EXPECT($L112, fail, 'Static "("'))), function($skip, $loc, $0, $1, $2) {
3999
+ var Static$1 = $TS($S($EXPECT($L9, fail, 'Static "@"'), $N($EXPECT($L111, fail, 'Static "("'))), function($skip, $loc, $0, $1, $2) {
3784
4000
  return { $loc, token: "static " };
3785
4001
  });
3786
4002
  function Static(state) {
@@ -3790,7 +4006,7 @@ var Civet = (() => {
3790
4006
  return Static$0(state) || Static$1(state);
3791
4007
  }
3792
4008
  }
3793
- var SubstitutionStart$0 = $TV($EXPECT($L117, fail, 'SubstitutionStart "${"'), function($skip, $loc, $0, $1) {
4009
+ var SubstitutionStart$0 = $TV($EXPECT($L116, fail, 'SubstitutionStart "${"'), function($skip, $loc, $0, $1) {
3794
4010
  return { $loc, token: $1 };
3795
4011
  });
3796
4012
  function SubstitutionStart(state) {
@@ -3802,7 +4018,7 @@ var Civet = (() => {
3802
4018
  return SubstitutionStart$0(state);
3803
4019
  }
3804
4020
  }
3805
- var Switch$0 = $TS($S($EXPECT($L118, fail, 'Switch "switch"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4021
+ var Switch$0 = $TS($S($EXPECT($L117, fail, 'Switch "switch"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
3806
4022
  return { $loc, token: $1 };
3807
4023
  });
3808
4024
  function Switch(state) {
@@ -3814,7 +4030,7 @@ var Civet = (() => {
3814
4030
  return Switch$0(state);
3815
4031
  }
3816
4032
  }
3817
- var Target$0 = $TV($EXPECT($L119, fail, 'Target "target"'), function($skip, $loc, $0, $1) {
4033
+ var Target$0 = $TV($EXPECT($L118, fail, 'Target "target"'), function($skip, $loc, $0, $1) {
3818
4034
  return { $loc, token: $1 };
3819
4035
  });
3820
4036
  function Target(state) {
@@ -3826,6 +4042,18 @@ var Civet = (() => {
3826
4042
  return Target$0(state);
3827
4043
  }
3828
4044
  }
4045
+ var Throw$0 = $TS($S($EXPECT($L119, fail, 'Throw "throw"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4046
+ return { $loc, token: $1 };
4047
+ });
4048
+ function Throw(state) {
4049
+ if (state.verbose)
4050
+ console.log("ENTER:", "Throw");
4051
+ if (state.tokenize) {
4052
+ return $TOKEN("Throw", state, Throw$0(state));
4053
+ } else {
4054
+ return Throw$0(state);
4055
+ }
4056
+ }
3829
4057
  var TripleDoubleQuote$0 = $TV($EXPECT($L120, fail, 'TripleDoubleQuote "\\\\\\"\\\\\\"\\\\\\""'), function($skip, $loc, $0, $1) {
3830
4058
  return { $loc, token: "`" };
3831
4059
  });
@@ -3986,7 +4214,7 @@ var Civet = (() => {
3986
4214
  return JSXElementName$0(state);
3987
4215
  }
3988
4216
  }
3989
- var JSXIdentifierName$0 = $R$0($EXPECT($R27, fail, "JSXIdentifierName /(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*/"));
4217
+ var JSXIdentifierName$0 = $R$0($EXPECT($R28, fail, "JSXIdentifierName /(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*/"));
3990
4218
  function JSXIdentifierName(state) {
3991
4219
  if (state.verbose)
3992
4220
  console.log("ENTER:", "JSXIdentifierName");
@@ -4035,8 +4263,8 @@ var Civet = (() => {
4035
4263
  return JSXAttributeInitializer$0(state);
4036
4264
  }
4037
4265
  }
4038
- var JSXAttributeValue$0 = $R$0($EXPECT($R28, fail, 'JSXAttributeValue /"[^"]*"/'));
4039
- var JSXAttributeValue$1 = $R$0($EXPECT($R29, fail, "JSXAttributeValue /'[^']*'/"));
4266
+ var JSXAttributeValue$0 = $R$0($EXPECT($R29, fail, 'JSXAttributeValue /"[^"]*"/'));
4267
+ var JSXAttributeValue$1 = $R$0($EXPECT($R30, fail, "JSXAttributeValue /'[^']*'/"));
4040
4268
  var JSXAttributeValue$2 = $S(OpenBrace, __, AssignmentExpression, __, CloseBrace);
4041
4269
  var JSXAttributeValue$3 = JSXElement;
4042
4270
  var JSXAttributeValue$4 = JSXFragment;
@@ -4068,7 +4296,7 @@ var Civet = (() => {
4068
4296
  return JSXChild$0(state) || JSXChild$1(state) || JSXChild$2(state) || JSXChild$3(state);
4069
4297
  }
4070
4298
  }
4071
- var JSXText$0 = $R$0($EXPECT($R30, fail, "JSXText /[^{}<>]+/"));
4299
+ var JSXText$0 = $R$0($EXPECT($R31, fail, "JSXText /[^{}<>]+/"));
4072
4300
  function JSXText(state) {
4073
4301
  if (state.verbose)
4074
4302
  console.log("ENTER:", "JSXText");
@@ -4243,7 +4471,7 @@ var Civet = (() => {
4243
4471
  return NestedTypeDeclaration$0(state);
4244
4472
  }
4245
4473
  }
4246
- var TypeIndexSignature$0 = $S($E($S($R$0($EXPECT($R31, fail, "TypeIndexSignature /[+-]?/")), $EXPECT($L136, fail, 'TypeIndexSignature "readonly"'), __)), OpenBracket, TypeIndex, CloseBracket, $E($S(__, $R$0($EXPECT($R32, fail, "TypeIndexSignature /[+-]/")), QuestionMark)));
4474
+ var TypeIndexSignature$0 = $S($E($S($R$0($EXPECT($R32, fail, "TypeIndexSignature /[+-]?/")), $EXPECT($L136, fail, 'TypeIndexSignature "readonly"'), __)), OpenBracket, TypeIndex, CloseBracket, $E($S(__, $R$0($EXPECT($R33, fail, "TypeIndexSignature /[+-]/")), QuestionMark)));
4247
4475
  function TypeIndexSignature(state) {
4248
4476
  if (state.verbose)
4249
4477
  console.log("ENTER:", "TypeIndexSignature");
@@ -4464,7 +4692,7 @@ var Civet = (() => {
4464
4692
  return TypeParameterDelimiter$0(state) || TypeParameterDelimiter$1(state) || TypeParameterDelimiter$2(state) || TypeParameterDelimiter$3(state);
4465
4693
  }
4466
4694
  }
4467
- var Shebang$0 = $S($R$0($EXPECT($R33, fail, "Shebang /#![^\\r\\n]*/")), EOL);
4695
+ var Shebang$0 = $S($R$0($EXPECT($R34, fail, "Shebang /#![^\\r\\n]*/")), EOL);
4468
4696
  function Shebang(state) {
4469
4697
  if (state.verbose)
4470
4698
  console.log("ENTER:", "Shebang");
@@ -4474,7 +4702,7 @@ var Civet = (() => {
4474
4702
  return Shebang$0(state);
4475
4703
  }
4476
4704
  }
4477
- var DirectivePrologue$0 = $Q($S($R$0($EXPECT($R34, fail, "DirectivePrologue /[\\t ]*/")), StringLiteral, $TEXT(StatementDelimiter), EOS));
4705
+ var DirectivePrologue$0 = $Q($S($R$0($EXPECT($R35, fail, "DirectivePrologue /[\\t ]*/")), StringLiteral, $TEXT(StatementDelimiter), EOS));
4478
4706
  function DirectivePrologue(state) {
4479
4707
  if (state.verbose)
4480
4708
  console.log("ENTER:", "DirectivePrologue");
@@ -4494,7 +4722,7 @@ var Civet = (() => {
4494
4722
  return EOS$0(state);
4495
4723
  }
4496
4724
  }
4497
- var EOL$0 = $R$0($EXPECT($R35, fail, "EOL /\\r\\n|\\n|\\r|$/"));
4725
+ var EOL$0 = $R$0($EXPECT($R36, fail, "EOL /\\r\\n|\\n|\\r|$/"));
4498
4726
  function EOL(state) {
4499
4727
  if (state.verbose)
4500
4728
  console.log("ENTER:", "EOL");
@@ -4504,7 +4732,7 @@ var Civet = (() => {
4504
4732
  return EOL$0(state);
4505
4733
  }
4506
4734
  }
4507
- var EOF$0 = $R$0($EXPECT($R36, fail, "EOF /$/"));
4735
+ var EOF$0 = $R$0($EXPECT($R37, fail, "EOF /$/"));
4508
4736
  function EOF(state) {
4509
4737
  if (state.verbose)
4510
4738
  console.log("ENTER:", "EOF");
@@ -4658,15 +4886,103 @@ var Civet = (() => {
4658
4886
  return InsertBreak$0(state);
4659
4887
  }
4660
4888
  }
4661
- var Init$0 = $TS($S($E(Shebang), DirectivePrologue, $EXPECT($L1, fail, 'Init ""')), function($skip, $loc, $0, $1, $2, $3) {
4662
- var directives = $2;
4889
+ var Reset$0 = $TV($EXPECT($L1, fail, 'Reset ""'), function($skip, $loc, $0, $1) {
4663
4890
  module.currentIndent = 0;
4664
4891
  module.indentLevels = [0];
4665
4892
  module.verbose = false;
4893
+ module.coffeeCompat = false;
4894
+ module.implicitReturns = true;
4895
+ });
4896
+ function Reset(state) {
4897
+ if (state.verbose)
4898
+ console.log("ENTER:", "Reset");
4899
+ if (state.tokenize) {
4900
+ return $TOKEN("Reset", state, Reset$0(state));
4901
+ } else {
4902
+ return Reset$0(state);
4903
+ }
4904
+ }
4905
+ var Init$0 = $TS($S($E(Shebang), DirectivePrologue, $EXPECT($L1, fail, 'Init ""')), function($skip, $loc, $0, $1, $2, $3) {
4906
+ var directives = $2;
4666
4907
  if (directives) {
4667
4908
  const compatRe = /use coffee-compat/;
4668
4909
  module.coffeeCompat = directives.some((d) => d[1].token?.match(compatRe));
4669
4910
  }
4911
+ function hasReturnStatement(node) {
4912
+ if (!node)
4913
+ return false;
4914
+ if (Array.isArray(node))
4915
+ return node.some(hasReturnStatement);
4916
+ if (node.type === "ReturnStatement")
4917
+ return true;
4918
+ if (node.type === "FunctionExpression")
4919
+ return false;
4920
+ if (node.children)
4921
+ return hasReturnStatement(node.children);
4922
+ return false;
4923
+ }
4924
+ function insertReturn(node) {
4925
+ if (!node)
4926
+ return;
4927
+ switch (node.type) {
4928
+ case "AssignmentExpression":
4929
+ node.children.unshift("return ");
4930
+ return;
4931
+ case "BlockStatement":
4932
+ insertReturn(node.expressions[node.expressions.length - 1]);
4933
+ return;
4934
+ case "CaseBlock":
4935
+ node.clauses.forEach((clause) => {
4936
+ insertReturn(clause);
4937
+ });
4938
+ return;
4939
+ case "CaseClause":
4940
+ return;
4941
+ case "WhenClause":
4942
+ node.children.pop();
4943
+ insertReturn(node.expressions[node.expressions.length - 1]);
4944
+ return;
4945
+ case "DefaultClause":
4946
+ insertReturn(node.expressions[node.expressions.length - 1]);
4947
+ return;
4948
+ }
4949
+ if (!Array.isArray(node))
4950
+ return;
4951
+ const [, exp] = node;
4952
+ debugger;
4953
+ if (!exp)
4954
+ return;
4955
+ switch (exp.type) {
4956
+ case "BreakStatement":
4957
+ case "ContinueStatement":
4958
+ case "DebuggerStatement":
4959
+ case "EmptyStatement":
4960
+ case "IterationStatement":
4961
+ case "ThrowStatement":
4962
+ case "VariableDeclaration":
4963
+ return;
4964
+ case "IfStatement":
4965
+ debugger;
4966
+ insertReturn(exp.children[2]);
4967
+ if (exp.children[3])
4968
+ insertReturn(exp.children[3][2]);
4969
+ return;
4970
+ case "SwitchStatement":
4971
+ insertReturn(exp.children[2]);
4972
+ return;
4973
+ case "TryStatement":
4974
+ insertReturn(exp.children[1]);
4975
+ insertReturn(exp.children[2][3]);
4976
+ return;
4977
+ }
4978
+ node.splice(1, 0, "return ");
4979
+ }
4980
+ module.addImplicitReturns = function(block) {
4981
+ if (hasReturnStatement(block))
4982
+ return block;
4983
+ insertReturn(block);
4984
+ return block;
4985
+ };
4670
4986
  module.parsePosition = function() {
4671
4987
  let s = Error().stack.split(/\n at /);
4672
4988
  s.shift();
@@ -4674,6 +4990,25 @@ var Civet = (() => {
4674
4990
  s = s.slice(1, s.indexOf("Program") + 1);
4675
4991
  return s;
4676
4992
  };
4993
+ module.prune = function(node) {
4994
+ if (node === null || node === void 0)
4995
+ return;
4996
+ if (node.length === 0)
4997
+ return;
4998
+ if (Array.isArray(node)) {
4999
+ const a = node.map((n) => module.prune(n)).filter((n) => !!n);
5000
+ if (a.length > 1)
5001
+ return a;
5002
+ if (a.length === 1)
5003
+ return a[0];
5004
+ return;
5005
+ }
5006
+ if (node.children != null) {
5007
+ node.children = module.prune(node.children);
5008
+ return node;
5009
+ }
5010
+ return node;
5011
+ };
4677
5012
  module.insertTrimmingSpace = function(spacing, c) {
4678
5013
  let target = spacing;
4679
5014
  while (Array.isArray(target)) {
@@ -4730,7 +5065,7 @@ var Civet = (() => {
4730
5065
  if (trim) {
4731
5066
  str = str.replace(/^(\r?\n|\n)/, "").replace(/(\r?\n|\n)[ \t]*$/, "");
4732
5067
  }
4733
- str = str.replace(/(`|\$)/g, "\\$1");
5068
+ str = str.replace(/(`|\$\{)/g, "\\$1");
4734
5069
  return {
4735
5070
  $loc: $loc2,
4736
5071
  token: str
@@ -4943,7 +5278,7 @@ var Civet = (() => {
4943
5278
  return;
4944
5279
  }
4945
5280
  if (node.children != null) {
4946
- node.children = prune(node.children);
5281
+ node.children = prune(node.children) || [];
4947
5282
  return node;
4948
5283
  }
4949
5284
  return node;