@danielx/civet 0.4.27 → 0.4.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -4,6 +4,85 @@ var __commonJS = (cb, mod) => function __require() {
4
4
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
5
5
  };
6
6
 
7
+ // source/generate.coffee
8
+ var require_generate = __commonJS({
9
+ "source/generate.coffee"(exports2, module2) {
10
+ "civet coffeeCompat";
11
+ var gen2;
12
+ var prune2;
13
+ gen2 = function(node, options) {
14
+ var $loc, token;
15
+ if (node === null || node === void 0) {
16
+ return "";
17
+ }
18
+ if (typeof node === "string") {
19
+ if (options != null) {
20
+ if (typeof options.updateSourceMap === "function") {
21
+ options.updateSourceMap(node);
22
+ }
23
+ }
24
+ return node;
25
+ }
26
+ if (Array.isArray(node)) {
27
+ return node.map(function(child) {
28
+ return gen2(child, options);
29
+ }).join("");
30
+ }
31
+ if (typeof node === "object") {
32
+ if (options.js && node.ts) {
33
+ return "";
34
+ }
35
+ if (node.$loc != null) {
36
+ ({ token, $loc } = node);
37
+ if (options != null) {
38
+ if (typeof options.updateSourceMap === "function") {
39
+ options.updateSourceMap(token, $loc.pos);
40
+ }
41
+ }
42
+ return token;
43
+ }
44
+ if (!node.children) {
45
+ debugger;
46
+ throw new Error("Unknown node", JSON.stringify(node));
47
+ }
48
+ return gen2(node.children, options);
49
+ }
50
+ debugger;
51
+ throw new Error("Unknown node", JSON.stringify(node));
52
+ };
53
+ module2.exports = gen2;
54
+ prune2 = function(node) {
55
+ var a;
56
+ if (node === null || node === void 0) {
57
+ return;
58
+ }
59
+ if (node.length === 0) {
60
+ return;
61
+ }
62
+ if (Array.isArray(node)) {
63
+ a = node.map(function(n) {
64
+ return prune2(n);
65
+ }).filter(function(n) {
66
+ return !!n;
67
+ });
68
+ if (a.length > 1) {
69
+ return a;
70
+ }
71
+ if (a.length === 1) {
72
+ return a[0];
73
+ }
74
+ return;
75
+ }
76
+ if (node.children != null) {
77
+ node.children = prune2(node.children) || [];
78
+ return node;
79
+ }
80
+ return node;
81
+ };
82
+ gen2.prune = prune2;
83
+ }
84
+ });
85
+
7
86
  // source/parser.hera
8
87
  var require_parser = __commonJS({
9
88
  "source/parser.hera"(exports2, module2) {
@@ -757,6 +836,7 @@ ${input.slice(result.pos)}
757
836
  JSXAttributeInitializer,
758
837
  JSXAttributeValue,
759
838
  JSXChildren,
839
+ JSXNestedChildren,
760
840
  JSXChild,
761
841
  JSXText,
762
842
  JSXChildExpression,
@@ -1003,57 +1083,58 @@ ${input.slice(result.pos)}
1003
1083
  var $R1 = $R(new RegExp("[&]", "suy"));
1004
1084
  var $R2 = $R(new RegExp("[!~+-]+", "suy"));
1005
1085
  var $R3 = $R(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$])*", "suy"));
1006
- var $R4 = $R(new RegExp("[!~+-](?!\\s|[!~+-]*&)", "suy"));
1007
- var $R5 = $R(new RegExp("(?=[\\s\\)])", "suy"));
1008
- var $R6 = $R(new RegExp('[^;"\\s]+', "suy"));
1009
- var $R7 = $R(new RegExp("(?:0|[1-9](?:_[0-9]|[0-9])*)n", "suy"));
1010
- var $R8 = $R(new RegExp("(?:0|[1-9](?:_[0-9]|[0-9])*)(?=\\.(?:\\p{ID_Start}|[_$]))", "suy"));
1011
- var $R9 = $R(new RegExp("(?:0|[1-9](?:_[0-9]|[0-9])*)(?:\\.(?:[0-9](?:_[0-9]|[0-9])*))?", "suy"));
1012
- var $R10 = $R(new RegExp("(?:\\.[0-9](?:_[0-9]|[0-9])*)", "suy"));
1013
- var $R11 = $R(new RegExp("(?:[eE][+-]?[0-9]+(?:_[0-9]|[0-9])*)", "suy"));
1014
- var $R12 = $R(new RegExp("0[bB][01](?:[01]|_[01])*n?", "suy"));
1015
- var $R13 = $R(new RegExp("0[oO][0-7](?:[0-7]|_[0-7])*n?", "suy"));
1016
- var $R14 = $R(new RegExp("0[xX][0-9a-fA-F](?:[0-9a-fA-F]|_[0-9a-fA-F])*n?", "suy"));
1017
- var $R15 = $R(new RegExp('(?:\\\\.|[^"])*', "suy"));
1018
- var $R16 = $R(new RegExp("(?:\\\\.|[^'])*", "suy"));
1019
- var $R17 = $R(new RegExp('(?:"(?!"")|#(?!\\{)|\\\\.|[^#"])+', "suy"));
1020
- var $R18 = $R(new RegExp("(?:'(?!'')|\\\\.|[^'])*", "suy"));
1021
- var $R19 = $R(new RegExp('(?:\\\\.|#(?!\\{)|[^"#])+', "suy"));
1022
- var $R20 = $R(new RegExp("(?:\\\\.|[^\\]])*", "suy"));
1023
- var $R21 = $R(new RegExp("(?:\\\\.)", "suy"));
1024
- var $R22 = $R(new RegExp("[\\s]+", "suy"));
1025
- var $R23 = $R(new RegExp("\\/(?!\\/\\/)", "suy"));
1026
- var $R24 = $R(new RegExp("[^\\/\\s#\\\\]+", "suy"));
1027
- var $R25 = $R(new RegExp("[*\\/\\r\\n]", "suy"));
1028
- var $R26 = $R(new RegExp("(?:\\\\.|[^\\/\\r\\n])+", "suy"));
1029
- var $R27 = $R(new RegExp("(?:\\p{ID_Continue}|[\\u200C\\u200D$])*", "suy"));
1030
- var $R28 = $R(new RegExp("(?:\\$(?!\\{)|\\\\.|[^$`])+", "suy"));
1031
- var $R29 = $R(new RegExp("(?:\\$(?!\\{)|`(?!``)|\\\\.|[^$`])+", "suy"));
1032
- var $R30 = $R(new RegExp("(?:on|off|yes|no)(?!\\p{ID_Continue})", "suy"));
1033
- var $R31 = $R(new RegExp("(?:isnt)(?!\\p{ID_Continue})", "suy"));
1034
- var $R32 = $R(new RegExp("(?:by)(?!\\p{ID_Continue})", "suy"));
1035
- var $R33 = $R(new RegExp("(?:of)(?!\\p{ID_Continue})", "suy"));
1036
- var $R34 = $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|let|loop|new|null|or|return|static|super|switch|this|throw|true|try|typeof|unless|until|var|void|while|with|yield)(?!\\p{ID_Continue})", "suy"));
1037
- var $R35 = $R(new RegExp("\\/\\/(?!\\/)[^\\r\\n]*", "suy"));
1038
- var $R36 = $R(new RegExp(".", "suy"));
1039
- var $R37 = $R(new RegExp("#(?!##(?!#))([^\\r\\n]*)", "suy"));
1040
- var $R38 = $R(new RegExp("###(?!#)", "suy"));
1041
- var $R39 = $R(new RegExp("[^\\r\\n]", "suy"));
1042
- var $R40 = $R(new RegExp("[ \\t]+", "suy"));
1043
- var $R41 = $R(new RegExp("(?!\\p{ID_Continue})", "suy"));
1044
- var $R42 = $R(new RegExp("\\s", "suy"));
1045
- var $R43 = $R(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*", "suy"));
1046
- var $R44 = $R(new RegExp('"[^"]*"', "suy"));
1047
- var $R45 = $R(new RegExp("'[^']*'", "suy"));
1048
- var $R46 = $R(new RegExp("[^{}<>]+", "suy"));
1049
- var $R47 = $R(new RegExp("[+-]?", "suy"));
1050
- var $R48 = $R(new RegExp("[+-]", "suy"));
1051
- var $R49 = $R(new RegExp("#![^\\r\\n]*", "suy"));
1052
- var $R50 = $R(new RegExp("[\\t ]*", "suy"));
1053
- var $R51 = $R(new RegExp("[\\s]*", "suy"));
1054
- var $R52 = $R(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?", "suy"));
1055
- var $R53 = $R(new RegExp("\\r\\n|\\n|\\r|$", "suy"));
1056
- var $R54 = $R(new RegExp("[ \\t]*", "suy"));
1086
+ var $R4 = $R(new RegExp("<(?!\\p{ID_Start}|[_$])", "suy"));
1087
+ var $R5 = $R(new RegExp("[!~+-](?!\\s|[!~+-]*&)", "suy"));
1088
+ var $R6 = $R(new RegExp("(?=[\\s\\)])", "suy"));
1089
+ var $R7 = $R(new RegExp('[^;"\\s]+', "suy"));
1090
+ var $R8 = $R(new RegExp("(?:0|[1-9](?:_[0-9]|[0-9])*)n", "suy"));
1091
+ var $R9 = $R(new RegExp("(?:0|[1-9](?:_[0-9]|[0-9])*)(?=\\.(?:\\p{ID_Start}|[_$]))", "suy"));
1092
+ var $R10 = $R(new RegExp("(?:0|[1-9](?:_[0-9]|[0-9])*)(?:\\.(?:[0-9](?:_[0-9]|[0-9])*))?", "suy"));
1093
+ var $R11 = $R(new RegExp("(?:\\.[0-9](?:_[0-9]|[0-9])*)", "suy"));
1094
+ var $R12 = $R(new RegExp("(?:[eE][+-]?[0-9]+(?:_[0-9]|[0-9])*)", "suy"));
1095
+ var $R13 = $R(new RegExp("0[bB][01](?:[01]|_[01])*n?", "suy"));
1096
+ var $R14 = $R(new RegExp("0[oO][0-7](?:[0-7]|_[0-7])*n?", "suy"));
1097
+ var $R15 = $R(new RegExp("0[xX][0-9a-fA-F](?:[0-9a-fA-F]|_[0-9a-fA-F])*n?", "suy"));
1098
+ var $R16 = $R(new RegExp('(?:\\\\.|[^"])*', "suy"));
1099
+ var $R17 = $R(new RegExp("(?:\\\\.|[^'])*", "suy"));
1100
+ var $R18 = $R(new RegExp('(?:"(?!"")|#(?!\\{)|\\\\.|[^#"])+', "suy"));
1101
+ var $R19 = $R(new RegExp("(?:'(?!'')|\\\\.|[^'])*", "suy"));
1102
+ var $R20 = $R(new RegExp('(?:\\\\.|#(?!\\{)|[^"#])+', "suy"));
1103
+ var $R21 = $R(new RegExp("(?:\\\\.|[^\\]])*", "suy"));
1104
+ var $R22 = $R(new RegExp("(?:\\\\.)", "suy"));
1105
+ var $R23 = $R(new RegExp("[\\s]+", "suy"));
1106
+ var $R24 = $R(new RegExp("\\/(?!\\/\\/)", "suy"));
1107
+ var $R25 = $R(new RegExp("[^\\/\\s#\\\\]+", "suy"));
1108
+ var $R26 = $R(new RegExp("[*\\/\\r\\n]", "suy"));
1109
+ var $R27 = $R(new RegExp("(?:\\\\.|[^\\/\\r\\n])+", "suy"));
1110
+ var $R28 = $R(new RegExp("(?:\\p{ID_Continue}|[\\u200C\\u200D$])*", "suy"));
1111
+ var $R29 = $R(new RegExp("(?:\\$(?!\\{)|\\\\.|[^$`])+", "suy"));
1112
+ var $R30 = $R(new RegExp("(?:\\$(?!\\{)|`(?!``)|\\\\.|[^$`])+", "suy"));
1113
+ var $R31 = $R(new RegExp("(?:on|off|yes|no)(?!\\p{ID_Continue})", "suy"));
1114
+ var $R32 = $R(new RegExp("(?:isnt)(?!\\p{ID_Continue})", "suy"));
1115
+ var $R33 = $R(new RegExp("(?:by)(?!\\p{ID_Continue})", "suy"));
1116
+ var $R34 = $R(new RegExp("(?:of)(?!\\p{ID_Continue})", "suy"));
1117
+ var $R35 = $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|let|loop|new|null|or|return|static|super|switch|this|throw|true|try|typeof|unless|until|var|void|while|with|yield)(?!\\p{ID_Continue})", "suy"));
1118
+ var $R36 = $R(new RegExp("\\/\\/(?!\\/)[^\\r\\n]*", "suy"));
1119
+ var $R37 = $R(new RegExp(".", "suy"));
1120
+ var $R38 = $R(new RegExp("#(?!##(?!#))([^\\r\\n]*)", "suy"));
1121
+ var $R39 = $R(new RegExp("###(?!#)", "suy"));
1122
+ var $R40 = $R(new RegExp("[^\\r\\n]", "suy"));
1123
+ var $R41 = $R(new RegExp("[ \\t]+", "suy"));
1124
+ var $R42 = $R(new RegExp("(?!\\p{ID_Continue})", "suy"));
1125
+ var $R43 = $R(new RegExp("\\s", "suy"));
1126
+ var $R44 = $R(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*", "suy"));
1127
+ var $R45 = $R(new RegExp('"[^"]*"', "suy"));
1128
+ var $R46 = $R(new RegExp("'[^']*'", "suy"));
1129
+ var $R47 = $R(new RegExp("[^{}<>\\r\\n]+", "suy"));
1130
+ var $R48 = $R(new RegExp("[+-]?", "suy"));
1131
+ var $R49 = $R(new RegExp("[+-]", "suy"));
1132
+ var $R50 = $R(new RegExp("#![^\\r\\n]*", "suy"));
1133
+ var $R51 = $R(new RegExp("[\\t ]*", "suy"));
1134
+ var $R52 = $R(new RegExp("[\\s]*", "suy"));
1135
+ var $R53 = $R(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?", "suy"));
1136
+ var $R54 = $R(new RegExp("\\r\\n|\\n|\\r|$", "suy"));
1137
+ var $R55 = $R(new RegExp("[ \\t]*", "suy"));
1057
1138
  var Program$0 = $TS($S(Reset, Init, __, $Q(TopLevelStatement), __), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
1058
1139
  var statements = $4;
1059
1140
  module2.processProgram(statements);
@@ -5113,7 +5194,9 @@ ${input.slice(result.pos)}
5113
5194
  var BinaryOpSymbol$6 = $EXPECT($L53, fail, 'BinaryOpSymbol "<="');
5114
5195
  var BinaryOpSymbol$7 = $EXPECT($L54, fail, 'BinaryOpSymbol ">="');
5115
5196
  var BinaryOpSymbol$8 = $EXPECT($L55, fail, 'BinaryOpSymbol "<<"');
5116
- var BinaryOpSymbol$9 = $EXPECT($L5, fail, 'BinaryOpSymbol "<"');
5197
+ var BinaryOpSymbol$9 = $TR($EXPECT($R4, fail, "BinaryOpSymbol /<(?!\\p{ID_Start}|[_$])/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
5198
+ return "<";
5199
+ });
5117
5200
  var BinaryOpSymbol$10 = $EXPECT($L56, fail, 'BinaryOpSymbol ">>>"');
5118
5201
  var BinaryOpSymbol$11 = $EXPECT($L57, fail, 'BinaryOpSymbol ">>"');
5119
5202
  var BinaryOpSymbol$12 = $EXPECT($L25, fail, 'BinaryOpSymbol ">"');
@@ -5207,7 +5290,7 @@ ${input.slice(result.pos)}
5207
5290
  return result;
5208
5291
  }
5209
5292
  }
5210
- var UnaryOp$0 = $TR($EXPECT($R4, fail, "UnaryOp /[!~+-](?!\\s|[!~+-]*&)/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
5293
+ var UnaryOp$0 = $TR($EXPECT($R5, fail, "UnaryOp /[!~+-](?!\\s|[!~+-]*&)/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
5211
5294
  return { $loc, token: $0 };
5212
5295
  });
5213
5296
  var UnaryOp$1 = $S($C(Await, Delete, Void, Typeof), __);
@@ -6285,7 +6368,7 @@ ${input.slice(result.pos)}
6285
6368
  names: binding.names
6286
6369
  };
6287
6370
  });
6288
- var ForDeclaration$1 = $TS($S(InsertConst, ForBinding, $EXPECT($R5, fail, "ForDeclaration /(?=[\\s\\)])/")), function($skip, $loc, $0, $1, $2, $3) {
6371
+ var ForDeclaration$1 = $TS($S(InsertConst, ForBinding, $EXPECT($R6, fail, "ForDeclaration /(?=[\\s\\)])/")), function($skip, $loc, $0, $1, $2, $3) {
6289
6372
  var c = $1;
6290
6373
  var binding = $2;
6291
6374
  return {
@@ -6516,10 +6599,15 @@ ${input.slice(result.pos)}
6516
6599
  var expressions = value[2];
6517
6600
  return { "type": "CaseClause", "cases": cases, "expressions": expressions, "children": value };
6518
6601
  });
6519
- var CaseClause$1 = $TS($S(When, CaseExpressionList, InsertOpenBrace, $C(ThenClause, NestedBlockStatements), InsertBreak, InsertNewline, InsertIndent, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8) {
6602
+ var CaseClause$1 = $TS($S(When, CaseExpressionList, InsertOpenBrace, $E($C(ThenClause, NestedBlockStatements)), InsertBreak, InsertNewline, InsertIndent, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8) {
6520
6603
  var cases = $2;
6521
6604
  var expressions = $4;
6522
6605
  var b = $5;
6606
+ let children = $0;
6607
+ if (!expressions) {
6608
+ expressions = [];
6609
+ children = children.map((c, i) => i === 3 ? expressions : c);
6610
+ }
6523
6611
  if (expressions.expressions) {
6524
6612
  expressions = expressions.expressions;
6525
6613
  }
@@ -6528,7 +6616,7 @@ ${input.slice(result.pos)}
6528
6616
  cases,
6529
6617
  expressions,
6530
6618
  break: b,
6531
- children: $0
6619
+ children
6532
6620
  };
6533
6621
  });
6534
6622
  var CaseClause$2 = $TS($S(Default, ImpliedColon, $C(NestedBlockStatements, NoExpressions)), function($skip, $loc, $0, $1, $2, $3) {
@@ -6934,9 +7022,10 @@ ${input.slice(result.pos)}
6934
7022
  var MaybeNestedExpression$0 = $TS($S($N(EOS), ExtendedExpression), function($skip, $loc, $0, $1, $2) {
6935
7023
  return $2;
6936
7024
  });
6937
- var MaybeNestedExpression$1 = $T($S($Y(EOS), ObjectLiteral), function(value) {
6938
- return value[1];
7025
+ var MaybeNestedExpression$1 = $TS($S($Y(EOS), ObjectLiteral), function($skip, $loc, $0, $1, $2) {
7026
+ return $2;
6939
7027
  });
7028
+ var MaybeNestedExpression$2 = $S($Y(EOS), InsertSpace, InsertOpenParen, PushIndent, Nested, ExtendedExpression, PopIndent, InsertNewline, InsertIndent, InsertCloseParen);
6940
7029
  function MaybeNestedExpression(state) {
6941
7030
  if (state.events) {
6942
7031
  const result = state.events.enter?.("MaybeNestedExpression", state);
@@ -6944,12 +7033,12 @@ ${input.slice(result.pos)}
6944
7033
  return result.cache;
6945
7034
  }
6946
7035
  if (state.tokenize) {
6947
- const result = $TOKEN("MaybeNestedExpression", state, MaybeNestedExpression$0(state) || MaybeNestedExpression$1(state));
7036
+ const result = $TOKEN("MaybeNestedExpression", state, MaybeNestedExpression$0(state) || MaybeNestedExpression$1(state) || MaybeNestedExpression$2(state));
6948
7037
  if (state.events)
6949
7038
  state.events.exit?.("MaybeNestedExpression", state, result);
6950
7039
  return result;
6951
7040
  } else {
6952
- const result = MaybeNestedExpression$0(state) || MaybeNestedExpression$1(state);
7041
+ const result = MaybeNestedExpression$0(state) || MaybeNestedExpression$1(state) || MaybeNestedExpression$2(state);
6953
7042
  if (state.events)
6954
7043
  state.events.exit?.("MaybeNestedExpression", state, result);
6955
7044
  return result;
@@ -7214,7 +7303,7 @@ ${input.slice(result.pos)}
7214
7303
  return result;
7215
7304
  }
7216
7305
  }
7217
- var UnquotedSpecifier$0 = $TV($EXPECT($R6, fail, 'UnquotedSpecifier /[^;"\\s]+/'), function($skip, $loc, $0, $1) {
7306
+ var UnquotedSpecifier$0 = $TV($EXPECT($R7, fail, 'UnquotedSpecifier /[^;"\\s]+/'), function($skip, $loc, $0, $1) {
7218
7307
  var spec = $0;
7219
7308
  return { $loc, token: `"${spec}"` };
7220
7309
  });
@@ -7706,7 +7795,7 @@ ${input.slice(result.pos)}
7706
7795
  return result;
7707
7796
  }
7708
7797
  }
7709
- var DecimalBigIntegerLiteral$0 = $R$0($EXPECT($R7, fail, "DecimalBigIntegerLiteral /(?:0|[1-9](?:_[0-9]|[0-9])*)n/"));
7798
+ var DecimalBigIntegerLiteral$0 = $R$0($EXPECT($R8, fail, "DecimalBigIntegerLiteral /(?:0|[1-9](?:_[0-9]|[0-9])*)n/"));
7710
7799
  function DecimalBigIntegerLiteral(state) {
7711
7800
  if (state.events) {
7712
7801
  const result = state.events.enter?.("DecimalBigIntegerLiteral", state);
@@ -7725,11 +7814,11 @@ ${input.slice(result.pos)}
7725
7814
  return result;
7726
7815
  }
7727
7816
  }
7728
- var DecimalLiteral$0 = $TV($TEXT($EXPECT($R8, fail, "DecimalLiteral /(?:0|[1-9](?:_[0-9]|[0-9])*)(?=\\.(?:\\p{ID_Start}|[_$]))/")), function($skip, $loc, $0, $1) {
7817
+ var DecimalLiteral$0 = $TV($TEXT($EXPECT($R9, fail, "DecimalLiteral /(?:0|[1-9](?:_[0-9]|[0-9])*)(?=\\.(?:\\p{ID_Start}|[_$]))/")), function($skip, $loc, $0, $1) {
7729
7818
  return $1 + ".";
7730
7819
  });
7731
- var DecimalLiteral$1 = $TEXT($S($EXPECT($R9, fail, "DecimalLiteral /(?:0|[1-9](?:_[0-9]|[0-9])*)(?:\\.(?:[0-9](?:_[0-9]|[0-9])*))?/"), $E(ExponentPart)));
7732
- var DecimalLiteral$2 = $TEXT($S($EXPECT($R10, fail, "DecimalLiteral /(?:\\.[0-9](?:_[0-9]|[0-9])*)/"), $E(ExponentPart)));
7820
+ var DecimalLiteral$1 = $TEXT($S($EXPECT($R10, fail, "DecimalLiteral /(?:0|[1-9](?:_[0-9]|[0-9])*)(?:\\.(?:[0-9](?:_[0-9]|[0-9])*))?/"), $E(ExponentPart)));
7821
+ var DecimalLiteral$2 = $TEXT($S($EXPECT($R11, fail, "DecimalLiteral /(?:\\.[0-9](?:_[0-9]|[0-9])*)/"), $E(ExponentPart)));
7733
7822
  function DecimalLiteral(state) {
7734
7823
  if (state.events) {
7735
7824
  const result = state.events.enter?.("DecimalLiteral", state);
@@ -7748,7 +7837,7 @@ ${input.slice(result.pos)}
7748
7837
  return result;
7749
7838
  }
7750
7839
  }
7751
- var ExponentPart$0 = $R$0($EXPECT($R11, fail, "ExponentPart /(?:[eE][+-]?[0-9]+(?:_[0-9]|[0-9])*)/"));
7840
+ var ExponentPart$0 = $R$0($EXPECT($R12, fail, "ExponentPart /(?:[eE][+-]?[0-9]+(?:_[0-9]|[0-9])*)/"));
7752
7841
  function ExponentPart(state) {
7753
7842
  if (state.events) {
7754
7843
  const result = state.events.enter?.("ExponentPart", state);
@@ -7767,7 +7856,7 @@ ${input.slice(result.pos)}
7767
7856
  return result;
7768
7857
  }
7769
7858
  }
7770
- var BinaryIntegerLiteral$0 = $R$0($EXPECT($R12, fail, "BinaryIntegerLiteral /0[bB][01](?:[01]|_[01])*n?/"));
7859
+ var BinaryIntegerLiteral$0 = $R$0($EXPECT($R13, fail, "BinaryIntegerLiteral /0[bB][01](?:[01]|_[01])*n?/"));
7771
7860
  function BinaryIntegerLiteral(state) {
7772
7861
  if (state.events) {
7773
7862
  const result = state.events.enter?.("BinaryIntegerLiteral", state);
@@ -7786,7 +7875,7 @@ ${input.slice(result.pos)}
7786
7875
  return result;
7787
7876
  }
7788
7877
  }
7789
- var OctalIntegerLiteral$0 = $R$0($EXPECT($R13, fail, "OctalIntegerLiteral /0[oO][0-7](?:[0-7]|_[0-7])*n?/"));
7878
+ var OctalIntegerLiteral$0 = $R$0($EXPECT($R14, fail, "OctalIntegerLiteral /0[oO][0-7](?:[0-7]|_[0-7])*n?/"));
7790
7879
  function OctalIntegerLiteral(state) {
7791
7880
  if (state.events) {
7792
7881
  const result = state.events.enter?.("OctalIntegerLiteral", state);
@@ -7805,7 +7894,7 @@ ${input.slice(result.pos)}
7805
7894
  return result;
7806
7895
  }
7807
7896
  }
7808
- var HexLiteral$0 = $R$0($EXPECT($R14, fail, "HexLiteral /0[xX][0-9a-fA-F](?:[0-9a-fA-F]|_[0-9a-fA-F])*n?/"));
7897
+ var HexLiteral$0 = $R$0($EXPECT($R15, fail, "HexLiteral /0[xX][0-9a-fA-F](?:[0-9a-fA-F]|_[0-9a-fA-F])*n?/"));
7809
7898
  function HexLiteral(state) {
7810
7899
  if (state.events) {
7811
7900
  const result = state.events.enter?.("HexLiteral", state);
@@ -7885,7 +7974,7 @@ ${input.slice(result.pos)}
7885
7974
  return result;
7886
7975
  }
7887
7976
  }
7888
- var DoubleStringCharacters$0 = $TR($EXPECT($R15, fail, 'DoubleStringCharacters /(?:\\\\.|[^"])*/'), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
7977
+ var DoubleStringCharacters$0 = $TR($EXPECT($R16, fail, 'DoubleStringCharacters /(?:\\\\.|[^"])*/'), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
7889
7978
  return { $loc, token: $0 };
7890
7979
  });
7891
7980
  function DoubleStringCharacters(state) {
@@ -7906,7 +7995,7 @@ ${input.slice(result.pos)}
7906
7995
  return result;
7907
7996
  }
7908
7997
  }
7909
- var SingleStringCharacters$0 = $TR($EXPECT($R16, fail, "SingleStringCharacters /(?:\\\\.|[^'])*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
7998
+ var SingleStringCharacters$0 = $TR($EXPECT($R17, fail, "SingleStringCharacters /(?:\\\\.|[^'])*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
7910
7999
  return { $loc, token: $0 };
7911
8000
  });
7912
8001
  function SingleStringCharacters(state) {
@@ -7927,7 +8016,7 @@ ${input.slice(result.pos)}
7927
8016
  return result;
7928
8017
  }
7929
8018
  }
7930
- var TripleDoubleStringCharacters$0 = $TR($EXPECT($R17, fail, 'TripleDoubleStringCharacters /(?:"(?!"")|#(?!\\{)|\\\\.|[^#"])+/'), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
8019
+ var TripleDoubleStringCharacters$0 = $TR($EXPECT($R18, fail, 'TripleDoubleStringCharacters /(?:"(?!"")|#(?!\\{)|\\\\.|[^#"])+/'), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
7931
8020
  return { $loc, token: $0 };
7932
8021
  });
7933
8022
  function TripleDoubleStringCharacters(state) {
@@ -7948,7 +8037,7 @@ ${input.slice(result.pos)}
7948
8037
  return result;
7949
8038
  }
7950
8039
  }
7951
- var TripleSingleStringCharacters$0 = $TR($EXPECT($R18, fail, "TripleSingleStringCharacters /(?:'(?!'')|\\\\.|[^'])*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
8040
+ var TripleSingleStringCharacters$0 = $TR($EXPECT($R19, fail, "TripleSingleStringCharacters /(?:'(?!'')|\\\\.|[^'])*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
7952
8041
  return { $loc, token: $0 };
7953
8042
  });
7954
8043
  function TripleSingleStringCharacters(state) {
@@ -8026,7 +8115,7 @@ ${input.slice(result.pos)}
8026
8115
  return result;
8027
8116
  }
8028
8117
  }
8029
- var CoffeeDoubleQuotedStringCharacters$0 = $TR($EXPECT($R19, fail, 'CoffeeDoubleQuotedStringCharacters /(?:\\\\.|#(?!\\{)|[^"#])+/'), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
8118
+ var CoffeeDoubleQuotedStringCharacters$0 = $TR($EXPECT($R20, fail, 'CoffeeDoubleQuotedStringCharacters /(?:\\\\.|#(?!\\{)|[^"#])+/'), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
8030
8119
  return { $loc, token: $0 };
8031
8120
  });
8032
8121
  function CoffeeDoubleQuotedStringCharacters(state) {
@@ -8090,7 +8179,7 @@ ${input.slice(result.pos)}
8090
8179
  return result;
8091
8180
  }
8092
8181
  }
8093
- var RegularExpressionClassCharacters$0 = $TR($EXPECT($R20, fail, "RegularExpressionClassCharacters /(?:\\\\.|[^\\]])*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
8182
+ var RegularExpressionClassCharacters$0 = $TR($EXPECT($R21, fail, "RegularExpressionClassCharacters /(?:\\\\.|[^\\]])*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
8094
8183
  return { $loc, token: $0 };
8095
8184
  });
8096
8185
  function RegularExpressionClassCharacters(state) {
@@ -8185,7 +8274,7 @@ ${input.slice(result.pos)}
8185
8274
  var HeregexPart$2 = $T($S(TemplateSubstitution), function(value) {
8186
8275
  return { "type": "Substitution", "children": value[0] };
8187
8276
  });
8188
- var HeregexPart$3 = $TR($EXPECT($R21, fail, "HeregexPart /(?:\\\\.)/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
8277
+ var HeregexPart$3 = $TR($EXPECT($R22, fail, "HeregexPart /(?:\\\\.)/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
8189
8278
  let token = $0;
8190
8279
  switch ($0[1]) {
8191
8280
  case "\n":
@@ -8203,13 +8292,13 @@ ${input.slice(result.pos)}
8203
8292
  var HeregexPart$4 = $TS($S(HeregexComment), function($skip, $loc, $0, $1) {
8204
8293
  return { $loc, token: "" };
8205
8294
  });
8206
- var HeregexPart$5 = $TR($EXPECT($R22, fail, "HeregexPart /[\\s]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
8295
+ var HeregexPart$5 = $TR($EXPECT($R23, fail, "HeregexPart /[\\s]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
8207
8296
  return { $loc, token: "" };
8208
8297
  });
8209
- var HeregexPart$6 = $TR($EXPECT($R23, fail, "HeregexPart /\\/(?!\\/\\/)/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
8298
+ var HeregexPart$6 = $TR($EXPECT($R24, fail, "HeregexPart /\\/(?!\\/\\/)/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
8210
8299
  return { $loc, token: "\\/" };
8211
8300
  });
8212
- var HeregexPart$7 = $TR($EXPECT($R24, fail, "HeregexPart /[^\\/\\s#\\\\]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
8301
+ var HeregexPart$7 = $TR($EXPECT($R25, fail, "HeregexPart /[^\\/\\s#\\\\]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
8213
8302
  return { $loc, token: $0 };
8214
8303
  });
8215
8304
  function HeregexPart(state) {
@@ -8250,7 +8339,7 @@ ${input.slice(result.pos)}
8250
8339
  return result;
8251
8340
  }
8252
8341
  }
8253
- var RegularExpressionBody$0 = $S($N($R$0($EXPECT($R25, fail, "RegularExpressionBody /[*\\/\\r\\n]/"))), $Q(RegExpCharacter));
8342
+ var RegularExpressionBody$0 = $S($N($R$0($EXPECT($R26, fail, "RegularExpressionBody /[*\\/\\r\\n]/"))), $Q(RegExpCharacter));
8254
8343
  function RegularExpressionBody(state) {
8255
8344
  if (state.events) {
8256
8345
  const result = state.events.enter?.("RegularExpressionBody", state);
@@ -8269,7 +8358,7 @@ ${input.slice(result.pos)}
8269
8358
  return result;
8270
8359
  }
8271
8360
  }
8272
- var RegExpCharacter$0 = $R$0($EXPECT($R26, fail, "RegExpCharacter /(?:\\\\.|[^\\/\\r\\n])+/"));
8361
+ var RegExpCharacter$0 = $R$0($EXPECT($R27, fail, "RegExpCharacter /(?:\\\\.|[^\\/\\r\\n])+/"));
8273
8362
  function RegExpCharacter(state) {
8274
8363
  if (state.events) {
8275
8364
  const result = state.events.enter?.("RegExpCharacter", state);
@@ -8288,7 +8377,7 @@ ${input.slice(result.pos)}
8288
8377
  return result;
8289
8378
  }
8290
8379
  }
8291
- var RegularExpressionFlags$0 = $R$0($EXPECT($R27, fail, "RegularExpressionFlags /(?:\\p{ID_Continue}|[\\u200C\\u200D$])*/"));
8380
+ var RegularExpressionFlags$0 = $R$0($EXPECT($R28, fail, "RegularExpressionFlags /(?:\\p{ID_Continue}|[\\u200C\\u200D$])*/"));
8292
8381
  function RegularExpressionFlags(state) {
8293
8382
  if (state.events) {
8294
8383
  const result = state.events.enter?.("RegularExpressionFlags", state);
@@ -8348,7 +8437,7 @@ ${input.slice(result.pos)}
8348
8437
  return result;
8349
8438
  }
8350
8439
  }
8351
- var TemplateCharacters$0 = $TR($EXPECT($R28, fail, "TemplateCharacters /(?:\\$(?!\\{)|\\\\.|[^$`])+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
8440
+ var TemplateCharacters$0 = $TR($EXPECT($R29, fail, "TemplateCharacters /(?:\\$(?!\\{)|\\\\.|[^$`])+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
8352
8441
  return { $loc, token: $0 };
8353
8442
  });
8354
8443
  function TemplateCharacters(state) {
@@ -8369,7 +8458,7 @@ ${input.slice(result.pos)}
8369
8458
  return result;
8370
8459
  }
8371
8460
  }
8372
- var TemplateBlockCharacters$0 = $TR($EXPECT($R29, fail, "TemplateBlockCharacters /(?:\\$(?!\\{)|`(?!``)|\\\\.|[^$`])+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
8461
+ var TemplateBlockCharacters$0 = $TR($EXPECT($R30, fail, "TemplateBlockCharacters /(?:\\$(?!\\{)|`(?!``)|\\\\.|[^$`])+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
8373
8462
  return { $loc, token: $0 };
8374
8463
  });
8375
8464
  function TemplateBlockCharacters(state) {
@@ -8390,11 +8479,11 @@ ${input.slice(result.pos)}
8390
8479
  return result;
8391
8480
  }
8392
8481
  }
8393
- var ReservedWord$0 = $S(CoffeeBooleansEnabled, $R$0($EXPECT($R30, fail, "ReservedWord /(?:on|off|yes|no)(?!\\p{ID_Continue})/")));
8394
- var ReservedWord$1 = $S(CoffeeIsntEnabled, $R$0($EXPECT($R31, fail, "ReservedWord /(?:isnt)(?!\\p{ID_Continue})/")));
8395
- var ReservedWord$2 = $S(CoffeeForLoopsEnabled, $R$0($EXPECT($R32, fail, "ReservedWord /(?:by)(?!\\p{ID_Continue})/")));
8396
- var ReservedWord$3 = $S(CoffeeOfEnabled, $R$0($EXPECT($R33, fail, "ReservedWord /(?:of)(?!\\p{ID_Continue})/")));
8397
- var ReservedWord$4 = $R$0($EXPECT($R34, 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|let|loop|new|null|or|return|static|super|switch|this|throw|true|try|typeof|unless|until|var|void|while|with|yield)(?!\\p{ID_Continue})/"));
8482
+ var ReservedWord$0 = $S(CoffeeBooleansEnabled, $R$0($EXPECT($R31, fail, "ReservedWord /(?:on|off|yes|no)(?!\\p{ID_Continue})/")));
8483
+ var ReservedWord$1 = $S(CoffeeIsntEnabled, $R$0($EXPECT($R32, fail, "ReservedWord /(?:isnt)(?!\\p{ID_Continue})/")));
8484
+ var ReservedWord$2 = $S(CoffeeForLoopsEnabled, $R$0($EXPECT($R33, fail, "ReservedWord /(?:by)(?!\\p{ID_Continue})/")));
8485
+ var ReservedWord$3 = $S(CoffeeOfEnabled, $R$0($EXPECT($R34, fail, "ReservedWord /(?:of)(?!\\p{ID_Continue})/")));
8486
+ var ReservedWord$4 = $R$0($EXPECT($R35, 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|let|loop|new|null|or|return|static|super|switch|this|throw|true|try|typeof|unless|until|var|void|while|with|yield)(?!\\p{ID_Continue})/"));
8398
8487
  function ReservedWord(state) {
8399
8488
  if (state.events) {
8400
8489
  const result = state.events.enter?.("ReservedWord", state);
@@ -8453,7 +8542,7 @@ ${input.slice(result.pos)}
8453
8542
  return result;
8454
8543
  }
8455
8544
  }
8456
- var JSSingleLineComment$0 = $TR($EXPECT($R35, fail, "JSSingleLineComment /\\/\\/(?!\\/)[^\\r\\n]*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
8545
+ var JSSingleLineComment$0 = $TR($EXPECT($R36, fail, "JSSingleLineComment /\\/\\/(?!\\/)[^\\r\\n]*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
8457
8546
  return { $loc, token: $0 };
8458
8547
  });
8459
8548
  function JSSingleLineComment(state) {
@@ -8494,7 +8583,7 @@ ${input.slice(result.pos)}
8494
8583
  return result;
8495
8584
  }
8496
8585
  }
8497
- var JSMultiLineComment$0 = $TV($TEXT($S($EXPECT($L86, fail, 'JSMultiLineComment "/*"'), $Q($S($N($EXPECT($L87, fail, 'JSMultiLineComment "*/"')), $EXPECT($R36, fail, "JSMultiLineComment /./"))), $EXPECT($L87, fail, 'JSMultiLineComment "*/"'))), function($skip, $loc, $0, $1) {
8586
+ var JSMultiLineComment$0 = $TV($TEXT($S($EXPECT($L86, fail, 'JSMultiLineComment "/*"'), $Q($S($N($EXPECT($L87, fail, 'JSMultiLineComment "*/"')), $EXPECT($R37, fail, "JSMultiLineComment /./"))), $EXPECT($L87, fail, 'JSMultiLineComment "*/"'))), function($skip, $loc, $0, $1) {
8498
8587
  return { $loc, token: $1 };
8499
8588
  });
8500
8589
  function JSMultiLineComment(state) {
@@ -8515,7 +8604,7 @@ ${input.slice(result.pos)}
8515
8604
  return result;
8516
8605
  }
8517
8606
  }
8518
- var CoffeeSingleLineComment$0 = $TR($EXPECT($R37, fail, "CoffeeSingleLineComment /#(?!##(?!#))([^\\r\\n]*)/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
8607
+ var CoffeeSingleLineComment$0 = $TR($EXPECT($R38, fail, "CoffeeSingleLineComment /#(?!##(?!#))([^\\r\\n]*)/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
8519
8608
  return { $loc, token: `//${$1}` };
8520
8609
  });
8521
8610
  function CoffeeSingleLineComment(state) {
@@ -8536,7 +8625,7 @@ ${input.slice(result.pos)}
8536
8625
  return result;
8537
8626
  }
8538
8627
  }
8539
- var CoffeeMultiLineComment$0 = $TS($S(CoffeeHereCommentStart, $TEXT($Q($S($N($C(CoffeeHereCommentStart, $EXPECT($L87, fail, 'CoffeeMultiLineComment "*/"'))), $EXPECT($R36, fail, "CoffeeMultiLineComment /./")))), CoffeeHereCommentStart), function($skip, $loc, $0, $1, $2, $3) {
8628
+ var CoffeeMultiLineComment$0 = $TS($S(CoffeeHereCommentStart, $TEXT($Q($S($N($C(CoffeeHereCommentStart, $EXPECT($L87, fail, 'CoffeeMultiLineComment "*/"'))), $EXPECT($R37, fail, "CoffeeMultiLineComment /./")))), CoffeeHereCommentStart), function($skip, $loc, $0, $1, $2, $3) {
8540
8629
  return { $loc, token: `/*${$2}*/` };
8541
8630
  });
8542
8631
  function CoffeeMultiLineComment(state) {
@@ -8557,7 +8646,7 @@ ${input.slice(result.pos)}
8557
8646
  return result;
8558
8647
  }
8559
8648
  }
8560
- var CoffeeHereCommentStart$0 = $R$0($EXPECT($R38, fail, "CoffeeHereCommentStart /###(?!#)/"));
8649
+ var CoffeeHereCommentStart$0 = $R$0($EXPECT($R39, fail, "CoffeeHereCommentStart /###(?!#)/"));
8561
8650
  function CoffeeHereCommentStart(state) {
8562
8651
  if (state.events) {
8563
8652
  const result = state.events.enter?.("CoffeeHereCommentStart", state);
@@ -8576,7 +8665,7 @@ ${input.slice(result.pos)}
8576
8665
  return result;
8577
8666
  }
8578
8667
  }
8579
- var InlineComment$0 = $TV($TEXT($S($EXPECT($L86, fail, 'InlineComment "/*"'), $TEXT($Q($S($N($EXPECT($L87, fail, 'InlineComment "*/"')), $EXPECT($R39, fail, "InlineComment /[^\\r\\n]/")))), $EXPECT($L87, fail, 'InlineComment "*/"'))), function($skip, $loc, $0, $1) {
8668
+ var InlineComment$0 = $TV($TEXT($S($EXPECT($L86, fail, 'InlineComment "/*"'), $TEXT($Q($S($N($EXPECT($L87, fail, 'InlineComment "*/"')), $EXPECT($R40, fail, "InlineComment /[^\\r\\n]/")))), $EXPECT($L87, fail, 'InlineComment "*/"'))), function($skip, $loc, $0, $1) {
8580
8669
  return { $loc, token: $1 };
8581
8670
  });
8582
8671
  function InlineComment(state) {
@@ -8656,7 +8745,7 @@ ${input.slice(result.pos)}
8656
8745
  return result;
8657
8746
  }
8658
8747
  }
8659
- var NonNewlineWhitespace$0 = $TR($EXPECT($R40, fail, "NonNewlineWhitespace /[ \\t]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
8748
+ var NonNewlineWhitespace$0 = $TR($EXPECT($R41, fail, "NonNewlineWhitespace /[ \\t]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
8660
8749
  return { $loc, token: $0 };
8661
8750
  });
8662
8751
  var NonNewlineWhitespace$1 = $T($S(CoffeeLineContinuationEnabled, $EXPECT($L88, fail, 'NonNewlineWhitespace "\\\\\\\\"'), EOL), function(value) {
@@ -8699,7 +8788,7 @@ ${input.slice(result.pos)}
8699
8788
  return result;
8700
8789
  }
8701
8790
  }
8702
- var Whitespace$0 = $TR($EXPECT($R22, fail, "Whitespace /[\\s]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
8791
+ var Whitespace$0 = $TR($EXPECT($R23, fail, "Whitespace /[\\s]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
8703
8792
  return { $loc, token: $0 };
8704
8793
  });
8705
8794
  function Whitespace(state) {
@@ -8765,7 +8854,7 @@ ${input.slice(result.pos)}
8765
8854
  return result;
8766
8855
  }
8767
8856
  }
8768
- var NonIdContinue$0 = $R$0($EXPECT($R41, fail, "NonIdContinue /(?!\\p{ID_Continue})/"));
8857
+ var NonIdContinue$0 = $R$0($EXPECT($R42, fail, "NonIdContinue /(?!\\p{ID_Continue})/"));
8769
8858
  function NonIdContinue(state) {
8770
8859
  if (state.events) {
8771
8860
  const result = state.events.enter?.("NonIdContinue", state);
@@ -9498,7 +9587,7 @@ ${input.slice(result.pos)}
9498
9587
  return result;
9499
9588
  }
9500
9589
  }
9501
- var Import$0 = $TS($S($EXPECT($L10, fail, 'Import "import"'), $Y($EXPECT($R42, fail, "Import /\\s/"))), function($skip, $loc, $0, $1, $2) {
9590
+ var Import$0 = $TS($S($EXPECT($L10, fail, 'Import "import"'), $Y($EXPECT($R43, fail, "Import /\\s/"))), function($skip, $loc, $0, $1, $2) {
9502
9591
  return { $loc, token: $1 };
9503
9592
  });
9504
9593
  function Import(state) {
@@ -10237,12 +10326,24 @@ ${input.slice(result.pos)}
10237
10326
  }
10238
10327
  }
10239
10328
  var JSXElement$0 = JSXSelfClosingElement;
10240
- var JSXElement$1 = $TS($S(JSXOpeningElement, $Q(JSXChildren), __, JSXClosingElement), function($skip, $loc, $0, $1, $2, $3, $4) {
10241
- if ($1[1] !== $4[2]) {
10242
- throw new Error(`mismatched closing tags at ${JSON.stringify($loc)}`);
10243
- }
10329
+ var JSXElement$1 = $TS($S(JSXOpeningElement, $E(JSXChildren), __, JSXClosingElement), function($skip, $loc, $0, $1, $2, $3, $4) {
10330
+ if ($1[1] !== $4[2])
10331
+ return $skip;
10244
10332
  return $0;
10245
10333
  });
10334
+ var JSXElement$2 = $TS($S(JSXOpeningElement, $Q($C(_, JSXChild)), JSXNestedChildren, InsertNewline, InsertIndent), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
10335
+ var open = $1;
10336
+ var c1 = $2;
10337
+ var c2 = $3;
10338
+ if (c1.length || c2.length) {
10339
+ return [...$0, ["</", open[1], ">"]];
10340
+ } else {
10341
+ return [open.slice(0, -1), " />"];
10342
+ }
10343
+ });
10344
+ var JSXElement$3 = $TS($S(JSXOpeningElement), function($skip, $loc, $0, $1) {
10345
+ throw new Error(`could not parse JSX element "${require_generate()($0)}" at pos ${$loc.pos}`);
10346
+ });
10246
10347
  function JSXElement(state) {
10247
10348
  if (state.events) {
10248
10349
  const result = state.events.enter?.("JSXElement", state);
@@ -10250,12 +10351,12 @@ ${input.slice(result.pos)}
10250
10351
  return result.cache;
10251
10352
  }
10252
10353
  if (state.tokenize) {
10253
- const result = $TOKEN("JSXElement", state, JSXElement$0(state) || JSXElement$1(state));
10354
+ const result = $TOKEN("JSXElement", state, JSXElement$0(state) || JSXElement$1(state) || JSXElement$2(state) || JSXElement$3(state));
10254
10355
  if (state.events)
10255
10356
  state.events.exit?.("JSXElement", state, result);
10256
10357
  return result;
10257
10358
  } else {
10258
- const result = JSXElement$0(state) || JSXElement$1(state);
10359
+ const result = JSXElement$0(state) || JSXElement$1(state) || JSXElement$2(state) || JSXElement$3(state);
10259
10360
  if (state.events)
10260
10361
  state.events.exit?.("JSXElement", state, result);
10261
10362
  return result;
@@ -10319,6 +10420,9 @@ ${input.slice(result.pos)}
10319
10420
  }
10320
10421
  }
10321
10422
  var JSXFragment$0 = $S($EXPECT($L145, fail, 'JSXFragment "<>"'), $E(JSXChildren), $EXPECT($L146, fail, 'JSXFragment "</>"'));
10423
+ var JSXFragment$1 = $TS($S($EXPECT($L145, fail, 'JSXFragment "<>"'), JSXNestedChildren, InsertNewline, InsertIndent), function($skip, $loc, $0, $1, $2, $3, $4) {
10424
+ return [...$0, "</>"];
10425
+ });
10322
10426
  function JSXFragment(state) {
10323
10427
  if (state.events) {
10324
10428
  const result = state.events.enter?.("JSXFragment", state);
@@ -10326,12 +10430,12 @@ ${input.slice(result.pos)}
10326
10430
  return result.cache;
10327
10431
  }
10328
10432
  if (state.tokenize) {
10329
- const result = $TOKEN("JSXFragment", state, JSXFragment$0(state));
10433
+ const result = $TOKEN("JSXFragment", state, JSXFragment$0(state) || JSXFragment$1(state));
10330
10434
  if (state.events)
10331
10435
  state.events.exit?.("JSXFragment", state, result);
10332
10436
  return result;
10333
10437
  } else {
10334
- const result = JSXFragment$0(state);
10438
+ const result = JSXFragment$0(state) || JSXFragment$1(state);
10335
10439
  if (state.events)
10336
10440
  state.events.exit?.("JSXFragment", state, result);
10337
10441
  return result;
@@ -10356,7 +10460,7 @@ ${input.slice(result.pos)}
10356
10460
  return result;
10357
10461
  }
10358
10462
  }
10359
- var JSXIdentifierName$0 = $R$0($EXPECT($R43, fail, "JSXIdentifierName /(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*/"));
10463
+ var JSXIdentifierName$0 = $R$0($EXPECT($R44, fail, "JSXIdentifierName /(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*/"));
10360
10464
  function JSXIdentifierName(state) {
10361
10465
  if (state.events) {
10362
10466
  const result = state.events.enter?.("JSXIdentifierName", state);
@@ -10452,8 +10556,8 @@ ${input.slice(result.pos)}
10452
10556
  return result;
10453
10557
  }
10454
10558
  }
10455
- var JSXAttributeValue$0 = $R$0($EXPECT($R44, fail, 'JSXAttributeValue /"[^"]*"/'));
10456
- var JSXAttributeValue$1 = $R$0($EXPECT($R45, fail, "JSXAttributeValue /'[^']*'/"));
10559
+ var JSXAttributeValue$0 = $R$0($EXPECT($R45, fail, 'JSXAttributeValue /"[^"]*"/'));
10560
+ var JSXAttributeValue$1 = $R$0($EXPECT($R46, fail, "JSXAttributeValue /'[^']*'/"));
10457
10561
  var JSXAttributeValue$2 = $S(OpenBrace, ExtendedExpression, __, CloseBrace);
10458
10562
  var JSXAttributeValue$3 = JSXElement;
10459
10563
  var JSXAttributeValue$4 = JSXFragment;
@@ -10494,6 +10598,32 @@ ${input.slice(result.pos)}
10494
10598
  return result;
10495
10599
  }
10496
10600
  }
10601
+ var JSXNestedChildren$0 = $TS($S(PushIndent, $Q($S(Nested, $P(JSXChild))), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
10602
+ if ($2.length)
10603
+ return $2;
10604
+ return $skip;
10605
+ });
10606
+ var JSXNestedChildren$1 = $TV($Y(EOS), function($skip, $loc, $0, $1) {
10607
+ return [];
10608
+ });
10609
+ function JSXNestedChildren(state) {
10610
+ if (state.events) {
10611
+ const result = state.events.enter?.("JSXNestedChildren", state);
10612
+ if (result)
10613
+ return result.cache;
10614
+ }
10615
+ if (state.tokenize) {
10616
+ const result = $TOKEN("JSXNestedChildren", state, JSXNestedChildren$0(state) || JSXNestedChildren$1(state));
10617
+ if (state.events)
10618
+ state.events.exit?.("JSXNestedChildren", state, result);
10619
+ return result;
10620
+ } else {
10621
+ const result = JSXNestedChildren$0(state) || JSXNestedChildren$1(state);
10622
+ if (state.events)
10623
+ state.events.exit?.("JSXNestedChildren", state, result);
10624
+ return result;
10625
+ }
10626
+ }
10497
10627
  var JSXChild$0 = JSXText;
10498
10628
  var JSXChild$1 = JSXElement;
10499
10629
  var JSXChild$2 = JSXFragment;
@@ -10516,7 +10646,7 @@ ${input.slice(result.pos)}
10516
10646
  return result;
10517
10647
  }
10518
10648
  }
10519
- var JSXText$0 = $R$0($EXPECT($R46, fail, "JSXText /[^{}<>]+/"));
10649
+ var JSXText$0 = $R$0($EXPECT($R47, fail, "JSXText /[^{}<>\\r\\n]+/"));
10520
10650
  function JSXText(state) {
10521
10651
  if (state.events) {
10522
10652
  const result = state.events.enter?.("JSXText", state);
@@ -10844,7 +10974,7 @@ ${input.slice(result.pos)}
10844
10974
  return result;
10845
10975
  }
10846
10976
  }
10847
- var TypeIndexSignature$0 = $S($E($S($R$0($EXPECT($R47, fail, "TypeIndexSignature /[+-]?/")), $EXPECT($L151, fail, 'TypeIndexSignature "readonly"'), __)), OpenBracket, TypeIndex, CloseBracket, $E($S(__, $R$0($EXPECT($R48, fail, "TypeIndexSignature /[+-]/")), QuestionMark)));
10977
+ var TypeIndexSignature$0 = $S($E($S($R$0($EXPECT($R48, fail, "TypeIndexSignature /[+-]?/")), $EXPECT($L151, fail, 'TypeIndexSignature "readonly"'), __)), OpenBracket, TypeIndex, CloseBracket, $E($S(__, $R$0($EXPECT($R49, fail, "TypeIndexSignature /[+-]/")), QuestionMark)));
10848
10978
  function TypeIndexSignature(state) {
10849
10979
  if (state.events) {
10850
10980
  const result = state.events.enter?.("TypeIndexSignature", state);
@@ -11382,7 +11512,7 @@ ${input.slice(result.pos)}
11382
11512
  return result;
11383
11513
  }
11384
11514
  }
11385
- var Shebang$0 = $S($R$0($EXPECT($R49, fail, "Shebang /#![^\\r\\n]*/")), EOL);
11515
+ var Shebang$0 = $S($R$0($EXPECT($R50, fail, "Shebang /#![^\\r\\n]*/")), EOL);
11386
11516
  function Shebang(state) {
11387
11517
  if (state.events) {
11388
11518
  const result = state.events.enter?.("Shebang", state);
@@ -11401,11 +11531,11 @@ ${input.slice(result.pos)}
11401
11531
  return result;
11402
11532
  }
11403
11533
  }
11404
- var CivetPrologue$0 = $T($S($EXPECT($R50, fail, "CivetPrologue /[\\t ]*/"), DoubleQuote, CivetPrologueContent, DoubleQuote, $TEXT(StatementDelimiter), EOS), function(value) {
11534
+ var CivetPrologue$0 = $T($S($EXPECT($R51, fail, "CivetPrologue /[\\t ]*/"), DoubleQuote, CivetPrologueContent, DoubleQuote, $TEXT(StatementDelimiter), EOS), function(value) {
11405
11535
  var content = value[2];
11406
11536
  return content;
11407
11537
  });
11408
- var CivetPrologue$1 = $T($S($EXPECT($R50, fail, "CivetPrologue /[\\t ]*/"), SingleQuote, CivetPrologueContent, SingleQuote, $TEXT(StatementDelimiter), EOS), function(value) {
11538
+ var CivetPrologue$1 = $T($S($EXPECT($R51, fail, "CivetPrologue /[\\t ]*/"), SingleQuote, CivetPrologueContent, SingleQuote, $TEXT(StatementDelimiter), EOS), function(value) {
11409
11539
  var content = value[2];
11410
11540
  return content;
11411
11541
  });
@@ -11427,7 +11557,7 @@ ${input.slice(result.pos)}
11427
11557
  return result;
11428
11558
  }
11429
11559
  }
11430
- var CivetPrologueContent$0 = $TS($S($EXPECT($L156, fail, 'CivetPrologueContent "civet"'), $Q(CivetOption), $EXPECT($R51, fail, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3) {
11560
+ var CivetPrologueContent$0 = $TS($S($EXPECT($L156, fail, 'CivetPrologueContent "civet"'), $Q(CivetOption), $EXPECT($R52, fail, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3) {
11431
11561
  var options = $2;
11432
11562
  return {
11433
11563
  type: "CivetPrologue",
@@ -11453,7 +11583,7 @@ ${input.slice(result.pos)}
11453
11583
  return result;
11454
11584
  }
11455
11585
  }
11456
- var CivetOption$0 = $TR($EXPECT($R52, fail, "CivetOption /\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
11586
+ var CivetOption$0 = $TR($EXPECT($R53, fail, "CivetOption /\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
11457
11587
  const optionName = $2.replace(/-+([a-z]?)/g, (_2, l) => {
11458
11588
  if (l)
11459
11589
  return l.toUpperCase();
@@ -11485,7 +11615,7 @@ ${input.slice(result.pos)}
11485
11615
  return result;
11486
11616
  }
11487
11617
  }
11488
- var UnknownPrologue$0 = $S($R$0($EXPECT($R50, fail, "UnknownPrologue /[\\t ]*/")), BasicStringLiteral, $TEXT(StatementDelimiter), EOS);
11618
+ var UnknownPrologue$0 = $S($R$0($EXPECT($R51, fail, "UnknownPrologue /[\\t ]*/")), BasicStringLiteral, $TEXT(StatementDelimiter), EOS);
11489
11619
  function UnknownPrologue(state) {
11490
11620
  if (state.events) {
11491
11621
  const result = state.events.enter?.("UnknownPrologue", state);
@@ -11543,7 +11673,7 @@ ${input.slice(result.pos)}
11543
11673
  return result;
11544
11674
  }
11545
11675
  }
11546
- var EOL$0 = $TR($EXPECT($R53, fail, "EOL /\\r\\n|\\n|\\r|$/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
11676
+ var EOL$0 = $TR($EXPECT($R54, fail, "EOL /\\r\\n|\\n|\\r|$/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
11547
11677
  return { $loc, token: $0 };
11548
11678
  });
11549
11679
  function EOL(state) {
@@ -12126,8 +12256,7 @@ ${input.slice(result.pos)}
12126
12256
  }
12127
12257
  });
12128
12258
  }
12129
- module2.verbose = false;
12130
- module2.config = {
12259
+ module2.config = parse2.config = {
12131
12260
  autoVar: false,
12132
12261
  coffeeBinaryExistential: false,
12133
12262
  coffeeBooleans: false,
@@ -12142,7 +12271,8 @@ ${input.slice(result.pos)}
12142
12271
  coffeeNot: false,
12143
12272
  coffeeOf: false,
12144
12273
  implicitReturns: true,
12145
- tab: void 0
12274
+ tab: void 0,
12275
+ verbose: false
12146
12276
  };
12147
12277
  let indexOfRef, hasPropRef, spliceRef;
12148
12278
  const asAny = {
@@ -12421,6 +12551,10 @@ ${input.slice(result.pos)}
12421
12551
  return;
12422
12552
  case "WhenClause":
12423
12553
  node.children.splice(node.children.indexOf(node.break), 1);
12554
+ if (node.expressions.length === 0) {
12555
+ node.expressions.push("return");
12556
+ return;
12557
+ }
12424
12558
  insertReturn(node.expressions[node.expressions.length - 1]);
12425
12559
  return;
12426
12560
  case "DefaultClause":
@@ -13015,7 +13149,7 @@ ${input.slice(result.pos)}
13015
13149
  return result;
13016
13150
  }
13017
13151
  }
13018
- var Indent$0 = $TR($EXPECT($R54, fail, "Indent /[ \\t]*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
13152
+ var Indent$0 = $TR($EXPECT($R55, fail, "Indent /[ \\t]*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
13019
13153
  let level;
13020
13154
  if (module2.config.tab) {
13021
13155
  const tabs = $0.match(/\t/g);
@@ -13054,6 +13188,9 @@ ${input.slice(result.pos)}
13054
13188
  if (level <= module2.currentIndent.level) {
13055
13189
  return $skip;
13056
13190
  }
13191
+ if (module2.config.verbose) {
13192
+ console.log("pushing indent", indent);
13193
+ }
13057
13194
  module2.indentLevels.push(indent);
13058
13195
  });
13059
13196
  function TrackIndented(state) {
@@ -13148,7 +13285,7 @@ ${input.slice(result.pos)}
13148
13285
  }
13149
13286
  }
13150
13287
  var PopIndent$0 = $TV($EXPECT($L0, fail, 'PopIndent ""'), function($skip, $loc, $0, $1) {
13151
- if (module2.verbose) {
13288
+ if (module2.config.verbose) {
13152
13289
  console.log("popping indent", module2.indentLevels[module2.indentLevels.length - 1], "->", module2.indentLevels[module2.indentLevels.length - 2]);
13153
13290
  }
13154
13291
  module2.indentLevels.pop();
@@ -13176,11 +13313,11 @@ ${input.slice(result.pos)}
13176
13313
  var indent = $2;
13177
13314
  const { level } = indent;
13178
13315
  const currentIndent = module2.currentIndent;
13179
- if (module2.verbose) {
13316
+ if (module2.config.verbose) {
13180
13317
  console.log("Indented", level, currentIndent);
13181
13318
  }
13182
13319
  if (level !== currentIndent.level) {
13183
- if (module2.verbose) {
13320
+ if (module2.config.verbose) {
13184
13321
  console.log("skipped nested");
13185
13322
  }
13186
13323
  return $skip;
@@ -13210,85 +13347,6 @@ ${input.slice(result.pos)}
13210
13347
  }
13211
13348
  });
13212
13349
 
13213
- // source/generate.coffee
13214
- var require_generate = __commonJS({
13215
- "source/generate.coffee"(exports2, module2) {
13216
- "civet coffeeCompat";
13217
- var gen2;
13218
- var prune2;
13219
- gen2 = function(node, options) {
13220
- var $loc, token;
13221
- if (node === null || node === void 0) {
13222
- return "";
13223
- }
13224
- if (typeof node === "string") {
13225
- if (options != null) {
13226
- if (typeof options.updateSourceMap === "function") {
13227
- options.updateSourceMap(node);
13228
- }
13229
- }
13230
- return node;
13231
- }
13232
- if (Array.isArray(node)) {
13233
- return node.map(function(child) {
13234
- return gen2(child, options);
13235
- }).join("");
13236
- }
13237
- if (typeof node === "object") {
13238
- if (options.js && node.ts) {
13239
- return "";
13240
- }
13241
- if (node.$loc != null) {
13242
- ({ token, $loc } = node);
13243
- if (options != null) {
13244
- if (typeof options.updateSourceMap === "function") {
13245
- options.updateSourceMap(token, $loc.pos);
13246
- }
13247
- }
13248
- return token;
13249
- }
13250
- if (!node.children) {
13251
- debugger;
13252
- throw new Error("Unknown node", JSON.stringify(node));
13253
- }
13254
- return gen2(node.children, options);
13255
- }
13256
- debugger;
13257
- throw new Error("Unknown node", JSON.stringify(node));
13258
- };
13259
- module2.exports = gen2;
13260
- prune2 = function(node) {
13261
- var a;
13262
- if (node === null || node === void 0) {
13263
- return;
13264
- }
13265
- if (node.length === 0) {
13266
- return;
13267
- }
13268
- if (Array.isArray(node)) {
13269
- a = node.map(function(n) {
13270
- return prune2(n);
13271
- }).filter(function(n) {
13272
- return !!n;
13273
- });
13274
- if (a.length > 1) {
13275
- return a;
13276
- }
13277
- if (a.length === 1) {
13278
- return a[0];
13279
- }
13280
- return;
13281
- }
13282
- if (node.children != null) {
13283
- node.children = prune2(node.children) || [];
13284
- return node;
13285
- }
13286
- return node;
13287
- };
13288
- gen2.prune = prune2;
13289
- }
13290
- });
13291
-
13292
13350
  // source/util.coffee
13293
13351
  var require_util = __commonJS({
13294
13352
  "source/util.coffee"(exports2, module2) {
@@ -13708,7 +13766,13 @@ makeCache = function() {
13708
13766
  case "NestedImplicitObjectLiteral":
13709
13767
  case "NestedImplicitPropertyDefinitions":
13710
13768
  case "NestedBlockStatement":
13769
+ case "NestedElement":
13770
+ case "NestedElementList":
13771
+ case "NestedBindingElement":
13772
+ case "NestedBindingElements":
13711
13773
  case "NestedInterfaceProperty":
13774
+ case "MemberExpression":
13775
+ case "PrimaryExpression":
13712
13776
  case "IndentedApplicationAllowed":
13713
13777
  case "ExpressionWithIndentedApplicationSuppressed":
13714
13778
  case "SuppressIndentedApplication":
@@ -13721,6 +13785,11 @@ makeCache = function() {
13721
13785
  case "CoffeeCommentEnabled":
13722
13786
  case "SingleLineComment":
13723
13787
  case "Debugger":
13788
+ case "JSXElement":
13789
+ case "JSXChild":
13790
+ case "JSXChildren":
13791
+ case "JSXFragment":
13792
+ case "JSXNestedChildren":
13724
13793
  break;
13725
13794
  default:
13726
13795
  cache = /* @__PURE__ */ new Map();
@@ -13734,6 +13803,9 @@ makeCache = function() {
13734
13803
  cache.set(state.pos, result);
13735
13804
  }
13736
13805
  }
13806
+ if (parse.config.verbose && result) {
13807
+ console.log(`Parsed ${JSON.stringify(state.input.slice(state.pos, result.pos))} [pos ${state.pos}-${result.pos}] as ${ruleName}`);
13808
+ }
13737
13809
  }
13738
13810
  };
13739
13811
  return events;