@danielx/civet 0.4.17 → 0.4.18

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.
Files changed (4) hide show
  1. package/README.md +11 -23
  2. package/dist/browser.js +583 -242
  3. package/dist/main.js +583 -242
  4. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -549,6 +549,10 @@ var require_parser = __commonJS({
549
549
  ForStatement,
550
550
  ForClause,
551
551
  ForStatementControl,
552
+ WhenCondition,
553
+ CoffeeForStatementParameters,
554
+ CoffeeForDeclaration,
555
+ ForStatementParameters,
552
556
  ForInOfDeclaration,
553
557
  ForDeclaration,
554
558
  ForBinding,
@@ -642,6 +646,7 @@ var require_parser = __commonJS({
642
646
  StatementDelimiter,
643
647
  NonIdContinue,
644
648
  Loc,
649
+ Ampersand,
645
650
  As,
646
651
  Async,
647
652
  Await,
@@ -780,9 +785,11 @@ var require_parser = __commonJS({
780
785
  InsertBreak,
781
786
  CoffeeCommentEnabled,
782
787
  CoffeeBooleansEnabled,
788
+ CoffeeForLoopsEnabled,
783
789
  CoffeeInterpolationEnabled,
784
790
  CoffeeIsntEnabled,
785
791
  CoffeeNotEnabled,
792
+ CoffeeOfEnabled,
786
793
  Reset,
787
794
  Init,
788
795
  Indent,
@@ -858,95 +865,96 @@ var require_parser = __commonJS({
858
865
  var $L62 = $L("==");
859
866
  var $L63 = $L("and");
860
867
  var $L64 = $L("&&");
861
- var $L65 = $L("or");
862
- var $L66 = $L("||");
863
- var $L67 = $L("??");
864
- var $L68 = $L("instanceof");
865
- var $L69 = $L("in");
866
- var $L70 = $L("&");
867
- var $L71 = $L("^");
868
- var $L72 = $L("|");
869
- var $L73 = $L(";");
870
- var $L74 = $L("finally");
871
- var $L75 = $L("break");
872
- var $L76 = $L("continue");
873
- var $L77 = $L("debugger");
874
- var $L78 = $L("import type");
875
- var $L79 = $L("default");
876
- var $L80 = $L(":=");
877
- var $L81 = $L("/*");
878
- var $L82 = $L("*/");
879
- var $L83 = $L("###");
880
- var $L84 = $L("as");
881
- var $L85 = $L("async");
882
- var $L86 = $L("await");
883
- var $L87 = $L("`");
884
- var $L88 = $L("case");
885
- var $L89 = $L("catch");
886
- var $L90 = $L("class");
887
- var $L91 = $L("#{");
888
- var $L92 = $L(":");
889
- var $L93 = $L("delete");
890
- var $L94 = $L("do");
891
- var $L95 = $L("..");
892
- var $L96 = $L("...");
893
- var $L97 = $L('"');
894
- var $L98 = $L("else");
895
- var $L99 = $L("export");
896
- var $L100 = $L("for");
897
- var $L101 = $L("from");
898
- var $L102 = $L("function");
899
- var $L103 = $L("get");
900
- var $L104 = $L("set");
901
- var $L105 = $L("if");
902
- var $L106 = $L(" ");
903
- var $L107 = $L("let");
904
- var $L108 = $L("const");
905
- var $L109 = $L("loop");
906
- var $L110 = $L("new");
907
- var $L111 = $L("not");
908
- var $L112 = $L("of");
909
- var $L113 = $L("{");
910
- var $L114 = $L("[");
911
- var $L115 = $L("(");
912
- var $L116 = $L("?");
913
- var $L117 = $L("return");
914
- var $L118 = $L("'");
915
- var $L119 = $L("static");
916
- var $L120 = $L("${");
917
- var $L121 = $L("switch");
918
- var $L122 = $L("target");
919
- var $L123 = $L("then");
920
- var $L124 = $L("throw");
921
- var $L125 = $L('"""');
922
- var $L126 = $L("'''");
923
- var $L127 = $L("```");
924
- var $L128 = $L("try");
925
- var $L129 = $L("typeof");
926
- var $L130 = $L("unless");
927
- var $L131 = $L("until");
928
- var $L132 = $L("var");
929
- var $L133 = $L("void");
930
- var $L134 = $L("when");
931
- var $L135 = $L("while");
932
- var $L136 = $L("yield");
933
- var $L137 = $L("/>");
934
- var $L138 = $L("</");
935
- var $L139 = $L("<>");
936
- var $L140 = $L("</>");
937
- var $L141 = $L("declare");
938
- var $L142 = $L("type");
939
- var $L143 = $L("interface");
940
- var $L144 = $L("namespace");
941
- var $L145 = $L("readonly");
942
- var $L146 = $L("asserts");
943
- var $L147 = $L("keyof");
944
- var $L148 = $L("infer");
945
- var $L149 = $L("[]");
946
- var $L150 = $L("civet");
947
- var $L151 = $L(" ");
948
- var $L152 = $L(" ");
949
- var $R0 = $R(new RegExp("(of|then)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
868
+ var $L65 = $L("of");
869
+ var $L66 = $L("or");
870
+ var $L67 = $L("||");
871
+ var $L68 = $L("??");
872
+ var $L69 = $L("instanceof");
873
+ var $L70 = $L("in");
874
+ var $L71 = $L("&");
875
+ var $L72 = $L("^");
876
+ var $L73 = $L("|");
877
+ var $L74 = $L(";");
878
+ var $L75 = $L("own");
879
+ var $L76 = $L("finally");
880
+ var $L77 = $L("break");
881
+ var $L78 = $L("continue");
882
+ var $L79 = $L("debugger");
883
+ var $L80 = $L("import type");
884
+ var $L81 = $L("default");
885
+ var $L82 = $L(":=");
886
+ var $L83 = $L("/*");
887
+ var $L84 = $L("*/");
888
+ var $L85 = $L("###");
889
+ var $L86 = $L("as");
890
+ var $L87 = $L("async");
891
+ var $L88 = $L("await");
892
+ var $L89 = $L("`");
893
+ var $L90 = $L("case");
894
+ var $L91 = $L("catch");
895
+ var $L92 = $L("class");
896
+ var $L93 = $L("#{");
897
+ var $L94 = $L(":");
898
+ var $L95 = $L("delete");
899
+ var $L96 = $L("do");
900
+ var $L97 = $L("..");
901
+ var $L98 = $L("...");
902
+ var $L99 = $L('"');
903
+ var $L100 = $L("else");
904
+ var $L101 = $L("export");
905
+ var $L102 = $L("for");
906
+ var $L103 = $L("from");
907
+ var $L104 = $L("function");
908
+ var $L105 = $L("get");
909
+ var $L106 = $L("set");
910
+ var $L107 = $L("if");
911
+ var $L108 = $L(" ");
912
+ var $L109 = $L("let");
913
+ var $L110 = $L("const");
914
+ var $L111 = $L("loop");
915
+ var $L112 = $L("new");
916
+ var $L113 = $L("not");
917
+ var $L114 = $L("{");
918
+ var $L115 = $L("[");
919
+ var $L116 = $L("(");
920
+ var $L117 = $L("?");
921
+ var $L118 = $L("return");
922
+ var $L119 = $L("'");
923
+ var $L120 = $L("static");
924
+ var $L121 = $L("${");
925
+ var $L122 = $L("switch");
926
+ var $L123 = $L("target");
927
+ var $L124 = $L("then");
928
+ var $L125 = $L("throw");
929
+ var $L126 = $L('"""');
930
+ var $L127 = $L("'''");
931
+ var $L128 = $L("```");
932
+ var $L129 = $L("try");
933
+ var $L130 = $L("typeof");
934
+ var $L131 = $L("unless");
935
+ var $L132 = $L("until");
936
+ var $L133 = $L("var");
937
+ var $L134 = $L("void");
938
+ var $L135 = $L("when");
939
+ var $L136 = $L("while");
940
+ var $L137 = $L("yield");
941
+ var $L138 = $L("/>");
942
+ var $L139 = $L("</");
943
+ var $L140 = $L("<>");
944
+ var $L141 = $L("</>");
945
+ var $L142 = $L("declare");
946
+ var $L143 = $L("type");
947
+ var $L144 = $L("interface");
948
+ var $L145 = $L("namespace");
949
+ var $L146 = $L("readonly");
950
+ var $L147 = $L("asserts");
951
+ var $L148 = $L("keyof");
952
+ var $L149 = $L("infer");
953
+ var $L150 = $L("[]");
954
+ var $L151 = $L("civet");
955
+ var $L152 = $L(" ");
956
+ var $L153 = $L(" ");
957
+ var $R0 = $R(new RegExp("(of|then|when)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
950
958
  var $R1 = $R(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$])*", "suy"));
951
959
  var $R2 = $R(new RegExp("[!~+-](?!\\s)", "suy"));
952
960
  var $R3 = $R(new RegExp("(?=[\\s\\)])", "suy"));
@@ -1015,7 +1023,12 @@ var require_parser = __commonJS({
1015
1023
  return TopLevelStatement$0(state);
1016
1024
  }
1017
1025
  }
1018
- var ExtendedExpression$0 = $S(__, ExpressionizedStatement);
1026
+ var ExtendedExpression$0 = $TS($S(__, ExpressionizedStatement), function($skip, $loc, $0, $1, $2) {
1027
+ if ($1.length) {
1028
+ $2.children.splice(0, 0, ...$1);
1029
+ }
1030
+ return $2;
1031
+ });
1019
1032
  var ExtendedExpression$1 = AssignmentExpression;
1020
1033
  function ExtendedExpression(state) {
1021
1034
  if (state.tokenize) {
@@ -1160,7 +1173,23 @@ var require_parser = __commonJS({
1160
1173
  }
1161
1174
  var BinaryOpExpression$0 = $TS($S(UnaryExpression, $Q($S(__, BinaryOp, __, UnaryExpression))), function($skip, $loc, $0, $1, $2) {
1162
1175
  if ($2.length) {
1163
- return module2.expandChainedComparisons($0);
1176
+ const expandedOps = module2.expandChainedComparisons($0);
1177
+ let i = 2;
1178
+ while (i < expandedOps.length) {
1179
+ const op = expandedOps[i];
1180
+ if (op.type === "Ref") {
1181
+ const [a, wsOp, op2, wsB, b] = expandedOps.slice(i - 2, i + 3);
1182
+ module2.insertTrimmingSpace(wsOp, "");
1183
+ module2.insertTrimmingSpace(wsB, "");
1184
+ expandedOps.splice(i - 2, 5, {
1185
+ type: "Call",
1186
+ children: [wsOp, op2, ".call(", wsB, b, ", ", a, ") >= 0"]
1187
+ });
1188
+ } else {
1189
+ i += 4;
1190
+ }
1191
+ }
1192
+ return expandedOps;
1164
1193
  }
1165
1194
  return $1;
1166
1195
  });
@@ -1255,40 +1284,56 @@ var require_parser = __commonJS({
1255
1284
  var AssignmentExpressionTail$0 = YieldExpression;
1256
1285
  var AssignmentExpressionTail$1 = ArrowFunction;
1257
1286
  var AssignmentExpressionTail$2 = $TS($S($P($S(__, LeftHandSideExpression, __, AssignmentOp)), ExtendedExpression), function($skip, $loc, $0, $1, $2) {
1258
- const lastAssignment = $1[$1.length - 1];
1259
- let tail = [];
1260
- if (lastAssignment[3].token === "=") {
1261
- const lhs = lastAssignment[1];
1287
+ let tail = [], i = 0, len = $1.length;
1288
+ while (i < len) {
1289
+ const lastAssignment = $1[i++];
1290
+ const [, lhs, , op] = lastAssignment;
1291
+ if (op.token !== "=")
1292
+ continue;
1262
1293
  if (lhs.type === "ObjectExpression") {
1263
1294
  lhs.children.splice(0, 0, "(");
1264
1295
  tail.push(")");
1296
+ break;
1265
1297
  }
1266
- if (Array.isArray(lhs) && lhs.length > 1) {
1267
- const props = lhs[lhs.length - 1];
1268
- if (Array.isArray(props)) {
1269
- const lastProp = props[props.length - 1];
1270
- if (lastProp.type === "SliceExpression") {
1271
- const { start, end, children: c } = lastProp;
1272
- c[0].token = ".splice(";
1273
- c[1] = start;
1274
- c[2] = ", ";
1275
- if (end)
1276
- c[3] = [end, " - ", start];
1277
- else
1278
- c[3] = ["1/0"];
1279
- c[4] = [", ...", $2];
1280
- c[5] = ")";
1281
- lastAssignment.pop();
1282
- if (module2.isWhitespaceOrEmpty(lastAssignment[2]))
1298
+ }
1299
+ i = len - 1;
1300
+ while (i >= 0) {
1301
+ const lastAssignment = $1[i];
1302
+ if (lastAssignment[3].token === "=") {
1303
+ const lhs = lastAssignment[1];
1304
+ if (Array.isArray(lhs) && lhs.length > 1) {
1305
+ const props = lhs[lhs.length - 1];
1306
+ if (Array.isArray(props)) {
1307
+ const lastProp = props[props.length - 1];
1308
+ if (lastProp.type === "SliceExpression") {
1309
+ const { start, end, children: c } = lastProp;
1310
+ c[0].token = ".splice(";
1311
+ c[1] = start;
1312
+ c[2] = ", ";
1313
+ if (end)
1314
+ c[3] = [end, " - ", start];
1315
+ else
1316
+ c[3] = ["1/0"];
1317
+ c[4] = [", ...", $2];
1318
+ c[5] = ")";
1283
1319
  lastAssignment.pop();
1284
- return $1;
1320
+ if (module2.isWhitespaceOrEmpty(lastAssignment[2]))
1321
+ lastAssignment.pop();
1322
+ if ($1.length > 1) {
1323
+ throw new Error("Not implemented yet! TODO: Handle multiple splice assignments");
1324
+ }
1325
+ return $1;
1326
+ }
1285
1327
  }
1286
1328
  }
1287
1329
  }
1330
+ i--;
1288
1331
  }
1332
+ const names = $1.flatMap(([, l]) => l.names || []);
1289
1333
  return {
1290
1334
  type: "AssignmentExpression",
1291
- children: [...$0, ...tail]
1335
+ children: [...$0, ...tail],
1336
+ names
1292
1337
  };
1293
1338
  });
1294
1339
  var AssignmentExpressionTail$3 = ConditionalExpression;
@@ -1622,7 +1667,7 @@ var require_parser = __commonJS({
1622
1667
  return NonNullAssertion$0(state);
1623
1668
  }
1624
1669
  }
1625
- var AdditionalReservedWords$0 = $R$0($EXPECT($R0, fail, "AdditionalReservedWords /(of|then)(?!\\p{ID_Continue}|[\\u200C\\u200D$])/"));
1670
+ var AdditionalReservedWords$0 = $R$0($EXPECT($R0, fail, "AdditionalReservedWords /(of|then|when)(?!\\p{ID_Continue}|[\\u200C\\u200D$])/"));
1626
1671
  function AdditionalReservedWords(state) {
1627
1672
  if (state.verbose)
1628
1673
  console.log("ENTER:", "AdditionalReservedWords");
@@ -1647,11 +1692,19 @@ var require_parser = __commonJS({
1647
1692
  }
1648
1693
  }
1649
1694
  var MemberExpressionRest$0 = $TS($S($E($C(OptionalShorthand, NonNullAssertion)), MemberBracketContent), function($skip, $loc, $0, $1, $2) {
1650
- if ($1)
1695
+ if ($1) {
1696
+ if ($1.length === 2 && $2.type === "SliceExpression") {
1697
+ $1.pop();
1698
+ }
1651
1699
  return $0;
1700
+ }
1701
+ return $2;
1702
+ });
1703
+ var MemberExpressionRest$1 = $TS($S($E($S($Y(EOS), IndentedFurther)), PropertyAccess), function($skip, $loc, $0, $1, $2) {
1704
+ if ($1)
1705
+ $2.children.unshift($1[1]);
1652
1706
  return $2;
1653
1707
  });
1654
- var MemberExpressionRest$1 = $S($E($S($Y(EOS), IndentedFurther)), PropertyAccess);
1655
1708
  var MemberExpressionRest$2 = $TS($S($E($S($Y(EOS), IndentedFurther)), $EXPECT($L13, fail, 'MemberExpressionRest "::"'), $E(IdentifierName)), function($skip, $loc, $0, $1, $2, $3) {
1656
1709
  var id = $3;
1657
1710
  if (id)
@@ -1708,7 +1761,14 @@ var require_parser = __commonJS({
1708
1761
  return MemberBracketContent$0(state);
1709
1762
  }
1710
1763
  }
1711
- var PropertyAccess$0 = $S($E($C(QuestionMark, NonNullAssertion)), Dot, $C(IdentifierName, PrivateIdentifier));
1764
+ var PropertyAccess$0 = $TS($S($E($C(QuestionMark, NonNullAssertion)), Dot, $C(IdentifierName, PrivateIdentifier)), function($skip, $loc, $0, $1, $2, $3) {
1765
+ var id = $3;
1766
+ id.type = "PropertyAccess";
1767
+ id.children.unshift($2);
1768
+ if ($1)
1769
+ id.children.unshift($1);
1770
+ return id;
1771
+ });
1712
1772
  function PropertyAccess(state) {
1713
1773
  if (state.verbose)
1714
1774
  console.log("ENTER:", "PropertyAccess");
@@ -2135,13 +2195,18 @@ var require_parser = __commonJS({
2135
2195
  $1.type = "FunctionExpression";
2136
2196
  return $1;
2137
2197
  });
2198
+ var FunctionExpression$1 = $TS($S(Ampersand, $P(MemberExpressionRest)), function($skip, $loc, $0, $1, $2) {
2199
+ $1.token = "$ => $";
2200
+ return {
2201
+ type: "FunctionExpression",
2202
+ children: [$1, $2]
2203
+ };
2204
+ });
2138
2205
  function FunctionExpression(state) {
2139
- if (state.verbose)
2140
- console.log("ENTER:", "FunctionExpression");
2141
2206
  if (state.tokenize) {
2142
- return $TOKEN("FunctionExpression", state, FunctionExpression$0(state));
2207
+ return $TOKEN("FunctionExpression", state, FunctionExpression$0(state) || FunctionExpression$1(state));
2143
2208
  } else {
2144
- return FunctionExpression$0(state);
2209
+ return FunctionExpression$0(state) || FunctionExpression$1(state);
2145
2210
  }
2146
2211
  }
2147
2212
  var ThinArrowFunction$0 = $TS($S(Parameters, $E(ReturnTypeSuffix), $Q(_), Arrow, BracedOrEmptyBlock), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
@@ -2769,8 +2834,13 @@ var require_parser = __commonJS({
2769
2834
  }
2770
2835
  var PrivateIdentifier$0 = $TV($TEXT($S($EXPECT($L7, fail, 'PrivateIdentifier "#"'), IdentifierName)), function($skip, $loc, $0, $1) {
2771
2836
  return {
2772
- $loc,
2773
- token: $1
2837
+ type: "Identifier",
2838
+ name: $0,
2839
+ names: [$0],
2840
+ children: [{
2841
+ $loc,
2842
+ token: $0
2843
+ }]
2774
2844
  };
2775
2845
  });
2776
2846
  function PrivateIdentifier(state) {
@@ -2821,7 +2891,9 @@ var require_parser = __commonJS({
2821
2891
  }
2822
2892
  }
2823
2893
  var BinaryOp$0 = $TS($S(BinaryOpSymbol), function($skip, $loc, $0, $1) {
2824
- return { $loc, token: $1 };
2894
+ if (typeof $1 === "string")
2895
+ return { $loc, token: $1 };
2896
+ return $1;
2825
2897
  });
2826
2898
  function BinaryOp(state) {
2827
2899
  if (state.verbose)
@@ -2869,25 +2941,31 @@ var require_parser = __commonJS({
2869
2941
  return "&&";
2870
2942
  });
2871
2943
  var BinaryOpSymbol$20 = $EXPECT($L64, fail, 'BinaryOpSymbol "&&"');
2872
- var BinaryOpSymbol$21 = $T($S($EXPECT($L65, fail, 'BinaryOpSymbol "or"'), NonIdContinue), function(value) {
2944
+ var BinaryOpSymbol$21 = $T($S(CoffeeOfEnabled, $EXPECT($L65, fail, 'BinaryOpSymbol "of"'), NonIdContinue), function(value) {
2945
+ return "in";
2946
+ });
2947
+ var BinaryOpSymbol$22 = $T($S($EXPECT($L66, fail, 'BinaryOpSymbol "or"'), NonIdContinue), function(value) {
2873
2948
  return "||";
2874
2949
  });
2875
- var BinaryOpSymbol$22 = $EXPECT($L66, fail, 'BinaryOpSymbol "||"');
2876
- var BinaryOpSymbol$23 = $EXPECT($L67, fail, 'BinaryOpSymbol "??"');
2877
- var BinaryOpSymbol$24 = $TS($S($EXPECT($L68, fail, 'BinaryOpSymbol "instanceof"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
2950
+ var BinaryOpSymbol$23 = $EXPECT($L67, fail, 'BinaryOpSymbol "||"');
2951
+ var BinaryOpSymbol$24 = $EXPECT($L68, fail, 'BinaryOpSymbol "??"');
2952
+ var BinaryOpSymbol$25 = $TS($S($EXPECT($L69, fail, 'BinaryOpSymbol "instanceof"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
2878
2953
  return $1;
2879
2954
  });
2880
- var BinaryOpSymbol$25 = $TS($S($EXPECT($L69, fail, 'BinaryOpSymbol "in"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
2955
+ var BinaryOpSymbol$26 = $TS($S(CoffeeOfEnabled, $EXPECT($L70, fail, 'BinaryOpSymbol "in"'), NonIdContinue), function($skip, $loc, $0, $1, $2, $3) {
2956
+ return module2.getIndexOfRef();
2957
+ });
2958
+ var BinaryOpSymbol$27 = $TS($S($EXPECT($L70, fail, 'BinaryOpSymbol "in"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
2881
2959
  return $1;
2882
2960
  });
2883
- var BinaryOpSymbol$26 = $EXPECT($L70, fail, 'BinaryOpSymbol "&"');
2884
- var BinaryOpSymbol$27 = $EXPECT($L71, fail, 'BinaryOpSymbol "^"');
2885
- var BinaryOpSymbol$28 = $EXPECT($L72, fail, 'BinaryOpSymbol "|"');
2961
+ var BinaryOpSymbol$28 = $EXPECT($L71, fail, 'BinaryOpSymbol "&"');
2962
+ var BinaryOpSymbol$29 = $EXPECT($L72, fail, 'BinaryOpSymbol "^"');
2963
+ var BinaryOpSymbol$30 = $EXPECT($L73, fail, 'BinaryOpSymbol "|"');
2886
2964
  function BinaryOpSymbol(state) {
2887
2965
  if (state.tokenize) {
2888
- return $TOKEN("BinaryOpSymbol", state, BinaryOpSymbol$0(state) || BinaryOpSymbol$1(state) || BinaryOpSymbol$2(state) || BinaryOpSymbol$3(state) || BinaryOpSymbol$4(state) || BinaryOpSymbol$5(state) || BinaryOpSymbol$6(state) || BinaryOpSymbol$7(state) || BinaryOpSymbol$8(state) || BinaryOpSymbol$9(state) || BinaryOpSymbol$10(state) || BinaryOpSymbol$11(state) || BinaryOpSymbol$12(state) || BinaryOpSymbol$13(state) || BinaryOpSymbol$14(state) || BinaryOpSymbol$15(state) || BinaryOpSymbol$16(state) || BinaryOpSymbol$17(state) || BinaryOpSymbol$18(state) || BinaryOpSymbol$19(state) || BinaryOpSymbol$20(state) || BinaryOpSymbol$21(state) || BinaryOpSymbol$22(state) || BinaryOpSymbol$23(state) || BinaryOpSymbol$24(state) || BinaryOpSymbol$25(state) || BinaryOpSymbol$26(state) || BinaryOpSymbol$27(state) || BinaryOpSymbol$28(state));
2966
+ return $TOKEN("BinaryOpSymbol", state, BinaryOpSymbol$0(state) || BinaryOpSymbol$1(state) || BinaryOpSymbol$2(state) || BinaryOpSymbol$3(state) || BinaryOpSymbol$4(state) || BinaryOpSymbol$5(state) || BinaryOpSymbol$6(state) || BinaryOpSymbol$7(state) || BinaryOpSymbol$8(state) || BinaryOpSymbol$9(state) || BinaryOpSymbol$10(state) || BinaryOpSymbol$11(state) || BinaryOpSymbol$12(state) || BinaryOpSymbol$13(state) || BinaryOpSymbol$14(state) || BinaryOpSymbol$15(state) || BinaryOpSymbol$16(state) || BinaryOpSymbol$17(state) || BinaryOpSymbol$18(state) || BinaryOpSymbol$19(state) || BinaryOpSymbol$20(state) || BinaryOpSymbol$21(state) || BinaryOpSymbol$22(state) || BinaryOpSymbol$23(state) || BinaryOpSymbol$24(state) || BinaryOpSymbol$25(state) || BinaryOpSymbol$26(state) || BinaryOpSymbol$27(state) || BinaryOpSymbol$28(state) || BinaryOpSymbol$29(state) || BinaryOpSymbol$30(state));
2889
2967
  } else {
2890
- return BinaryOpSymbol$0(state) || BinaryOpSymbol$1(state) || BinaryOpSymbol$2(state) || BinaryOpSymbol$3(state) || BinaryOpSymbol$4(state) || BinaryOpSymbol$5(state) || BinaryOpSymbol$6(state) || BinaryOpSymbol$7(state) || BinaryOpSymbol$8(state) || BinaryOpSymbol$9(state) || BinaryOpSymbol$10(state) || BinaryOpSymbol$11(state) || BinaryOpSymbol$12(state) || BinaryOpSymbol$13(state) || BinaryOpSymbol$14(state) || BinaryOpSymbol$15(state) || BinaryOpSymbol$16(state) || BinaryOpSymbol$17(state) || BinaryOpSymbol$18(state) || BinaryOpSymbol$19(state) || BinaryOpSymbol$20(state) || BinaryOpSymbol$21(state) || BinaryOpSymbol$22(state) || BinaryOpSymbol$23(state) || BinaryOpSymbol$24(state) || BinaryOpSymbol$25(state) || BinaryOpSymbol$26(state) || BinaryOpSymbol$27(state) || BinaryOpSymbol$28(state);
2968
+ return BinaryOpSymbol$0(state) || BinaryOpSymbol$1(state) || BinaryOpSymbol$2(state) || BinaryOpSymbol$3(state) || BinaryOpSymbol$4(state) || BinaryOpSymbol$5(state) || BinaryOpSymbol$6(state) || BinaryOpSymbol$7(state) || BinaryOpSymbol$8(state) || BinaryOpSymbol$9(state) || BinaryOpSymbol$10(state) || BinaryOpSymbol$11(state) || BinaryOpSymbol$12(state) || BinaryOpSymbol$13(state) || BinaryOpSymbol$14(state) || BinaryOpSymbol$15(state) || BinaryOpSymbol$16(state) || BinaryOpSymbol$17(state) || BinaryOpSymbol$18(state) || BinaryOpSymbol$19(state) || BinaryOpSymbol$20(state) || BinaryOpSymbol$21(state) || BinaryOpSymbol$22(state) || BinaryOpSymbol$23(state) || BinaryOpSymbol$24(state) || BinaryOpSymbol$25(state) || BinaryOpSymbol$26(state) || BinaryOpSymbol$27(state) || BinaryOpSymbol$28(state) || BinaryOpSymbol$29(state) || BinaryOpSymbol$30(state);
2891
2969
  }
2892
2970
  }
2893
2971
  var UnaryOp$0 = $TR($EXPECT($R2, fail, "UnaryOp /[!~+-](?!\\s)/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
@@ -2918,7 +2996,18 @@ var require_parser = __commonJS({
2918
2996
  var ws = $2;
2919
2997
  var post = $3;
2920
2998
  if (post) {
2921
- post.children.push(statement);
2999
+ let block;
3000
+ if (post.type === "ForStatement") {
3001
+ if (post.blockPrefix?.length) {
3002
+ block = [" {", ...post.blockPrefix, ...statement, " }"];
3003
+ } else {
3004
+ block = statement;
3005
+ }
3006
+ } else {
3007
+ block = statement;
3008
+ }
3009
+ post.block = block;
3010
+ post.children.push(block);
2922
3011
  if (!module2.isWhitespaceOrEmpty(ws))
2923
3012
  post.children.push(ws);
2924
3013
  return post;
@@ -2960,7 +3049,7 @@ var require_parser = __commonJS({
2960
3049
  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);
2961
3050
  }
2962
3051
  }
2963
- var EmptyStatement$0 = $T($S($Q(TrailingComment), $Y($EXPECT($L73, fail, 'EmptyStatement ";"'))), function(value) {
3052
+ var EmptyStatement$0 = $T($S($Q(TrailingComment), $Y($EXPECT($L74, fail, 'EmptyStatement ";"'))), function(value) {
2964
3053
  return { "type": "EmptyStatement", "children": value[0] };
2965
3054
  });
2966
3055
  function EmptyStatement(state) {
@@ -3200,6 +3289,9 @@ var require_parser = __commonJS({
3200
3289
  var block = $2;
3201
3290
  clause.children.push(block);
3202
3291
  clause.block = block;
3292
+ if (clause.blockPrefix) {
3293
+ block.expressions.splice(0, 0, ...clause.blockPrefix);
3294
+ }
3203
3295
  return clause;
3204
3296
  });
3205
3297
  function ForStatement(state) {
@@ -3219,7 +3311,8 @@ var require_parser = __commonJS({
3219
3311
  type: "ForStatement",
3220
3312
  children,
3221
3313
  declaration,
3222
- block: null
3314
+ block: null,
3315
+ blockPrefix: c.blockPrefix
3223
3316
  };
3224
3317
  });
3225
3318
  function ForClause(state) {
@@ -3231,39 +3324,155 @@ var require_parser = __commonJS({
3231
3324
  return ForClause$0(state);
3232
3325
  }
3233
3326
  }
3234
- var ForStatementControl$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) {
3327
+ var ForStatementControl$0 = $T($S($N(CoffeeForLoopsEnabled), ForStatementParameters), function(value) {
3328
+ return value[1];
3329
+ });
3330
+ var ForStatementControl$1 = $TS($S(CoffeeForLoopsEnabled, CoffeeForStatementParameters, $E(WhenCondition)), function($skip, $loc, $0, $1, $2, $3) {
3331
+ if ($3) {
3332
+ const indent = "".padStart((module2.currentIndent + 1) * 2);
3333
+ module2.insertTrimmingSpace($3, "");
3334
+ $2.blockPrefix.push({
3335
+ type: "IfStatement",
3336
+ children: [indent, "if (!(", $3, ")) continue\n"]
3337
+ });
3338
+ }
3339
+ return $2;
3340
+ });
3341
+ function ForStatementControl(state) {
3342
+ if (state.tokenize) {
3343
+ return $TOKEN("ForStatementControl", state, ForStatementControl$0(state) || ForStatementControl$1(state));
3344
+ } else {
3345
+ return ForStatementControl$0(state) || ForStatementControl$1(state);
3346
+ }
3347
+ }
3348
+ var WhenCondition$0 = $T($S(__, When, ExtendedExpression), function(value) {
3349
+ var exp = value[2];
3350
+ return exp;
3351
+ });
3352
+ function WhenCondition(state) {
3353
+ if (state.verbose)
3354
+ console.log("ENTER:", "WhenCondition");
3355
+ if (state.tokenize) {
3356
+ return $TOKEN("WhenCondition", state, WhenCondition$0(state));
3357
+ } else {
3358
+ return WhenCondition$0(state);
3359
+ }
3360
+ }
3361
+ var CoffeeForStatementParameters$0 = $TS($S($E($S(Await, __)), InsertOpenParen, CoffeeForDeclaration, __, $C(In, Of, From), ExtendedExpression, InsertCloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
3362
+ var declaration = $3;
3363
+ var kind = $5;
3364
+ var exp = $6;
3365
+ let blockPrefix = [];
3366
+ if (kind.token === "from") {
3367
+ kind.token = "of";
3368
+ } else if (kind.token === "of") {
3369
+ module2.insertTrimmingSpace(declaration, "");
3370
+ module2.insertTrimmingSpace(exp, "");
3371
+ if (declaration.own) {
3372
+ const indent = "".padStart((module2.currentIndent + 1) * 2);
3373
+ const hasPropRef = module2.getHasPropRef();
3374
+ blockPrefix.push([indent, "if (!", hasPropRef, ".call(", exp, ", ", declaration, ")) continue\n"]);
3375
+ }
3376
+ kind.token = "in ";
3377
+ } else if (kind.token === "in") {
3378
+ const counterRef = {
3379
+ type: "Ref",
3380
+ base: "i"
3381
+ };
3382
+ const lenRef = {
3383
+ type: "Ref",
3384
+ base: "len"
3385
+ };
3386
+ const expRef = exp.type === "Identifier" ? exp : {
3387
+ type: "Ref",
3388
+ base: "ref"
3389
+ };
3390
+ const varRef = declaration;
3391
+ module2.insertTrimmingSpace(exp, "");
3392
+ const expRefDec = expRef !== exp ? [expRef, " = ", exp, ", "] : [];
3393
+ declaration = {
3394
+ type: "Declaration",
3395
+ children: ["let ", ...expRefDec, counterRef, " = 0, ", lenRef, " = ", expRef, ".length"],
3396
+ names: []
3397
+ };
3398
+ const indent = "".padStart((module2.currentIndent + 1) * 2);
3399
+ blockPrefix.push([{
3400
+ type: "AssignmentExpression",
3401
+ children: [indent, varRef, " = ", expRef, "[", counterRef, "]\n"],
3402
+ names: varRef.names
3403
+ }]);
3404
+ return {
3405
+ declaration,
3406
+ children: [$1, $2, declaration, "; ", counterRef, " < ", lenRef, "; ", counterRef, "++", $7],
3407
+ blockPrefix
3408
+ };
3409
+ }
3410
+ return {
3411
+ declaration,
3412
+ children: $0,
3413
+ blockPrefix
3414
+ };
3415
+ });
3416
+ function CoffeeForStatementParameters(state) {
3417
+ if (state.verbose)
3418
+ console.log("ENTER:", "CoffeeForStatementParameters");
3419
+ if (state.tokenize) {
3420
+ return $TOKEN("CoffeeForStatementParameters", state, CoffeeForStatementParameters$0(state));
3421
+ } else {
3422
+ return CoffeeForStatementParameters$0(state);
3423
+ }
3424
+ }
3425
+ var CoffeeForDeclaration$0 = $TS($S($E($S(__, $EXPECT($L75, fail, 'CoffeeForDeclaration "own"'))), ForBinding), function($skip, $loc, $0, $1, $2) {
3426
+ var own = $1;
3427
+ var binding = $2;
3428
+ if (own) {
3429
+ binding.own = true;
3430
+ }
3431
+ binding.type = "AssignmentExpression";
3432
+ return binding;
3433
+ });
3434
+ function CoffeeForDeclaration(state) {
3435
+ if (state.verbose)
3436
+ console.log("ENTER:", "CoffeeForDeclaration");
3437
+ if (state.tokenize) {
3438
+ return $TOKEN("CoffeeForDeclaration", state, CoffeeForDeclaration$0(state));
3439
+ } else {
3440
+ return CoffeeForDeclaration$0(state);
3441
+ }
3442
+ }
3443
+ 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) {
3235
3444
  var declaration = $3;
3236
3445
  return {
3237
3446
  declaration,
3238
3447
  children: $0
3239
3448
  };
3240
3449
  });
3241
- var ForStatementControl$1 = $TS($S(InsertOpenParen, __, $C(LexicalDeclaration, VariableStatement, $E(Expression)), __, Semicolon, $E(Expression), Semicolon, $E($S($N(EOS), Expression)), InsertCloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
3450
+ var ForStatementParameters$1 = $TS($S(InsertOpenParen, __, $C(LexicalDeclaration, VariableStatement, $E(Expression)), __, Semicolon, $E(Expression), Semicolon, $E($S($N(EOS), Expression)), InsertCloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
3242
3451
  var declaration = $3;
3243
3452
  return {
3244
3453
  declaration,
3245
3454
  children: $0
3246
3455
  };
3247
3456
  });
3248
- var ForStatementControl$2 = $TS($S($E($S(Await, __)), OpenParen, __, ForInOfDeclaration, __, $C(In, Of), ExtendedExpression, __, CloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
3457
+ var ForStatementParameters$2 = $TS($S($E($S(Await, __)), OpenParen, __, ForInOfDeclaration, __, $C(In, Of), ExtendedExpression, __, CloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
3249
3458
  var declaration = $4;
3250
3459
  return {
3251
3460
  declaration,
3252
3461
  children: $0
3253
3462
  };
3254
3463
  });
3255
- var ForStatementControl$3 = $TS($S($E($S(Await, __)), InsertOpenParen, ForInOfDeclaration, __, $C(In, Of), ExtendedExpression, InsertCloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
3464
+ var ForStatementParameters$3 = $TS($S($E($S(Await, __)), InsertOpenParen, ForInOfDeclaration, __, $C(In, Of), ExtendedExpression, InsertCloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
3256
3465
  var declaration = $3;
3257
3466
  return {
3258
3467
  declaration,
3259
3468
  children: $0
3260
3469
  };
3261
3470
  });
3262
- function ForStatementControl(state) {
3471
+ function ForStatementParameters(state) {
3263
3472
  if (state.tokenize) {
3264
- return $TOKEN("ForStatementControl", state, ForStatementControl$0(state) || ForStatementControl$1(state) || ForStatementControl$2(state) || ForStatementControl$3(state));
3473
+ return $TOKEN("ForStatementParameters", state, ForStatementParameters$0(state) || ForStatementParameters$1(state) || ForStatementParameters$2(state) || ForStatementParameters$3(state));
3265
3474
  } else {
3266
- return ForStatementControl$0(state) || ForStatementControl$1(state) || ForStatementControl$2(state) || ForStatementControl$3(state);
3475
+ return ForStatementParameters$0(state) || ForStatementParameters$1(state) || ForStatementParameters$2(state) || ForStatementParameters$3(state);
3267
3476
  }
3268
3477
  }
3269
3478
  var ForInOfDeclaration$0 = $TS($S(Var, ForBinding), function($skip, $loc, $0, $1, $2) {
@@ -3512,7 +3721,7 @@ var require_parser = __commonJS({
3512
3721
  return CatchBind$0(state) || CatchBind$1(state);
3513
3722
  }
3514
3723
  }
3515
- var Finally$0 = $S(__, $EXPECT($L74, fail, 'Finally "finally"'), BracedBlock);
3724
+ var Finally$0 = $S(__, $EXPECT($L76, fail, 'Finally "finally"'), BracedBlock);
3516
3725
  function Finally(state) {
3517
3726
  if (state.verbose)
3518
3727
  console.log("ENTER:", "Finally");
@@ -3581,13 +3790,13 @@ var require_parser = __commonJS({
3581
3790
  return ExpressionStatement$0(state);
3582
3791
  }
3583
3792
  }
3584
- var KeywordStatement$0 = $T($S($EXPECT($L75, fail, 'KeywordStatement "break"'), NonIdContinue), function(value) {
3793
+ var KeywordStatement$0 = $T($S($EXPECT($L77, fail, 'KeywordStatement "break"'), NonIdContinue), function(value) {
3585
3794
  return { "type": "BreakStatement", "children": value };
3586
3795
  });
3587
- var KeywordStatement$1 = $T($S($EXPECT($L76, fail, 'KeywordStatement "continue"'), NonIdContinue), function(value) {
3796
+ var KeywordStatement$1 = $T($S($EXPECT($L78, fail, 'KeywordStatement "continue"'), NonIdContinue), function(value) {
3588
3797
  return { "type": "ContinueStatement", "children": value };
3589
3798
  });
3590
- var KeywordStatement$2 = $T($S($EXPECT($L77, fail, 'KeywordStatement "debugger"'), NonIdContinue), function(value) {
3799
+ var KeywordStatement$2 = $T($S($EXPECT($L79, fail, 'KeywordStatement "debugger"'), NonIdContinue), function(value) {
3591
3800
  return { "type": "DebuggerStatement", "children": value };
3592
3801
  });
3593
3802
  var KeywordStatement$3 = $T($S(Return, $E(MaybeNestedExpression)), function(value) {
@@ -3603,7 +3812,7 @@ var require_parser = __commonJS({
3603
3812
  return KeywordStatement$0(state) || KeywordStatement$1(state) || KeywordStatement$2(state) || KeywordStatement$3(state) || KeywordStatement$4(state);
3604
3813
  }
3605
3814
  }
3606
- var DebuggerExpression$0 = $TS($S($EXPECT($L77, fail, 'DebuggerExpression "debugger"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
3815
+ var DebuggerExpression$0 = $TS($S($EXPECT($L79, fail, 'DebuggerExpression "debugger"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
3607
3816
  return {
3608
3817
  type: "DebuggerExpression",
3609
3818
  children: ["($=>{", $1, "})()"]
@@ -3646,7 +3855,7 @@ var require_parser = __commonJS({
3646
3855
  return MaybeNestedExpression$0(state) || MaybeNestedExpression$1(state);
3647
3856
  }
3648
3857
  }
3649
- var ImportDeclaration$0 = $T($S($EXPECT($L78, fail, 'ImportDeclaration "import type"'), NonIdContinue, __, ImportClause, __, FromClause), function(value) {
3858
+ var ImportDeclaration$0 = $T($S($EXPECT($L80, fail, 'ImportDeclaration "import type"'), NonIdContinue, __, ImportClause, __, FromClause), function(value) {
3650
3859
  return { "ts": true, "children": value };
3651
3860
  });
3652
3861
  var ImportDeclaration$1 = $S(Import, __, ImportClause, __, FromClause);
@@ -3825,7 +4034,7 @@ var require_parser = __commonJS({
3825
4034
  return ImportedBinding$0(state);
3826
4035
  }
3827
4036
  }
3828
- var ExportDeclaration$0 = $S(Export, __, $EXPECT($L79, fail, 'ExportDeclaration "default"'), NonIdContinue, __, $C(HoistableDeclaration, ClassDeclaration, ExtendedExpression));
4037
+ var ExportDeclaration$0 = $S(Export, __, $EXPECT($L81, fail, 'ExportDeclaration "default"'), NonIdContinue, __, $C(HoistableDeclaration, ClassDeclaration, ExtendedExpression));
3829
4038
  var ExportDeclaration$1 = $S(Export, __, ExportFromClause, __, FromClause);
3830
4039
  var ExportDeclaration$2 = $S(Export, __, $C(NamedExports, VariableStatement, Declaration));
3831
4040
  function ExportDeclaration(state) {
@@ -3932,7 +4141,7 @@ var require_parser = __commonJS({
3932
4141
  return LexicalDeclaration$0(state) || LexicalDeclaration$1(state);
3933
4142
  }
3934
4143
  }
3935
- var ConstAssignment$0 = $TV($EXPECT($L80, fail, 'ConstAssignment ":="'), function($skip, $loc, $0, $1) {
4144
+ var ConstAssignment$0 = $TV($EXPECT($L82, fail, 'ConstAssignment ":="'), function($skip, $loc, $0, $1) {
3936
4145
  return { $loc, token: "=" };
3937
4146
  });
3938
4147
  function ConstAssignment(state) {
@@ -4380,7 +4589,7 @@ var require_parser = __commonJS({
4380
4589
  return MultiLineComment$0(state) || MultiLineComment$1(state);
4381
4590
  }
4382
4591
  }
4383
- var JSMultiLineComment$0 = $TV($TEXT($S($EXPECT($L81, fail, 'JSMultiLineComment "/*"'), $Q($S($N($EXPECT($L82, fail, 'JSMultiLineComment "*/"')), $EXPECT($R27, fail, "JSMultiLineComment /./"))), $EXPECT($L82, fail, 'JSMultiLineComment "*/"'))), function($skip, $loc, $0, $1) {
4592
+ var JSMultiLineComment$0 = $TV($TEXT($S($EXPECT($L83, fail, 'JSMultiLineComment "/*"'), $Q($S($N($EXPECT($L84, fail, 'JSMultiLineComment "*/"')), $EXPECT($R27, fail, "JSMultiLineComment /./"))), $EXPECT($L84, fail, 'JSMultiLineComment "*/"'))), function($skip, $loc, $0, $1) {
4384
4593
  return { $loc, token: $1 };
4385
4594
  });
4386
4595
  function JSMultiLineComment(state) {
@@ -4404,7 +4613,7 @@ var require_parser = __commonJS({
4404
4613
  return CoffeeSingleLineComment$0(state);
4405
4614
  }
4406
4615
  }
4407
- var CoffeeMultiLineComment$0 = $TS($S($EXPECT($L83, fail, 'CoffeeMultiLineComment "###"'), $TEXT($Q($S($N($C($EXPECT($L83, fail, 'CoffeeMultiLineComment "###"'), $EXPECT($L82, fail, 'CoffeeMultiLineComment "*/"'))), $EXPECT($R27, fail, "CoffeeMultiLineComment /./")))), $EXPECT($L83, fail, 'CoffeeMultiLineComment "###"')), function($skip, $loc, $0, $1, $2, $3) {
4616
+ var CoffeeMultiLineComment$0 = $TS($S($EXPECT($L85, fail, 'CoffeeMultiLineComment "###"'), $TEXT($Q($S($N($C($EXPECT($L85, fail, 'CoffeeMultiLineComment "###"'), $EXPECT($L84, fail, 'CoffeeMultiLineComment "*/"'))), $EXPECT($R27, fail, "CoffeeMultiLineComment /./")))), $EXPECT($L85, fail, 'CoffeeMultiLineComment "###"')), function($skip, $loc, $0, $1, $2, $3) {
4408
4617
  return { $loc, token: `/*${$2}*/` };
4409
4618
  });
4410
4619
  function CoffeeMultiLineComment(state) {
@@ -4416,7 +4625,7 @@ var require_parser = __commonJS({
4416
4625
  return CoffeeMultiLineComment$0(state);
4417
4626
  }
4418
4627
  }
4419
- var InlineComment$0 = $TV($TEXT($S($EXPECT($L81, fail, 'InlineComment "/*"'), $TEXT($Q($S($N($EXPECT($L82, fail, 'InlineComment "*/"')), $EXPECT($R29, fail, "InlineComment /[^\\r\\n]/")))), $EXPECT($L82, fail, 'InlineComment "*/"'))), function($skip, $loc, $0, $1) {
4628
+ var InlineComment$0 = $TV($TEXT($S($EXPECT($L83, fail, 'InlineComment "/*"'), $TEXT($Q($S($N($EXPECT($L84, fail, 'InlineComment "*/"')), $EXPECT($R29, fail, "InlineComment /[^\\r\\n]/")))), $EXPECT($L84, fail, 'InlineComment "*/"'))), function($skip, $loc, $0, $1) {
4420
4629
  return { $loc, token: $1 };
4421
4630
  });
4422
4631
  function InlineComment(state) {
@@ -4537,7 +4746,19 @@ var require_parser = __commonJS({
4537
4746
  return Loc$0(state);
4538
4747
  }
4539
4748
  }
4540
- var As$0 = $TS($S($EXPECT($L84, fail, 'As "as"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4749
+ var Ampersand$0 = $TV($EXPECT($L71, fail, 'Ampersand "&"'), function($skip, $loc, $0, $1) {
4750
+ return { $loc, token: $1 };
4751
+ });
4752
+ function Ampersand(state) {
4753
+ if (state.verbose)
4754
+ console.log("ENTER:", "Ampersand");
4755
+ if (state.tokenize) {
4756
+ return $TOKEN("Ampersand", state, Ampersand$0(state));
4757
+ } else {
4758
+ return Ampersand$0(state);
4759
+ }
4760
+ }
4761
+ var As$0 = $TS($S($EXPECT($L86, fail, 'As "as"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4541
4762
  return { $loc, token: $1 };
4542
4763
  });
4543
4764
  function As(state) {
@@ -4549,7 +4770,7 @@ var require_parser = __commonJS({
4549
4770
  return As$0(state);
4550
4771
  }
4551
4772
  }
4552
- var Async$0 = $TV($EXPECT($L85, fail, 'Async "async"'), function($skip, $loc, $0, $1) {
4773
+ var Async$0 = $TV($EXPECT($L87, fail, 'Async "async"'), function($skip, $loc, $0, $1) {
4553
4774
  return { $loc, token: $1 };
4554
4775
  });
4555
4776
  function Async(state) {
@@ -4561,7 +4782,7 @@ var require_parser = __commonJS({
4561
4782
  return Async$0(state);
4562
4783
  }
4563
4784
  }
4564
- var Await$0 = $TS($S($EXPECT($L86, fail, 'Await "await"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4785
+ var Await$0 = $TS($S($EXPECT($L88, fail, 'Await "await"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4565
4786
  return { $loc, token: $1 };
4566
4787
  });
4567
4788
  function Await(state) {
@@ -4573,7 +4794,7 @@ var require_parser = __commonJS({
4573
4794
  return Await$0(state);
4574
4795
  }
4575
4796
  }
4576
- var Backtick$0 = $TV($EXPECT($L87, fail, 'Backtick "`"'), function($skip, $loc, $0, $1) {
4797
+ var Backtick$0 = $TV($EXPECT($L89, fail, 'Backtick "`"'), function($skip, $loc, $0, $1) {
4577
4798
  return { $loc, token: $1 };
4578
4799
  });
4579
4800
  function Backtick(state) {
@@ -4585,7 +4806,7 @@ var require_parser = __commonJS({
4585
4806
  return Backtick$0(state);
4586
4807
  }
4587
4808
  }
4588
- var Case$0 = $TS($S($EXPECT($L88, fail, 'Case "case"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4809
+ var Case$0 = $TS($S($EXPECT($L90, fail, 'Case "case"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4589
4810
  return { $loc, token: $1 };
4590
4811
  });
4591
4812
  function Case(state) {
@@ -4597,7 +4818,7 @@ var require_parser = __commonJS({
4597
4818
  return Case$0(state);
4598
4819
  }
4599
4820
  }
4600
- var Catch$0 = $TV($EXPECT($L89, fail, 'Catch "catch"'), function($skip, $loc, $0, $1) {
4821
+ var Catch$0 = $TV($EXPECT($L91, fail, 'Catch "catch"'), function($skip, $loc, $0, $1) {
4601
4822
  return { $loc, token: $1 };
4602
4823
  });
4603
4824
  function Catch(state) {
@@ -4609,7 +4830,7 @@ var require_parser = __commonJS({
4609
4830
  return Catch$0(state);
4610
4831
  }
4611
4832
  }
4612
- var Class$0 = $TV($EXPECT($L90, fail, 'Class "class"'), function($skip, $loc, $0, $1) {
4833
+ var Class$0 = $TV($EXPECT($L92, fail, 'Class "class"'), function($skip, $loc, $0, $1) {
4613
4834
  return { $loc, token: $1 };
4614
4835
  });
4615
4836
  function Class(state) {
@@ -4657,7 +4878,7 @@ var require_parser = __commonJS({
4657
4878
  return CloseParen$0(state);
4658
4879
  }
4659
4880
  }
4660
- var CoffeeSubstitutionStart$0 = $TV($EXPECT($L91, fail, 'CoffeeSubstitutionStart "#{"'), function($skip, $loc, $0, $1) {
4881
+ var CoffeeSubstitutionStart$0 = $TV($EXPECT($L93, fail, 'CoffeeSubstitutionStart "#{"'), function($skip, $loc, $0, $1) {
4661
4882
  return { $loc, token: "${" };
4662
4883
  });
4663
4884
  function CoffeeSubstitutionStart(state) {
@@ -4669,7 +4890,7 @@ var require_parser = __commonJS({
4669
4890
  return CoffeeSubstitutionStart$0(state);
4670
4891
  }
4671
4892
  }
4672
- var Colon$0 = $TV($EXPECT($L92, fail, 'Colon ":"'), function($skip, $loc, $0, $1) {
4893
+ var Colon$0 = $TV($EXPECT($L94, fail, 'Colon ":"'), function($skip, $loc, $0, $1) {
4673
4894
  return { $loc, token: $1 };
4674
4895
  });
4675
4896
  function Colon(state) {
@@ -4693,7 +4914,7 @@ var require_parser = __commonJS({
4693
4914
  return ConstructorShorthand$0(state);
4694
4915
  }
4695
4916
  }
4696
- var Default$0 = $TS($S($EXPECT($L79, fail, 'Default "default"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4917
+ var Default$0 = $TS($S($EXPECT($L81, fail, 'Default "default"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4697
4918
  return { $loc, token: $1 };
4698
4919
  });
4699
4920
  function Default(state) {
@@ -4705,7 +4926,7 @@ var require_parser = __commonJS({
4705
4926
  return Default$0(state);
4706
4927
  }
4707
4928
  }
4708
- var Delete$0 = $TS($S($EXPECT($L93, fail, 'Delete "delete"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4929
+ var Delete$0 = $TS($S($EXPECT($L95, fail, 'Delete "delete"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4709
4930
  return { $loc, token: $1 };
4710
4931
  });
4711
4932
  function Delete(state) {
@@ -4717,7 +4938,7 @@ var require_parser = __commonJS({
4717
4938
  return Delete$0(state);
4718
4939
  }
4719
4940
  }
4720
- var Do$0 = $TS($S($EXPECT($L94, fail, 'Do "do"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4941
+ var Do$0 = $TS($S($EXPECT($L96, fail, 'Do "do"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4721
4942
  return { $loc, token: $1 };
4722
4943
  });
4723
4944
  function Do(state) {
@@ -4741,7 +4962,7 @@ var require_parser = __commonJS({
4741
4962
  return Dot$0(state);
4742
4963
  }
4743
4964
  }
4744
- var DotDot$0 = $TV($EXPECT($L95, fail, 'DotDot ".."'), function($skip, $loc, $0, $1) {
4965
+ var DotDot$0 = $TV($EXPECT($L97, fail, 'DotDot ".."'), function($skip, $loc, $0, $1) {
4745
4966
  return { $loc, token: $1 };
4746
4967
  });
4747
4968
  function DotDot(state) {
@@ -4753,7 +4974,7 @@ var require_parser = __commonJS({
4753
4974
  return DotDot$0(state);
4754
4975
  }
4755
4976
  }
4756
- var DotDotDot$0 = $TV($EXPECT($L96, fail, 'DotDotDot "..."'), function($skip, $loc, $0, $1) {
4977
+ var DotDotDot$0 = $TV($EXPECT($L98, fail, 'DotDotDot "..."'), function($skip, $loc, $0, $1) {
4757
4978
  return { $loc, token: $1 };
4758
4979
  });
4759
4980
  function DotDotDot(state) {
@@ -4765,7 +4986,7 @@ var require_parser = __commonJS({
4765
4986
  return DotDotDot$0(state);
4766
4987
  }
4767
4988
  }
4768
- var DoubleQuote$0 = $TV($EXPECT($L97, fail, 'DoubleQuote "\\\\\\""'), function($skip, $loc, $0, $1) {
4989
+ var DoubleQuote$0 = $TV($EXPECT($L99, fail, 'DoubleQuote "\\\\\\""'), function($skip, $loc, $0, $1) {
4769
4990
  return { $loc, token: $1 };
4770
4991
  });
4771
4992
  function DoubleQuote(state) {
@@ -4777,7 +4998,7 @@ var require_parser = __commonJS({
4777
4998
  return DoubleQuote$0(state);
4778
4999
  }
4779
5000
  }
4780
- var Else$0 = $TV($EXPECT($L98, fail, 'Else "else"'), function($skip, $loc, $0, $1) {
5001
+ var Else$0 = $TV($EXPECT($L100, fail, 'Else "else"'), function($skip, $loc, $0, $1) {
4781
5002
  return { $loc, token: $1 };
4782
5003
  });
4783
5004
  function Else(state) {
@@ -4801,7 +5022,7 @@ var require_parser = __commonJS({
4801
5022
  return Equals$0(state);
4802
5023
  }
4803
5024
  }
4804
- var Export$0 = $TS($S($EXPECT($L99, fail, 'Export "export"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5025
+ var Export$0 = $TS($S($EXPECT($L101, fail, 'Export "export"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4805
5026
  return { $loc, token: $1 };
4806
5027
  });
4807
5028
  function Export(state) {
@@ -4813,7 +5034,7 @@ var require_parser = __commonJS({
4813
5034
  return Export$0(state);
4814
5035
  }
4815
5036
  }
4816
- var For$0 = $TS($S($EXPECT($L100, fail, 'For "for"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5037
+ var For$0 = $TS($S($EXPECT($L102, fail, 'For "for"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4817
5038
  return { $loc, token: $1 };
4818
5039
  });
4819
5040
  function For(state) {
@@ -4825,7 +5046,7 @@ var require_parser = __commonJS({
4825
5046
  return For$0(state);
4826
5047
  }
4827
5048
  }
4828
- var From$0 = $TS($S($EXPECT($L101, fail, 'From "from"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5049
+ var From$0 = $TS($S($EXPECT($L103, fail, 'From "from"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4829
5050
  return { $loc, token: $1 };
4830
5051
  });
4831
5052
  function From(state) {
@@ -4837,7 +5058,7 @@ var require_parser = __commonJS({
4837
5058
  return From$0(state);
4838
5059
  }
4839
5060
  }
4840
- var Function$0 = $TV($EXPECT($L102, fail, 'Function "function"'), function($skip, $loc, $0, $1) {
5061
+ var Function$0 = $TV($EXPECT($L104, fail, 'Function "function"'), function($skip, $loc, $0, $1) {
4841
5062
  return { $loc, token: $1 };
4842
5063
  });
4843
5064
  function Function(state) {
@@ -4849,7 +5070,7 @@ var require_parser = __commonJS({
4849
5070
  return Function$0(state);
4850
5071
  }
4851
5072
  }
4852
- var GetOrSet$0 = $TS($S($C($EXPECT($L103, fail, 'GetOrSet "get"'), $EXPECT($L104, fail, 'GetOrSet "set"')), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5073
+ var GetOrSet$0 = $TS($S($C($EXPECT($L105, fail, 'GetOrSet "get"'), $EXPECT($L106, fail, 'GetOrSet "set"')), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4853
5074
  return { $loc, token: $1 };
4854
5075
  });
4855
5076
  function GetOrSet(state) {
@@ -4861,7 +5082,7 @@ var require_parser = __commonJS({
4861
5082
  return GetOrSet$0(state);
4862
5083
  }
4863
5084
  }
4864
- var If$0 = $TV($TEXT($S($EXPECT($L105, fail, 'If "if"'), $E($EXPECT($L106, fail, 'If " "')))), function($skip, $loc, $0, $1) {
5085
+ var If$0 = $TV($TEXT($S($EXPECT($L107, fail, 'If "if"'), $E($EXPECT($L108, fail, 'If " "')))), function($skip, $loc, $0, $1) {
4865
5086
  return { $loc, token: $1 };
4866
5087
  });
4867
5088
  function If(state) {
@@ -4885,7 +5106,7 @@ var require_parser = __commonJS({
4885
5106
  return Import$0(state);
4886
5107
  }
4887
5108
  }
4888
- var In$0 = $TV($EXPECT($L69, fail, 'In "in"'), function($skip, $loc, $0, $1) {
5109
+ var In$0 = $TV($EXPECT($L70, fail, 'In "in"'), function($skip, $loc, $0, $1) {
4889
5110
  return { $loc, token: $1 };
4890
5111
  });
4891
5112
  function In(state) {
@@ -4897,7 +5118,7 @@ var require_parser = __commonJS({
4897
5118
  return In$0(state);
4898
5119
  }
4899
5120
  }
4900
- var LetOrConst$0 = $TV($C($EXPECT($L107, fail, 'LetOrConst "let"'), $EXPECT($L108, fail, 'LetOrConst "const"')), function($skip, $loc, $0, $1) {
5121
+ var LetOrConst$0 = $TV($C($EXPECT($L109, fail, 'LetOrConst "let"'), $EXPECT($L110, fail, 'LetOrConst "const"')), function($skip, $loc, $0, $1) {
4901
5122
  return { $loc, token: $1 };
4902
5123
  });
4903
5124
  function LetOrConst(state) {
@@ -4909,7 +5130,7 @@ var require_parser = __commonJS({
4909
5130
  return LetOrConst$0(state);
4910
5131
  }
4911
5132
  }
4912
- var Loop$0 = $TS($S($EXPECT($L109, fail, 'Loop "loop"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5133
+ var Loop$0 = $TS($S($EXPECT($L111, fail, 'Loop "loop"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4913
5134
  return { $loc, token: "while(true)" };
4914
5135
  });
4915
5136
  function Loop(state) {
@@ -4921,7 +5142,7 @@ var require_parser = __commonJS({
4921
5142
  return Loop$0(state);
4922
5143
  }
4923
5144
  }
4924
- var New$0 = $TV($EXPECT($L110, fail, 'New "new"'), function($skip, $loc, $0, $1) {
5145
+ var New$0 = $TV($EXPECT($L112, fail, 'New "new"'), function($skip, $loc, $0, $1) {
4925
5146
  return { $loc, token: $1 };
4926
5147
  });
4927
5148
  function New(state) {
@@ -4933,7 +5154,7 @@ var require_parser = __commonJS({
4933
5154
  return New$0(state);
4934
5155
  }
4935
5156
  }
4936
- var Not$0 = $TS($S(CoffeeNotEnabled, $EXPECT($L111, fail, 'Not "not"'), NonIdContinue, $E($EXPECT($L106, fail, 'Not " "'))), function($skip, $loc, $0, $1, $2, $3, $4) {
5157
+ var Not$0 = $TS($S(CoffeeNotEnabled, $EXPECT($L113, fail, 'Not "not"'), NonIdContinue, $E($EXPECT($L108, fail, 'Not " "'))), function($skip, $loc, $0, $1, $2, $3, $4) {
4937
5158
  return { $loc, token: "!" };
4938
5159
  });
4939
5160
  function Not(state) {
@@ -4945,7 +5166,7 @@ var require_parser = __commonJS({
4945
5166
  return Not$0(state);
4946
5167
  }
4947
5168
  }
4948
- var Of$0 = $TV($EXPECT($L112, fail, 'Of "of"'), function($skip, $loc, $0, $1) {
5169
+ var Of$0 = $TV($EXPECT($L65, fail, 'Of "of"'), function($skip, $loc, $0, $1) {
4949
5170
  return { $loc, token: $1 };
4950
5171
  });
4951
5172
  function Of(state) {
@@ -4957,7 +5178,7 @@ var require_parser = __commonJS({
4957
5178
  return Of$0(state);
4958
5179
  }
4959
5180
  }
4960
- var OpenBrace$0 = $TV($EXPECT($L113, fail, 'OpenBrace "{"'), function($skip, $loc, $0, $1) {
5181
+ var OpenBrace$0 = $TV($EXPECT($L114, fail, 'OpenBrace "{"'), function($skip, $loc, $0, $1) {
4961
5182
  return { $loc, token: $1 };
4962
5183
  });
4963
5184
  function OpenBrace(state) {
@@ -4969,7 +5190,7 @@ var require_parser = __commonJS({
4969
5190
  return OpenBrace$0(state);
4970
5191
  }
4971
5192
  }
4972
- var OpenBracket$0 = $TV($EXPECT($L114, fail, 'OpenBracket "["'), function($skip, $loc, $0, $1) {
5193
+ var OpenBracket$0 = $TV($EXPECT($L115, fail, 'OpenBracket "["'), function($skip, $loc, $0, $1) {
4973
5194
  return { $loc, token: $1 };
4974
5195
  });
4975
5196
  function OpenBracket(state) {
@@ -4981,7 +5202,7 @@ var require_parser = __commonJS({
4981
5202
  return OpenBracket$0(state);
4982
5203
  }
4983
5204
  }
4984
- var OpenParen$0 = $TV($EXPECT($L115, fail, 'OpenParen "("'), function($skip, $loc, $0, $1) {
5205
+ var OpenParen$0 = $TV($EXPECT($L116, fail, 'OpenParen "("'), function($skip, $loc, $0, $1) {
4985
5206
  return { $loc, token: $1 };
4986
5207
  });
4987
5208
  function OpenParen(state) {
@@ -4993,7 +5214,7 @@ var require_parser = __commonJS({
4993
5214
  return OpenParen$0(state);
4994
5215
  }
4995
5216
  }
4996
- var QuestionMark$0 = $TV($EXPECT($L116, fail, 'QuestionMark "?"'), function($skip, $loc, $0, $1) {
5217
+ var QuestionMark$0 = $TV($EXPECT($L117, fail, 'QuestionMark "?"'), function($skip, $loc, $0, $1) {
4997
5218
  return { $loc, token: $1 };
4998
5219
  });
4999
5220
  function QuestionMark(state) {
@@ -5005,7 +5226,7 @@ var require_parser = __commonJS({
5005
5226
  return QuestionMark$0(state);
5006
5227
  }
5007
5228
  }
5008
- var Return$0 = $TS($S($EXPECT($L117, fail, 'Return "return"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5229
+ var Return$0 = $TS($S($EXPECT($L118, fail, 'Return "return"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5009
5230
  return { $loc, token: $1 };
5010
5231
  });
5011
5232
  function Return(state) {
@@ -5017,7 +5238,7 @@ var require_parser = __commonJS({
5017
5238
  return Return$0(state);
5018
5239
  }
5019
5240
  }
5020
- var Semicolon$0 = $TV($EXPECT($L73, fail, 'Semicolon ";"'), function($skip, $loc, $0, $1) {
5241
+ var Semicolon$0 = $TV($EXPECT($L74, fail, 'Semicolon ";"'), function($skip, $loc, $0, $1) {
5021
5242
  return { $loc, token: $1 };
5022
5243
  });
5023
5244
  function Semicolon(state) {
@@ -5029,7 +5250,7 @@ var require_parser = __commonJS({
5029
5250
  return Semicolon$0(state);
5030
5251
  }
5031
5252
  }
5032
- var SingleQuote$0 = $TV($EXPECT($L118, fail, `SingleQuote "'"`), function($skip, $loc, $0, $1) {
5253
+ var SingleQuote$0 = $TV($EXPECT($L119, fail, `SingleQuote "'"`), function($skip, $loc, $0, $1) {
5033
5254
  return { $loc, token: $1 };
5034
5255
  });
5035
5256
  function SingleQuote(state) {
@@ -5053,10 +5274,10 @@ var require_parser = __commonJS({
5053
5274
  return Star$0(state);
5054
5275
  }
5055
5276
  }
5056
- var Static$0 = $TV($EXPECT($L119, fail, 'Static "static"'), function($skip, $loc, $0, $1) {
5277
+ var Static$0 = $TV($EXPECT($L120, fail, 'Static "static"'), function($skip, $loc, $0, $1) {
5057
5278
  return { $loc, token: $1 };
5058
5279
  });
5059
- var Static$1 = $TS($S($EXPECT($L8, fail, 'Static "@"'), $N($EXPECT($L115, fail, 'Static "("'))), function($skip, $loc, $0, $1, $2) {
5280
+ var Static$1 = $TS($S($EXPECT($L8, fail, 'Static "@"'), $N($EXPECT($L116, fail, 'Static "("'))), function($skip, $loc, $0, $1, $2) {
5060
5281
  return { $loc, token: "static " };
5061
5282
  });
5062
5283
  function Static(state) {
@@ -5066,7 +5287,7 @@ var require_parser = __commonJS({
5066
5287
  return Static$0(state) || Static$1(state);
5067
5288
  }
5068
5289
  }
5069
- var SubstitutionStart$0 = $TV($EXPECT($L120, fail, 'SubstitutionStart "${"'), function($skip, $loc, $0, $1) {
5290
+ var SubstitutionStart$0 = $TV($EXPECT($L121, fail, 'SubstitutionStart "${"'), function($skip, $loc, $0, $1) {
5070
5291
  return { $loc, token: $1 };
5071
5292
  });
5072
5293
  function SubstitutionStart(state) {
@@ -5078,7 +5299,7 @@ var require_parser = __commonJS({
5078
5299
  return SubstitutionStart$0(state);
5079
5300
  }
5080
5301
  }
5081
- var Switch$0 = $TS($S($EXPECT($L121, fail, 'Switch "switch"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5302
+ var Switch$0 = $TS($S($EXPECT($L122, fail, 'Switch "switch"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5082
5303
  return { $loc, token: $1 };
5083
5304
  });
5084
5305
  function Switch(state) {
@@ -5090,7 +5311,7 @@ var require_parser = __commonJS({
5090
5311
  return Switch$0(state);
5091
5312
  }
5092
5313
  }
5093
- var Target$0 = $TV($EXPECT($L122, fail, 'Target "target"'), function($skip, $loc, $0, $1) {
5314
+ var Target$0 = $TV($EXPECT($L123, fail, 'Target "target"'), function($skip, $loc, $0, $1) {
5094
5315
  return { $loc, token: $1 };
5095
5316
  });
5096
5317
  function Target(state) {
@@ -5102,7 +5323,7 @@ var require_parser = __commonJS({
5102
5323
  return Target$0(state);
5103
5324
  }
5104
5325
  }
5105
- var Then$0 = $TS($S(__, $EXPECT($L123, fail, 'Then "then"'), NonIdContinue), function($skip, $loc, $0, $1, $2, $3) {
5326
+ var Then$0 = $TS($S(__, $EXPECT($L124, fail, 'Then "then"'), NonIdContinue), function($skip, $loc, $0, $1, $2, $3) {
5106
5327
  return { $loc, token: "" };
5107
5328
  });
5108
5329
  function Then(state) {
@@ -5114,7 +5335,7 @@ var require_parser = __commonJS({
5114
5335
  return Then$0(state);
5115
5336
  }
5116
5337
  }
5117
- var Throw$0 = $TS($S($EXPECT($L124, fail, 'Throw "throw"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5338
+ var Throw$0 = $TS($S($EXPECT($L125, fail, 'Throw "throw"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5118
5339
  return { $loc, token: $1 };
5119
5340
  });
5120
5341
  function Throw(state) {
@@ -5126,7 +5347,7 @@ var require_parser = __commonJS({
5126
5347
  return Throw$0(state);
5127
5348
  }
5128
5349
  }
5129
- var TripleDoubleQuote$0 = $TV($EXPECT($L125, fail, 'TripleDoubleQuote "\\\\\\"\\\\\\"\\\\\\""'), function($skip, $loc, $0, $1) {
5350
+ var TripleDoubleQuote$0 = $TV($EXPECT($L126, fail, 'TripleDoubleQuote "\\\\\\"\\\\\\"\\\\\\""'), function($skip, $loc, $0, $1) {
5130
5351
  return { $loc, token: "`" };
5131
5352
  });
5132
5353
  function TripleDoubleQuote(state) {
@@ -5138,7 +5359,7 @@ var require_parser = __commonJS({
5138
5359
  return TripleDoubleQuote$0(state);
5139
5360
  }
5140
5361
  }
5141
- var TripleSingleQuote$0 = $TV($EXPECT($L126, fail, `TripleSingleQuote "'''"`), function($skip, $loc, $0, $1) {
5362
+ var TripleSingleQuote$0 = $TV($EXPECT($L127, fail, `TripleSingleQuote "'''"`), function($skip, $loc, $0, $1) {
5142
5363
  return { $loc, token: "`" };
5143
5364
  });
5144
5365
  function TripleSingleQuote(state) {
@@ -5150,7 +5371,7 @@ var require_parser = __commonJS({
5150
5371
  return TripleSingleQuote$0(state);
5151
5372
  }
5152
5373
  }
5153
- var TripleTick$0 = $TV($EXPECT($L127, fail, 'TripleTick "```"'), function($skip, $loc, $0, $1) {
5374
+ var TripleTick$0 = $TV($EXPECT($L128, fail, 'TripleTick "```"'), function($skip, $loc, $0, $1) {
5154
5375
  return { $loc, token: "`" };
5155
5376
  });
5156
5377
  function TripleTick(state) {
@@ -5162,7 +5383,7 @@ var require_parser = __commonJS({
5162
5383
  return TripleTick$0(state);
5163
5384
  }
5164
5385
  }
5165
- var Try$0 = $TV($EXPECT($L128, fail, 'Try "try"'), function($skip, $loc, $0, $1) {
5386
+ var Try$0 = $TV($EXPECT($L129, fail, 'Try "try"'), function($skip, $loc, $0, $1) {
5166
5387
  return { $loc, token: $1 };
5167
5388
  });
5168
5389
  function Try(state) {
@@ -5174,7 +5395,7 @@ var require_parser = __commonJS({
5174
5395
  return Try$0(state);
5175
5396
  }
5176
5397
  }
5177
- var Typeof$0 = $TS($S($EXPECT($L129, fail, 'Typeof "typeof"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5398
+ var Typeof$0 = $TS($S($EXPECT($L130, fail, 'Typeof "typeof"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5178
5399
  return { $loc, token: $1 };
5179
5400
  });
5180
5401
  function Typeof(state) {
@@ -5186,7 +5407,7 @@ var require_parser = __commonJS({
5186
5407
  return Typeof$0(state);
5187
5408
  }
5188
5409
  }
5189
- var Unless$0 = $TV($EXPECT($L130, fail, 'Unless "unless"'), function($skip, $loc, $0, $1) {
5410
+ var Unless$0 = $TV($EXPECT($L131, fail, 'Unless "unless"'), function($skip, $loc, $0, $1) {
5190
5411
  return { $loc, token: $1 };
5191
5412
  });
5192
5413
  function Unless(state) {
@@ -5198,7 +5419,7 @@ var require_parser = __commonJS({
5198
5419
  return Unless$0(state);
5199
5420
  }
5200
5421
  }
5201
- var Until$0 = $TS($S($EXPECT($L131, fail, 'Until "until"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5422
+ var Until$0 = $TS($S($EXPECT($L132, fail, 'Until "until"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5202
5423
  return { $loc, token: $1 };
5203
5424
  });
5204
5425
  function Until(state) {
@@ -5210,7 +5431,7 @@ var require_parser = __commonJS({
5210
5431
  return Until$0(state);
5211
5432
  }
5212
5433
  }
5213
- var Var$0 = $TV($EXPECT($L132, fail, 'Var "var"'), function($skip, $loc, $0, $1) {
5434
+ var Var$0 = $TV($EXPECT($L133, fail, 'Var "var"'), function($skip, $loc, $0, $1) {
5214
5435
  return { $loc, token: $1 };
5215
5436
  });
5216
5437
  function Var(state) {
@@ -5222,7 +5443,7 @@ var require_parser = __commonJS({
5222
5443
  return Var$0(state);
5223
5444
  }
5224
5445
  }
5225
- var Void$0 = $TS($S($EXPECT($L133, fail, 'Void "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5446
+ var Void$0 = $TS($S($EXPECT($L134, fail, 'Void "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5226
5447
  return { $loc, token: $1 };
5227
5448
  });
5228
5449
  function Void(state) {
@@ -5234,7 +5455,7 @@ var require_parser = __commonJS({
5234
5455
  return Void$0(state);
5235
5456
  }
5236
5457
  }
5237
- var When$0 = $TS($S($EXPECT($L134, fail, 'When "when"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5458
+ var When$0 = $TS($S($EXPECT($L135, fail, 'When "when"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5238
5459
  return { $loc, token: "case" };
5239
5460
  });
5240
5461
  function When(state) {
@@ -5246,7 +5467,7 @@ var require_parser = __commonJS({
5246
5467
  return When$0(state);
5247
5468
  }
5248
5469
  }
5249
- var While$0 = $TS($S($EXPECT($L135, fail, 'While "while"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5470
+ var While$0 = $TS($S($EXPECT($L136, fail, 'While "while"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5250
5471
  return { $loc, token: $1 };
5251
5472
  });
5252
5473
  function While(state) {
@@ -5258,7 +5479,7 @@ var require_parser = __commonJS({
5258
5479
  return While$0(state);
5259
5480
  }
5260
5481
  }
5261
- var Yield$0 = $TS($S($EXPECT($L136, fail, 'Yield "yield"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5482
+ var Yield$0 = $TS($S($EXPECT($L137, fail, 'Yield "yield"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5262
5483
  return { $loc, token: $1 };
5263
5484
  });
5264
5485
  function Yield(state) {
@@ -5284,7 +5505,7 @@ var require_parser = __commonJS({
5284
5505
  return JSXElement$0(state) || JSXElement$1(state);
5285
5506
  }
5286
5507
  }
5287
- var JSXSelfClosingElement$0 = $S($EXPECT($L4, fail, 'JSXSelfClosingElement "<"'), $TEXT(JSXElementName), $E(JSXAttributes), __, $EXPECT($L137, fail, 'JSXSelfClosingElement "/>"'));
5508
+ var JSXSelfClosingElement$0 = $S($EXPECT($L4, fail, 'JSXSelfClosingElement "<"'), $TEXT(JSXElementName), $E(JSXAttributes), __, $EXPECT($L138, fail, 'JSXSelfClosingElement "/>"'));
5288
5509
  function JSXSelfClosingElement(state) {
5289
5510
  if (state.verbose)
5290
5511
  console.log("ENTER:", "JSXSelfClosingElement");
@@ -5304,7 +5525,7 @@ var require_parser = __commonJS({
5304
5525
  return JSXOpeningElement$0(state);
5305
5526
  }
5306
5527
  }
5307
- var JSXClosingElement$0 = $S($EXPECT($L138, fail, 'JSXClosingElement "</"'), __, $TEXT(JSXElementName), __, $EXPECT($L56, fail, 'JSXClosingElement ">"'));
5528
+ var JSXClosingElement$0 = $S($EXPECT($L139, fail, 'JSXClosingElement "</"'), __, $TEXT(JSXElementName), __, $EXPECT($L56, fail, 'JSXClosingElement ">"'));
5308
5529
  function JSXClosingElement(state) {
5309
5530
  if (state.verbose)
5310
5531
  console.log("ENTER:", "JSXClosingElement");
@@ -5314,7 +5535,7 @@ var require_parser = __commonJS({
5314
5535
  return JSXClosingElement$0(state);
5315
5536
  }
5316
5537
  }
5317
- var JSXFragment$0 = $S($EXPECT($L139, fail, 'JSXFragment "<>"'), $E(JSXChildren), $EXPECT($L140, fail, 'JSXFragment "</>"'));
5538
+ var JSXFragment$0 = $S($EXPECT($L140, fail, 'JSXFragment "<>"'), $E(JSXChildren), $EXPECT($L141, fail, 'JSXFragment "</>"'));
5318
5539
  function JSXFragment(state) {
5319
5540
  if (state.verbose)
5320
5541
  console.log("ENTER:", "JSXFragment");
@@ -5448,7 +5669,7 @@ var require_parser = __commonJS({
5448
5669
  return TypeDeclaration$0(state);
5449
5670
  }
5450
5671
  }
5451
- var TypeDeclarationModifier$0 = $S($EXPECT($L141, fail, 'TypeDeclarationModifier "declare"'), NonIdContinue);
5672
+ var TypeDeclarationModifier$0 = $S($EXPECT($L142, fail, 'TypeDeclarationModifier "declare"'), NonIdContinue);
5452
5673
  var TypeDeclarationModifier$1 = Export;
5453
5674
  function TypeDeclarationModifier(state) {
5454
5675
  if (state.tokenize) {
@@ -5468,7 +5689,7 @@ var require_parser = __commonJS({
5468
5689
  return TypeDeclarationRest$0(state) || TypeDeclarationRest$1(state) || TypeDeclarationRest$2(state) || TypeDeclarationRest$3(state);
5469
5690
  }
5470
5691
  }
5471
- var TypeKeyword$0 = $S($EXPECT($L142, fail, 'TypeKeyword "type"'), NonIdContinue);
5692
+ var TypeKeyword$0 = $S($EXPECT($L143, fail, 'TypeKeyword "type"'), NonIdContinue);
5472
5693
  function TypeKeyword(state) {
5473
5694
  if (state.verbose)
5474
5695
  console.log("ENTER:", "TypeKeyword");
@@ -5478,7 +5699,7 @@ var require_parser = __commonJS({
5478
5699
  return TypeKeyword$0(state);
5479
5700
  }
5480
5701
  }
5481
- var Interface$0 = $S($EXPECT($L143, fail, 'Interface "interface"'), NonIdContinue);
5702
+ var Interface$0 = $S($EXPECT($L144, fail, 'Interface "interface"'), NonIdContinue);
5482
5703
  function Interface(state) {
5483
5704
  if (state.verbose)
5484
5705
  console.log("ENTER:", "Interface");
@@ -5488,7 +5709,7 @@ var require_parser = __commonJS({
5488
5709
  return Interface$0(state);
5489
5710
  }
5490
5711
  }
5491
- var Namespace$0 = $S($EXPECT($L144, fail, 'Namespace "namespace"'), NonIdContinue);
5712
+ var Namespace$0 = $S($EXPECT($L145, fail, 'Namespace "namespace"'), NonIdContinue);
5492
5713
  function Namespace(state) {
5493
5714
  if (state.verbose)
5494
5715
  console.log("ENTER:", "Namespace");
@@ -5588,7 +5809,7 @@ var require_parser = __commonJS({
5588
5809
  return NestedTypeDeclaration$0(state);
5589
5810
  }
5590
5811
  }
5591
- var TypeIndexSignature$0 = $S($E($S($R$0($EXPECT($R38, fail, "TypeIndexSignature /[+-]?/")), $EXPECT($L145, fail, 'TypeIndexSignature "readonly"'), __)), OpenBracket, TypeIndex, CloseBracket, $E($S(__, $R$0($EXPECT($R39, fail, "TypeIndexSignature /[+-]/")), QuestionMark)));
5812
+ var TypeIndexSignature$0 = $S($E($S($R$0($EXPECT($R38, fail, "TypeIndexSignature /[+-]?/")), $EXPECT($L146, fail, 'TypeIndexSignature "readonly"'), __)), OpenBracket, TypeIndex, CloseBracket, $E($S(__, $R$0($EXPECT($R39, fail, "TypeIndexSignature /[+-]/")), QuestionMark)));
5592
5813
  function TypeIndexSignature(state) {
5593
5814
  if (state.verbose)
5594
5815
  console.log("ENTER:", "TypeIndexSignature");
@@ -5619,7 +5840,7 @@ var require_parser = __commonJS({
5619
5840
  return TypeSuffix$0(state);
5620
5841
  }
5621
5842
  }
5622
- var ReturnTypeSuffix$0 = $TS($S(__, Colon, $E($S(__, $EXPECT($L146, fail, 'ReturnTypeSuffix "asserts"'), NonIdContinue)), TypePredicate), function($skip, $loc, $0, $1, $2, $3, $4) {
5843
+ var ReturnTypeSuffix$0 = $TS($S(__, Colon, $E($S(__, $EXPECT($L147, fail, 'ReturnTypeSuffix "asserts"'), NonIdContinue)), TypePredicate), function($skip, $loc, $0, $1, $2, $3, $4) {
5623
5844
  if (!$3)
5624
5845
  $0.splice(2, 1);
5625
5846
  if ($1.length === 0)
@@ -5702,9 +5923,9 @@ var require_parser = __commonJS({
5702
5923
  return TypeUnarySuffix$0(state) || TypeUnarySuffix$1(state);
5703
5924
  }
5704
5925
  }
5705
- var TypeUnaryOp$0 = $EXPECT($L147, fail, 'TypeUnaryOp "keyof"');
5706
- var TypeUnaryOp$1 = $EXPECT($L129, fail, 'TypeUnaryOp "typeof"');
5707
- var TypeUnaryOp$2 = $EXPECT($L148, fail, 'TypeUnaryOp "infer"');
5926
+ var TypeUnaryOp$0 = $EXPECT($L148, fail, 'TypeUnaryOp "keyof"');
5927
+ var TypeUnaryOp$1 = $EXPECT($L130, fail, 'TypeUnaryOp "typeof"');
5928
+ var TypeUnaryOp$2 = $EXPECT($L149, fail, 'TypeUnaryOp "infer"');
5708
5929
  function TypeUnaryOp(state) {
5709
5930
  if (state.tokenize) {
5710
5931
  return $TOKEN("TypeUnaryOp", state, TypeUnaryOp$0(state) || TypeUnaryOp$1(state) || TypeUnaryOp$2(state));
@@ -5794,10 +6015,10 @@ var require_parser = __commonJS({
5794
6015
  }
5795
6016
  }
5796
6017
  var TypeLiteral$0 = Literal;
5797
- var TypeLiteral$1 = $TV($EXPECT($L133, fail, 'TypeLiteral "void"'), function($skip, $loc, $0, $1) {
6018
+ var TypeLiteral$1 = $TV($EXPECT($L134, fail, 'TypeLiteral "void"'), function($skip, $loc, $0, $1) {
5798
6019
  return { $loc, token: "void" };
5799
6020
  });
5800
- var TypeLiteral$2 = $TV($EXPECT($L149, fail, 'TypeLiteral "[]"'), function($skip, $loc, $0, $1) {
6021
+ var TypeLiteral$2 = $TV($EXPECT($L150, fail, 'TypeLiteral "[]"'), function($skip, $loc, $0, $1) {
5801
6022
  return { $loc, token: "[]" };
5802
6023
  });
5803
6024
  function TypeLiteral(state) {
@@ -5807,10 +6028,10 @@ var require_parser = __commonJS({
5807
6028
  return TypeLiteral$0(state) || TypeLiteral$1(state) || TypeLiteral$2(state);
5808
6029
  }
5809
6030
  }
5810
- var TypeBinaryOp$0 = $TV($EXPECT($L72, fail, 'TypeBinaryOp "|"'), function($skip, $loc, $0, $1) {
6031
+ var TypeBinaryOp$0 = $TV($EXPECT($L73, fail, 'TypeBinaryOp "|"'), function($skip, $loc, $0, $1) {
5811
6032
  return { $loc, token: "|" };
5812
6033
  });
5813
- var TypeBinaryOp$1 = $TV($EXPECT($L70, fail, 'TypeBinaryOp "&"'), function($skip, $loc, $0, $1) {
6034
+ var TypeBinaryOp$1 = $TV($EXPECT($L71, fail, 'TypeBinaryOp "&"'), function($skip, $loc, $0, $1) {
5814
6035
  return { $loc, token: "&" };
5815
6036
  });
5816
6037
  function TypeBinaryOp(state) {
@@ -5912,7 +6133,7 @@ var require_parser = __commonJS({
5912
6133
  return CivetPrologue$0(state) || CivetPrologue$1(state);
5913
6134
  }
5914
6135
  }
5915
- var CivetPrologueContent$0 = $TS($S($EXPECT($L150, fail, 'CivetPrologueContent "civet"'), $Q(CivetOption), $EXPECT($R42, fail, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3) {
6136
+ var CivetPrologueContent$0 = $TS($S($EXPECT($L151, fail, 'CivetPrologueContent "civet"'), $Q(CivetOption), $EXPECT($R42, fail, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3) {
5916
6137
  var options = $2;
5917
6138
  return {
5918
6139
  type: "CivetPrologue",
@@ -6160,6 +6381,20 @@ var require_parser = __commonJS({
6160
6381
  return CoffeeBooleansEnabled$0(state);
6161
6382
  }
6162
6383
  }
6384
+ var CoffeeForLoopsEnabled$0 = $TV($EXPECT($L0, fail, 'CoffeeForLoopsEnabled ""'), function($skip, $loc, $0, $1) {
6385
+ if (module2.config.coffeeForLoops)
6386
+ return;
6387
+ return $skip;
6388
+ });
6389
+ function CoffeeForLoopsEnabled(state) {
6390
+ if (state.verbose)
6391
+ console.log("ENTER:", "CoffeeForLoopsEnabled");
6392
+ if (state.tokenize) {
6393
+ return $TOKEN("CoffeeForLoopsEnabled", state, CoffeeForLoopsEnabled$0(state));
6394
+ } else {
6395
+ return CoffeeForLoopsEnabled$0(state);
6396
+ }
6397
+ }
6163
6398
  var CoffeeInterpolationEnabled$0 = $TV($EXPECT($L0, fail, 'CoffeeInterpolationEnabled ""'), function($skip, $loc, $0, $1) {
6164
6399
  if (module2.config.coffeeInterpolation)
6165
6400
  return;
@@ -6202,6 +6437,20 @@ var require_parser = __commonJS({
6202
6437
  return CoffeeNotEnabled$0(state);
6203
6438
  }
6204
6439
  }
6440
+ var CoffeeOfEnabled$0 = $TV($EXPECT($L0, fail, 'CoffeeOfEnabled ""'), function($skip, $loc, $0, $1) {
6441
+ if (module2.config.coffeeOf)
6442
+ return;
6443
+ return $skip;
6444
+ });
6445
+ function CoffeeOfEnabled(state) {
6446
+ if (state.verbose)
6447
+ console.log("ENTER:", "CoffeeOfEnabled");
6448
+ if (state.tokenize) {
6449
+ return $TOKEN("CoffeeOfEnabled", state, CoffeeOfEnabled$0(state));
6450
+ } else {
6451
+ return CoffeeOfEnabled$0(state);
6452
+ }
6453
+ }
6205
6454
  var Reset$0 = $TV($EXPECT($L0, fail, 'Reset ""'), function($skip, $loc, $0, $1) {
6206
6455
  module2.currentIndent = 0;
6207
6456
  module2.indentLevels = [0];
@@ -6211,11 +6460,51 @@ var require_parser = __commonJS({
6211
6460
  coffeeBooleans: false,
6212
6461
  coffeeComment: false,
6213
6462
  coffeeEq: false,
6463
+ coffeeForLoops: false,
6214
6464
  coffeeInterpolation: false,
6215
6465
  coffeeIsnt: false,
6216
6466
  coffeeNot: false,
6467
+ coffeeOf: false,
6217
6468
  implicitReturns: true
6218
6469
  };
6470
+ let indexOfRef, hasPropRef;
6471
+ module2.prelude = [];
6472
+ module2.getIndexOfRef = function() {
6473
+ if (indexOfRef)
6474
+ return indexOfRef;
6475
+ indexOfRef = {
6476
+ type: "Ref",
6477
+ base: "indexOf"
6478
+ };
6479
+ const typeSuffix = {
6480
+ ts: true,
6481
+ children: [": <T>(this: T[], searchElement: T) => boolean"]
6482
+ };
6483
+ const asAny = {
6484
+ ts: true,
6485
+ children: [" as any"]
6486
+ };
6487
+ module2.prelude.push(["", "const ", indexOfRef, typeSuffix, " = [].indexOf", asAny, "\n"]);
6488
+ return indexOfRef;
6489
+ };
6490
+ module2.getHasPropRef = function() {
6491
+ if (hasPropRef)
6492
+ return hasPropRef;
6493
+ hasPropRef = {
6494
+ type: "Ref",
6495
+ base: "hasProp"
6496
+ };
6497
+ const typeSuffix = {
6498
+ ts: true,
6499
+ children: [": <T>(this: T, prop: keyof T) => boolean"]
6500
+ };
6501
+ const asAny = {
6502
+ ts: true,
6503
+ children: [" as any"]
6504
+ };
6505
+ module2.prelude.push(["", "const ", hasPropRef, typeSuffix, " = {}.hasOwnProperty", asAny, "\n"]);
6506
+ return hasPropRef;
6507
+ };
6219
6508
  Object.defineProperty(module2.config, "coffeeCompat", {
6220
6509
  set(b) {
6221
6510
  if (b) {
@@ -6223,17 +6512,21 @@ var require_parser = __commonJS({
6223
6512
  this.coffeeBooleans = true;
6224
6513
  this.coffeeComment = true;
6225
6514
  this.coffeeEq = true;
6515
+ this.coffeeForLoops = true;
6226
6516
  this.coffeeInterpolation = true;
6227
6517
  this.coffeeIsnt = true;
6228
6518
  this.coffeeNot = true;
6519
+ this.coffeeOf = true;
6229
6520
  } else {
6230
6521
  this.autoVar = false;
6231
6522
  this.coffeeBooleans = false;
6232
6523
  this.coffeeComment = false;
6233
6524
  this.coffeeEq = false;
6525
+ this.coffeeForLoops = false;
6234
6526
  this.coffeeInterpolation = false;
6235
6527
  this.coffeeIsnt = false;
6236
6528
  this.coffeeNot = false;
6529
+ this.coffeeOf = false;
6237
6530
  }
6238
6531
  }
6239
6532
  });
@@ -6348,7 +6641,7 @@ var require_parser = __commonJS({
6348
6641
  let chains = [];
6349
6642
  while (i < l) {
6350
6643
  const [, op] = binops[i];
6351
- if (relationalOps.includes(op.token)) {
6644
+ if (relationalOps.includes(op.token) || op.type === "Ref") {
6352
6645
  chains.push(i);
6353
6646
  } else if (lowerPrecedenceOps.includes(op.token)) {
6354
6647
  processChains();
@@ -6362,7 +6655,7 @@ var require_parser = __commonJS({
6362
6655
  if (chains.length > 1) {
6363
6656
  chains.forEach((index, k) => {
6364
6657
  if (k > 0) {
6365
- results.push(" && ");
6658
+ results.push(" ", "&&", " ");
6366
6659
  }
6367
6660
  const [pre, op, post, exp] = binops[index];
6368
6661
  let endIndex;
@@ -6410,6 +6703,8 @@ var require_parser = __commonJS({
6410
6703
  };
6411
6704
  module2.insertTrimmingSpace = function(spacing, c) {
6412
6705
  let target = spacing;
6706
+ if (!target)
6707
+ return;
6413
6708
  if (Array.isArray(target))
6414
6709
  return module2.insertTrimmingSpace(target[0], c);
6415
6710
  if (target.children)
@@ -6482,18 +6777,34 @@ var require_parser = __commonJS({
6482
6777
  case "BlockStatement":
6483
6778
  return [];
6484
6779
  case "ForStatement":
6485
- if (node.declaration.type === "Declaration")
6486
- return [];
6487
- return gatherNodes(node.declaration, predicate);
6780
+ const isDec = node.declaration?.type === "Declaration";
6781
+ return node.children.flatMap((n) => {
6782
+ if (isDec && n === node.declaration)
6783
+ return [];
6784
+ return gatherNodes(n, predicate);
6785
+ });
6488
6786
  default:
6489
6787
  return gatherNodes(node.children, predicate);
6490
6788
  }
6491
6789
  return [];
6492
6790
  }
6791
+ function gatherRecursive(node, predicate) {
6792
+ if (node == null)
6793
+ return [];
6794
+ if (Array.isArray(node)) {
6795
+ return node.flatMap((n) => gatherNodes(n, predicate));
6796
+ }
6797
+ if (predicate(node)) {
6798
+ return [node];
6799
+ }
6800
+ return gatherNodes(node.children, predicate);
6801
+ }
6493
6802
  module2.processProgram = function(statements) {
6803
+ statements.unshift(...module2.prelude);
6494
6804
  if (module2.config.autoVar) {
6495
- module2.autoVar(statements, []);
6805
+ createVarDecs(statements, []);
6496
6806
  }
6807
+ populateRefs(statements);
6497
6808
  };
6498
6809
  function findDecs(statements) {
6499
6810
  const declarationNames = gatherNodes(statements, (node) => {
@@ -6503,7 +6814,39 @@ var require_parser = __commonJS({
6503
6814
  }).flatMap((d) => d.names);
6504
6815
  return new Set(declarationNames);
6505
6816
  }
6506
- module2.autoVar = function(statements, scopes, pushVar) {
6817
+ function populateRefs(statements) {
6818
+ const refNodes = gatherNodes(statements, ({ type }) => type === "Ref");
6819
+ const blockNodes = new Set(gatherNodes(statements, ({ type }) => type === "BlockStatement"));
6820
+ const forNodes = gatherNodes(statements, ({ type }) => type === "ForStatement");
6821
+ forNodes.forEach(({ declaration, block }) => {
6822
+ if (block.type === "BlockStatement") {
6823
+ populateRefs([declaration, ...block.children]);
6824
+ } else {
6825
+ populateRefs([declaration, ...block]);
6826
+ }
6827
+ blockNodes.delete(block);
6828
+ });
6829
+ blockNodes.forEach(({ expressions }) => populateRefs(expressions));
6830
+ if (refNodes.length) {
6831
+ const ids = gatherRecursive(statements, (s) => s.type === "Identifier");
6832
+ const names = new Set(ids.flatMap(({ names: names2 }) => names2 || []));
6833
+ refNodes.forEach((ref) => {
6834
+ const { type, base } = ref;
6835
+ if (type !== "Ref")
6836
+ return;
6837
+ ref.type = "Identifier";
6838
+ let n = 0;
6839
+ let name = base;
6840
+ while (names.has(name)) {
6841
+ n++;
6842
+ name = `${base}${n}`;
6843
+ }
6844
+ names.add(name);
6845
+ ref.children = ref.names = [name];
6846
+ });
6847
+ }
6848
+ }
6849
+ function createVarDecs(statements, scopes, pushVar) {
6507
6850
  function hasDec(name) {
6508
6851
  return scopes.some((s) => s.has(name));
6509
6852
  }
@@ -6512,9 +6855,7 @@ var require_parser = __commonJS({
6512
6855
  return node.type === "AssignmentExpression";
6513
6856
  });
6514
6857
  const undeclaredIdentifiers = assignmentStatements.flatMap((a) => {
6515
- return a.children[0].flatMap((x) => {
6516
- return x[1].names || [];
6517
- });
6858
+ return a.names;
6518
6859
  });
6519
6860
  return undeclaredIdentifiers.filter((x, i, a) => {
6520
6861
  if (!hasDec(x))
@@ -6537,23 +6878,23 @@ var require_parser = __commonJS({
6537
6878
  fnNodes.forEach(({ block }) => blockNodes.delete(block));
6538
6879
  forNodes.forEach(({ block }) => blockNodes.delete(block));
6539
6880
  blockNodes.forEach((block) => {
6540
- module2.autoVar(block.expressions, scopes, pushVar);
6881
+ createVarDecs(block.expressions, scopes, pushVar);
6541
6882
  });
6542
6883
  forNodes.forEach(({ block, declaration }) => {
6543
6884
  scopes.push(new Set(declaration.names));
6544
- module2.autoVar(block.expressions, scopes, pushVar);
6885
+ createVarDecs(block.expressions, scopes, pushVar);
6545
6886
  scopes.pop();
6546
6887
  });
6547
6888
  fnNodes.forEach(({ block, parameters }) => {
6548
6889
  scopes.push(new Set(parameters.names));
6549
- module2.autoVar(block.expressions, scopes);
6890
+ createVarDecs(block.expressions, scopes);
6550
6891
  scopes.pop();
6551
6892
  });
6552
6893
  if (varIds.length) {
6553
6894
  const indent = statements[0][0];
6554
6895
  statements.unshift([indent, "var ", varIds.join(", "), "\n"]);
6555
6896
  }
6556
- };
6897
+ }
6557
6898
  return $0;
6558
6899
  });
6559
6900
  function Init(state) {
@@ -6565,7 +6906,7 @@ var require_parser = __commonJS({
6565
6906
  return Init$0(state);
6566
6907
  }
6567
6908
  }
6568
- var Indent$0 = $TV($Q($C($EXPECT($L151, fail, 'Indent " "'), $EXPECT($L152, fail, 'Indent "\\\\t"'))), function($skip, $loc, $0, $1) {
6909
+ var Indent$0 = $TV($Q($C($EXPECT($L152, fail, 'Indent " "'), $EXPECT($L153, fail, 'Indent "\\\\t"'))), function($skip, $loc, $0, $1) {
6569
6910
  const level = $1.length;
6570
6911
  return {
6571
6912
  $loc,