@danielx/civet 0.4.17 → 0.4.19-pre.0

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
@@ -550,6 +550,10 @@ var Civet = (() => {
550
550
  ForStatement,
551
551
  ForClause,
552
552
  ForStatementControl,
553
+ WhenCondition,
554
+ CoffeeForStatementParameters,
555
+ CoffeeForDeclaration,
556
+ ForStatementParameters,
553
557
  ForInOfDeclaration,
554
558
  ForDeclaration,
555
559
  ForBinding,
@@ -643,6 +647,7 @@ var Civet = (() => {
643
647
  StatementDelimiter,
644
648
  NonIdContinue,
645
649
  Loc,
650
+ Ampersand,
646
651
  As,
647
652
  Async,
648
653
  Await,
@@ -781,9 +786,11 @@ var Civet = (() => {
781
786
  InsertBreak,
782
787
  CoffeeCommentEnabled,
783
788
  CoffeeBooleansEnabled,
789
+ CoffeeForLoopsEnabled,
784
790
  CoffeeInterpolationEnabled,
785
791
  CoffeeIsntEnabled,
786
792
  CoffeeNotEnabled,
793
+ CoffeeOfEnabled,
787
794
  Reset,
788
795
  Init,
789
796
  Indent,
@@ -859,139 +866,142 @@ var Civet = (() => {
859
866
  var $L62 = $L("==");
860
867
  var $L63 = $L("and");
861
868
  var $L64 = $L("&&");
862
- var $L65 = $L("or");
863
- var $L66 = $L("||");
864
- var $L67 = $L("??");
865
- var $L68 = $L("instanceof");
866
- var $L69 = $L("in");
867
- var $L70 = $L("&");
868
- var $L71 = $L("^");
869
- var $L72 = $L("|");
870
- var $L73 = $L(";");
871
- var $L74 = $L("finally");
872
- var $L75 = $L("break");
873
- var $L76 = $L("continue");
874
- var $L77 = $L("debugger");
875
- var $L78 = $L("import type");
876
- var $L79 = $L("default");
877
- var $L80 = $L(":=");
878
- var $L81 = $L("/*");
879
- var $L82 = $L("*/");
880
- var $L83 = $L("###");
881
- var $L84 = $L("as");
882
- var $L85 = $L("async");
883
- var $L86 = $L("await");
884
- var $L87 = $L("`");
885
- var $L88 = $L("case");
886
- var $L89 = $L("catch");
887
- var $L90 = $L("class");
888
- var $L91 = $L("#{");
889
- var $L92 = $L(":");
890
- var $L93 = $L("delete");
891
- var $L94 = $L("do");
892
- var $L95 = $L("..");
893
- var $L96 = $L("...");
894
- var $L97 = $L('"');
895
- var $L98 = $L("else");
896
- var $L99 = $L("export");
897
- var $L100 = $L("for");
898
- var $L101 = $L("from");
899
- var $L102 = $L("function");
900
- var $L103 = $L("get");
901
- var $L104 = $L("set");
902
- var $L105 = $L("if");
903
- var $L106 = $L(" ");
904
- var $L107 = $L("let");
905
- var $L108 = $L("const");
906
- var $L109 = $L("loop");
907
- var $L110 = $L("new");
908
- var $L111 = $L("not");
909
- var $L112 = $L("of");
910
- var $L113 = $L("{");
911
- var $L114 = $L("[");
912
- var $L115 = $L("(");
913
- var $L116 = $L("?");
914
- var $L117 = $L("return");
915
- var $L118 = $L("'");
916
- var $L119 = $L("static");
917
- var $L120 = $L("${");
918
- var $L121 = $L("switch");
919
- var $L122 = $L("target");
920
- var $L123 = $L("then");
921
- var $L124 = $L("throw");
922
- var $L125 = $L('"""');
923
- var $L126 = $L("'''");
924
- var $L127 = $L("```");
925
- var $L128 = $L("try");
926
- var $L129 = $L("typeof");
927
- var $L130 = $L("unless");
928
- var $L131 = $L("until");
929
- var $L132 = $L("var");
930
- var $L133 = $L("void");
931
- var $L134 = $L("when");
932
- var $L135 = $L("while");
933
- var $L136 = $L("yield");
934
- var $L137 = $L("/>");
935
- var $L138 = $L("</");
936
- var $L139 = $L("<>");
937
- var $L140 = $L("</>");
938
- var $L141 = $L("declare");
939
- var $L142 = $L("type");
940
- var $L143 = $L("interface");
941
- var $L144 = $L("namespace");
942
- var $L145 = $L("readonly");
943
- var $L146 = $L("asserts");
944
- var $L147 = $L("keyof");
945
- var $L148 = $L("infer");
946
- var $L149 = $L("[]");
947
- var $L150 = $L("civet");
948
- var $L151 = $L(" ");
949
- var $L152 = $L(" ");
950
- var $R0 = $R(new RegExp("(of|then)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
951
- var $R1 = $R(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$])*", "suy"));
952
- var $R2 = $R(new RegExp("[!~+-](?!\\s)", "suy"));
953
- var $R3 = $R(new RegExp("(?=[\\s\\)])", "suy"));
954
- var $R4 = $R(new RegExp('[^;"\\s]+', "suy"));
955
- var $R5 = $R(new RegExp("(?:0|[1-9](?:_[0-9]|[0-9])*)n", "suy"));
956
- var $R6 = $R(new RegExp("(?:0|[1-9](?:_[0-9]|[0-9])*)(?=\\.(?:\\p{ID_Start}|[_$]))", "suy"));
957
- var $R7 = $R(new RegExp("(?:0|[1-9](?:_[0-9]|[0-9])*)(?:\\.(?:[0-9](?:_[0-9]|[0-9])*))?", "suy"));
958
- var $R8 = $R(new RegExp("(?:\\.[0-9](?:_[0-9]|[0-9])*)", "suy"));
959
- var $R9 = $R(new RegExp("(?:[eE][+-]?[0-9]+(?:_[0-9]|[0-9])*)", "suy"));
960
- var $R10 = $R(new RegExp("0[bB][01](?:[01]|_[01])*n?", "suy"));
961
- var $R11 = $R(new RegExp("0[oO][0-7](?:[0-7]|_[0-7])*n?", "suy"));
962
- var $R12 = $R(new RegExp("0[xX][0-9a-fA-F](?:[0-9a-fA-F]|_[0-9a-fA-F])*n?", "suy"));
963
- var $R13 = $R(new RegExp('(?:\\\\.|[^"])*', "suy"));
964
- var $R14 = $R(new RegExp("(?:\\\\.|[^'])*", "suy"));
965
- var $R15 = $R(new RegExp('(?:"(?!"")|#(?!\\{)|\\\\.|[^#"])+', "suy"));
966
- var $R16 = $R(new RegExp("(?:'(?!'')|\\\\.|[^'])*", "suy"));
967
- var $R17 = $R(new RegExp('(?:\\\\.|#(?!\\{)|[^"#])+', "suy"));
968
- var $R18 = $R(new RegExp("[*\\/\\r\\n]", "suy"));
969
- var $R19 = $R(new RegExp("(?:\\\\.|[^\\/\\r\\n])+", "suy"));
970
- var $R20 = $R(new RegExp("(?:\\p{ID_Continue}|[\\u200C\\u200D$])*", "suy"));
971
- var $R21 = $R(new RegExp("(?:\\$(?!\\{)|\\\\.|[^$`])+", "suy"));
972
- var $R22 = $R(new RegExp("(?:\\$(?!\\{)|`(?!``)|\\\\.|[^$`])+", "suy"));
973
- var $R23 = $R(new RegExp("(?:on|off|yes|no)(?!\\p{ID_Continue})", "suy"));
974
- var $R24 = $R(new RegExp("(?:isnt)(?!\\p{ID_Continue})", "suy"));
975
- var $R25 = $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|loop|new|null|or|return|static|super|switch|this|throw|true|try|typeof|unless|until|var|void|while|with|yield)(?!\\p{ID_Continue})", "suy"));
976
- var $R26 = $R(new RegExp("\\/\\/[^\\r\\n]*", "suy"));
977
- var $R27 = $R(new RegExp(".", "suy"));
978
- var $R28 = $R(new RegExp("#([^\\r\\n]*)", "suy"));
979
- var $R29 = $R(new RegExp("[^\\r\\n]", "suy"));
980
- var $R30 = $R(new RegExp("[ \\t]+", "suy"));
981
- var $R31 = $R(new RegExp("[\\s]+", "suy"));
982
- var $R32 = $R(new RegExp("(?!\\p{ID_Continue})", "suy"));
983
- var $R33 = $R(new RegExp("\\s", "suy"));
984
- var $R34 = $R(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*", "suy"));
985
- var $R35 = $R(new RegExp('"[^"]*"', "suy"));
986
- var $R36 = $R(new RegExp("'[^']*'", "suy"));
987
- var $R37 = $R(new RegExp("[^{}<>]+", "suy"));
988
- var $R38 = $R(new RegExp("[+-]?", "suy"));
989
- var $R39 = $R(new RegExp("[+-]", "suy"));
990
- var $R40 = $R(new RegExp("#![^\\r\\n]*", "suy"));
991
- var $R41 = $R(new RegExp("[\\t ]*", "suy"));
992
- var $R42 = $R(new RegExp("[\\s]*", "suy"));
993
- var $R43 = $R(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)", "suy"));
994
- var $R44 = $R(new RegExp("\\r\\n|\\n|\\r|$", "suy"));
869
+ var $L65 = $L("of");
870
+ var $L66 = $L("or");
871
+ var $L67 = $L("||");
872
+ var $L68 = $L("??");
873
+ var $L69 = $L("instanceof");
874
+ var $L70 = $L("in");
875
+ var $L71 = $L("&");
876
+ var $L72 = $L("^");
877
+ var $L73 = $L("|");
878
+ var $L74 = $L(";");
879
+ var $L75 = $L("own");
880
+ var $L76 = $L("finally");
881
+ var $L77 = $L("break");
882
+ var $L78 = $L("continue");
883
+ var $L79 = $L("debugger");
884
+ var $L80 = $L("import type");
885
+ var $L81 = $L("default");
886
+ var $L82 = $L(":=");
887
+ var $L83 = $L("/*");
888
+ var $L84 = $L("*/");
889
+ var $L85 = $L("###");
890
+ var $L86 = $L("as");
891
+ var $L87 = $L("async");
892
+ var $L88 = $L("await");
893
+ var $L89 = $L("`");
894
+ var $L90 = $L("case");
895
+ var $L91 = $L("catch");
896
+ var $L92 = $L("class");
897
+ var $L93 = $L("#{");
898
+ var $L94 = $L(":");
899
+ var $L95 = $L("delete");
900
+ var $L96 = $L("do");
901
+ var $L97 = $L("..");
902
+ var $L98 = $L("...");
903
+ var $L99 = $L('"');
904
+ var $L100 = $L("else");
905
+ var $L101 = $L("export");
906
+ var $L102 = $L("for");
907
+ var $L103 = $L("from");
908
+ var $L104 = $L("function");
909
+ var $L105 = $L("get");
910
+ var $L106 = $L("set");
911
+ var $L107 = $L("if");
912
+ var $L108 = $L(" ");
913
+ var $L109 = $L("let");
914
+ var $L110 = $L("const");
915
+ var $L111 = $L("loop");
916
+ var $L112 = $L("new");
917
+ var $L113 = $L("not");
918
+ var $L114 = $L("{");
919
+ var $L115 = $L("[");
920
+ var $L116 = $L("(");
921
+ var $L117 = $L("?");
922
+ var $L118 = $L("return");
923
+ var $L119 = $L("'");
924
+ var $L120 = $L("static");
925
+ var $L121 = $L("${");
926
+ var $L122 = $L("switch");
927
+ var $L123 = $L("target");
928
+ var $L124 = $L("then");
929
+ var $L125 = $L("throw");
930
+ var $L126 = $L('"""');
931
+ var $L127 = $L("'''");
932
+ var $L128 = $L("```");
933
+ var $L129 = $L("try");
934
+ var $L130 = $L("typeof");
935
+ var $L131 = $L("unless");
936
+ var $L132 = $L("until");
937
+ var $L133 = $L("var");
938
+ var $L134 = $L("void");
939
+ var $L135 = $L("when");
940
+ var $L136 = $L("while");
941
+ var $L137 = $L("yield");
942
+ var $L138 = $L("/>");
943
+ var $L139 = $L("</");
944
+ var $L140 = $L("<>");
945
+ var $L141 = $L("</>");
946
+ var $L142 = $L("declare");
947
+ var $L143 = $L("type");
948
+ var $L144 = $L("interface");
949
+ var $L145 = $L("namespace");
950
+ var $L146 = $L("readonly");
951
+ var $L147 = $L("asserts");
952
+ var $L148 = $L("keyof");
953
+ var $L149 = $L("infer");
954
+ var $L150 = $L("[]");
955
+ var $L151 = $L("civet");
956
+ var $L152 = $L(" ");
957
+ var $L153 = $L(" ");
958
+ var $R0 = $R(new RegExp("(of|then|when)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
959
+ var $R1 = $R(new RegExp("[&]", "suy"));
960
+ var $R2 = $R(new RegExp("[!~+-]+", "suy"));
961
+ var $R3 = $R(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$])*", "suy"));
962
+ var $R4 = $R(new RegExp("[!~+-](?!\\s|[!~+-]*&)", "suy"));
963
+ var $R5 = $R(new RegExp("(?=[\\s\\)])", "suy"));
964
+ var $R6 = $R(new RegExp('[^;"\\s]+', "suy"));
965
+ var $R7 = $R(new RegExp("(?:0|[1-9](?:_[0-9]|[0-9])*)n", "suy"));
966
+ var $R8 = $R(new RegExp("(?:0|[1-9](?:_[0-9]|[0-9])*)(?=\\.(?:\\p{ID_Start}|[_$]))", "suy"));
967
+ var $R9 = $R(new RegExp("(?:0|[1-9](?:_[0-9]|[0-9])*)(?:\\.(?:[0-9](?:_[0-9]|[0-9])*))?", "suy"));
968
+ var $R10 = $R(new RegExp("(?:\\.[0-9](?:_[0-9]|[0-9])*)", "suy"));
969
+ var $R11 = $R(new RegExp("(?:[eE][+-]?[0-9]+(?:_[0-9]|[0-9])*)", "suy"));
970
+ var $R12 = $R(new RegExp("0[bB][01](?:[01]|_[01])*n?", "suy"));
971
+ var $R13 = $R(new RegExp("0[oO][0-7](?:[0-7]|_[0-7])*n?", "suy"));
972
+ var $R14 = $R(new RegExp("0[xX][0-9a-fA-F](?:[0-9a-fA-F]|_[0-9a-fA-F])*n?", "suy"));
973
+ var $R15 = $R(new RegExp('(?:\\\\.|[^"])*', "suy"));
974
+ var $R16 = $R(new RegExp("(?:\\\\.|[^'])*", "suy"));
975
+ var $R17 = $R(new RegExp('(?:"(?!"")|#(?!\\{)|\\\\.|[^#"])+', "suy"));
976
+ var $R18 = $R(new RegExp("(?:'(?!'')|\\\\.|[^'])*", "suy"));
977
+ var $R19 = $R(new RegExp('(?:\\\\.|#(?!\\{)|[^"#])+', "suy"));
978
+ var $R20 = $R(new RegExp("[*\\/\\r\\n]", "suy"));
979
+ var $R21 = $R(new RegExp("(?:\\\\.|[^\\/\\r\\n])+", "suy"));
980
+ var $R22 = $R(new RegExp("(?:\\p{ID_Continue}|[\\u200C\\u200D$])*", "suy"));
981
+ var $R23 = $R(new RegExp("(?:\\$(?!\\{)|\\\\.|[^$`])+", "suy"));
982
+ var $R24 = $R(new RegExp("(?:\\$(?!\\{)|`(?!``)|\\\\.|[^$`])+", "suy"));
983
+ var $R25 = $R(new RegExp("(?:on|off|yes|no)(?!\\p{ID_Continue})", "suy"));
984
+ var $R26 = $R(new RegExp("(?:isnt)(?!\\p{ID_Continue})", "suy"));
985
+ var $R27 = $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|loop|new|null|or|return|static|super|switch|this|throw|true|try|typeof|unless|until|var|void|while|with|yield)(?!\\p{ID_Continue})", "suy"));
986
+ var $R28 = $R(new RegExp("\\/\\/[^\\r\\n]*", "suy"));
987
+ var $R29 = $R(new RegExp(".", "suy"));
988
+ var $R30 = $R(new RegExp("#(?!##)([^\\r\\n]*)", "suy"));
989
+ var $R31 = $R(new RegExp("[^\\r\\n]", "suy"));
990
+ var $R32 = $R(new RegExp("[ \\t]+", "suy"));
991
+ var $R33 = $R(new RegExp("[\\s]+", "suy"));
992
+ var $R34 = $R(new RegExp("(?!\\p{ID_Continue})", "suy"));
993
+ var $R35 = $R(new RegExp("\\s", "suy"));
994
+ var $R36 = $R(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*", "suy"));
995
+ var $R37 = $R(new RegExp('"[^"]*"', "suy"));
996
+ var $R38 = $R(new RegExp("'[^']*'", "suy"));
997
+ var $R39 = $R(new RegExp("[^{}<>]+", "suy"));
998
+ var $R40 = $R(new RegExp("[+-]?", "suy"));
999
+ var $R41 = $R(new RegExp("[+-]", "suy"));
1000
+ var $R42 = $R(new RegExp("#![^\\r\\n]*", "suy"));
1001
+ var $R43 = $R(new RegExp("[\\t ]*", "suy"));
1002
+ var $R44 = $R(new RegExp("[\\s]*", "suy"));
1003
+ var $R45 = $R(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)", "suy"));
1004
+ var $R46 = $R(new RegExp("\\r\\n|\\n|\\r|$", "suy"));
995
1005
  var Program$0 = $TS($S(Reset, Init, __, $Q(TopLevelStatement), __), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
996
1006
  var statements = $4;
997
1007
  module.processProgram(statements);
@@ -1016,7 +1026,12 @@ var Civet = (() => {
1016
1026
  return TopLevelStatement$0(state);
1017
1027
  }
1018
1028
  }
1019
- var ExtendedExpression$0 = $S(__, ExpressionizedStatement);
1029
+ var ExtendedExpression$0 = $TS($S(__, ExpressionizedStatement), function($skip, $loc, $0, $1, $2) {
1030
+ if ($1.length) {
1031
+ $2.children.splice(0, 0, ...$1);
1032
+ }
1033
+ return $2;
1034
+ });
1020
1035
  var ExtendedExpression$1 = AssignmentExpression;
1021
1036
  function ExtendedExpression(state) {
1022
1037
  if (state.tokenize) {
@@ -1159,9 +1174,9 @@ var Civet = (() => {
1159
1174
  return IndentedApplicationAllowed$0(state);
1160
1175
  }
1161
1176
  }
1162
- var BinaryOpExpression$0 = $TS($S(UnaryExpression, $Q($S(__, BinaryOp, __, UnaryExpression))), function($skip, $loc, $0, $1, $2) {
1177
+ var BinaryOpExpression$0 = $TS($S(UnaryExpression, $Q($S(__, BinaryOp, __, $C(UnaryExpression, ExpressionizedStatement)))), function($skip, $loc, $0, $1, $2) {
1163
1178
  if ($2.length) {
1164
- return module.expandChainedComparisons($0);
1179
+ return module.processBinaryOpExpression($0);
1165
1180
  }
1166
1181
  return $1;
1167
1182
  });
@@ -1181,14 +1196,31 @@ var Civet = (() => {
1181
1196
  if (post?.token === "?") {
1182
1197
  return ["(", pre, "(", exp, ") != null)"];
1183
1198
  }
1184
- const result = [pre, exp, post];
1185
- if (!post)
1186
- result.pop();
1187
- if (!pre.length)
1188
- result.shift();
1189
- if (result.length === 1)
1190
- return result[0];
1191
- return result;
1199
+ if (exp.type === "Literal") {
1200
+ if (pre.length === 1 && pre[0].token === "-") {
1201
+ exp.raw = `-${exp.raw}`;
1202
+ exp.children.unshift(pre[0]);
1203
+ if (post)
1204
+ exp.children.push(post);
1205
+ return exp;
1206
+ }
1207
+ }
1208
+ if (exp.children) {
1209
+ exp.children.unshift(...pre);
1210
+ if (post)
1211
+ exp.children.push(post);
1212
+ return exp;
1213
+ } else if (Array.isArray(exp)) {
1214
+ exp.unshift(...pre);
1215
+ if (post)
1216
+ exp.push(post);
1217
+ return exp;
1218
+ } else {
1219
+ const result = [...pre, exp];
1220
+ if (post)
1221
+ result.push(post);
1222
+ return result;
1223
+ }
1192
1224
  });
1193
1225
  function UnaryExpression(state) {
1194
1226
  if (state.verbose)
@@ -1256,40 +1288,56 @@ var Civet = (() => {
1256
1288
  var AssignmentExpressionTail$0 = YieldExpression;
1257
1289
  var AssignmentExpressionTail$1 = ArrowFunction;
1258
1290
  var AssignmentExpressionTail$2 = $TS($S($P($S(__, LeftHandSideExpression, __, AssignmentOp)), ExtendedExpression), function($skip, $loc, $0, $1, $2) {
1259
- const lastAssignment = $1[$1.length - 1];
1260
- let tail = [];
1261
- if (lastAssignment[3].token === "=") {
1262
- const lhs = lastAssignment[1];
1291
+ let tail = [], i = 0, len = $1.length;
1292
+ while (i < len) {
1293
+ const lastAssignment = $1[i++];
1294
+ const [, lhs, , op] = lastAssignment;
1295
+ if (op.token !== "=")
1296
+ continue;
1263
1297
  if (lhs.type === "ObjectExpression") {
1264
1298
  lhs.children.splice(0, 0, "(");
1265
1299
  tail.push(")");
1300
+ break;
1266
1301
  }
1267
- if (Array.isArray(lhs) && lhs.length > 1) {
1268
- const props = lhs[lhs.length - 1];
1269
- if (Array.isArray(props)) {
1270
- const lastProp = props[props.length - 1];
1271
- if (lastProp.type === "SliceExpression") {
1272
- const { start, end, children: c } = lastProp;
1273
- c[0].token = ".splice(";
1274
- c[1] = start;
1275
- c[2] = ", ";
1276
- if (end)
1277
- c[3] = [end, " - ", start];
1278
- else
1279
- c[3] = ["1/0"];
1280
- c[4] = [", ...", $2];
1281
- c[5] = ")";
1282
- lastAssignment.pop();
1283
- if (module.isWhitespaceOrEmpty(lastAssignment[2]))
1302
+ }
1303
+ i = len - 1;
1304
+ while (i >= 0) {
1305
+ const lastAssignment = $1[i];
1306
+ if (lastAssignment[3].token === "=") {
1307
+ const lhs = lastAssignment[1];
1308
+ if (Array.isArray(lhs) && lhs.length > 1) {
1309
+ const props = lhs[lhs.length - 1];
1310
+ if (Array.isArray(props)) {
1311
+ const lastProp = props[props.length - 1];
1312
+ if (lastProp.type === "SliceExpression") {
1313
+ const { start, end, children: c } = lastProp;
1314
+ c[0].token = ".splice(";
1315
+ c[1] = start;
1316
+ c[2] = ", ";
1317
+ if (end)
1318
+ c[3] = [end, " - ", start];
1319
+ else
1320
+ c[3] = ["1/0"];
1321
+ c[4] = [", ...", $2];
1322
+ c[5] = ")";
1284
1323
  lastAssignment.pop();
1285
- return $1;
1324
+ if (module.isWhitespaceOrEmpty(lastAssignment[2]))
1325
+ lastAssignment.pop();
1326
+ if ($1.length > 1) {
1327
+ throw new Error("Not implemented yet! TODO: Handle multiple splice assignments");
1328
+ }
1329
+ return $1;
1330
+ }
1286
1331
  }
1287
1332
  }
1288
1333
  }
1334
+ i--;
1289
1335
  }
1336
+ const names = $1.flatMap(([, l]) => l.names || []);
1290
1337
  return {
1291
1338
  type: "AssignmentExpression",
1292
- children: [...$0, ...tail]
1339
+ children: [...$0, ...tail],
1340
+ names
1293
1341
  };
1294
1342
  });
1295
1343
  var AssignmentExpressionTail$3 = ConditionalExpression;
@@ -1623,7 +1671,7 @@ var Civet = (() => {
1623
1671
  return NonNullAssertion$0(state);
1624
1672
  }
1625
1673
  }
1626
- var AdditionalReservedWords$0 = $R$0($EXPECT($R0, fail, "AdditionalReservedWords /(of|then)(?!\\p{ID_Continue}|[\\u200C\\u200D$])/"));
1674
+ var AdditionalReservedWords$0 = $R$0($EXPECT($R0, fail, "AdditionalReservedWords /(of|then|when)(?!\\p{ID_Continue}|[\\u200C\\u200D$])/"));
1627
1675
  function AdditionalReservedWords(state) {
1628
1676
  if (state.verbose)
1629
1677
  console.log("ENTER:", "AdditionalReservedWords");
@@ -1648,11 +1696,19 @@ var Civet = (() => {
1648
1696
  }
1649
1697
  }
1650
1698
  var MemberExpressionRest$0 = $TS($S($E($C(OptionalShorthand, NonNullAssertion)), MemberBracketContent), function($skip, $loc, $0, $1, $2) {
1651
- if ($1)
1699
+ if ($1) {
1700
+ if ($1.length === 2 && $2.type === "SliceExpression") {
1701
+ $1.pop();
1702
+ }
1652
1703
  return $0;
1704
+ }
1705
+ return $2;
1706
+ });
1707
+ var MemberExpressionRest$1 = $TS($S($E($S($Y(EOS), IndentedFurther)), PropertyAccess), function($skip, $loc, $0, $1, $2) {
1708
+ if ($1)
1709
+ $2.children.unshift($1[1]);
1653
1710
  return $2;
1654
1711
  });
1655
- var MemberExpressionRest$1 = $S($E($S($Y(EOS), IndentedFurther)), PropertyAccess);
1656
1712
  var MemberExpressionRest$2 = $TS($S($E($S($Y(EOS), IndentedFurther)), $EXPECT($L13, fail, 'MemberExpressionRest "::"'), $E(IdentifierName)), function($skip, $loc, $0, $1, $2, $3) {
1657
1713
  var id = $3;
1658
1714
  if (id)
@@ -1667,10 +1723,10 @@ var Civet = (() => {
1667
1723
  return MemberExpressionRest$0(state) || MemberExpressionRest$1(state) || MemberExpressionRest$2(state) || MemberExpressionRest$3(state);
1668
1724
  }
1669
1725
  }
1670
- var MemberBracketContent$0 = $TS($S(OpenBracket, ExtendedExpression, $E($S($C(DotDotDot, DotDot), $E(ExtendedExpression))), __, CloseBracket), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
1726
+ var MemberBracketContent$0 = $TS($S(OpenBracket, ExtendedExpression, $E($S(__, $C(DotDotDot, DotDot), $E(ExtendedExpression))), __, CloseBracket), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
1671
1727
  if ($3) {
1672
- const sep = $3[0];
1673
- const end = $3[1];
1728
+ const sep = $3[1];
1729
+ const end = $3[2];
1674
1730
  const inclusive = sep.token === "..";
1675
1731
  sep.token = ", ";
1676
1732
  $1.token = ".slice(";
@@ -1684,6 +1740,7 @@ var Civet = (() => {
1684
1740
  };
1685
1741
  }
1686
1742
  if (inclusive) {
1743
+ module.insertTrimmingSpace(end, "");
1687
1744
  return {
1688
1745
  type: "SliceExpression",
1689
1746
  start: $2,
@@ -1709,7 +1766,14 @@ var Civet = (() => {
1709
1766
  return MemberBracketContent$0(state);
1710
1767
  }
1711
1768
  }
1712
- var PropertyAccess$0 = $S($E($C(QuestionMark, NonNullAssertion)), Dot, $C(IdentifierName, PrivateIdentifier));
1769
+ var PropertyAccess$0 = $TS($S($E($C(QuestionMark, NonNullAssertion)), Dot, $C(IdentifierName, PrivateIdentifier)), function($skip, $loc, $0, $1, $2, $3) {
1770
+ var id = $3;
1771
+ id.type = "PropertyAccess";
1772
+ id.children.unshift($2);
1773
+ if ($1)
1774
+ id.children.unshift($1);
1775
+ return id;
1776
+ });
1713
1777
  function PropertyAccess(state) {
1714
1778
  if (state.verbose)
1715
1779
  console.log("ENTER:", "PropertyAccess");
@@ -2136,13 +2200,33 @@ var Civet = (() => {
2136
2200
  $1.type = "FunctionExpression";
2137
2201
  return $1;
2138
2202
  });
2203
+ var FunctionExpression$1 = $TS($S(Ampersand, $N(_), $P(CallExpressionRest)), function($skip, $loc, $0, $1, $2, $3) {
2204
+ $1.token = "$ => $";
2205
+ return {
2206
+ type: "FunctionExpression",
2207
+ children: [$1, $3]
2208
+ };
2209
+ });
2210
+ var FunctionExpression$2 = $TS($S(Ampersand, $N($EXPECT($R1, fail, "FunctionExpression /[&]/")), $P($S(__, BinaryOp, __, UnaryExpression))), function($skip, $loc, $0, $1, $2, $3) {
2211
+ $0.splice(1, 1);
2212
+ $1.token = "$ => $";
2213
+ const exp = module.processBinaryOpExpression($0);
2214
+ return {
2215
+ type: "FunctionExpression",
2216
+ children: exp
2217
+ };
2218
+ });
2219
+ var FunctionExpression$3 = $TS($S($EXPECT($R2, fail, "FunctionExpression /[!~+-]+/"), Ampersand), function($skip, $loc, $0, $1, $2) {
2220
+ return {
2221
+ type: "FunctionExpression",
2222
+ children: ["$ => ", $1, "$"]
2223
+ };
2224
+ });
2139
2225
  function FunctionExpression(state) {
2140
- if (state.verbose)
2141
- console.log("ENTER:", "FunctionExpression");
2142
2226
  if (state.tokenize) {
2143
- return $TOKEN("FunctionExpression", state, FunctionExpression$0(state));
2227
+ return $TOKEN("FunctionExpression", state, FunctionExpression$0(state) || FunctionExpression$1(state) || FunctionExpression$2(state) || FunctionExpression$3(state));
2144
2228
  } else {
2145
- return FunctionExpression$0(state);
2229
+ return FunctionExpression$0(state) || FunctionExpression$1(state) || FunctionExpression$2(state) || FunctionExpression$3(state);
2146
2230
  }
2147
2231
  }
2148
2232
  var ThinArrowFunction$0 = $TS($S(Parameters, $E(ReturnTypeSuffix), $Q(_), Arrow, BracedOrEmptyBlock), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
@@ -2242,8 +2326,18 @@ var Civet = (() => {
2242
2326
  var exps = value[2];
2243
2327
  return { "type": "BlockStatement", "expressions": exps, "children": value };
2244
2328
  });
2245
- var BracedBlock$2 = $TS($S(InsertOpenBrace, $N(EOS), __, Statement, InsertSpace, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
2329
+ var BracedBlock$2 = $TS($S(InsertOpenBrace, $Y(EOS), ObjectLiteral, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4) {
2330
+ var s = $3;
2331
+ $0.splice(1, 1);
2332
+ return {
2333
+ type: "BlockStatement",
2334
+ expressions: [s],
2335
+ children: $0
2336
+ };
2337
+ });
2338
+ var BracedBlock$3 = $TS($S(InsertOpenBrace, $N(EOS), __, Statement, InsertSpace, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
2246
2339
  var s = $4;
2340
+ $0.splice(1, 1);
2247
2341
  return {
2248
2342
  type: "BlockStatement",
2249
2343
  expressions: [s],
@@ -2252,9 +2346,9 @@ var Civet = (() => {
2252
2346
  });
2253
2347
  function BracedBlock(state) {
2254
2348
  if (state.tokenize) {
2255
- return $TOKEN("BracedBlock", state, BracedBlock$0(state) || BracedBlock$1(state) || BracedBlock$2(state));
2349
+ return $TOKEN("BracedBlock", state, BracedBlock$0(state) || BracedBlock$1(state) || BracedBlock$2(state) || BracedBlock$3(state));
2256
2350
  } else {
2257
- return BracedBlock$0(state) || BracedBlock$1(state) || BracedBlock$2(state);
2351
+ return BracedBlock$0(state) || BracedBlock$1(state) || BracedBlock$2(state) || BracedBlock$3(state);
2258
2352
  }
2259
2353
  }
2260
2354
  var BracedContent$0 = $T($S($Y(EOS), NestedBlockStatements), function(value) {
@@ -2296,7 +2390,8 @@ var Civet = (() => {
2296
2390
  var Literal$0 = $TS($S(LiteralContent), function($skip, $loc, $0, $1) {
2297
2391
  return {
2298
2392
  type: "Literal",
2299
- children: $0
2393
+ children: $0,
2394
+ raw: $1.token
2300
2395
  };
2301
2396
  });
2302
2397
  function Literal(state) {
@@ -2379,7 +2474,7 @@ var Civet = (() => {
2379
2474
  return Identifier$0(state);
2380
2475
  }
2381
2476
  }
2382
- var IdentifierName$0 = $TR($EXPECT($R1, fail, "IdentifierName /(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$])*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
2477
+ var IdentifierName$0 = $TR($EXPECT($R3, fail, "IdentifierName /(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$])*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
2383
2478
  return {
2384
2479
  type: "Identifier",
2385
2480
  name: $0,
@@ -2410,11 +2505,16 @@ var Civet = (() => {
2410
2505
  }
2411
2506
  }
2412
2507
  var ArrayLiteral$0 = $TS($S(OpenBracket, ArrayLiteralContent, __, CloseBracket), function($skip, $loc, $0, $1, $2, $3, $4) {
2508
+ var content = $2;
2509
+ if (content.type === "RangeExpression") {
2510
+ content.children.push(...$3);
2511
+ return content;
2512
+ }
2413
2513
  let children;
2414
- if (Array.isArray($2)) {
2415
- children = [$1, ...$2, ...$3, $4];
2514
+ if (Array.isArray(content)) {
2515
+ children = [$1, ...content, ...$3, $4];
2416
2516
  } else {
2417
- children = [$1, $2, ...$3, $4];
2517
+ children = [$1, content, ...$3, $4];
2418
2518
  }
2419
2519
  const names = children.flatMap((c) => {
2420
2520
  return c.names || [];
@@ -2434,13 +2534,39 @@ var Civet = (() => {
2434
2534
  return ArrayLiteral$0(state);
2435
2535
  }
2436
2536
  }
2437
- var ArrayLiteralContent$0 = NestedElementList;
2438
- var ArrayLiteralContent$1 = ElementList;
2537
+ var ArrayLiteralContent$0 = $TS($S(ExtendedExpression, __, $C(DotDotDot, DotDot), ExtendedExpression), function($skip, $loc, $0, $1, $2, $3, $4) {
2538
+ var s = $1;
2539
+ var ws = $2;
2540
+ var range = $3;
2541
+ var e = $4;
2542
+ const inclusive = range.token === "..";
2543
+ range.token = ",";
2544
+ if (s.type === "Literal" && e.type === "Literal") {
2545
+ const start = JSON.parse(s.raw);
2546
+ const end = JSON.parse(e.raw);
2547
+ const step = end > start ? 1 : -1;
2548
+ const length = Math.abs(end - start) + (inclusive ? 1 : 0);
2549
+ if (length <= 20) {
2550
+ return Array.from({ length }, (_2, i) => start + i * step).join(", ");
2551
+ }
2552
+ }
2553
+ const inclusiveAdjust = inclusive ? " + 1" : "";
2554
+ const children = ["((s, e) => {let step = e > s ? 1 : -1; return Array.from({length: Math.abs(e - s)", inclusiveAdjust, "}, (_, i) => s + i * step)})(", s, ws, range, e, ")"];
2555
+ return {
2556
+ type: "RangeExpression",
2557
+ children,
2558
+ inclusive,
2559
+ start: s,
2560
+ end: e
2561
+ };
2562
+ });
2563
+ var ArrayLiteralContent$1 = NestedElementList;
2564
+ var ArrayLiteralContent$2 = ElementList;
2439
2565
  function ArrayLiteralContent(state) {
2440
2566
  if (state.tokenize) {
2441
- return $TOKEN("ArrayLiteralContent", state, ArrayLiteralContent$0(state) || ArrayLiteralContent$1(state));
2567
+ return $TOKEN("ArrayLiteralContent", state, ArrayLiteralContent$0(state) || ArrayLiteralContent$1(state) || ArrayLiteralContent$2(state));
2442
2568
  } else {
2443
- return ArrayLiteralContent$0(state) || ArrayLiteralContent$1(state);
2569
+ return ArrayLiteralContent$0(state) || ArrayLiteralContent$1(state) || ArrayLiteralContent$2(state);
2444
2570
  }
2445
2571
  }
2446
2572
  var NestedElementList$0 = $TS($S(PushIndent, $Q(NestedElement), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
@@ -2596,7 +2722,10 @@ var Civet = (() => {
2596
2722
  var NestedObjectLiteral$0 = $TS($S(InsertOpenBrace, $Y(EOS), NestedPropertyDefinitions, InsertNewline, InsertIndent, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
2597
2723
  $3.unshift($1);
2598
2724
  $3.push($4, $5, $6);
2599
- return $3;
2725
+ return {
2726
+ type: "ObjectExpression",
2727
+ children: $3
2728
+ };
2600
2729
  });
2601
2730
  function NestedObjectLiteral(state) {
2602
2731
  if (state.verbose)
@@ -2770,8 +2899,13 @@ var Civet = (() => {
2770
2899
  }
2771
2900
  var PrivateIdentifier$0 = $TV($TEXT($S($EXPECT($L7, fail, 'PrivateIdentifier "#"'), IdentifierName)), function($skip, $loc, $0, $1) {
2772
2901
  return {
2773
- $loc,
2774
- token: $1
2902
+ type: "Identifier",
2903
+ name: $0,
2904
+ names: [$0],
2905
+ children: [{
2906
+ $loc,
2907
+ token: $0
2908
+ }]
2775
2909
  };
2776
2910
  });
2777
2911
  function PrivateIdentifier(state) {
@@ -2822,7 +2956,9 @@ var Civet = (() => {
2822
2956
  }
2823
2957
  }
2824
2958
  var BinaryOp$0 = $TS($S(BinaryOpSymbol), function($skip, $loc, $0, $1) {
2825
- return { $loc, token: $1 };
2959
+ if (typeof $1 === "string")
2960
+ return { $loc, token: $1 };
2961
+ return $1;
2826
2962
  });
2827
2963
  function BinaryOp(state) {
2828
2964
  if (state.verbose)
@@ -2870,28 +3006,34 @@ var Civet = (() => {
2870
3006
  return "&&";
2871
3007
  });
2872
3008
  var BinaryOpSymbol$20 = $EXPECT($L64, fail, 'BinaryOpSymbol "&&"');
2873
- var BinaryOpSymbol$21 = $T($S($EXPECT($L65, fail, 'BinaryOpSymbol "or"'), NonIdContinue), function(value) {
3009
+ var BinaryOpSymbol$21 = $T($S(CoffeeOfEnabled, $EXPECT($L65, fail, 'BinaryOpSymbol "of"'), NonIdContinue), function(value) {
3010
+ return "in";
3011
+ });
3012
+ var BinaryOpSymbol$22 = $T($S($EXPECT($L66, fail, 'BinaryOpSymbol "or"'), NonIdContinue), function(value) {
2874
3013
  return "||";
2875
3014
  });
2876
- var BinaryOpSymbol$22 = $EXPECT($L66, fail, 'BinaryOpSymbol "||"');
2877
- var BinaryOpSymbol$23 = $EXPECT($L67, fail, 'BinaryOpSymbol "??"');
2878
- var BinaryOpSymbol$24 = $TS($S($EXPECT($L68, fail, 'BinaryOpSymbol "instanceof"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
3015
+ var BinaryOpSymbol$23 = $EXPECT($L67, fail, 'BinaryOpSymbol "||"');
3016
+ var BinaryOpSymbol$24 = $EXPECT($L68, fail, 'BinaryOpSymbol "??"');
3017
+ var BinaryOpSymbol$25 = $TS($S($EXPECT($L69, fail, 'BinaryOpSymbol "instanceof"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
2879
3018
  return $1;
2880
3019
  });
2881
- var BinaryOpSymbol$25 = $TS($S($EXPECT($L69, fail, 'BinaryOpSymbol "in"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
3020
+ var BinaryOpSymbol$26 = $TS($S(CoffeeOfEnabled, $EXPECT($L70, fail, 'BinaryOpSymbol "in"'), NonIdContinue), function($skip, $loc, $0, $1, $2, $3) {
3021
+ return module.getIndexOfRef();
3022
+ });
3023
+ var BinaryOpSymbol$27 = $TS($S($EXPECT($L70, fail, 'BinaryOpSymbol "in"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
2882
3024
  return $1;
2883
3025
  });
2884
- var BinaryOpSymbol$26 = $EXPECT($L70, fail, 'BinaryOpSymbol "&"');
2885
- var BinaryOpSymbol$27 = $EXPECT($L71, fail, 'BinaryOpSymbol "^"');
2886
- var BinaryOpSymbol$28 = $EXPECT($L72, fail, 'BinaryOpSymbol "|"');
3026
+ var BinaryOpSymbol$28 = $EXPECT($L71, fail, 'BinaryOpSymbol "&"');
3027
+ var BinaryOpSymbol$29 = $EXPECT($L72, fail, 'BinaryOpSymbol "^"');
3028
+ var BinaryOpSymbol$30 = $EXPECT($L73, fail, 'BinaryOpSymbol "|"');
2887
3029
  function BinaryOpSymbol(state) {
2888
3030
  if (state.tokenize) {
2889
- 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));
3031
+ 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));
2890
3032
  } else {
2891
- 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);
3033
+ 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);
2892
3034
  }
2893
3035
  }
2894
- var UnaryOp$0 = $TR($EXPECT($R2, fail, "UnaryOp /[!~+-](?!\\s)/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
3036
+ var UnaryOp$0 = $TR($EXPECT($R4, fail, "UnaryOp /[!~+-](?!\\s|[!~+-]*&)/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
2895
3037
  return { $loc, token: $0 };
2896
3038
  });
2897
3039
  var UnaryOp$1 = $S($C(Await, Delete, Void, Typeof), __);
@@ -2919,7 +3061,18 @@ var Civet = (() => {
2919
3061
  var ws = $2;
2920
3062
  var post = $3;
2921
3063
  if (post) {
2922
- post.children.push(statement);
3064
+ let block;
3065
+ if (post.type === "ForStatement") {
3066
+ if (post.blockPrefix?.length) {
3067
+ block = [" {", ...post.blockPrefix, ...statement, " }"];
3068
+ } else {
3069
+ block = statement;
3070
+ }
3071
+ } else {
3072
+ block = statement;
3073
+ }
3074
+ post.block = block;
3075
+ post.children.push(block);
2923
3076
  if (!module.isWhitespaceOrEmpty(ws))
2924
3077
  post.children.push(ws);
2925
3078
  return post;
@@ -2961,7 +3114,7 @@ var Civet = (() => {
2961
3114
  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);
2962
3115
  }
2963
3116
  }
2964
- var EmptyStatement$0 = $T($S($Q(TrailingComment), $Y($EXPECT($L73, fail, 'EmptyStatement ";"'))), function(value) {
3117
+ var EmptyStatement$0 = $T($S($Q(TrailingComment), $Y($EXPECT($L74, fail, 'EmptyStatement ";"'))), function(value) {
2965
3118
  return { "type": "EmptyStatement", "children": value[0] };
2966
3119
  });
2967
3120
  function EmptyStatement(state) {
@@ -3201,6 +3354,9 @@ var Civet = (() => {
3201
3354
  var block = $2;
3202
3355
  clause.children.push(block);
3203
3356
  clause.block = block;
3357
+ if (clause.blockPrefix) {
3358
+ block.expressions.splice(0, 0, ...clause.blockPrefix);
3359
+ }
3204
3360
  return clause;
3205
3361
  });
3206
3362
  function ForStatement(state) {
@@ -3220,7 +3376,8 @@ var Civet = (() => {
3220
3376
  type: "ForStatement",
3221
3377
  children,
3222
3378
  declaration,
3223
- block: null
3379
+ block: null,
3380
+ blockPrefix: c.blockPrefix
3224
3381
  };
3225
3382
  });
3226
3383
  function ForClause(state) {
@@ -3232,39 +3389,155 @@ var Civet = (() => {
3232
3389
  return ForClause$0(state);
3233
3390
  }
3234
3391
  }
3235
- 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) {
3392
+ var ForStatementControl$0 = $T($S($N(CoffeeForLoopsEnabled), ForStatementParameters), function(value) {
3393
+ return value[1];
3394
+ });
3395
+ var ForStatementControl$1 = $TS($S(CoffeeForLoopsEnabled, CoffeeForStatementParameters, $E(WhenCondition)), function($skip, $loc, $0, $1, $2, $3) {
3396
+ if ($3) {
3397
+ const indent = "".padStart((module.currentIndent + 1) * 2);
3398
+ module.insertTrimmingSpace($3, "");
3399
+ $2.blockPrefix.push({
3400
+ type: "IfStatement",
3401
+ children: [indent, "if (!(", $3, ")) continue\n"]
3402
+ });
3403
+ }
3404
+ return $2;
3405
+ });
3406
+ function ForStatementControl(state) {
3407
+ if (state.tokenize) {
3408
+ return $TOKEN("ForStatementControl", state, ForStatementControl$0(state) || ForStatementControl$1(state));
3409
+ } else {
3410
+ return ForStatementControl$0(state) || ForStatementControl$1(state);
3411
+ }
3412
+ }
3413
+ var WhenCondition$0 = $T($S(__, When, ExtendedExpression), function(value) {
3414
+ var exp = value[2];
3415
+ return exp;
3416
+ });
3417
+ function WhenCondition(state) {
3418
+ if (state.verbose)
3419
+ console.log("ENTER:", "WhenCondition");
3420
+ if (state.tokenize) {
3421
+ return $TOKEN("WhenCondition", state, WhenCondition$0(state));
3422
+ } else {
3423
+ return WhenCondition$0(state);
3424
+ }
3425
+ }
3426
+ 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) {
3427
+ var declaration = $3;
3428
+ var kind = $5;
3429
+ var exp = $6;
3430
+ let blockPrefix = [];
3431
+ if (kind.token === "from") {
3432
+ kind.token = "of";
3433
+ } else if (kind.token === "of") {
3434
+ module.insertTrimmingSpace(declaration, "");
3435
+ module.insertTrimmingSpace(exp, "");
3436
+ if (declaration.own) {
3437
+ const indent = "".padStart((module.currentIndent + 1) * 2);
3438
+ const hasPropRef = module.getHasPropRef();
3439
+ blockPrefix.push([indent, "if (!", hasPropRef, ".call(", exp, ", ", declaration, ")) continue\n"]);
3440
+ }
3441
+ kind.token = "in ";
3442
+ } else if (kind.token === "in") {
3443
+ const counterRef = {
3444
+ type: "Ref",
3445
+ base: "i"
3446
+ };
3447
+ const lenRef = {
3448
+ type: "Ref",
3449
+ base: "len"
3450
+ };
3451
+ const expRef = exp.type === "Identifier" ? exp : {
3452
+ type: "Ref",
3453
+ base: "ref"
3454
+ };
3455
+ const varRef = declaration;
3456
+ module.insertTrimmingSpace(exp, "");
3457
+ const expRefDec = expRef !== exp ? [expRef, " = ", exp, ", "] : [];
3458
+ declaration = {
3459
+ type: "Declaration",
3460
+ children: ["let ", ...expRefDec, counterRef, " = 0, ", lenRef, " = ", expRef, ".length"],
3461
+ names: []
3462
+ };
3463
+ const indent = "".padStart((module.currentIndent + 1) * 2);
3464
+ blockPrefix.push([{
3465
+ type: "AssignmentExpression",
3466
+ children: [indent, varRef, " = ", expRef, "[", counterRef, "]\n"],
3467
+ names: varRef.names
3468
+ }]);
3469
+ return {
3470
+ declaration,
3471
+ children: [$1, $2, declaration, "; ", counterRef, " < ", lenRef, "; ", counterRef, "++", $7],
3472
+ blockPrefix
3473
+ };
3474
+ }
3475
+ return {
3476
+ declaration,
3477
+ children: $0,
3478
+ blockPrefix
3479
+ };
3480
+ });
3481
+ function CoffeeForStatementParameters(state) {
3482
+ if (state.verbose)
3483
+ console.log("ENTER:", "CoffeeForStatementParameters");
3484
+ if (state.tokenize) {
3485
+ return $TOKEN("CoffeeForStatementParameters", state, CoffeeForStatementParameters$0(state));
3486
+ } else {
3487
+ return CoffeeForStatementParameters$0(state);
3488
+ }
3489
+ }
3490
+ var CoffeeForDeclaration$0 = $TS($S($E($S(__, $EXPECT($L75, fail, 'CoffeeForDeclaration "own"'))), ForBinding), function($skip, $loc, $0, $1, $2) {
3491
+ var own = $1;
3492
+ var binding = $2;
3493
+ if (own) {
3494
+ binding.own = true;
3495
+ }
3496
+ binding.type = "AssignmentExpression";
3497
+ return binding;
3498
+ });
3499
+ function CoffeeForDeclaration(state) {
3500
+ if (state.verbose)
3501
+ console.log("ENTER:", "CoffeeForDeclaration");
3502
+ if (state.tokenize) {
3503
+ return $TOKEN("CoffeeForDeclaration", state, CoffeeForDeclaration$0(state));
3504
+ } else {
3505
+ return CoffeeForDeclaration$0(state);
3506
+ }
3507
+ }
3508
+ 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) {
3236
3509
  var declaration = $3;
3237
3510
  return {
3238
3511
  declaration,
3239
3512
  children: $0
3240
3513
  };
3241
3514
  });
3242
- 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) {
3515
+ 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) {
3243
3516
  var declaration = $3;
3244
3517
  return {
3245
3518
  declaration,
3246
3519
  children: $0
3247
3520
  };
3248
3521
  });
3249
- 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) {
3522
+ 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) {
3250
3523
  var declaration = $4;
3251
3524
  return {
3252
3525
  declaration,
3253
3526
  children: $0
3254
3527
  };
3255
3528
  });
3256
- 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) {
3529
+ 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) {
3257
3530
  var declaration = $3;
3258
3531
  return {
3259
3532
  declaration,
3260
3533
  children: $0
3261
3534
  };
3262
3535
  });
3263
- function ForStatementControl(state) {
3536
+ function ForStatementParameters(state) {
3264
3537
  if (state.tokenize) {
3265
- return $TOKEN("ForStatementControl", state, ForStatementControl$0(state) || ForStatementControl$1(state) || ForStatementControl$2(state) || ForStatementControl$3(state));
3538
+ return $TOKEN("ForStatementParameters", state, ForStatementParameters$0(state) || ForStatementParameters$1(state) || ForStatementParameters$2(state) || ForStatementParameters$3(state));
3266
3539
  } else {
3267
- return ForStatementControl$0(state) || ForStatementControl$1(state) || ForStatementControl$2(state) || ForStatementControl$3(state);
3540
+ return ForStatementParameters$0(state) || ForStatementParameters$1(state) || ForStatementParameters$2(state) || ForStatementParameters$3(state);
3268
3541
  }
3269
3542
  }
3270
3543
  var ForInOfDeclaration$0 = $TS($S(Var, ForBinding), function($skip, $loc, $0, $1, $2) {
@@ -3293,7 +3566,7 @@ var Civet = (() => {
3293
3566
  names: binding.names
3294
3567
  };
3295
3568
  });
3296
- var ForDeclaration$1 = $TS($S(InsertConst, ForBinding, $EXPECT($R3, fail, "ForDeclaration /(?=[\\s\\)])/")), function($skip, $loc, $0, $1, $2, $3) {
3569
+ var ForDeclaration$1 = $TS($S(InsertConst, ForBinding, $EXPECT($R5, fail, "ForDeclaration /(?=[\\s\\)])/")), function($skip, $loc, $0, $1, $2, $3) {
3297
3570
  var c = $1;
3298
3571
  var binding = $2;
3299
3572
  return {
@@ -3513,7 +3786,7 @@ var Civet = (() => {
3513
3786
  return CatchBind$0(state) || CatchBind$1(state);
3514
3787
  }
3515
3788
  }
3516
- var Finally$0 = $S(__, $EXPECT($L74, fail, 'Finally "finally"'), BracedBlock);
3789
+ var Finally$0 = $S(__, $EXPECT($L76, fail, 'Finally "finally"'), BracedBlock);
3517
3790
  function Finally(state) {
3518
3791
  if (state.verbose)
3519
3792
  console.log("ENTER:", "Finally");
@@ -3582,13 +3855,13 @@ var Civet = (() => {
3582
3855
  return ExpressionStatement$0(state);
3583
3856
  }
3584
3857
  }
3585
- var KeywordStatement$0 = $T($S($EXPECT($L75, fail, 'KeywordStatement "break"'), NonIdContinue), function(value) {
3858
+ var KeywordStatement$0 = $T($S($EXPECT($L77, fail, 'KeywordStatement "break"'), NonIdContinue), function(value) {
3586
3859
  return { "type": "BreakStatement", "children": value };
3587
3860
  });
3588
- var KeywordStatement$1 = $T($S($EXPECT($L76, fail, 'KeywordStatement "continue"'), NonIdContinue), function(value) {
3861
+ var KeywordStatement$1 = $T($S($EXPECT($L78, fail, 'KeywordStatement "continue"'), NonIdContinue), function(value) {
3589
3862
  return { "type": "ContinueStatement", "children": value };
3590
3863
  });
3591
- var KeywordStatement$2 = $T($S($EXPECT($L77, fail, 'KeywordStatement "debugger"'), NonIdContinue), function(value) {
3864
+ var KeywordStatement$2 = $T($S($EXPECT($L79, fail, 'KeywordStatement "debugger"'), NonIdContinue), function(value) {
3592
3865
  return { "type": "DebuggerStatement", "children": value };
3593
3866
  });
3594
3867
  var KeywordStatement$3 = $T($S(Return, $E(MaybeNestedExpression)), function(value) {
@@ -3604,7 +3877,7 @@ var Civet = (() => {
3604
3877
  return KeywordStatement$0(state) || KeywordStatement$1(state) || KeywordStatement$2(state) || KeywordStatement$3(state) || KeywordStatement$4(state);
3605
3878
  }
3606
3879
  }
3607
- var DebuggerExpression$0 = $TS($S($EXPECT($L77, fail, 'DebuggerExpression "debugger"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
3880
+ var DebuggerExpression$0 = $TS($S($EXPECT($L79, fail, 'DebuggerExpression "debugger"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
3608
3881
  return {
3609
3882
  type: "DebuggerExpression",
3610
3883
  children: ["($=>{", $1, "})()"]
@@ -3647,7 +3920,7 @@ var Civet = (() => {
3647
3920
  return MaybeNestedExpression$0(state) || MaybeNestedExpression$1(state);
3648
3921
  }
3649
3922
  }
3650
- var ImportDeclaration$0 = $T($S($EXPECT($L78, fail, 'ImportDeclaration "import type"'), NonIdContinue, __, ImportClause, __, FromClause), function(value) {
3923
+ var ImportDeclaration$0 = $T($S($EXPECT($L80, fail, 'ImportDeclaration "import type"'), NonIdContinue, __, ImportClause, __, FromClause), function(value) {
3651
3924
  return { "ts": true, "children": value };
3652
3925
  });
3653
3926
  var ImportDeclaration$1 = $S(Import, __, ImportClause, __, FromClause);
@@ -3803,7 +4076,7 @@ var Civet = (() => {
3803
4076
  return UnprocessedModuleSpecifier$0(state) || UnprocessedModuleSpecifier$1(state);
3804
4077
  }
3805
4078
  }
3806
- var UnquotedSpecifier$0 = $TV($EXPECT($R4, fail, 'UnquotedSpecifier /[^;"\\s]+/'), function($skip, $loc, $0, $1) {
4079
+ var UnquotedSpecifier$0 = $TV($EXPECT($R6, fail, 'UnquotedSpecifier /[^;"\\s]+/'), function($skip, $loc, $0, $1) {
3807
4080
  var spec = $0;
3808
4081
  return { $loc, token: `"${spec}"` };
3809
4082
  });
@@ -3826,7 +4099,7 @@ var Civet = (() => {
3826
4099
  return ImportedBinding$0(state);
3827
4100
  }
3828
4101
  }
3829
- var ExportDeclaration$0 = $S(Export, __, $EXPECT($L79, fail, 'ExportDeclaration "default"'), NonIdContinue, __, $C(HoistableDeclaration, ClassDeclaration, ExtendedExpression));
4102
+ var ExportDeclaration$0 = $S(Export, __, $EXPECT($L81, fail, 'ExportDeclaration "default"'), NonIdContinue, __, $C(HoistableDeclaration, ClassDeclaration, ExtendedExpression));
3830
4103
  var ExportDeclaration$1 = $S(Export, __, ExportFromClause, __, FromClause);
3831
4104
  var ExportDeclaration$2 = $S(Export, __, $C(NamedExports, VariableStatement, Declaration));
3832
4105
  function ExportDeclaration(state) {
@@ -3933,7 +4206,7 @@ var Civet = (() => {
3933
4206
  return LexicalDeclaration$0(state) || LexicalDeclaration$1(state);
3934
4207
  }
3935
4208
  }
3936
- var ConstAssignment$0 = $TV($EXPECT($L80, fail, 'ConstAssignment ":="'), function($skip, $loc, $0, $1) {
4209
+ var ConstAssignment$0 = $TV($EXPECT($L82, fail, 'ConstAssignment ":="'), function($skip, $loc, $0, $1) {
3937
4210
  return { $loc, token: "=" };
3938
4211
  });
3939
4212
  function ConstAssignment(state) {
@@ -4055,7 +4328,7 @@ var Civet = (() => {
4055
4328
  return NumericLiteralKind$0(state) || NumericLiteralKind$1(state) || NumericLiteralKind$2(state) || NumericLiteralKind$3(state) || NumericLiteralKind$4(state);
4056
4329
  }
4057
4330
  }
4058
- var DecimalBigIntegerLiteral$0 = $R$0($EXPECT($R5, fail, "DecimalBigIntegerLiteral /(?:0|[1-9](?:_[0-9]|[0-9])*)n/"));
4331
+ var DecimalBigIntegerLiteral$0 = $R$0($EXPECT($R7, fail, "DecimalBigIntegerLiteral /(?:0|[1-9](?:_[0-9]|[0-9])*)n/"));
4059
4332
  function DecimalBigIntegerLiteral(state) {
4060
4333
  if (state.verbose)
4061
4334
  console.log("ENTER:", "DecimalBigIntegerLiteral");
@@ -4065,11 +4338,11 @@ var Civet = (() => {
4065
4338
  return DecimalBigIntegerLiteral$0(state);
4066
4339
  }
4067
4340
  }
4068
- var DecimalLiteral$0 = $TV($TEXT($EXPECT($R6, fail, "DecimalLiteral /(?:0|[1-9](?:_[0-9]|[0-9])*)(?=\\.(?:\\p{ID_Start}|[_$]))/")), function($skip, $loc, $0, $1) {
4341
+ var DecimalLiteral$0 = $TV($TEXT($EXPECT($R8, fail, "DecimalLiteral /(?:0|[1-9](?:_[0-9]|[0-9])*)(?=\\.(?:\\p{ID_Start}|[_$]))/")), function($skip, $loc, $0, $1) {
4069
4342
  return $1 + ".";
4070
4343
  });
4071
- var DecimalLiteral$1 = $TEXT($S($EXPECT($R7, fail, "DecimalLiteral /(?:0|[1-9](?:_[0-9]|[0-9])*)(?:\\.(?:[0-9](?:_[0-9]|[0-9])*))?/"), $E(ExponentPart)));
4072
- var DecimalLiteral$2 = $TEXT($S($EXPECT($R8, fail, "DecimalLiteral /(?:\\.[0-9](?:_[0-9]|[0-9])*)/"), $E(ExponentPart)));
4344
+ var DecimalLiteral$1 = $TEXT($S($EXPECT($R9, fail, "DecimalLiteral /(?:0|[1-9](?:_[0-9]|[0-9])*)(?:\\.(?:[0-9](?:_[0-9]|[0-9])*))?/"), $E(ExponentPart)));
4345
+ var DecimalLiteral$2 = $TEXT($S($EXPECT($R10, fail, "DecimalLiteral /(?:\\.[0-9](?:_[0-9]|[0-9])*)/"), $E(ExponentPart)));
4073
4346
  function DecimalLiteral(state) {
4074
4347
  if (state.tokenize) {
4075
4348
  return $TOKEN("DecimalLiteral", state, DecimalLiteral$0(state) || DecimalLiteral$1(state) || DecimalLiteral$2(state));
@@ -4077,7 +4350,7 @@ var Civet = (() => {
4077
4350
  return DecimalLiteral$0(state) || DecimalLiteral$1(state) || DecimalLiteral$2(state);
4078
4351
  }
4079
4352
  }
4080
- var ExponentPart$0 = $R$0($EXPECT($R9, fail, "ExponentPart /(?:[eE][+-]?[0-9]+(?:_[0-9]|[0-9])*)/"));
4353
+ var ExponentPart$0 = $R$0($EXPECT($R11, fail, "ExponentPart /(?:[eE][+-]?[0-9]+(?:_[0-9]|[0-9])*)/"));
4081
4354
  function ExponentPart(state) {
4082
4355
  if (state.verbose)
4083
4356
  console.log("ENTER:", "ExponentPart");
@@ -4087,7 +4360,7 @@ var Civet = (() => {
4087
4360
  return ExponentPart$0(state);
4088
4361
  }
4089
4362
  }
4090
- var BinaryIntegerLiteral$0 = $R$0($EXPECT($R10, fail, "BinaryIntegerLiteral /0[bB][01](?:[01]|_[01])*n?/"));
4363
+ var BinaryIntegerLiteral$0 = $R$0($EXPECT($R12, fail, "BinaryIntegerLiteral /0[bB][01](?:[01]|_[01])*n?/"));
4091
4364
  function BinaryIntegerLiteral(state) {
4092
4365
  if (state.verbose)
4093
4366
  console.log("ENTER:", "BinaryIntegerLiteral");
@@ -4097,7 +4370,7 @@ var Civet = (() => {
4097
4370
  return BinaryIntegerLiteral$0(state);
4098
4371
  }
4099
4372
  }
4100
- var OctalIntegerLiteral$0 = $R$0($EXPECT($R11, fail, "OctalIntegerLiteral /0[oO][0-7](?:[0-7]|_[0-7])*n?/"));
4373
+ var OctalIntegerLiteral$0 = $R$0($EXPECT($R13, fail, "OctalIntegerLiteral /0[oO][0-7](?:[0-7]|_[0-7])*n?/"));
4101
4374
  function OctalIntegerLiteral(state) {
4102
4375
  if (state.verbose)
4103
4376
  console.log("ENTER:", "OctalIntegerLiteral");
@@ -4107,7 +4380,7 @@ var Civet = (() => {
4107
4380
  return OctalIntegerLiteral$0(state);
4108
4381
  }
4109
4382
  }
4110
- var HexLiteral$0 = $R$0($EXPECT($R12, fail, "HexLiteral /0[xX][0-9a-fA-F](?:[0-9a-fA-F]|_[0-9a-fA-F])*n?/"));
4383
+ var HexLiteral$0 = $R$0($EXPECT($R14, fail, "HexLiteral /0[xX][0-9a-fA-F](?:[0-9a-fA-F]|_[0-9a-fA-F])*n?/"));
4111
4384
  function HexLiteral(state) {
4112
4385
  if (state.verbose)
4113
4386
  console.log("ENTER:", "HexLiteral");
@@ -4156,7 +4429,7 @@ var Civet = (() => {
4156
4429
  return BasicStringLiteral$0(state) || BasicStringLiteral$1(state);
4157
4430
  }
4158
4431
  }
4159
- var DoubleStringCharacters$0 = $TR($EXPECT($R13, fail, 'DoubleStringCharacters /(?:\\\\.|[^"])*/'), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
4432
+ var DoubleStringCharacters$0 = $TR($EXPECT($R15, fail, 'DoubleStringCharacters /(?:\\\\.|[^"])*/'), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
4160
4433
  return { $loc, token: $0 };
4161
4434
  });
4162
4435
  function DoubleStringCharacters(state) {
@@ -4168,7 +4441,7 @@ var Civet = (() => {
4168
4441
  return DoubleStringCharacters$0(state);
4169
4442
  }
4170
4443
  }
4171
- var SingleStringCharacters$0 = $TR($EXPECT($R14, fail, "SingleStringCharacters /(?:\\\\.|[^'])*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
4444
+ var SingleStringCharacters$0 = $TR($EXPECT($R16, fail, "SingleStringCharacters /(?:\\\\.|[^'])*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
4172
4445
  return { $loc, token: $0 };
4173
4446
  });
4174
4447
  function SingleStringCharacters(state) {
@@ -4180,7 +4453,7 @@ var Civet = (() => {
4180
4453
  return SingleStringCharacters$0(state);
4181
4454
  }
4182
4455
  }
4183
- var TripleDoubleStringCharacters$0 = $TR($EXPECT($R15, fail, 'TripleDoubleStringCharacters /(?:"(?!"")|#(?!\\{)|\\\\.|[^#"])+/'), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
4456
+ var TripleDoubleStringCharacters$0 = $TR($EXPECT($R17, fail, 'TripleDoubleStringCharacters /(?:"(?!"")|#(?!\\{)|\\\\.|[^#"])+/'), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
4184
4457
  return { $loc, token: $0 };
4185
4458
  });
4186
4459
  function TripleDoubleStringCharacters(state) {
@@ -4192,7 +4465,7 @@ var Civet = (() => {
4192
4465
  return TripleDoubleStringCharacters$0(state);
4193
4466
  }
4194
4467
  }
4195
- var TripleSingleStringCharacters$0 = $TR($EXPECT($R16, fail, "TripleSingleStringCharacters /(?:'(?!'')|\\\\.|[^'])*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
4468
+ var TripleSingleStringCharacters$0 = $TR($EXPECT($R18, fail, "TripleSingleStringCharacters /(?:'(?!'')|\\\\.|[^'])*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
4196
4469
  return { $loc, token: $0 };
4197
4470
  });
4198
4471
  function TripleSingleStringCharacters(state) {
@@ -4243,7 +4516,7 @@ var Civet = (() => {
4243
4516
  return CoffeeInterpolatedDoubleQuotedString$0(state);
4244
4517
  }
4245
4518
  }
4246
- var CoffeeDoubleQuotedStringCharacters$0 = $TR($EXPECT($R17, fail, 'CoffeeDoubleQuotedStringCharacters /(?:\\\\.|#(?!\\{)|[^"#])+/'), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
4519
+ var CoffeeDoubleQuotedStringCharacters$0 = $TR($EXPECT($R19, fail, 'CoffeeDoubleQuotedStringCharacters /(?:\\\\.|#(?!\\{)|[^"#])+/'), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
4247
4520
  return { $loc, token: $0 };
4248
4521
  });
4249
4522
  function CoffeeDoubleQuotedStringCharacters(state) {
@@ -4267,7 +4540,7 @@ var Civet = (() => {
4267
4540
  return RegularExpressionLiteral$0(state);
4268
4541
  }
4269
4542
  }
4270
- var RegularExpressionBody$0 = $S($N($R$0($EXPECT($R18, fail, "RegularExpressionBody /[*\\/\\r\\n]/"))), $Q(RegExpCharacter));
4543
+ var RegularExpressionBody$0 = $S($N($R$0($EXPECT($R20, fail, "RegularExpressionBody /[*\\/\\r\\n]/"))), $Q(RegExpCharacter));
4271
4544
  function RegularExpressionBody(state) {
4272
4545
  if (state.verbose)
4273
4546
  console.log("ENTER:", "RegularExpressionBody");
@@ -4277,7 +4550,7 @@ var Civet = (() => {
4277
4550
  return RegularExpressionBody$0(state);
4278
4551
  }
4279
4552
  }
4280
- var RegExpCharacter$0 = $R$0($EXPECT($R19, fail, "RegExpCharacter /(?:\\\\.|[^\\/\\r\\n])+/"));
4553
+ var RegExpCharacter$0 = $R$0($EXPECT($R21, fail, "RegExpCharacter /(?:\\\\.|[^\\/\\r\\n])+/"));
4281
4554
  function RegExpCharacter(state) {
4282
4555
  if (state.verbose)
4283
4556
  console.log("ENTER:", "RegExpCharacter");
@@ -4287,7 +4560,7 @@ var Civet = (() => {
4287
4560
  return RegExpCharacter$0(state);
4288
4561
  }
4289
4562
  }
4290
- var RegularExpressionFlags$0 = $R$0($EXPECT($R20, fail, "RegularExpressionFlags /(?:\\p{ID_Continue}|[\\u200C\\u200D$])*/"));
4563
+ var RegularExpressionFlags$0 = $R$0($EXPECT($R22, fail, "RegularExpressionFlags /(?:\\p{ID_Continue}|[\\u200C\\u200D$])*/"));
4291
4564
  function RegularExpressionFlags(state) {
4292
4565
  if (state.verbose)
4293
4566
  console.log("ENTER:", "RegularExpressionFlags");
@@ -4318,7 +4591,7 @@ var Civet = (() => {
4318
4591
  return TemplateSubstitution$0(state);
4319
4592
  }
4320
4593
  }
4321
- var TemplateCharacters$0 = $TR($EXPECT($R21, fail, "TemplateCharacters /(?:\\$(?!\\{)|\\\\.|[^$`])+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
4594
+ var TemplateCharacters$0 = $TR($EXPECT($R23, fail, "TemplateCharacters /(?:\\$(?!\\{)|\\\\.|[^$`])+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
4322
4595
  return { $loc, token: $0 };
4323
4596
  });
4324
4597
  function TemplateCharacters(state) {
@@ -4330,7 +4603,7 @@ var Civet = (() => {
4330
4603
  return TemplateCharacters$0(state);
4331
4604
  }
4332
4605
  }
4333
- var TemplateBlockCharacters$0 = $TR($EXPECT($R22, fail, "TemplateBlockCharacters /(?:\\$(?!\\{)|`(?!``)|\\\\.|[^$`])+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
4606
+ var TemplateBlockCharacters$0 = $TR($EXPECT($R24, fail, "TemplateBlockCharacters /(?:\\$(?!\\{)|`(?!``)|\\\\.|[^$`])+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
4334
4607
  return { $loc, token: $0 };
4335
4608
  });
4336
4609
  function TemplateBlockCharacters(state) {
@@ -4342,9 +4615,9 @@ var Civet = (() => {
4342
4615
  return TemplateBlockCharacters$0(state);
4343
4616
  }
4344
4617
  }
4345
- var ReservedWord$0 = $S(CoffeeBooleansEnabled, $R$0($EXPECT($R23, fail, "ReservedWord /(?:on|off|yes|no)(?!\\p{ID_Continue})/")));
4346
- var ReservedWord$1 = $S(CoffeeIsntEnabled, $R$0($EXPECT($R24, fail, "ReservedWord /(?:isnt)(?!\\p{ID_Continue})/")));
4347
- var ReservedWord$2 = $R$0($EXPECT($R25, 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|loop|new|null|or|return|static|super|switch|this|throw|true|try|typeof|unless|until|var|void|while|with|yield)(?!\\p{ID_Continue})/"));
4618
+ var ReservedWord$0 = $S(CoffeeBooleansEnabled, $R$0($EXPECT($R25, fail, "ReservedWord /(?:on|off|yes|no)(?!\\p{ID_Continue})/")));
4619
+ var ReservedWord$1 = $S(CoffeeIsntEnabled, $R$0($EXPECT($R26, fail, "ReservedWord /(?:isnt)(?!\\p{ID_Continue})/")));
4620
+ var ReservedWord$2 = $R$0($EXPECT($R27, 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|loop|new|null|or|return|static|super|switch|this|throw|true|try|typeof|unless|until|var|void|while|with|yield)(?!\\p{ID_Continue})/"));
4348
4621
  function ReservedWord(state) {
4349
4622
  if (state.tokenize) {
4350
4623
  return $TOKEN("ReservedWord", state, ReservedWord$0(state) || ReservedWord$1(state) || ReservedWord$2(state));
@@ -4361,7 +4634,7 @@ var Civet = (() => {
4361
4634
  return Comment$0(state) || Comment$1(state);
4362
4635
  }
4363
4636
  }
4364
- var SingleLineComment$0 = $TR($EXPECT($R26, fail, "SingleLineComment /\\/\\/[^\\r\\n]*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
4637
+ var SingleLineComment$0 = $TR($EXPECT($R28, fail, "SingleLineComment /\\/\\/[^\\r\\n]*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
4365
4638
  return { $loc, token: $0 };
4366
4639
  });
4367
4640
  var SingleLineComment$1 = $S(CoffeeCommentEnabled, CoffeeSingleLineComment);
@@ -4381,7 +4654,7 @@ var Civet = (() => {
4381
4654
  return MultiLineComment$0(state) || MultiLineComment$1(state);
4382
4655
  }
4383
4656
  }
4384
- 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) {
4657
+ var JSMultiLineComment$0 = $TV($TEXT($S($EXPECT($L83, fail, 'JSMultiLineComment "/*"'), $Q($S($N($EXPECT($L84, fail, 'JSMultiLineComment "*/"')), $EXPECT($R29, fail, "JSMultiLineComment /./"))), $EXPECT($L84, fail, 'JSMultiLineComment "*/"'))), function($skip, $loc, $0, $1) {
4385
4658
  return { $loc, token: $1 };
4386
4659
  });
4387
4660
  function JSMultiLineComment(state) {
@@ -4393,7 +4666,7 @@ var Civet = (() => {
4393
4666
  return JSMultiLineComment$0(state);
4394
4667
  }
4395
4668
  }
4396
- var CoffeeSingleLineComment$0 = $TR($EXPECT($R28, fail, "CoffeeSingleLineComment /#([^\\r\\n]*)/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
4669
+ var CoffeeSingleLineComment$0 = $TR($EXPECT($R30, fail, "CoffeeSingleLineComment /#(?!##)([^\\r\\n]*)/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
4397
4670
  return { $loc, token: `//${$1}` };
4398
4671
  });
4399
4672
  function CoffeeSingleLineComment(state) {
@@ -4405,7 +4678,7 @@ var Civet = (() => {
4405
4678
  return CoffeeSingleLineComment$0(state);
4406
4679
  }
4407
4680
  }
4408
- 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) {
4681
+ var CoffeeMultiLineComment$0 = $TS($S($EXPECT($L85, fail, 'CoffeeMultiLineComment "###"'), $TEXT($Q($S($N($C($EXPECT($L85, fail, 'CoffeeMultiLineComment "###"'), $EXPECT($L84, fail, 'CoffeeMultiLineComment "*/"'))), $EXPECT($R29, fail, "CoffeeMultiLineComment /./")))), $EXPECT($L85, fail, 'CoffeeMultiLineComment "###"')), function($skip, $loc, $0, $1, $2, $3) {
4409
4682
  return { $loc, token: `/*${$2}*/` };
4410
4683
  });
4411
4684
  function CoffeeMultiLineComment(state) {
@@ -4417,7 +4690,7 @@ var Civet = (() => {
4417
4690
  return CoffeeMultiLineComment$0(state);
4418
4691
  }
4419
4692
  }
4420
- 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) {
4693
+ var InlineComment$0 = $TV($TEXT($S($EXPECT($L83, fail, 'InlineComment "/*"'), $TEXT($Q($S($N($EXPECT($L84, fail, 'InlineComment "*/"')), $EXPECT($R31, fail, "InlineComment /[^\\r\\n]/")))), $EXPECT($L84, fail, 'InlineComment "*/"'))), function($skip, $loc, $0, $1) {
4421
4694
  return { $loc, token: $1 };
4422
4695
  });
4423
4696
  function InlineComment(state) {
@@ -4459,7 +4732,7 @@ var Civet = (() => {
4459
4732
  return _$0(state);
4460
4733
  }
4461
4734
  }
4462
- var NonNewlineWhitespace$0 = $TR($EXPECT($R30, fail, "NonNewlineWhitespace /[ \\t]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
4735
+ var NonNewlineWhitespace$0 = $TR($EXPECT($R32, fail, "NonNewlineWhitespace /[ \\t]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
4463
4736
  return { $loc, token: $0 };
4464
4737
  });
4465
4738
  function NonNewlineWhitespace(state) {
@@ -4481,7 +4754,7 @@ var Civet = (() => {
4481
4754
  return __$0(state);
4482
4755
  }
4483
4756
  }
4484
- var Whitespace$0 = $TR($EXPECT($R31, fail, "Whitespace /[\\s]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
4757
+ var Whitespace$0 = $TR($EXPECT($R33, fail, "Whitespace /[\\s]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
4485
4758
  return { $loc, token: $0 };
4486
4759
  });
4487
4760
  function Whitespace(state) {
@@ -4516,7 +4789,7 @@ var Civet = (() => {
4516
4789
  return StatementDelimiter$0(state) || StatementDelimiter$1(state);
4517
4790
  }
4518
4791
  }
4519
- var NonIdContinue$0 = $R$0($EXPECT($R32, fail, "NonIdContinue /(?!\\p{ID_Continue})/"));
4792
+ var NonIdContinue$0 = $R$0($EXPECT($R34, fail, "NonIdContinue /(?!\\p{ID_Continue})/"));
4520
4793
  function NonIdContinue(state) {
4521
4794
  if (state.verbose)
4522
4795
  console.log("ENTER:", "NonIdContinue");
@@ -4538,7 +4811,19 @@ var Civet = (() => {
4538
4811
  return Loc$0(state);
4539
4812
  }
4540
4813
  }
4541
- var As$0 = $TS($S($EXPECT($L84, fail, 'As "as"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4814
+ var Ampersand$0 = $TV($EXPECT($L71, fail, 'Ampersand "&"'), function($skip, $loc, $0, $1) {
4815
+ return { $loc, token: $1 };
4816
+ });
4817
+ function Ampersand(state) {
4818
+ if (state.verbose)
4819
+ console.log("ENTER:", "Ampersand");
4820
+ if (state.tokenize) {
4821
+ return $TOKEN("Ampersand", state, Ampersand$0(state));
4822
+ } else {
4823
+ return Ampersand$0(state);
4824
+ }
4825
+ }
4826
+ var As$0 = $TS($S($EXPECT($L86, fail, 'As "as"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4542
4827
  return { $loc, token: $1 };
4543
4828
  });
4544
4829
  function As(state) {
@@ -4550,7 +4835,7 @@ var Civet = (() => {
4550
4835
  return As$0(state);
4551
4836
  }
4552
4837
  }
4553
- var Async$0 = $TV($EXPECT($L85, fail, 'Async "async"'), function($skip, $loc, $0, $1) {
4838
+ var Async$0 = $TV($EXPECT($L87, fail, 'Async "async"'), function($skip, $loc, $0, $1) {
4554
4839
  return { $loc, token: $1 };
4555
4840
  });
4556
4841
  function Async(state) {
@@ -4562,7 +4847,7 @@ var Civet = (() => {
4562
4847
  return Async$0(state);
4563
4848
  }
4564
4849
  }
4565
- var Await$0 = $TS($S($EXPECT($L86, fail, 'Await "await"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4850
+ var Await$0 = $TS($S($EXPECT($L88, fail, 'Await "await"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4566
4851
  return { $loc, token: $1 };
4567
4852
  });
4568
4853
  function Await(state) {
@@ -4574,7 +4859,7 @@ var Civet = (() => {
4574
4859
  return Await$0(state);
4575
4860
  }
4576
4861
  }
4577
- var Backtick$0 = $TV($EXPECT($L87, fail, 'Backtick "`"'), function($skip, $loc, $0, $1) {
4862
+ var Backtick$0 = $TV($EXPECT($L89, fail, 'Backtick "`"'), function($skip, $loc, $0, $1) {
4578
4863
  return { $loc, token: $1 };
4579
4864
  });
4580
4865
  function Backtick(state) {
@@ -4586,7 +4871,7 @@ var Civet = (() => {
4586
4871
  return Backtick$0(state);
4587
4872
  }
4588
4873
  }
4589
- var Case$0 = $TS($S($EXPECT($L88, fail, 'Case "case"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4874
+ var Case$0 = $TS($S($EXPECT($L90, fail, 'Case "case"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4590
4875
  return { $loc, token: $1 };
4591
4876
  });
4592
4877
  function Case(state) {
@@ -4598,7 +4883,7 @@ var Civet = (() => {
4598
4883
  return Case$0(state);
4599
4884
  }
4600
4885
  }
4601
- var Catch$0 = $TV($EXPECT($L89, fail, 'Catch "catch"'), function($skip, $loc, $0, $1) {
4886
+ var Catch$0 = $TV($EXPECT($L91, fail, 'Catch "catch"'), function($skip, $loc, $0, $1) {
4602
4887
  return { $loc, token: $1 };
4603
4888
  });
4604
4889
  function Catch(state) {
@@ -4610,7 +4895,7 @@ var Civet = (() => {
4610
4895
  return Catch$0(state);
4611
4896
  }
4612
4897
  }
4613
- var Class$0 = $TV($EXPECT($L90, fail, 'Class "class"'), function($skip, $loc, $0, $1) {
4898
+ var Class$0 = $TV($EXPECT($L92, fail, 'Class "class"'), function($skip, $loc, $0, $1) {
4614
4899
  return { $loc, token: $1 };
4615
4900
  });
4616
4901
  function Class(state) {
@@ -4658,7 +4943,7 @@ var Civet = (() => {
4658
4943
  return CloseParen$0(state);
4659
4944
  }
4660
4945
  }
4661
- var CoffeeSubstitutionStart$0 = $TV($EXPECT($L91, fail, 'CoffeeSubstitutionStart "#{"'), function($skip, $loc, $0, $1) {
4946
+ var CoffeeSubstitutionStart$0 = $TV($EXPECT($L93, fail, 'CoffeeSubstitutionStart "#{"'), function($skip, $loc, $0, $1) {
4662
4947
  return { $loc, token: "${" };
4663
4948
  });
4664
4949
  function CoffeeSubstitutionStart(state) {
@@ -4670,7 +4955,7 @@ var Civet = (() => {
4670
4955
  return CoffeeSubstitutionStart$0(state);
4671
4956
  }
4672
4957
  }
4673
- var Colon$0 = $TV($EXPECT($L92, fail, 'Colon ":"'), function($skip, $loc, $0, $1) {
4958
+ var Colon$0 = $TV($EXPECT($L94, fail, 'Colon ":"'), function($skip, $loc, $0, $1) {
4674
4959
  return { $loc, token: $1 };
4675
4960
  });
4676
4961
  function Colon(state) {
@@ -4694,7 +4979,7 @@ var Civet = (() => {
4694
4979
  return ConstructorShorthand$0(state);
4695
4980
  }
4696
4981
  }
4697
- var Default$0 = $TS($S($EXPECT($L79, fail, 'Default "default"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4982
+ var Default$0 = $TS($S($EXPECT($L81, fail, 'Default "default"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4698
4983
  return { $loc, token: $1 };
4699
4984
  });
4700
4985
  function Default(state) {
@@ -4706,7 +4991,7 @@ var Civet = (() => {
4706
4991
  return Default$0(state);
4707
4992
  }
4708
4993
  }
4709
- var Delete$0 = $TS($S($EXPECT($L93, fail, 'Delete "delete"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4994
+ var Delete$0 = $TS($S($EXPECT($L95, fail, 'Delete "delete"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4710
4995
  return { $loc, token: $1 };
4711
4996
  });
4712
4997
  function Delete(state) {
@@ -4718,7 +5003,7 @@ var Civet = (() => {
4718
5003
  return Delete$0(state);
4719
5004
  }
4720
5005
  }
4721
- var Do$0 = $TS($S($EXPECT($L94, fail, 'Do "do"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5006
+ var Do$0 = $TS($S($EXPECT($L96, fail, 'Do "do"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4722
5007
  return { $loc, token: $1 };
4723
5008
  });
4724
5009
  function Do(state) {
@@ -4742,7 +5027,7 @@ var Civet = (() => {
4742
5027
  return Dot$0(state);
4743
5028
  }
4744
5029
  }
4745
- var DotDot$0 = $TV($EXPECT($L95, fail, 'DotDot ".."'), function($skip, $loc, $0, $1) {
5030
+ var DotDot$0 = $TV($EXPECT($L97, fail, 'DotDot ".."'), function($skip, $loc, $0, $1) {
4746
5031
  return { $loc, token: $1 };
4747
5032
  });
4748
5033
  function DotDot(state) {
@@ -4754,7 +5039,7 @@ var Civet = (() => {
4754
5039
  return DotDot$0(state);
4755
5040
  }
4756
5041
  }
4757
- var DotDotDot$0 = $TV($EXPECT($L96, fail, 'DotDotDot "..."'), function($skip, $loc, $0, $1) {
5042
+ var DotDotDot$0 = $TV($EXPECT($L98, fail, 'DotDotDot "..."'), function($skip, $loc, $0, $1) {
4758
5043
  return { $loc, token: $1 };
4759
5044
  });
4760
5045
  function DotDotDot(state) {
@@ -4766,7 +5051,7 @@ var Civet = (() => {
4766
5051
  return DotDotDot$0(state);
4767
5052
  }
4768
5053
  }
4769
- var DoubleQuote$0 = $TV($EXPECT($L97, fail, 'DoubleQuote "\\\\\\""'), function($skip, $loc, $0, $1) {
5054
+ var DoubleQuote$0 = $TV($EXPECT($L99, fail, 'DoubleQuote "\\\\\\""'), function($skip, $loc, $0, $1) {
4770
5055
  return { $loc, token: $1 };
4771
5056
  });
4772
5057
  function DoubleQuote(state) {
@@ -4778,7 +5063,7 @@ var Civet = (() => {
4778
5063
  return DoubleQuote$0(state);
4779
5064
  }
4780
5065
  }
4781
- var Else$0 = $TV($EXPECT($L98, fail, 'Else "else"'), function($skip, $loc, $0, $1) {
5066
+ var Else$0 = $TV($EXPECT($L100, fail, 'Else "else"'), function($skip, $loc, $0, $1) {
4782
5067
  return { $loc, token: $1 };
4783
5068
  });
4784
5069
  function Else(state) {
@@ -4802,7 +5087,7 @@ var Civet = (() => {
4802
5087
  return Equals$0(state);
4803
5088
  }
4804
5089
  }
4805
- var Export$0 = $TS($S($EXPECT($L99, fail, 'Export "export"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5090
+ var Export$0 = $TS($S($EXPECT($L101, fail, 'Export "export"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4806
5091
  return { $loc, token: $1 };
4807
5092
  });
4808
5093
  function Export(state) {
@@ -4814,7 +5099,7 @@ var Civet = (() => {
4814
5099
  return Export$0(state);
4815
5100
  }
4816
5101
  }
4817
- var For$0 = $TS($S($EXPECT($L100, fail, 'For "for"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5102
+ var For$0 = $TS($S($EXPECT($L102, fail, 'For "for"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4818
5103
  return { $loc, token: $1 };
4819
5104
  });
4820
5105
  function For(state) {
@@ -4826,7 +5111,7 @@ var Civet = (() => {
4826
5111
  return For$0(state);
4827
5112
  }
4828
5113
  }
4829
- var From$0 = $TS($S($EXPECT($L101, fail, 'From "from"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5114
+ var From$0 = $TS($S($EXPECT($L103, fail, 'From "from"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4830
5115
  return { $loc, token: $1 };
4831
5116
  });
4832
5117
  function From(state) {
@@ -4838,7 +5123,7 @@ var Civet = (() => {
4838
5123
  return From$0(state);
4839
5124
  }
4840
5125
  }
4841
- var Function$0 = $TV($EXPECT($L102, fail, 'Function "function"'), function($skip, $loc, $0, $1) {
5126
+ var Function$0 = $TV($EXPECT($L104, fail, 'Function "function"'), function($skip, $loc, $0, $1) {
4842
5127
  return { $loc, token: $1 };
4843
5128
  });
4844
5129
  function Function(state) {
@@ -4850,7 +5135,7 @@ var Civet = (() => {
4850
5135
  return Function$0(state);
4851
5136
  }
4852
5137
  }
4853
- var GetOrSet$0 = $TS($S($C($EXPECT($L103, fail, 'GetOrSet "get"'), $EXPECT($L104, fail, 'GetOrSet "set"')), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5138
+ var GetOrSet$0 = $TS($S($C($EXPECT($L105, fail, 'GetOrSet "get"'), $EXPECT($L106, fail, 'GetOrSet "set"')), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4854
5139
  return { $loc, token: $1 };
4855
5140
  });
4856
5141
  function GetOrSet(state) {
@@ -4862,7 +5147,7 @@ var Civet = (() => {
4862
5147
  return GetOrSet$0(state);
4863
5148
  }
4864
5149
  }
4865
- var If$0 = $TV($TEXT($S($EXPECT($L105, fail, 'If "if"'), $E($EXPECT($L106, fail, 'If " "')))), function($skip, $loc, $0, $1) {
5150
+ var If$0 = $TV($TEXT($S($EXPECT($L107, fail, 'If "if"'), $E($EXPECT($L108, fail, 'If " "')))), function($skip, $loc, $0, $1) {
4866
5151
  return { $loc, token: $1 };
4867
5152
  });
4868
5153
  function If(state) {
@@ -4874,7 +5159,7 @@ var Civet = (() => {
4874
5159
  return If$0(state);
4875
5160
  }
4876
5161
  }
4877
- var Import$0 = $TS($S($EXPECT($L11, fail, 'Import "import"'), $Y($EXPECT($R33, fail, "Import /\\s/"))), function($skip, $loc, $0, $1, $2) {
5162
+ var Import$0 = $TS($S($EXPECT($L11, fail, 'Import "import"'), $Y($EXPECT($R35, fail, "Import /\\s/"))), function($skip, $loc, $0, $1, $2) {
4878
5163
  return { $loc, token: $1 };
4879
5164
  });
4880
5165
  function Import(state) {
@@ -4886,7 +5171,7 @@ var Civet = (() => {
4886
5171
  return Import$0(state);
4887
5172
  }
4888
5173
  }
4889
- var In$0 = $TV($EXPECT($L69, fail, 'In "in"'), function($skip, $loc, $0, $1) {
5174
+ var In$0 = $TV($EXPECT($L70, fail, 'In "in"'), function($skip, $loc, $0, $1) {
4890
5175
  return { $loc, token: $1 };
4891
5176
  });
4892
5177
  function In(state) {
@@ -4898,7 +5183,7 @@ var Civet = (() => {
4898
5183
  return In$0(state);
4899
5184
  }
4900
5185
  }
4901
- var LetOrConst$0 = $TV($C($EXPECT($L107, fail, 'LetOrConst "let"'), $EXPECT($L108, fail, 'LetOrConst "const"')), function($skip, $loc, $0, $1) {
5186
+ var LetOrConst$0 = $TV($C($EXPECT($L109, fail, 'LetOrConst "let"'), $EXPECT($L110, fail, 'LetOrConst "const"')), function($skip, $loc, $0, $1) {
4902
5187
  return { $loc, token: $1 };
4903
5188
  });
4904
5189
  function LetOrConst(state) {
@@ -4910,7 +5195,7 @@ var Civet = (() => {
4910
5195
  return LetOrConst$0(state);
4911
5196
  }
4912
5197
  }
4913
- var Loop$0 = $TS($S($EXPECT($L109, fail, 'Loop "loop"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5198
+ var Loop$0 = $TS($S($EXPECT($L111, fail, 'Loop "loop"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
4914
5199
  return { $loc, token: "while(true)" };
4915
5200
  });
4916
5201
  function Loop(state) {
@@ -4922,7 +5207,7 @@ var Civet = (() => {
4922
5207
  return Loop$0(state);
4923
5208
  }
4924
5209
  }
4925
- var New$0 = $TV($EXPECT($L110, fail, 'New "new"'), function($skip, $loc, $0, $1) {
5210
+ var New$0 = $TV($EXPECT($L112, fail, 'New "new"'), function($skip, $loc, $0, $1) {
4926
5211
  return { $loc, token: $1 };
4927
5212
  });
4928
5213
  function New(state) {
@@ -4934,7 +5219,7 @@ var Civet = (() => {
4934
5219
  return New$0(state);
4935
5220
  }
4936
5221
  }
4937
- 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) {
5222
+ 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) {
4938
5223
  return { $loc, token: "!" };
4939
5224
  });
4940
5225
  function Not(state) {
@@ -4946,7 +5231,7 @@ var Civet = (() => {
4946
5231
  return Not$0(state);
4947
5232
  }
4948
5233
  }
4949
- var Of$0 = $TV($EXPECT($L112, fail, 'Of "of"'), function($skip, $loc, $0, $1) {
5234
+ var Of$0 = $TV($EXPECT($L65, fail, 'Of "of"'), function($skip, $loc, $0, $1) {
4950
5235
  return { $loc, token: $1 };
4951
5236
  });
4952
5237
  function Of(state) {
@@ -4958,7 +5243,7 @@ var Civet = (() => {
4958
5243
  return Of$0(state);
4959
5244
  }
4960
5245
  }
4961
- var OpenBrace$0 = $TV($EXPECT($L113, fail, 'OpenBrace "{"'), function($skip, $loc, $0, $1) {
5246
+ var OpenBrace$0 = $TV($EXPECT($L114, fail, 'OpenBrace "{"'), function($skip, $loc, $0, $1) {
4962
5247
  return { $loc, token: $1 };
4963
5248
  });
4964
5249
  function OpenBrace(state) {
@@ -4970,7 +5255,7 @@ var Civet = (() => {
4970
5255
  return OpenBrace$0(state);
4971
5256
  }
4972
5257
  }
4973
- var OpenBracket$0 = $TV($EXPECT($L114, fail, 'OpenBracket "["'), function($skip, $loc, $0, $1) {
5258
+ var OpenBracket$0 = $TV($EXPECT($L115, fail, 'OpenBracket "["'), function($skip, $loc, $0, $1) {
4974
5259
  return { $loc, token: $1 };
4975
5260
  });
4976
5261
  function OpenBracket(state) {
@@ -4982,7 +5267,7 @@ var Civet = (() => {
4982
5267
  return OpenBracket$0(state);
4983
5268
  }
4984
5269
  }
4985
- var OpenParen$0 = $TV($EXPECT($L115, fail, 'OpenParen "("'), function($skip, $loc, $0, $1) {
5270
+ var OpenParen$0 = $TV($EXPECT($L116, fail, 'OpenParen "("'), function($skip, $loc, $0, $1) {
4986
5271
  return { $loc, token: $1 };
4987
5272
  });
4988
5273
  function OpenParen(state) {
@@ -4994,7 +5279,7 @@ var Civet = (() => {
4994
5279
  return OpenParen$0(state);
4995
5280
  }
4996
5281
  }
4997
- var QuestionMark$0 = $TV($EXPECT($L116, fail, 'QuestionMark "?"'), function($skip, $loc, $0, $1) {
5282
+ var QuestionMark$0 = $TV($EXPECT($L117, fail, 'QuestionMark "?"'), function($skip, $loc, $0, $1) {
4998
5283
  return { $loc, token: $1 };
4999
5284
  });
5000
5285
  function QuestionMark(state) {
@@ -5006,7 +5291,7 @@ var Civet = (() => {
5006
5291
  return QuestionMark$0(state);
5007
5292
  }
5008
5293
  }
5009
- var Return$0 = $TS($S($EXPECT($L117, fail, 'Return "return"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5294
+ var Return$0 = $TS($S($EXPECT($L118, fail, 'Return "return"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5010
5295
  return { $loc, token: $1 };
5011
5296
  });
5012
5297
  function Return(state) {
@@ -5018,7 +5303,7 @@ var Civet = (() => {
5018
5303
  return Return$0(state);
5019
5304
  }
5020
5305
  }
5021
- var Semicolon$0 = $TV($EXPECT($L73, fail, 'Semicolon ";"'), function($skip, $loc, $0, $1) {
5306
+ var Semicolon$0 = $TV($EXPECT($L74, fail, 'Semicolon ";"'), function($skip, $loc, $0, $1) {
5022
5307
  return { $loc, token: $1 };
5023
5308
  });
5024
5309
  function Semicolon(state) {
@@ -5030,7 +5315,7 @@ var Civet = (() => {
5030
5315
  return Semicolon$0(state);
5031
5316
  }
5032
5317
  }
5033
- var SingleQuote$0 = $TV($EXPECT($L118, fail, `SingleQuote "'"`), function($skip, $loc, $0, $1) {
5318
+ var SingleQuote$0 = $TV($EXPECT($L119, fail, `SingleQuote "'"`), function($skip, $loc, $0, $1) {
5034
5319
  return { $loc, token: $1 };
5035
5320
  });
5036
5321
  function SingleQuote(state) {
@@ -5054,10 +5339,10 @@ var Civet = (() => {
5054
5339
  return Star$0(state);
5055
5340
  }
5056
5341
  }
5057
- var Static$0 = $TV($EXPECT($L119, fail, 'Static "static"'), function($skip, $loc, $0, $1) {
5342
+ var Static$0 = $TV($EXPECT($L120, fail, 'Static "static"'), function($skip, $loc, $0, $1) {
5058
5343
  return { $loc, token: $1 };
5059
5344
  });
5060
- var Static$1 = $TS($S($EXPECT($L8, fail, 'Static "@"'), $N($EXPECT($L115, fail, 'Static "("'))), function($skip, $loc, $0, $1, $2) {
5345
+ var Static$1 = $TS($S($EXPECT($L8, fail, 'Static "@"'), $N($EXPECT($L116, fail, 'Static "("'))), function($skip, $loc, $0, $1, $2) {
5061
5346
  return { $loc, token: "static " };
5062
5347
  });
5063
5348
  function Static(state) {
@@ -5067,7 +5352,7 @@ var Civet = (() => {
5067
5352
  return Static$0(state) || Static$1(state);
5068
5353
  }
5069
5354
  }
5070
- var SubstitutionStart$0 = $TV($EXPECT($L120, fail, 'SubstitutionStart "${"'), function($skip, $loc, $0, $1) {
5355
+ var SubstitutionStart$0 = $TV($EXPECT($L121, fail, 'SubstitutionStart "${"'), function($skip, $loc, $0, $1) {
5071
5356
  return { $loc, token: $1 };
5072
5357
  });
5073
5358
  function SubstitutionStart(state) {
@@ -5079,7 +5364,7 @@ var Civet = (() => {
5079
5364
  return SubstitutionStart$0(state);
5080
5365
  }
5081
5366
  }
5082
- var Switch$0 = $TS($S($EXPECT($L121, fail, 'Switch "switch"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5367
+ var Switch$0 = $TS($S($EXPECT($L122, fail, 'Switch "switch"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5083
5368
  return { $loc, token: $1 };
5084
5369
  });
5085
5370
  function Switch(state) {
@@ -5091,7 +5376,7 @@ var Civet = (() => {
5091
5376
  return Switch$0(state);
5092
5377
  }
5093
5378
  }
5094
- var Target$0 = $TV($EXPECT($L122, fail, 'Target "target"'), function($skip, $loc, $0, $1) {
5379
+ var Target$0 = $TV($EXPECT($L123, fail, 'Target "target"'), function($skip, $loc, $0, $1) {
5095
5380
  return { $loc, token: $1 };
5096
5381
  });
5097
5382
  function Target(state) {
@@ -5103,7 +5388,7 @@ var Civet = (() => {
5103
5388
  return Target$0(state);
5104
5389
  }
5105
5390
  }
5106
- var Then$0 = $TS($S(__, $EXPECT($L123, fail, 'Then "then"'), NonIdContinue), function($skip, $loc, $0, $1, $2, $3) {
5391
+ var Then$0 = $TS($S(__, $EXPECT($L124, fail, 'Then "then"'), NonIdContinue), function($skip, $loc, $0, $1, $2, $3) {
5107
5392
  return { $loc, token: "" };
5108
5393
  });
5109
5394
  function Then(state) {
@@ -5115,7 +5400,7 @@ var Civet = (() => {
5115
5400
  return Then$0(state);
5116
5401
  }
5117
5402
  }
5118
- var Throw$0 = $TS($S($EXPECT($L124, fail, 'Throw "throw"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5403
+ var Throw$0 = $TS($S($EXPECT($L125, fail, 'Throw "throw"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5119
5404
  return { $loc, token: $1 };
5120
5405
  });
5121
5406
  function Throw(state) {
@@ -5127,7 +5412,7 @@ var Civet = (() => {
5127
5412
  return Throw$0(state);
5128
5413
  }
5129
5414
  }
5130
- var TripleDoubleQuote$0 = $TV($EXPECT($L125, fail, 'TripleDoubleQuote "\\\\\\"\\\\\\"\\\\\\""'), function($skip, $loc, $0, $1) {
5415
+ var TripleDoubleQuote$0 = $TV($EXPECT($L126, fail, 'TripleDoubleQuote "\\\\\\"\\\\\\"\\\\\\""'), function($skip, $loc, $0, $1) {
5131
5416
  return { $loc, token: "`" };
5132
5417
  });
5133
5418
  function TripleDoubleQuote(state) {
@@ -5139,7 +5424,7 @@ var Civet = (() => {
5139
5424
  return TripleDoubleQuote$0(state);
5140
5425
  }
5141
5426
  }
5142
- var TripleSingleQuote$0 = $TV($EXPECT($L126, fail, `TripleSingleQuote "'''"`), function($skip, $loc, $0, $1) {
5427
+ var TripleSingleQuote$0 = $TV($EXPECT($L127, fail, `TripleSingleQuote "'''"`), function($skip, $loc, $0, $1) {
5143
5428
  return { $loc, token: "`" };
5144
5429
  });
5145
5430
  function TripleSingleQuote(state) {
@@ -5151,7 +5436,7 @@ var Civet = (() => {
5151
5436
  return TripleSingleQuote$0(state);
5152
5437
  }
5153
5438
  }
5154
- var TripleTick$0 = $TV($EXPECT($L127, fail, 'TripleTick "```"'), function($skip, $loc, $0, $1) {
5439
+ var TripleTick$0 = $TV($EXPECT($L128, fail, 'TripleTick "```"'), function($skip, $loc, $0, $1) {
5155
5440
  return { $loc, token: "`" };
5156
5441
  });
5157
5442
  function TripleTick(state) {
@@ -5163,7 +5448,7 @@ var Civet = (() => {
5163
5448
  return TripleTick$0(state);
5164
5449
  }
5165
5450
  }
5166
- var Try$0 = $TV($EXPECT($L128, fail, 'Try "try"'), function($skip, $loc, $0, $1) {
5451
+ var Try$0 = $TV($EXPECT($L129, fail, 'Try "try"'), function($skip, $loc, $0, $1) {
5167
5452
  return { $loc, token: $1 };
5168
5453
  });
5169
5454
  function Try(state) {
@@ -5175,7 +5460,7 @@ var Civet = (() => {
5175
5460
  return Try$0(state);
5176
5461
  }
5177
5462
  }
5178
- var Typeof$0 = $TS($S($EXPECT($L129, fail, 'Typeof "typeof"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5463
+ var Typeof$0 = $TS($S($EXPECT($L130, fail, 'Typeof "typeof"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5179
5464
  return { $loc, token: $1 };
5180
5465
  });
5181
5466
  function Typeof(state) {
@@ -5187,7 +5472,7 @@ var Civet = (() => {
5187
5472
  return Typeof$0(state);
5188
5473
  }
5189
5474
  }
5190
- var Unless$0 = $TV($EXPECT($L130, fail, 'Unless "unless"'), function($skip, $loc, $0, $1) {
5475
+ var Unless$0 = $TV($EXPECT($L131, fail, 'Unless "unless"'), function($skip, $loc, $0, $1) {
5191
5476
  return { $loc, token: $1 };
5192
5477
  });
5193
5478
  function Unless(state) {
@@ -5199,7 +5484,7 @@ var Civet = (() => {
5199
5484
  return Unless$0(state);
5200
5485
  }
5201
5486
  }
5202
- var Until$0 = $TS($S($EXPECT($L131, fail, 'Until "until"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5487
+ var Until$0 = $TS($S($EXPECT($L132, fail, 'Until "until"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5203
5488
  return { $loc, token: $1 };
5204
5489
  });
5205
5490
  function Until(state) {
@@ -5211,7 +5496,7 @@ var Civet = (() => {
5211
5496
  return Until$0(state);
5212
5497
  }
5213
5498
  }
5214
- var Var$0 = $TV($EXPECT($L132, fail, 'Var "var"'), function($skip, $loc, $0, $1) {
5499
+ var Var$0 = $TV($EXPECT($L133, fail, 'Var "var"'), function($skip, $loc, $0, $1) {
5215
5500
  return { $loc, token: $1 };
5216
5501
  });
5217
5502
  function Var(state) {
@@ -5223,7 +5508,7 @@ var Civet = (() => {
5223
5508
  return Var$0(state);
5224
5509
  }
5225
5510
  }
5226
- var Void$0 = $TS($S($EXPECT($L133, fail, 'Void "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5511
+ var Void$0 = $TS($S($EXPECT($L134, fail, 'Void "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5227
5512
  return { $loc, token: $1 };
5228
5513
  });
5229
5514
  function Void(state) {
@@ -5235,7 +5520,7 @@ var Civet = (() => {
5235
5520
  return Void$0(state);
5236
5521
  }
5237
5522
  }
5238
- var When$0 = $TS($S($EXPECT($L134, fail, 'When "when"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5523
+ var When$0 = $TS($S($EXPECT($L135, fail, 'When "when"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5239
5524
  return { $loc, token: "case" };
5240
5525
  });
5241
5526
  function When(state) {
@@ -5247,7 +5532,7 @@ var Civet = (() => {
5247
5532
  return When$0(state);
5248
5533
  }
5249
5534
  }
5250
- var While$0 = $TS($S($EXPECT($L135, fail, 'While "while"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5535
+ var While$0 = $TS($S($EXPECT($L136, fail, 'While "while"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5251
5536
  return { $loc, token: $1 };
5252
5537
  });
5253
5538
  function While(state) {
@@ -5259,7 +5544,7 @@ var Civet = (() => {
5259
5544
  return While$0(state);
5260
5545
  }
5261
5546
  }
5262
- var Yield$0 = $TS($S($EXPECT($L136, fail, 'Yield "yield"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5547
+ var Yield$0 = $TS($S($EXPECT($L137, fail, 'Yield "yield"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
5263
5548
  return { $loc, token: $1 };
5264
5549
  });
5265
5550
  function Yield(state) {
@@ -5285,7 +5570,7 @@ var Civet = (() => {
5285
5570
  return JSXElement$0(state) || JSXElement$1(state);
5286
5571
  }
5287
5572
  }
5288
- var JSXSelfClosingElement$0 = $S($EXPECT($L4, fail, 'JSXSelfClosingElement "<"'), $TEXT(JSXElementName), $E(JSXAttributes), __, $EXPECT($L137, fail, 'JSXSelfClosingElement "/>"'));
5573
+ var JSXSelfClosingElement$0 = $S($EXPECT($L4, fail, 'JSXSelfClosingElement "<"'), $TEXT(JSXElementName), $E(JSXAttributes), __, $EXPECT($L138, fail, 'JSXSelfClosingElement "/>"'));
5289
5574
  function JSXSelfClosingElement(state) {
5290
5575
  if (state.verbose)
5291
5576
  console.log("ENTER:", "JSXSelfClosingElement");
@@ -5305,7 +5590,7 @@ var Civet = (() => {
5305
5590
  return JSXOpeningElement$0(state);
5306
5591
  }
5307
5592
  }
5308
- var JSXClosingElement$0 = $S($EXPECT($L138, fail, 'JSXClosingElement "</"'), __, $TEXT(JSXElementName), __, $EXPECT($L56, fail, 'JSXClosingElement ">"'));
5593
+ var JSXClosingElement$0 = $S($EXPECT($L139, fail, 'JSXClosingElement "</"'), __, $TEXT(JSXElementName), __, $EXPECT($L56, fail, 'JSXClosingElement ">"'));
5309
5594
  function JSXClosingElement(state) {
5310
5595
  if (state.verbose)
5311
5596
  console.log("ENTER:", "JSXClosingElement");
@@ -5315,7 +5600,7 @@ var Civet = (() => {
5315
5600
  return JSXClosingElement$0(state);
5316
5601
  }
5317
5602
  }
5318
- var JSXFragment$0 = $S($EXPECT($L139, fail, 'JSXFragment "<>"'), $E(JSXChildren), $EXPECT($L140, fail, 'JSXFragment "</>"'));
5603
+ var JSXFragment$0 = $S($EXPECT($L140, fail, 'JSXFragment "<>"'), $E(JSXChildren), $EXPECT($L141, fail, 'JSXFragment "</>"'));
5319
5604
  function JSXFragment(state) {
5320
5605
  if (state.verbose)
5321
5606
  console.log("ENTER:", "JSXFragment");
@@ -5335,7 +5620,7 @@ var Civet = (() => {
5335
5620
  return JSXElementName$0(state);
5336
5621
  }
5337
5622
  }
5338
- var JSXIdentifierName$0 = $R$0($EXPECT($R34, fail, "JSXIdentifierName /(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*/"));
5623
+ var JSXIdentifierName$0 = $R$0($EXPECT($R36, fail, "JSXIdentifierName /(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*/"));
5339
5624
  function JSXIdentifierName(state) {
5340
5625
  if (state.verbose)
5341
5626
  console.log("ENTER:", "JSXIdentifierName");
@@ -5384,8 +5669,8 @@ var Civet = (() => {
5384
5669
  return JSXAttributeInitializer$0(state);
5385
5670
  }
5386
5671
  }
5387
- var JSXAttributeValue$0 = $R$0($EXPECT($R35, fail, 'JSXAttributeValue /"[^"]*"/'));
5388
- var JSXAttributeValue$1 = $R$0($EXPECT($R36, fail, "JSXAttributeValue /'[^']*'/"));
5672
+ var JSXAttributeValue$0 = $R$0($EXPECT($R37, fail, 'JSXAttributeValue /"[^"]*"/'));
5673
+ var JSXAttributeValue$1 = $R$0($EXPECT($R38, fail, "JSXAttributeValue /'[^']*'/"));
5389
5674
  var JSXAttributeValue$2 = $S(OpenBrace, ExtendedExpression, __, CloseBrace);
5390
5675
  var JSXAttributeValue$3 = JSXElement;
5391
5676
  var JSXAttributeValue$4 = JSXFragment;
@@ -5417,7 +5702,7 @@ var Civet = (() => {
5417
5702
  return JSXChild$0(state) || JSXChild$1(state) || JSXChild$2(state) || JSXChild$3(state);
5418
5703
  }
5419
5704
  }
5420
- var JSXText$0 = $R$0($EXPECT($R37, fail, "JSXText /[^{}<>]+/"));
5705
+ var JSXText$0 = $R$0($EXPECT($R39, fail, "JSXText /[^{}<>]+/"));
5421
5706
  function JSXText(state) {
5422
5707
  if (state.verbose)
5423
5708
  console.log("ENTER:", "JSXText");
@@ -5449,7 +5734,7 @@ var Civet = (() => {
5449
5734
  return TypeDeclaration$0(state);
5450
5735
  }
5451
5736
  }
5452
- var TypeDeclarationModifier$0 = $S($EXPECT($L141, fail, 'TypeDeclarationModifier "declare"'), NonIdContinue);
5737
+ var TypeDeclarationModifier$0 = $S($EXPECT($L142, fail, 'TypeDeclarationModifier "declare"'), NonIdContinue);
5453
5738
  var TypeDeclarationModifier$1 = Export;
5454
5739
  function TypeDeclarationModifier(state) {
5455
5740
  if (state.tokenize) {
@@ -5469,7 +5754,7 @@ var Civet = (() => {
5469
5754
  return TypeDeclarationRest$0(state) || TypeDeclarationRest$1(state) || TypeDeclarationRest$2(state) || TypeDeclarationRest$3(state);
5470
5755
  }
5471
5756
  }
5472
- var TypeKeyword$0 = $S($EXPECT($L142, fail, 'TypeKeyword "type"'), NonIdContinue);
5757
+ var TypeKeyword$0 = $S($EXPECT($L143, fail, 'TypeKeyword "type"'), NonIdContinue);
5473
5758
  function TypeKeyword(state) {
5474
5759
  if (state.verbose)
5475
5760
  console.log("ENTER:", "TypeKeyword");
@@ -5479,7 +5764,7 @@ var Civet = (() => {
5479
5764
  return TypeKeyword$0(state);
5480
5765
  }
5481
5766
  }
5482
- var Interface$0 = $S($EXPECT($L143, fail, 'Interface "interface"'), NonIdContinue);
5767
+ var Interface$0 = $S($EXPECT($L144, fail, 'Interface "interface"'), NonIdContinue);
5483
5768
  function Interface(state) {
5484
5769
  if (state.verbose)
5485
5770
  console.log("ENTER:", "Interface");
@@ -5489,7 +5774,7 @@ var Civet = (() => {
5489
5774
  return Interface$0(state);
5490
5775
  }
5491
5776
  }
5492
- var Namespace$0 = $S($EXPECT($L144, fail, 'Namespace "namespace"'), NonIdContinue);
5777
+ var Namespace$0 = $S($EXPECT($L145, fail, 'Namespace "namespace"'), NonIdContinue);
5493
5778
  function Namespace(state) {
5494
5779
  if (state.verbose)
5495
5780
  console.log("ENTER:", "Namespace");
@@ -5589,7 +5874,7 @@ var Civet = (() => {
5589
5874
  return NestedTypeDeclaration$0(state);
5590
5875
  }
5591
5876
  }
5592
- 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)));
5877
+ var TypeIndexSignature$0 = $S($E($S($R$0($EXPECT($R40, fail, "TypeIndexSignature /[+-]?/")), $EXPECT($L146, fail, 'TypeIndexSignature "readonly"'), __)), OpenBracket, TypeIndex, CloseBracket, $E($S(__, $R$0($EXPECT($R41, fail, "TypeIndexSignature /[+-]/")), QuestionMark)));
5593
5878
  function TypeIndexSignature(state) {
5594
5879
  if (state.verbose)
5595
5880
  console.log("ENTER:", "TypeIndexSignature");
@@ -5620,7 +5905,7 @@ var Civet = (() => {
5620
5905
  return TypeSuffix$0(state);
5621
5906
  }
5622
5907
  }
5623
- var ReturnTypeSuffix$0 = $TS($S(__, Colon, $E($S(__, $EXPECT($L146, fail, 'ReturnTypeSuffix "asserts"'), NonIdContinue)), TypePredicate), function($skip, $loc, $0, $1, $2, $3, $4) {
5908
+ var ReturnTypeSuffix$0 = $TS($S(__, Colon, $E($S(__, $EXPECT($L147, fail, 'ReturnTypeSuffix "asserts"'), NonIdContinue)), TypePredicate), function($skip, $loc, $0, $1, $2, $3, $4) {
5624
5909
  if (!$3)
5625
5910
  $0.splice(2, 1);
5626
5911
  if ($1.length === 0)
@@ -5703,9 +5988,9 @@ var Civet = (() => {
5703
5988
  return TypeUnarySuffix$0(state) || TypeUnarySuffix$1(state);
5704
5989
  }
5705
5990
  }
5706
- var TypeUnaryOp$0 = $EXPECT($L147, fail, 'TypeUnaryOp "keyof"');
5707
- var TypeUnaryOp$1 = $EXPECT($L129, fail, 'TypeUnaryOp "typeof"');
5708
- var TypeUnaryOp$2 = $EXPECT($L148, fail, 'TypeUnaryOp "infer"');
5991
+ var TypeUnaryOp$0 = $EXPECT($L148, fail, 'TypeUnaryOp "keyof"');
5992
+ var TypeUnaryOp$1 = $EXPECT($L130, fail, 'TypeUnaryOp "typeof"');
5993
+ var TypeUnaryOp$2 = $EXPECT($L149, fail, 'TypeUnaryOp "infer"');
5709
5994
  function TypeUnaryOp(state) {
5710
5995
  if (state.tokenize) {
5711
5996
  return $TOKEN("TypeUnaryOp", state, TypeUnaryOp$0(state) || TypeUnaryOp$1(state) || TypeUnaryOp$2(state));
@@ -5795,10 +6080,10 @@ var Civet = (() => {
5795
6080
  }
5796
6081
  }
5797
6082
  var TypeLiteral$0 = Literal;
5798
- var TypeLiteral$1 = $TV($EXPECT($L133, fail, 'TypeLiteral "void"'), function($skip, $loc, $0, $1) {
6083
+ var TypeLiteral$1 = $TV($EXPECT($L134, fail, 'TypeLiteral "void"'), function($skip, $loc, $0, $1) {
5799
6084
  return { $loc, token: "void" };
5800
6085
  });
5801
- var TypeLiteral$2 = $TV($EXPECT($L149, fail, 'TypeLiteral "[]"'), function($skip, $loc, $0, $1) {
6086
+ var TypeLiteral$2 = $TV($EXPECT($L150, fail, 'TypeLiteral "[]"'), function($skip, $loc, $0, $1) {
5802
6087
  return { $loc, token: "[]" };
5803
6088
  });
5804
6089
  function TypeLiteral(state) {
@@ -5808,10 +6093,10 @@ var Civet = (() => {
5808
6093
  return TypeLiteral$0(state) || TypeLiteral$1(state) || TypeLiteral$2(state);
5809
6094
  }
5810
6095
  }
5811
- var TypeBinaryOp$0 = $TV($EXPECT($L72, fail, 'TypeBinaryOp "|"'), function($skip, $loc, $0, $1) {
6096
+ var TypeBinaryOp$0 = $TV($EXPECT($L73, fail, 'TypeBinaryOp "|"'), function($skip, $loc, $0, $1) {
5812
6097
  return { $loc, token: "|" };
5813
6098
  });
5814
- var TypeBinaryOp$1 = $TV($EXPECT($L70, fail, 'TypeBinaryOp "&"'), function($skip, $loc, $0, $1) {
6099
+ var TypeBinaryOp$1 = $TV($EXPECT($L71, fail, 'TypeBinaryOp "&"'), function($skip, $loc, $0, $1) {
5815
6100
  return { $loc, token: "&" };
5816
6101
  });
5817
6102
  function TypeBinaryOp(state) {
@@ -5888,7 +6173,7 @@ var Civet = (() => {
5888
6173
  return TypeParameterDelimiter$0(state) || TypeParameterDelimiter$1(state) || TypeParameterDelimiter$2(state) || TypeParameterDelimiter$3(state);
5889
6174
  }
5890
6175
  }
5891
- var Shebang$0 = $S($R$0($EXPECT($R40, fail, "Shebang /#![^\\r\\n]*/")), EOL);
6176
+ var Shebang$0 = $S($R$0($EXPECT($R42, fail, "Shebang /#![^\\r\\n]*/")), EOL);
5892
6177
  function Shebang(state) {
5893
6178
  if (state.verbose)
5894
6179
  console.log("ENTER:", "Shebang");
@@ -5898,11 +6183,11 @@ var Civet = (() => {
5898
6183
  return Shebang$0(state);
5899
6184
  }
5900
6185
  }
5901
- var CivetPrologue$0 = $T($S($EXPECT($R41, fail, "CivetPrologue /[\\t ]*/"), DoubleQuote, CivetPrologueContent, DoubleQuote, $TEXT(StatementDelimiter), EOS), function(value) {
6186
+ var CivetPrologue$0 = $T($S($EXPECT($R43, fail, "CivetPrologue /[\\t ]*/"), DoubleQuote, CivetPrologueContent, DoubleQuote, $TEXT(StatementDelimiter), EOS), function(value) {
5902
6187
  var content = value[2];
5903
6188
  return content;
5904
6189
  });
5905
- var CivetPrologue$1 = $T($S($EXPECT($R41, fail, "CivetPrologue /[\\t ]*/"), SingleQuote, CivetPrologueContent, SingleQuote, $TEXT(StatementDelimiter), EOS), function(value) {
6190
+ var CivetPrologue$1 = $T($S($EXPECT($R43, fail, "CivetPrologue /[\\t ]*/"), SingleQuote, CivetPrologueContent, SingleQuote, $TEXT(StatementDelimiter), EOS), function(value) {
5906
6191
  var content = value[2];
5907
6192
  return content;
5908
6193
  });
@@ -5913,7 +6198,7 @@ var Civet = (() => {
5913
6198
  return CivetPrologue$0(state) || CivetPrologue$1(state);
5914
6199
  }
5915
6200
  }
5916
- var CivetPrologueContent$0 = $TS($S($EXPECT($L150, fail, 'CivetPrologueContent "civet"'), $Q(CivetOption), $EXPECT($R42, fail, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3) {
6201
+ var CivetPrologueContent$0 = $TS($S($EXPECT($L151, fail, 'CivetPrologueContent "civet"'), $Q(CivetOption), $EXPECT($R44, fail, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3) {
5917
6202
  var options = $2;
5918
6203
  return {
5919
6204
  type: "CivetPrologue",
@@ -5930,7 +6215,7 @@ var Civet = (() => {
5930
6215
  return CivetPrologueContent$0(state);
5931
6216
  }
5932
6217
  }
5933
- var CivetOption$0 = $TR($EXPECT($R43, fail, "CivetOption /\\s+([+-]?)([a-zA-Z0-9-]+)/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
6218
+ var CivetOption$0 = $TR($EXPECT($R45, fail, "CivetOption /\\s+([+-]?)([a-zA-Z0-9-]+)/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
5934
6219
  const optionName = $2.replace(/-+([a-z]?)/g, (_2, l) => {
5935
6220
  if (l)
5936
6221
  return l.toUpperCase();
@@ -5948,7 +6233,7 @@ var Civet = (() => {
5948
6233
  return CivetOption$0(state);
5949
6234
  }
5950
6235
  }
5951
- var UnknownPrologue$0 = $S($R$0($EXPECT($R41, fail, "UnknownPrologue /[\\t ]*/")), BasicStringLiteral, $TEXT(StatementDelimiter), EOS);
6236
+ var UnknownPrologue$0 = $S($R$0($EXPECT($R43, fail, "UnknownPrologue /[\\t ]*/")), BasicStringLiteral, $TEXT(StatementDelimiter), EOS);
5952
6237
  function UnknownPrologue(state) {
5953
6238
  if (state.verbose)
5954
6239
  console.log("ENTER:", "UnknownPrologue");
@@ -5977,7 +6262,7 @@ var Civet = (() => {
5977
6262
  return EOS$0(state);
5978
6263
  }
5979
6264
  }
5980
- var EOL$0 = $TR($EXPECT($R44, fail, "EOL /\\r\\n|\\n|\\r|$/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
6265
+ var EOL$0 = $TR($EXPECT($R46, fail, "EOL /\\r\\n|\\n|\\r|$/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
5981
6266
  return { $loc, token: $0 };
5982
6267
  });
5983
6268
  function EOL(state) {
@@ -6161,6 +6446,20 @@ var Civet = (() => {
6161
6446
  return CoffeeBooleansEnabled$0(state);
6162
6447
  }
6163
6448
  }
6449
+ var CoffeeForLoopsEnabled$0 = $TV($EXPECT($L0, fail, 'CoffeeForLoopsEnabled ""'), function($skip, $loc, $0, $1) {
6450
+ if (module.config.coffeeForLoops)
6451
+ return;
6452
+ return $skip;
6453
+ });
6454
+ function CoffeeForLoopsEnabled(state) {
6455
+ if (state.verbose)
6456
+ console.log("ENTER:", "CoffeeForLoopsEnabled");
6457
+ if (state.tokenize) {
6458
+ return $TOKEN("CoffeeForLoopsEnabled", state, CoffeeForLoopsEnabled$0(state));
6459
+ } else {
6460
+ return CoffeeForLoopsEnabled$0(state);
6461
+ }
6462
+ }
6164
6463
  var CoffeeInterpolationEnabled$0 = $TV($EXPECT($L0, fail, 'CoffeeInterpolationEnabled ""'), function($skip, $loc, $0, $1) {
6165
6464
  if (module.config.coffeeInterpolation)
6166
6465
  return;
@@ -6203,6 +6502,20 @@ var Civet = (() => {
6203
6502
  return CoffeeNotEnabled$0(state);
6204
6503
  }
6205
6504
  }
6505
+ var CoffeeOfEnabled$0 = $TV($EXPECT($L0, fail, 'CoffeeOfEnabled ""'), function($skip, $loc, $0, $1) {
6506
+ if (module.config.coffeeOf)
6507
+ return;
6508
+ return $skip;
6509
+ });
6510
+ function CoffeeOfEnabled(state) {
6511
+ if (state.verbose)
6512
+ console.log("ENTER:", "CoffeeOfEnabled");
6513
+ if (state.tokenize) {
6514
+ return $TOKEN("CoffeeOfEnabled", state, CoffeeOfEnabled$0(state));
6515
+ } else {
6516
+ return CoffeeOfEnabled$0(state);
6517
+ }
6518
+ }
6206
6519
  var Reset$0 = $TV($EXPECT($L0, fail, 'Reset ""'), function($skip, $loc, $0, $1) {
6207
6520
  module.currentIndent = 0;
6208
6521
  module.indentLevels = [0];
@@ -6212,11 +6525,51 @@ var Civet = (() => {
6212
6525
  coffeeBooleans: false,
6213
6526
  coffeeComment: false,
6214
6527
  coffeeEq: false,
6528
+ coffeeForLoops: false,
6215
6529
  coffeeInterpolation: false,
6216
6530
  coffeeIsnt: false,
6217
6531
  coffeeNot: false,
6532
+ coffeeOf: false,
6218
6533
  implicitReturns: true
6219
6534
  };
6535
+ let indexOfRef, hasPropRef;
6536
+ module.prelude = [];
6537
+ module.getIndexOfRef = function() {
6538
+ if (indexOfRef)
6539
+ return indexOfRef;
6540
+ indexOfRef = {
6541
+ type: "Ref",
6542
+ base: "indexOf"
6543
+ };
6544
+ const typeSuffix = {
6545
+ ts: true,
6546
+ children: [": <T>(this: T[], searchElement: T) => boolean"]
6547
+ };
6548
+ const asAny = {
6549
+ ts: true,
6550
+ children: [" as any"]
6551
+ };
6552
+ module.prelude.push(["", "const ", indexOfRef, typeSuffix, " = [].indexOf", asAny, "\n"]);
6553
+ return indexOfRef;
6554
+ };
6555
+ module.getHasPropRef = function() {
6556
+ if (hasPropRef)
6557
+ return hasPropRef;
6558
+ hasPropRef = {
6559
+ type: "Ref",
6560
+ base: "hasProp"
6561
+ };
6562
+ const typeSuffix = {
6563
+ ts: true,
6564
+ children: [": <T>(this: T, prop: keyof T) => boolean"]
6565
+ };
6566
+ const asAny = {
6567
+ ts: true,
6568
+ children: [" as any"]
6569
+ };
6570
+ module.prelude.push(["", "const ", hasPropRef, typeSuffix, " = {}.hasOwnProperty", asAny, "\n"]);
6571
+ return hasPropRef;
6572
+ };
6220
6573
  Object.defineProperty(module.config, "coffeeCompat", {
6221
6574
  set(b) {
6222
6575
  if (b) {
@@ -6224,17 +6577,21 @@ var Civet = (() => {
6224
6577
  this.coffeeBooleans = true;
6225
6578
  this.coffeeComment = true;
6226
6579
  this.coffeeEq = true;
6580
+ this.coffeeForLoops = true;
6227
6581
  this.coffeeInterpolation = true;
6228
6582
  this.coffeeIsnt = true;
6229
6583
  this.coffeeNot = true;
6584
+ this.coffeeOf = true;
6230
6585
  } else {
6231
6586
  this.autoVar = false;
6232
6587
  this.coffeeBooleans = false;
6233
6588
  this.coffeeComment = false;
6234
6589
  this.coffeeEq = false;
6590
+ this.coffeeForLoops = false;
6235
6591
  this.coffeeInterpolation = false;
6236
6592
  this.coffeeIsnt = false;
6237
6593
  this.coffeeNot = false;
6594
+ this.coffeeOf = false;
6238
6595
  }
6239
6596
  }
6240
6597
  });
@@ -6271,6 +6628,10 @@ var Civet = (() => {
6271
6628
  case "BlockStatement":
6272
6629
  insertReturn(node.expressions[node.expressions.length - 1]);
6273
6630
  return;
6631
+ case "ObjectExpression":
6632
+ module.insertTrimmingSpace(node.children[0], "");
6633
+ node.children.unshift("return ");
6634
+ return;
6274
6635
  case "CaseBlock":
6275
6636
  node.clauses.forEach((clause) => {
6276
6637
  insertReturn(clause);
@@ -6339,6 +6700,25 @@ var Civet = (() => {
6339
6700
  if (Array.isArray(node))
6340
6701
  return node.every(module.isWhitespaceOrEmpty);
6341
6702
  };
6703
+ module.processBinaryOpExpression = function($02) {
6704
+ const expandedOps = module.expandChainedComparisons($02);
6705
+ let i = 2;
6706
+ while (i < expandedOps.length) {
6707
+ const op = expandedOps[i];
6708
+ if (op.type === "Ref") {
6709
+ const [a, wsOp, op2, wsB, b] = expandedOps.slice(i - 2, i + 3);
6710
+ module.insertTrimmingSpace(wsOp, "");
6711
+ module.insertTrimmingSpace(wsB, "");
6712
+ expandedOps.splice(i - 2, 5, {
6713
+ type: "Call",
6714
+ children: [wsOp, op2, ".call(", wsB, b, ", ", a, ") >= 0"]
6715
+ });
6716
+ } else {
6717
+ i += 4;
6718
+ }
6719
+ }
6720
+ return expandedOps;
6721
+ };
6342
6722
  module.expandChainedComparisons = function([first, binops]) {
6343
6723
  const relationalOps = ["==", "===", "!=", "!==", "<", "<=", ">", ">=", "in", "instanceof"];
6344
6724
  const lowerPrecedenceOps = ["??", "&&", "||", "&", "|", "^"];
@@ -6349,7 +6729,7 @@ var Civet = (() => {
6349
6729
  let chains = [];
6350
6730
  while (i < l) {
6351
6731
  const [, op] = binops[i];
6352
- if (relationalOps.includes(op.token)) {
6732
+ if (relationalOps.includes(op.token) || op.type === "Ref") {
6353
6733
  chains.push(i);
6354
6734
  } else if (lowerPrecedenceOps.includes(op.token)) {
6355
6735
  processChains();
@@ -6363,7 +6743,7 @@ var Civet = (() => {
6363
6743
  if (chains.length > 1) {
6364
6744
  chains.forEach((index, k) => {
6365
6745
  if (k > 0) {
6366
- results.push(" && ");
6746
+ results.push(" ", "&&", " ");
6367
6747
  }
6368
6748
  const [pre, op, post, exp] = binops[index];
6369
6749
  let endIndex;
@@ -6411,6 +6791,8 @@ var Civet = (() => {
6411
6791
  };
6412
6792
  module.insertTrimmingSpace = function(spacing, c) {
6413
6793
  let target = spacing;
6794
+ if (!target)
6795
+ return;
6414
6796
  if (Array.isArray(target))
6415
6797
  return module.insertTrimmingSpace(target[0], c);
6416
6798
  if (target.children)
@@ -6483,18 +6865,34 @@ var Civet = (() => {
6483
6865
  case "BlockStatement":
6484
6866
  return [];
6485
6867
  case "ForStatement":
6486
- if (node.declaration.type === "Declaration")
6487
- return [];
6488
- return gatherNodes(node.declaration, predicate);
6868
+ const isDec = node.declaration?.type === "Declaration";
6869
+ return node.children.flatMap((n) => {
6870
+ if (isDec && n === node.declaration)
6871
+ return [];
6872
+ return gatherNodes(n, predicate);
6873
+ });
6489
6874
  default:
6490
6875
  return gatherNodes(node.children, predicate);
6491
6876
  }
6492
6877
  return [];
6493
6878
  }
6879
+ function gatherRecursive(node, predicate) {
6880
+ if (node == null)
6881
+ return [];
6882
+ if (Array.isArray(node)) {
6883
+ return node.flatMap((n) => gatherNodes(n, predicate));
6884
+ }
6885
+ if (predicate(node)) {
6886
+ return [node];
6887
+ }
6888
+ return gatherNodes(node.children, predicate);
6889
+ }
6494
6890
  module.processProgram = function(statements) {
6891
+ statements.unshift(...module.prelude);
6495
6892
  if (module.config.autoVar) {
6496
- module.autoVar(statements, []);
6893
+ createVarDecs(statements, []);
6497
6894
  }
6895
+ populateRefs(statements);
6498
6896
  };
6499
6897
  function findDecs(statements) {
6500
6898
  const declarationNames = gatherNodes(statements, (node) => {
@@ -6504,7 +6902,39 @@ var Civet = (() => {
6504
6902
  }).flatMap((d) => d.names);
6505
6903
  return new Set(declarationNames);
6506
6904
  }
6507
- module.autoVar = function(statements, scopes, pushVar) {
6905
+ function populateRefs(statements) {
6906
+ const refNodes = gatherNodes(statements, ({ type }) => type === "Ref");
6907
+ const blockNodes = new Set(gatherNodes(statements, ({ type }) => type === "BlockStatement"));
6908
+ const forNodes = gatherNodes(statements, ({ type }) => type === "ForStatement");
6909
+ forNodes.forEach(({ declaration, block }) => {
6910
+ if (block.type === "BlockStatement") {
6911
+ populateRefs([declaration, ...block.children]);
6912
+ } else {
6913
+ populateRefs([declaration, ...block]);
6914
+ }
6915
+ blockNodes.delete(block);
6916
+ });
6917
+ blockNodes.forEach(({ expressions }) => populateRefs(expressions));
6918
+ if (refNodes.length) {
6919
+ const ids = gatherRecursive(statements, (s) => s.type === "Identifier");
6920
+ const names = new Set(ids.flatMap(({ names: names2 }) => names2 || []));
6921
+ refNodes.forEach((ref) => {
6922
+ const { type, base } = ref;
6923
+ if (type !== "Ref")
6924
+ return;
6925
+ ref.type = "Identifier";
6926
+ let n = 0;
6927
+ let name = base;
6928
+ while (names.has(name)) {
6929
+ n++;
6930
+ name = `${base}${n}`;
6931
+ }
6932
+ names.add(name);
6933
+ ref.children = ref.names = [name];
6934
+ });
6935
+ }
6936
+ }
6937
+ function createVarDecs(statements, scopes, pushVar) {
6508
6938
  function hasDec(name) {
6509
6939
  return scopes.some((s) => s.has(name));
6510
6940
  }
@@ -6513,9 +6943,7 @@ var Civet = (() => {
6513
6943
  return node.type === "AssignmentExpression";
6514
6944
  });
6515
6945
  const undeclaredIdentifiers = assignmentStatements.flatMap((a) => {
6516
- return a.children[0].flatMap((x) => {
6517
- return x[1].names || [];
6518
- });
6946
+ return a.names;
6519
6947
  });
6520
6948
  return undeclaredIdentifiers.filter((x, i, a) => {
6521
6949
  if (!hasDec(x))
@@ -6538,23 +6966,23 @@ var Civet = (() => {
6538
6966
  fnNodes.forEach(({ block }) => blockNodes.delete(block));
6539
6967
  forNodes.forEach(({ block }) => blockNodes.delete(block));
6540
6968
  blockNodes.forEach((block) => {
6541
- module.autoVar(block.expressions, scopes, pushVar);
6969
+ createVarDecs(block.expressions, scopes, pushVar);
6542
6970
  });
6543
6971
  forNodes.forEach(({ block, declaration }) => {
6544
6972
  scopes.push(new Set(declaration.names));
6545
- module.autoVar(block.expressions, scopes, pushVar);
6973
+ createVarDecs(block.expressions, scopes, pushVar);
6546
6974
  scopes.pop();
6547
6975
  });
6548
6976
  fnNodes.forEach(({ block, parameters }) => {
6549
6977
  scopes.push(new Set(parameters.names));
6550
- module.autoVar(block.expressions, scopes);
6978
+ createVarDecs(block.expressions, scopes);
6551
6979
  scopes.pop();
6552
6980
  });
6553
6981
  if (varIds.length) {
6554
6982
  const indent = statements[0][0];
6555
6983
  statements.unshift([indent, "var ", varIds.join(", "), "\n"]);
6556
6984
  }
6557
- };
6985
+ }
6558
6986
  return $0;
6559
6987
  });
6560
6988
  function Init(state) {
@@ -6566,7 +6994,7 @@ var Civet = (() => {
6566
6994
  return Init$0(state);
6567
6995
  }
6568
6996
  }
6569
- var Indent$0 = $TV($Q($C($EXPECT($L151, fail, 'Indent " "'), $EXPECT($L152, fail, 'Indent "\\\\t"'))), function($skip, $loc, $0, $1) {
6997
+ var Indent$0 = $TV($Q($C($EXPECT($L152, fail, 'Indent " "'), $EXPECT($L153, fail, 'Indent "\\\\t"'))), function($skip, $loc, $0, $1) {
6570
6998
  const level = $1.length;
6571
6999
  return {
6572
7000
  $loc,
@@ -6698,6 +7126,7 @@ var Civet = (() => {
6698
7126
  // source/generate.coffee
6699
7127
  var require_generate = __commonJS({
6700
7128
  "source/generate.coffee"(exports, module) {
7129
+ "civet coffeeCompat";
6701
7130
  var gen;
6702
7131
  var prune;
6703
7132
  gen = function(node, options) {
@@ -6775,6 +7204,7 @@ var Civet = (() => {
6775
7204
  var require_util = __commonJS({
6776
7205
  "source/util.coffee"(exports, module) {
6777
7206
  "use strict";
7207
+ "civet coffeeCompat";
6778
7208
  var BASE64_CHARS;
6779
7209
  var SourceMap;
6780
7210
  var VLQ_CONTINUATION_BIT;
@@ -7099,6 +7529,7 @@ var Civet = (() => {
7099
7529
  // source/main.coffee
7100
7530
  var require_main = __commonJS({
7101
7531
  "source/main.coffee"(exports, module) {
7532
+ "civet coffeeCompat";
7102
7533
  var SourceMap;
7103
7534
  var base64Encode;
7104
7535
  var defaultOptions;