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