@danielx/civet 0.5.0 → 0.5.2

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/README.md CHANGED
@@ -208,6 +208,7 @@ Things Added that CoffeeScript didn't
208
208
  - Any braced object literal can be used as an attribute:
209
209
  `{foo}` → `foo={foo}`, `{foo: bar}` → `foo={bar}`,
210
210
  `{...foo}` remains as is; methods and getters/setters work too.
211
+ - `...foo` shorthand for `{...foo}`
211
212
  - Attribute values without whitespace or suitably wrapped
212
213
  (parenthesized expressions, strings and template strings,
213
214
  regular expressions, array literals, braced object literals)
package/dist/browser.js CHANGED
@@ -809,6 +809,7 @@ ${input.slice(result.pos)}
809
809
  OpenParen,
810
810
  QuestionMark,
811
811
  Return,
812
+ Satisfies,
812
813
  Semicolon,
813
814
  SingleQuote,
814
815
  Star,
@@ -1070,41 +1071,42 @@ ${input.slice(result.pos)}
1070
1071
  var $L122 = $L("[");
1071
1072
  var $L123 = $L("(");
1072
1073
  var $L124 = $L("return");
1073
- var $L125 = $L("'");
1074
- var $L126 = $L("static");
1075
- var $L127 = $L("${");
1076
- var $L128 = $L("switch");
1077
- var $L129 = $L("target");
1078
- var $L130 = $L("then");
1079
- var $L131 = $L("this");
1080
- var $L132 = $L("throw");
1081
- var $L133 = $L('"""');
1082
- var $L134 = $L("'''");
1083
- var $L135 = $L("///");
1084
- var $L136 = $L("```");
1085
- var $L137 = $L("try");
1086
- var $L138 = $L("typeof");
1087
- var $L139 = $L("unless");
1088
- var $L140 = $L("until");
1089
- var $L141 = $L("var");
1090
- var $L142 = $L("void");
1091
- var $L143 = $L("when");
1092
- var $L144 = $L("while");
1093
- var $L145 = $L("yield");
1094
- var $L146 = $L("/>");
1095
- var $L147 = $L("</");
1096
- var $L148 = $L("<>");
1097
- var $L149 = $L("</>");
1098
- var $L150 = $L("declare");
1099
- var $L151 = $L("type");
1100
- var $L152 = $L("interface");
1101
- var $L153 = $L("namespace");
1102
- var $L154 = $L("readonly");
1103
- var $L155 = $L("asserts");
1104
- var $L156 = $L("keyof");
1105
- var $L157 = $L("infer");
1106
- var $L158 = $L("[]");
1107
- var $L159 = $L("civet");
1074
+ var $L125 = $L("satisfies");
1075
+ var $L126 = $L("'");
1076
+ var $L127 = $L("static");
1077
+ var $L128 = $L("${");
1078
+ var $L129 = $L("switch");
1079
+ var $L130 = $L("target");
1080
+ var $L131 = $L("then");
1081
+ var $L132 = $L("this");
1082
+ var $L133 = $L("throw");
1083
+ var $L134 = $L('"""');
1084
+ var $L135 = $L("'''");
1085
+ var $L136 = $L("///");
1086
+ var $L137 = $L("```");
1087
+ var $L138 = $L("try");
1088
+ var $L139 = $L("typeof");
1089
+ var $L140 = $L("unless");
1090
+ var $L141 = $L("until");
1091
+ var $L142 = $L("var");
1092
+ var $L143 = $L("void");
1093
+ var $L144 = $L("when");
1094
+ var $L145 = $L("while");
1095
+ var $L146 = $L("yield");
1096
+ var $L147 = $L("/>");
1097
+ var $L148 = $L("</");
1098
+ var $L149 = $L("<>");
1099
+ var $L150 = $L("</>");
1100
+ var $L151 = $L("declare");
1101
+ var $L152 = $L("type");
1102
+ var $L153 = $L("interface");
1103
+ var $L154 = $L("namespace");
1104
+ var $L155 = $L("readonly");
1105
+ var $L156 = $L("asserts");
1106
+ var $L157 = $L("keyof");
1107
+ var $L158 = $L("infer");
1108
+ var $L159 = $L("[]");
1109
+ var $L160 = $L("civet");
1108
1110
  var $R0 = $R(new RegExp("(for|of|then|when)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
1109
1111
  var $R1 = $R(new RegExp("[&]", "suy"));
1110
1112
  var $R2 = $R(new RegExp("[!~+-]+", "suy"));
@@ -1141,7 +1143,7 @@ ${input.slice(result.pos)}
1141
1143
  var $R33 = $R(new RegExp("(?:isnt)(?!\\p{ID_Continue})", "suy"));
1142
1144
  var $R34 = $R(new RegExp("(?:by)(?!\\p{ID_Continue})", "suy"));
1143
1145
  var $R35 = $R(new RegExp("(?:of)(?!\\p{ID_Continue})", "suy"));
1144
- var $R36 = $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"));
1146
+ var $R36 = $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|satisfies|static|super|switch|this|throw|true|try|typeof|unless|until|var|void|while|with|yield)(?!\\p{ID_Continue})", "suy"));
1145
1147
  var $R37 = $R(new RegExp("\\/\\/(?!\\/)[^\\r\\n]*", "suy"));
1146
1148
  var $R38 = $R(new RegExp(".", "suy"));
1147
1149
  var $R39 = $R(new RegExp("#(?!##(?!#))([^\\r\\n]*)", "suy"));
@@ -1305,7 +1307,7 @@ ${input.slice(result.pos)}
1305
1307
  return result;
1306
1308
  }
1307
1309
  }
1308
- var ExplicitArguments$0 = $S(OpenParen, $E(ArgumentList), $E($S(__, Comma)), __, CloseParen);
1310
+ var ExplicitArguments$0 = $S($E(TypeArguments), OpenParen, $E(ArgumentList), $E($S(__, Comma)), __, CloseParen);
1309
1311
  function ExplicitArguments(state) {
1310
1312
  if (state.events) {
1311
1313
  const result = state.events.enter?.("ExplicitArguments", state);
@@ -1610,6 +1612,9 @@ ${input.slice(result.pos)}
1610
1612
  var UnaryPostfix$1 = $T($P($S(__, As, Type)), function(value) {
1611
1613
  return { "ts": true, "children": value };
1612
1614
  });
1615
+ var UnaryPostfix$2 = $T($P($S(__, Satisfies, Type)), function(value) {
1616
+ return { "ts": true, "children": value };
1617
+ });
1613
1618
  function UnaryPostfix(state) {
1614
1619
  if (state.events) {
1615
1620
  const result = state.events.enter?.("UnaryPostfix", state);
@@ -1617,12 +1622,12 @@ ${input.slice(result.pos)}
1617
1622
  return result.cache;
1618
1623
  }
1619
1624
  if (state.tokenize) {
1620
- const result = $TOKEN("UnaryPostfix", state, UnaryPostfix$0(state) || UnaryPostfix$1(state));
1625
+ const result = $TOKEN("UnaryPostfix", state, UnaryPostfix$0(state) || UnaryPostfix$1(state) || UnaryPostfix$2(state));
1621
1626
  if (state.events)
1622
1627
  state.events.exit?.("UnaryPostfix", state, result);
1623
1628
  return result;
1624
1629
  } else {
1625
- const result = UnaryPostfix$0(state) || UnaryPostfix$1(state);
1630
+ const result = UnaryPostfix$0(state) || UnaryPostfix$1(state) || UnaryPostfix$2(state);
1626
1631
  if (state.events)
1627
1632
  state.events.exit?.("UnaryPostfix", state, result);
1628
1633
  return result;
@@ -8698,7 +8703,7 @@ ${input.slice(result.pos)}
8698
8703
  var ReservedWord$1 = $S(CoffeeIsntEnabled, $R$0($EXPECT($R33, fail, "ReservedWord /(?:isnt)(?!\\p{ID_Continue})/")));
8699
8704
  var ReservedWord$2 = $S(CoffeeForLoopsEnabled, $R$0($EXPECT($R34, fail, "ReservedWord /(?:by)(?!\\p{ID_Continue})/")));
8700
8705
  var ReservedWord$3 = $S(CoffeeOfEnabled, $R$0($EXPECT($R35, fail, "ReservedWord /(?:of)(?!\\p{ID_Continue})/")));
8701
- var ReservedWord$4 = $R$0($EXPECT($R36, 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})/"));
8706
+ var ReservedWord$4 = $R$0($EXPECT($R36, 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|satisfies|static|super|switch|this|throw|true|try|typeof|unless|until|var|void|while|with|yield)(?!\\p{ID_Continue})/"));
8702
8707
  function ReservedWord(state) {
8703
8708
  if (state.events) {
8704
8709
  const result = state.events.enter?.("ReservedWord", state);
@@ -10053,6 +10058,27 @@ ${input.slice(result.pos)}
10053
10058
  return result;
10054
10059
  }
10055
10060
  }
10061
+ var Satisfies$0 = $TS($S($EXPECT($L125, fail, 'Satisfies "satisfies"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10062
+ return { $loc, token: $1 };
10063
+ });
10064
+ function Satisfies(state) {
10065
+ if (state.events) {
10066
+ const result = state.events.enter?.("Satisfies", state);
10067
+ if (result)
10068
+ return result.cache;
10069
+ }
10070
+ if (state.tokenize) {
10071
+ const result = $TOKEN("Satisfies", state, Satisfies$0(state));
10072
+ if (state.events)
10073
+ state.events.exit?.("Satisfies", state, result);
10074
+ return result;
10075
+ } else {
10076
+ const result = Satisfies$0(state);
10077
+ if (state.events)
10078
+ state.events.exit?.("Satisfies", state, result);
10079
+ return result;
10080
+ }
10081
+ }
10056
10082
  var Semicolon$0 = $TV($EXPECT($L78, fail, 'Semicolon ";"'), function($skip, $loc, $0, $1) {
10057
10083
  return { $loc, token: $1 };
10058
10084
  });
@@ -10074,7 +10100,7 @@ ${input.slice(result.pos)}
10074
10100
  return result;
10075
10101
  }
10076
10102
  }
10077
- var SingleQuote$0 = $TV($EXPECT($L125, fail, `SingleQuote "'"`), function($skip, $loc, $0, $1) {
10103
+ var SingleQuote$0 = $TV($EXPECT($L126, fail, `SingleQuote "'"`), function($skip, $loc, $0, $1) {
10078
10104
  return { $loc, token: $1 };
10079
10105
  });
10080
10106
  function SingleQuote(state) {
@@ -10116,7 +10142,7 @@ ${input.slice(result.pos)}
10116
10142
  return result;
10117
10143
  }
10118
10144
  }
10119
- var Static$0 = $TV($EXPECT($L126, fail, 'Static "static"'), function($skip, $loc, $0, $1) {
10145
+ var Static$0 = $TV($EXPECT($L127, fail, 'Static "static"'), function($skip, $loc, $0, $1) {
10120
10146
  return { $loc, token: $1 };
10121
10147
  });
10122
10148
  var Static$1 = $TS($S($EXPECT($L93, fail, 'Static "@"'), $N($C($EXPECT($L123, fail, 'Static "("'), $EXPECT($L93, fail, 'Static "@"')))), function($skip, $loc, $0, $1, $2) {
@@ -10140,7 +10166,7 @@ ${input.slice(result.pos)}
10140
10166
  return result;
10141
10167
  }
10142
10168
  }
10143
- var SubstitutionStart$0 = $TV($EXPECT($L127, fail, 'SubstitutionStart "${"'), function($skip, $loc, $0, $1) {
10169
+ var SubstitutionStart$0 = $TV($EXPECT($L128, fail, 'SubstitutionStart "${"'), function($skip, $loc, $0, $1) {
10144
10170
  return { $loc, token: $1 };
10145
10171
  });
10146
10172
  function SubstitutionStart(state) {
@@ -10161,7 +10187,7 @@ ${input.slice(result.pos)}
10161
10187
  return result;
10162
10188
  }
10163
10189
  }
10164
- var Switch$0 = $TS($S($EXPECT($L128, fail, 'Switch "switch"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10190
+ var Switch$0 = $TS($S($EXPECT($L129, fail, 'Switch "switch"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10165
10191
  return { $loc, token: $1 };
10166
10192
  });
10167
10193
  function Switch(state) {
@@ -10182,7 +10208,7 @@ ${input.slice(result.pos)}
10182
10208
  return result;
10183
10209
  }
10184
10210
  }
10185
- var Target$0 = $TS($S($EXPECT($L129, fail, 'Target "target"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10211
+ var Target$0 = $TS($S($EXPECT($L130, fail, 'Target "target"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10186
10212
  return { $loc, token: $1 };
10187
10213
  });
10188
10214
  function Target(state) {
@@ -10203,7 +10229,7 @@ ${input.slice(result.pos)}
10203
10229
  return result;
10204
10230
  }
10205
10231
  }
10206
- var Then$0 = $TS($S(__, $EXPECT($L130, fail, 'Then "then"'), NonIdContinue), function($skip, $loc, $0, $1, $2, $3) {
10232
+ var Then$0 = $TS($S(__, $EXPECT($L131, fail, 'Then "then"'), NonIdContinue), function($skip, $loc, $0, $1, $2, $3) {
10207
10233
  return { $loc, token: "" };
10208
10234
  });
10209
10235
  function Then(state) {
@@ -10224,7 +10250,7 @@ ${input.slice(result.pos)}
10224
10250
  return result;
10225
10251
  }
10226
10252
  }
10227
- var This$0 = $TS($S($EXPECT($L131, fail, 'This "this"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10253
+ var This$0 = $TS($S($EXPECT($L132, fail, 'This "this"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10228
10254
  return { $loc, token: $1 };
10229
10255
  });
10230
10256
  function This(state) {
@@ -10245,7 +10271,7 @@ ${input.slice(result.pos)}
10245
10271
  return result;
10246
10272
  }
10247
10273
  }
10248
- var Throw$0 = $TS($S($EXPECT($L132, fail, 'Throw "throw"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10274
+ var Throw$0 = $TS($S($EXPECT($L133, fail, 'Throw "throw"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10249
10275
  return { $loc, token: $1 };
10250
10276
  });
10251
10277
  function Throw(state) {
@@ -10266,7 +10292,7 @@ ${input.slice(result.pos)}
10266
10292
  return result;
10267
10293
  }
10268
10294
  }
10269
- var TripleDoubleQuote$0 = $TV($EXPECT($L133, fail, 'TripleDoubleQuote "\\\\\\"\\\\\\"\\\\\\""'), function($skip, $loc, $0, $1) {
10295
+ var TripleDoubleQuote$0 = $TV($EXPECT($L134, fail, 'TripleDoubleQuote "\\\\\\"\\\\\\"\\\\\\""'), function($skip, $loc, $0, $1) {
10270
10296
  return { $loc, token: "`" };
10271
10297
  });
10272
10298
  function TripleDoubleQuote(state) {
@@ -10287,7 +10313,7 @@ ${input.slice(result.pos)}
10287
10313
  return result;
10288
10314
  }
10289
10315
  }
10290
- var TripleSingleQuote$0 = $TV($EXPECT($L134, fail, `TripleSingleQuote "'''"`), function($skip, $loc, $0, $1) {
10316
+ var TripleSingleQuote$0 = $TV($EXPECT($L135, fail, `TripleSingleQuote "'''"`), function($skip, $loc, $0, $1) {
10291
10317
  return { $loc, token: "`" };
10292
10318
  });
10293
10319
  function TripleSingleQuote(state) {
@@ -10308,7 +10334,7 @@ ${input.slice(result.pos)}
10308
10334
  return result;
10309
10335
  }
10310
10336
  }
10311
- var TripleSlash$0 = $TV($EXPECT($L135, fail, 'TripleSlash "///"'), function($skip, $loc, $0, $1) {
10337
+ var TripleSlash$0 = $TV($EXPECT($L136, fail, 'TripleSlash "///"'), function($skip, $loc, $0, $1) {
10312
10338
  return { $loc, token: "/" };
10313
10339
  });
10314
10340
  function TripleSlash(state) {
@@ -10329,7 +10355,7 @@ ${input.slice(result.pos)}
10329
10355
  return result;
10330
10356
  }
10331
10357
  }
10332
- var TripleTick$0 = $TV($EXPECT($L136, fail, 'TripleTick "```"'), function($skip, $loc, $0, $1) {
10358
+ var TripleTick$0 = $TV($EXPECT($L137, fail, 'TripleTick "```"'), function($skip, $loc, $0, $1) {
10333
10359
  return { $loc, token: "`" };
10334
10360
  });
10335
10361
  function TripleTick(state) {
@@ -10350,7 +10376,7 @@ ${input.slice(result.pos)}
10350
10376
  return result;
10351
10377
  }
10352
10378
  }
10353
- var Try$0 = $TS($S($EXPECT($L137, fail, 'Try "try"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10379
+ var Try$0 = $TS($S($EXPECT($L138, fail, 'Try "try"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10354
10380
  return { $loc, token: $1 };
10355
10381
  });
10356
10382
  function Try(state) {
@@ -10371,7 +10397,7 @@ ${input.slice(result.pos)}
10371
10397
  return result;
10372
10398
  }
10373
10399
  }
10374
- var Typeof$0 = $TS($S($EXPECT($L138, fail, 'Typeof "typeof"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10400
+ var Typeof$0 = $TS($S($EXPECT($L139, fail, 'Typeof "typeof"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10375
10401
  return { $loc, token: $1 };
10376
10402
  });
10377
10403
  function Typeof(state) {
@@ -10392,7 +10418,7 @@ ${input.slice(result.pos)}
10392
10418
  return result;
10393
10419
  }
10394
10420
  }
10395
- var Unless$0 = $TS($S($EXPECT($L139, fail, 'Unless "unless"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10421
+ var Unless$0 = $TS($S($EXPECT($L140, fail, 'Unless "unless"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10396
10422
  return { $loc, token: $1 };
10397
10423
  });
10398
10424
  function Unless(state) {
@@ -10413,7 +10439,7 @@ ${input.slice(result.pos)}
10413
10439
  return result;
10414
10440
  }
10415
10441
  }
10416
- var Until$0 = $TS($S($EXPECT($L140, fail, 'Until "until"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10442
+ var Until$0 = $TS($S($EXPECT($L141, fail, 'Until "until"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10417
10443
  return { $loc, token: $1 };
10418
10444
  });
10419
10445
  function Until(state) {
@@ -10434,7 +10460,7 @@ ${input.slice(result.pos)}
10434
10460
  return result;
10435
10461
  }
10436
10462
  }
10437
- var Var$0 = $TS($S($EXPECT($L141, fail, 'Var "var"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10463
+ var Var$0 = $TS($S($EXPECT($L142, fail, 'Var "var"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10438
10464
  return { $loc, token: $1 };
10439
10465
  });
10440
10466
  function Var(state) {
@@ -10455,7 +10481,7 @@ ${input.slice(result.pos)}
10455
10481
  return result;
10456
10482
  }
10457
10483
  }
10458
- var Void$0 = $TS($S($EXPECT($L142, fail, 'Void "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10484
+ var Void$0 = $TS($S($EXPECT($L143, fail, 'Void "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10459
10485
  return { $loc, token: $1 };
10460
10486
  });
10461
10487
  function Void(state) {
@@ -10476,7 +10502,7 @@ ${input.slice(result.pos)}
10476
10502
  return result;
10477
10503
  }
10478
10504
  }
10479
- var When$0 = $TS($S($EXPECT($L143, fail, 'When "when"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10505
+ var When$0 = $TS($S($EXPECT($L144, fail, 'When "when"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10480
10506
  return { $loc, token: "case" };
10481
10507
  });
10482
10508
  function When(state) {
@@ -10497,7 +10523,7 @@ ${input.slice(result.pos)}
10497
10523
  return result;
10498
10524
  }
10499
10525
  }
10500
- var While$0 = $TS($S($EXPECT($L144, fail, 'While "while"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10526
+ var While$0 = $TS($S($EXPECT($L145, fail, 'While "while"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10501
10527
  return { $loc, token: $1 };
10502
10528
  });
10503
10529
  function While(state) {
@@ -10518,7 +10544,7 @@ ${input.slice(result.pos)}
10518
10544
  return result;
10519
10545
  }
10520
10546
  }
10521
- var Yield$0 = $TS($S($EXPECT($L145, fail, 'Yield "yield"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10547
+ var Yield$0 = $TS($S($EXPECT($L146, fail, 'Yield "yield"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10522
10548
  return { $loc, token: $1 };
10523
10549
  });
10524
10550
  function Yield(state) {
@@ -10575,7 +10601,7 @@ ${input.slice(result.pos)}
10575
10601
  return result;
10576
10602
  }
10577
10603
  }
10578
- var JSXSelfClosingElement$0 = $S($EXPECT($L5, fail, 'JSXSelfClosingElement "<"'), $TEXT(JSXElementName), $E(JSXAttributes), __, $EXPECT($L146, fail, 'JSXSelfClosingElement "/>"'));
10604
+ var JSXSelfClosingElement$0 = $S($EXPECT($L5, fail, 'JSXSelfClosingElement "<"'), $TEXT(JSXElementName), $E(JSXAttributes), __, $EXPECT($L147, fail, 'JSXSelfClosingElement "/>"'));
10579
10605
  function JSXSelfClosingElement(state) {
10580
10606
  if (state.events) {
10581
10607
  const result = state.events.enter?.("JSXSelfClosingElement", state);
@@ -10613,7 +10639,7 @@ ${input.slice(result.pos)}
10613
10639
  return result;
10614
10640
  }
10615
10641
  }
10616
- var JSXClosingElement$0 = $S($EXPECT($L147, fail, 'JSXClosingElement "</"'), __, $TEXT(JSXElementName), __, $EXPECT($L27, fail, 'JSXClosingElement ">"'));
10642
+ var JSXClosingElement$0 = $S($EXPECT($L148, fail, 'JSXClosingElement "</"'), __, $TEXT(JSXElementName), __, $EXPECT($L27, fail, 'JSXClosingElement ">"'));
10617
10643
  function JSXClosingElement(state) {
10618
10644
  if (state.events) {
10619
10645
  const result = state.events.enter?.("JSXClosingElement", state);
@@ -10632,8 +10658,8 @@ ${input.slice(result.pos)}
10632
10658
  return result;
10633
10659
  }
10634
10660
  }
10635
- var JSXFragment$0 = $S($EXPECT($L148, fail, 'JSXFragment "<>"'), $E(JSXChildren), $EXPECT($L149, fail, 'JSXFragment "</>"'));
10636
- var JSXFragment$1 = $TS($S($EXPECT($L148, fail, 'JSXFragment "<>"'), JSXMixedChildren, InsertNewline, InsertIndent), function($skip, $loc, $0, $1, $2, $3, $4) {
10661
+ var JSXFragment$0 = $S($EXPECT($L149, fail, 'JSXFragment "<>"'), $E(JSXChildren), $EXPECT($L150, fail, 'JSXFragment "</>"'));
10662
+ var JSXFragment$1 = $TS($S($EXPECT($L149, fail, 'JSXFragment "<>"'), JSXMixedChildren, InsertNewline, InsertIndent), function($skip, $loc, $0, $1, $2, $3, $4) {
10637
10663
  return [...$0, "</>"];
10638
10664
  });
10639
10665
  function JSXFragment(state) {
@@ -10766,6 +10792,7 @@ ${input.slice(result.pos)}
10766
10792
  return $0;
10767
10793
  }
10768
10794
  });
10795
+ var JSXAttribute$2 = $S(InsertInlineOpenBrace, DotDotDot, InlineJSXAttributeValue, InsertCloseBrace);
10769
10796
  function JSXAttribute(state) {
10770
10797
  if (state.events) {
10771
10798
  const result = state.events.enter?.("JSXAttribute", state);
@@ -10773,12 +10800,12 @@ ${input.slice(result.pos)}
10773
10800
  return result.cache;
10774
10801
  }
10775
10802
  if (state.tokenize) {
10776
- const result = $TOKEN("JSXAttribute", state, JSXAttribute$0(state) || JSXAttribute$1(state));
10803
+ const result = $TOKEN("JSXAttribute", state, JSXAttribute$0(state) || JSXAttribute$1(state) || JSXAttribute$2(state));
10777
10804
  if (state.events)
10778
10805
  state.events.exit?.("JSXAttribute", state, result);
10779
10806
  return result;
10780
10807
  } else {
10781
- const result = JSXAttribute$0(state) || JSXAttribute$1(state);
10808
+ const result = JSXAttribute$0(state) || JSXAttribute$1(state) || JSXAttribute$2(state);
10782
10809
  if (state.events)
10783
10810
  state.events.exit?.("JSXAttribute", state, result);
10784
10811
  return result;
@@ -11260,7 +11287,7 @@ ${input.slice(result.pos)}
11260
11287
  return result;
11261
11288
  }
11262
11289
  }
11263
- var TypeDeclarationModifier$0 = $S($EXPECT($L150, fail, 'TypeDeclarationModifier "declare"'), NonIdContinue);
11290
+ var TypeDeclarationModifier$0 = $S($EXPECT($L151, fail, 'TypeDeclarationModifier "declare"'), NonIdContinue);
11264
11291
  var TypeDeclarationModifier$1 = Export;
11265
11292
  function TypeDeclarationModifier(state) {
11266
11293
  if (state.events) {
@@ -11302,7 +11329,7 @@ ${input.slice(result.pos)}
11302
11329
  return result;
11303
11330
  }
11304
11331
  }
11305
- var TypeKeyword$0 = $S($EXPECT($L151, fail, 'TypeKeyword "type"'), NonIdContinue);
11332
+ var TypeKeyword$0 = $S($EXPECT($L152, fail, 'TypeKeyword "type"'), NonIdContinue);
11306
11333
  function TypeKeyword(state) {
11307
11334
  if (state.events) {
11308
11335
  const result = state.events.enter?.("TypeKeyword", state);
@@ -11321,7 +11348,7 @@ ${input.slice(result.pos)}
11321
11348
  return result;
11322
11349
  }
11323
11350
  }
11324
- var Interface$0 = $S($EXPECT($L152, fail, 'Interface "interface"'), NonIdContinue);
11351
+ var Interface$0 = $S($EXPECT($L153, fail, 'Interface "interface"'), NonIdContinue);
11325
11352
  function Interface(state) {
11326
11353
  if (state.events) {
11327
11354
  const result = state.events.enter?.("Interface", state);
@@ -11340,7 +11367,7 @@ ${input.slice(result.pos)}
11340
11367
  return result;
11341
11368
  }
11342
11369
  }
11343
- var Namespace$0 = $S($EXPECT($L153, fail, 'Namespace "namespace"'), NonIdContinue);
11370
+ var Namespace$0 = $S($EXPECT($L154, fail, 'Namespace "namespace"'), NonIdContinue);
11344
11371
  function Namespace(state) {
11345
11372
  if (state.events) {
11346
11373
  const result = state.events.enter?.("Namespace", state);
@@ -11529,7 +11556,7 @@ ${input.slice(result.pos)}
11529
11556
  return result;
11530
11557
  }
11531
11558
  }
11532
- var TypeIndexSignature$0 = $S($E($S($R$0($EXPECT($R47, fail, "TypeIndexSignature /[+-]?/")), $EXPECT($L154, fail, 'TypeIndexSignature "readonly"'), __)), OpenBracket, TypeIndex, CloseBracket, $E($S(__, $R$0($EXPECT($R4, fail, "TypeIndexSignature /[+-]/")), QuestionMark)));
11559
+ var TypeIndexSignature$0 = $S($E($S($R$0($EXPECT($R47, fail, "TypeIndexSignature /[+-]?/")), $EXPECT($L155, fail, 'TypeIndexSignature "readonly"'), __)), OpenBracket, TypeIndex, CloseBracket, $E($S(__, $R$0($EXPECT($R4, fail, "TypeIndexSignature /[+-]/")), QuestionMark)));
11533
11560
  function TypeIndexSignature(state) {
11534
11561
  if (state.events) {
11535
11562
  const result = state.events.enter?.("TypeIndexSignature", state);
@@ -11589,7 +11616,7 @@ ${input.slice(result.pos)}
11589
11616
  return result;
11590
11617
  }
11591
11618
  }
11592
- var ReturnTypeSuffix$0 = $TS($S(__, Colon, $E($S(__, $EXPECT($L155, fail, 'ReturnTypeSuffix "asserts"'), NonIdContinue)), TypePredicate), function($skip, $loc, $0, $1, $2, $3, $4) {
11619
+ var ReturnTypeSuffix$0 = $TS($S(__, Colon, $E($S(__, $EXPECT($L156, fail, 'ReturnTypeSuffix "asserts"'), NonIdContinue)), TypePredicate), function($skip, $loc, $0, $1, $2, $3, $4) {
11593
11620
  const children = [...$1, $2];
11594
11621
  if ($3)
11595
11622
  children.push($3);
@@ -11724,10 +11751,10 @@ ${input.slice(result.pos)}
11724
11751
  return result;
11725
11752
  }
11726
11753
  }
11727
- var TypeUnaryOp$0 = $EXPECT($L156, fail, 'TypeUnaryOp "keyof"');
11728
- var TypeUnaryOp$1 = $EXPECT($L138, fail, 'TypeUnaryOp "typeof"');
11729
- var TypeUnaryOp$2 = $EXPECT($L157, fail, 'TypeUnaryOp "infer"');
11730
- var TypeUnaryOp$3 = $EXPECT($L154, fail, 'TypeUnaryOp "readonly"');
11754
+ var TypeUnaryOp$0 = $EXPECT($L157, fail, 'TypeUnaryOp "keyof"');
11755
+ var TypeUnaryOp$1 = $EXPECT($L139, fail, 'TypeUnaryOp "typeof"');
11756
+ var TypeUnaryOp$2 = $EXPECT($L158, fail, 'TypeUnaryOp "infer"');
11757
+ var TypeUnaryOp$3 = $EXPECT($L155, fail, 'TypeUnaryOp "readonly"');
11731
11758
  function TypeUnaryOp(state) {
11732
11759
  if (state.events) {
11733
11760
  const result = state.events.enter?.("TypeUnaryOp", state);
@@ -11896,10 +11923,10 @@ ${input.slice(result.pos)}
11896
11923
  }
11897
11924
  var TypeLiteral$0 = Literal;
11898
11925
  var TypeLiteral$1 = TemplateLiteral;
11899
- var TypeLiteral$2 = $TV($EXPECT($L142, fail, 'TypeLiteral "void"'), function($skip, $loc, $0, $1) {
11926
+ var TypeLiteral$2 = $TV($EXPECT($L143, fail, 'TypeLiteral "void"'), function($skip, $loc, $0, $1) {
11900
11927
  return { $loc, token: "void" };
11901
11928
  });
11902
- var TypeLiteral$3 = $TV($EXPECT($L158, fail, 'TypeLiteral "[]"'), function($skip, $loc, $0, $1) {
11929
+ var TypeLiteral$3 = $TV($EXPECT($L159, fail, 'TypeLiteral "[]"'), function($skip, $loc, $0, $1) {
11903
11930
  return { $loc, token: "[]" };
11904
11931
  });
11905
11932
  function TypeLiteral(state) {
@@ -12111,7 +12138,7 @@ ${input.slice(result.pos)}
12111
12138
  return result;
12112
12139
  }
12113
12140
  }
12114
- var CivetPrologueContent$0 = $TS($S($EXPECT($L159, fail, 'CivetPrologueContent "civet"'), $Q(CivetOption), $EXPECT($R50, fail, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3) {
12141
+ var CivetPrologueContent$0 = $TS($S($EXPECT($L160, fail, 'CivetPrologueContent "civet"'), $Q(CivetOption), $EXPECT($R50, fail, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3) {
12115
12142
  var options = $2;
12116
12143
  return {
12117
12144
  type: "CivetPrologue",
@@ -13689,11 +13716,10 @@ ${input.slice(result.pos)}
13689
13716
  gatherRecursiveAll(statements, (n) => n.type === "IterationExpression").forEach((e) => expressionizeIteration(e));
13690
13717
  checkSpliceRef(statements);
13691
13718
  statements.unshift(...module.prelude);
13692
- if (module.config.autoVar) {
13693
- createVarDecs(statements, []);
13694
- }
13695
13719
  if (module.config.autoLet) {
13696
13720
  createLetDecs(statements, []);
13721
+ } else if (module.config.autoVar) {
13722
+ createVarDecs(statements, []);
13697
13723
  }
13698
13724
  populateRefs(statements);
13699
13725
  adjustAtBindings(statements);
package/dist/esm.mjs CHANGED
@@ -84,7 +84,7 @@ export async function load(url, context, next) {
84
84
  sourceMap: true,
85
85
  })
86
86
 
87
- const transpiledPath = url + ".ts"
87
+ const transpiledPath = url + ".tsx"
88
88
 
89
89
  // NOTE: Assuming ts-node hook follows load hook
90
90
  const result = await next(transpiledPath, {
package/dist/main.js CHANGED
@@ -808,6 +808,7 @@ ${input.slice(result.pos)}
808
808
  OpenParen,
809
809
  QuestionMark,
810
810
  Return,
811
+ Satisfies,
811
812
  Semicolon,
812
813
  SingleQuote,
813
814
  Star,
@@ -1069,41 +1070,42 @@ ${input.slice(result.pos)}
1069
1070
  var $L122 = $L("[");
1070
1071
  var $L123 = $L("(");
1071
1072
  var $L124 = $L("return");
1072
- var $L125 = $L("'");
1073
- var $L126 = $L("static");
1074
- var $L127 = $L("${");
1075
- var $L128 = $L("switch");
1076
- var $L129 = $L("target");
1077
- var $L130 = $L("then");
1078
- var $L131 = $L("this");
1079
- var $L132 = $L("throw");
1080
- var $L133 = $L('"""');
1081
- var $L134 = $L("'''");
1082
- var $L135 = $L("///");
1083
- var $L136 = $L("```");
1084
- var $L137 = $L("try");
1085
- var $L138 = $L("typeof");
1086
- var $L139 = $L("unless");
1087
- var $L140 = $L("until");
1088
- var $L141 = $L("var");
1089
- var $L142 = $L("void");
1090
- var $L143 = $L("when");
1091
- var $L144 = $L("while");
1092
- var $L145 = $L("yield");
1093
- var $L146 = $L("/>");
1094
- var $L147 = $L("</");
1095
- var $L148 = $L("<>");
1096
- var $L149 = $L("</>");
1097
- var $L150 = $L("declare");
1098
- var $L151 = $L("type");
1099
- var $L152 = $L("interface");
1100
- var $L153 = $L("namespace");
1101
- var $L154 = $L("readonly");
1102
- var $L155 = $L("asserts");
1103
- var $L156 = $L("keyof");
1104
- var $L157 = $L("infer");
1105
- var $L158 = $L("[]");
1106
- var $L159 = $L("civet");
1073
+ var $L125 = $L("satisfies");
1074
+ var $L126 = $L("'");
1075
+ var $L127 = $L("static");
1076
+ var $L128 = $L("${");
1077
+ var $L129 = $L("switch");
1078
+ var $L130 = $L("target");
1079
+ var $L131 = $L("then");
1080
+ var $L132 = $L("this");
1081
+ var $L133 = $L("throw");
1082
+ var $L134 = $L('"""');
1083
+ var $L135 = $L("'''");
1084
+ var $L136 = $L("///");
1085
+ var $L137 = $L("```");
1086
+ var $L138 = $L("try");
1087
+ var $L139 = $L("typeof");
1088
+ var $L140 = $L("unless");
1089
+ var $L141 = $L("until");
1090
+ var $L142 = $L("var");
1091
+ var $L143 = $L("void");
1092
+ var $L144 = $L("when");
1093
+ var $L145 = $L("while");
1094
+ var $L146 = $L("yield");
1095
+ var $L147 = $L("/>");
1096
+ var $L148 = $L("</");
1097
+ var $L149 = $L("<>");
1098
+ var $L150 = $L("</>");
1099
+ var $L151 = $L("declare");
1100
+ var $L152 = $L("type");
1101
+ var $L153 = $L("interface");
1102
+ var $L154 = $L("namespace");
1103
+ var $L155 = $L("readonly");
1104
+ var $L156 = $L("asserts");
1105
+ var $L157 = $L("keyof");
1106
+ var $L158 = $L("infer");
1107
+ var $L159 = $L("[]");
1108
+ var $L160 = $L("civet");
1107
1109
  var $R0 = $R(new RegExp("(for|of|then|when)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
1108
1110
  var $R1 = $R(new RegExp("[&]", "suy"));
1109
1111
  var $R2 = $R(new RegExp("[!~+-]+", "suy"));
@@ -1140,7 +1142,7 @@ ${input.slice(result.pos)}
1140
1142
  var $R33 = $R(new RegExp("(?:isnt)(?!\\p{ID_Continue})", "suy"));
1141
1143
  var $R34 = $R(new RegExp("(?:by)(?!\\p{ID_Continue})", "suy"));
1142
1144
  var $R35 = $R(new RegExp("(?:of)(?!\\p{ID_Continue})", "suy"));
1143
- var $R36 = $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"));
1145
+ var $R36 = $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|satisfies|static|super|switch|this|throw|true|try|typeof|unless|until|var|void|while|with|yield)(?!\\p{ID_Continue})", "suy"));
1144
1146
  var $R37 = $R(new RegExp("\\/\\/(?!\\/)[^\\r\\n]*", "suy"));
1145
1147
  var $R38 = $R(new RegExp(".", "suy"));
1146
1148
  var $R39 = $R(new RegExp("#(?!##(?!#))([^\\r\\n]*)", "suy"));
@@ -1304,7 +1306,7 @@ ${input.slice(result.pos)}
1304
1306
  return result;
1305
1307
  }
1306
1308
  }
1307
- var ExplicitArguments$0 = $S(OpenParen, $E(ArgumentList), $E($S(__, Comma)), __, CloseParen);
1309
+ var ExplicitArguments$0 = $S($E(TypeArguments), OpenParen, $E(ArgumentList), $E($S(__, Comma)), __, CloseParen);
1308
1310
  function ExplicitArguments(state) {
1309
1311
  if (state.events) {
1310
1312
  const result = state.events.enter?.("ExplicitArguments", state);
@@ -1609,6 +1611,9 @@ ${input.slice(result.pos)}
1609
1611
  var UnaryPostfix$1 = $T($P($S(__, As, Type)), function(value) {
1610
1612
  return { "ts": true, "children": value };
1611
1613
  });
1614
+ var UnaryPostfix$2 = $T($P($S(__, Satisfies, Type)), function(value) {
1615
+ return { "ts": true, "children": value };
1616
+ });
1612
1617
  function UnaryPostfix(state) {
1613
1618
  if (state.events) {
1614
1619
  const result = state.events.enter?.("UnaryPostfix", state);
@@ -1616,12 +1621,12 @@ ${input.slice(result.pos)}
1616
1621
  return result.cache;
1617
1622
  }
1618
1623
  if (state.tokenize) {
1619
- const result = $TOKEN("UnaryPostfix", state, UnaryPostfix$0(state) || UnaryPostfix$1(state));
1624
+ const result = $TOKEN("UnaryPostfix", state, UnaryPostfix$0(state) || UnaryPostfix$1(state) || UnaryPostfix$2(state));
1620
1625
  if (state.events)
1621
1626
  state.events.exit?.("UnaryPostfix", state, result);
1622
1627
  return result;
1623
1628
  } else {
1624
- const result = UnaryPostfix$0(state) || UnaryPostfix$1(state);
1629
+ const result = UnaryPostfix$0(state) || UnaryPostfix$1(state) || UnaryPostfix$2(state);
1625
1630
  if (state.events)
1626
1631
  state.events.exit?.("UnaryPostfix", state, result);
1627
1632
  return result;
@@ -8697,7 +8702,7 @@ ${input.slice(result.pos)}
8697
8702
  var ReservedWord$1 = $S(CoffeeIsntEnabled, $R$0($EXPECT($R33, fail, "ReservedWord /(?:isnt)(?!\\p{ID_Continue})/")));
8698
8703
  var ReservedWord$2 = $S(CoffeeForLoopsEnabled, $R$0($EXPECT($R34, fail, "ReservedWord /(?:by)(?!\\p{ID_Continue})/")));
8699
8704
  var ReservedWord$3 = $S(CoffeeOfEnabled, $R$0($EXPECT($R35, fail, "ReservedWord /(?:of)(?!\\p{ID_Continue})/")));
8700
- var ReservedWord$4 = $R$0($EXPECT($R36, 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})/"));
8705
+ var ReservedWord$4 = $R$0($EXPECT($R36, 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|satisfies|static|super|switch|this|throw|true|try|typeof|unless|until|var|void|while|with|yield)(?!\\p{ID_Continue})/"));
8701
8706
  function ReservedWord(state) {
8702
8707
  if (state.events) {
8703
8708
  const result = state.events.enter?.("ReservedWord", state);
@@ -10052,6 +10057,27 @@ ${input.slice(result.pos)}
10052
10057
  return result;
10053
10058
  }
10054
10059
  }
10060
+ var Satisfies$0 = $TS($S($EXPECT($L125, fail, 'Satisfies "satisfies"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10061
+ return { $loc, token: $1 };
10062
+ });
10063
+ function Satisfies(state) {
10064
+ if (state.events) {
10065
+ const result = state.events.enter?.("Satisfies", state);
10066
+ if (result)
10067
+ return result.cache;
10068
+ }
10069
+ if (state.tokenize) {
10070
+ const result = $TOKEN("Satisfies", state, Satisfies$0(state));
10071
+ if (state.events)
10072
+ state.events.exit?.("Satisfies", state, result);
10073
+ return result;
10074
+ } else {
10075
+ const result = Satisfies$0(state);
10076
+ if (state.events)
10077
+ state.events.exit?.("Satisfies", state, result);
10078
+ return result;
10079
+ }
10080
+ }
10055
10081
  var Semicolon$0 = $TV($EXPECT($L78, fail, 'Semicolon ";"'), function($skip, $loc, $0, $1) {
10056
10082
  return { $loc, token: $1 };
10057
10083
  });
@@ -10073,7 +10099,7 @@ ${input.slice(result.pos)}
10073
10099
  return result;
10074
10100
  }
10075
10101
  }
10076
- var SingleQuote$0 = $TV($EXPECT($L125, fail, `SingleQuote "'"`), function($skip, $loc, $0, $1) {
10102
+ var SingleQuote$0 = $TV($EXPECT($L126, fail, `SingleQuote "'"`), function($skip, $loc, $0, $1) {
10077
10103
  return { $loc, token: $1 };
10078
10104
  });
10079
10105
  function SingleQuote(state) {
@@ -10115,7 +10141,7 @@ ${input.slice(result.pos)}
10115
10141
  return result;
10116
10142
  }
10117
10143
  }
10118
- var Static$0 = $TV($EXPECT($L126, fail, 'Static "static"'), function($skip, $loc, $0, $1) {
10144
+ var Static$0 = $TV($EXPECT($L127, fail, 'Static "static"'), function($skip, $loc, $0, $1) {
10119
10145
  return { $loc, token: $1 };
10120
10146
  });
10121
10147
  var Static$1 = $TS($S($EXPECT($L93, fail, 'Static "@"'), $N($C($EXPECT($L123, fail, 'Static "("'), $EXPECT($L93, fail, 'Static "@"')))), function($skip, $loc, $0, $1, $2) {
@@ -10139,7 +10165,7 @@ ${input.slice(result.pos)}
10139
10165
  return result;
10140
10166
  }
10141
10167
  }
10142
- var SubstitutionStart$0 = $TV($EXPECT($L127, fail, 'SubstitutionStart "${"'), function($skip, $loc, $0, $1) {
10168
+ var SubstitutionStart$0 = $TV($EXPECT($L128, fail, 'SubstitutionStart "${"'), function($skip, $loc, $0, $1) {
10143
10169
  return { $loc, token: $1 };
10144
10170
  });
10145
10171
  function SubstitutionStart(state) {
@@ -10160,7 +10186,7 @@ ${input.slice(result.pos)}
10160
10186
  return result;
10161
10187
  }
10162
10188
  }
10163
- var Switch$0 = $TS($S($EXPECT($L128, fail, 'Switch "switch"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10189
+ var Switch$0 = $TS($S($EXPECT($L129, fail, 'Switch "switch"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10164
10190
  return { $loc, token: $1 };
10165
10191
  });
10166
10192
  function Switch(state) {
@@ -10181,7 +10207,7 @@ ${input.slice(result.pos)}
10181
10207
  return result;
10182
10208
  }
10183
10209
  }
10184
- var Target$0 = $TS($S($EXPECT($L129, fail, 'Target "target"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10210
+ var Target$0 = $TS($S($EXPECT($L130, fail, 'Target "target"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10185
10211
  return { $loc, token: $1 };
10186
10212
  });
10187
10213
  function Target(state) {
@@ -10202,7 +10228,7 @@ ${input.slice(result.pos)}
10202
10228
  return result;
10203
10229
  }
10204
10230
  }
10205
- var Then$0 = $TS($S(__, $EXPECT($L130, fail, 'Then "then"'), NonIdContinue), function($skip, $loc, $0, $1, $2, $3) {
10231
+ var Then$0 = $TS($S(__, $EXPECT($L131, fail, 'Then "then"'), NonIdContinue), function($skip, $loc, $0, $1, $2, $3) {
10206
10232
  return { $loc, token: "" };
10207
10233
  });
10208
10234
  function Then(state) {
@@ -10223,7 +10249,7 @@ ${input.slice(result.pos)}
10223
10249
  return result;
10224
10250
  }
10225
10251
  }
10226
- var This$0 = $TS($S($EXPECT($L131, fail, 'This "this"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10252
+ var This$0 = $TS($S($EXPECT($L132, fail, 'This "this"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10227
10253
  return { $loc, token: $1 };
10228
10254
  });
10229
10255
  function This(state) {
@@ -10244,7 +10270,7 @@ ${input.slice(result.pos)}
10244
10270
  return result;
10245
10271
  }
10246
10272
  }
10247
- var Throw$0 = $TS($S($EXPECT($L132, fail, 'Throw "throw"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10273
+ var Throw$0 = $TS($S($EXPECT($L133, fail, 'Throw "throw"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10248
10274
  return { $loc, token: $1 };
10249
10275
  });
10250
10276
  function Throw(state) {
@@ -10265,7 +10291,7 @@ ${input.slice(result.pos)}
10265
10291
  return result;
10266
10292
  }
10267
10293
  }
10268
- var TripleDoubleQuote$0 = $TV($EXPECT($L133, fail, 'TripleDoubleQuote "\\\\\\"\\\\\\"\\\\\\""'), function($skip, $loc, $0, $1) {
10294
+ var TripleDoubleQuote$0 = $TV($EXPECT($L134, fail, 'TripleDoubleQuote "\\\\\\"\\\\\\"\\\\\\""'), function($skip, $loc, $0, $1) {
10269
10295
  return { $loc, token: "`" };
10270
10296
  });
10271
10297
  function TripleDoubleQuote(state) {
@@ -10286,7 +10312,7 @@ ${input.slice(result.pos)}
10286
10312
  return result;
10287
10313
  }
10288
10314
  }
10289
- var TripleSingleQuote$0 = $TV($EXPECT($L134, fail, `TripleSingleQuote "'''"`), function($skip, $loc, $0, $1) {
10315
+ var TripleSingleQuote$0 = $TV($EXPECT($L135, fail, `TripleSingleQuote "'''"`), function($skip, $loc, $0, $1) {
10290
10316
  return { $loc, token: "`" };
10291
10317
  });
10292
10318
  function TripleSingleQuote(state) {
@@ -10307,7 +10333,7 @@ ${input.slice(result.pos)}
10307
10333
  return result;
10308
10334
  }
10309
10335
  }
10310
- var TripleSlash$0 = $TV($EXPECT($L135, fail, 'TripleSlash "///"'), function($skip, $loc, $0, $1) {
10336
+ var TripleSlash$0 = $TV($EXPECT($L136, fail, 'TripleSlash "///"'), function($skip, $loc, $0, $1) {
10311
10337
  return { $loc, token: "/" };
10312
10338
  });
10313
10339
  function TripleSlash(state) {
@@ -10328,7 +10354,7 @@ ${input.slice(result.pos)}
10328
10354
  return result;
10329
10355
  }
10330
10356
  }
10331
- var TripleTick$0 = $TV($EXPECT($L136, fail, 'TripleTick "```"'), function($skip, $loc, $0, $1) {
10357
+ var TripleTick$0 = $TV($EXPECT($L137, fail, 'TripleTick "```"'), function($skip, $loc, $0, $1) {
10332
10358
  return { $loc, token: "`" };
10333
10359
  });
10334
10360
  function TripleTick(state) {
@@ -10349,7 +10375,7 @@ ${input.slice(result.pos)}
10349
10375
  return result;
10350
10376
  }
10351
10377
  }
10352
- var Try$0 = $TS($S($EXPECT($L137, fail, 'Try "try"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10378
+ var Try$0 = $TS($S($EXPECT($L138, fail, 'Try "try"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10353
10379
  return { $loc, token: $1 };
10354
10380
  });
10355
10381
  function Try(state) {
@@ -10370,7 +10396,7 @@ ${input.slice(result.pos)}
10370
10396
  return result;
10371
10397
  }
10372
10398
  }
10373
- var Typeof$0 = $TS($S($EXPECT($L138, fail, 'Typeof "typeof"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10399
+ var Typeof$0 = $TS($S($EXPECT($L139, fail, 'Typeof "typeof"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10374
10400
  return { $loc, token: $1 };
10375
10401
  });
10376
10402
  function Typeof(state) {
@@ -10391,7 +10417,7 @@ ${input.slice(result.pos)}
10391
10417
  return result;
10392
10418
  }
10393
10419
  }
10394
- var Unless$0 = $TS($S($EXPECT($L139, fail, 'Unless "unless"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10420
+ var Unless$0 = $TS($S($EXPECT($L140, fail, 'Unless "unless"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10395
10421
  return { $loc, token: $1 };
10396
10422
  });
10397
10423
  function Unless(state) {
@@ -10412,7 +10438,7 @@ ${input.slice(result.pos)}
10412
10438
  return result;
10413
10439
  }
10414
10440
  }
10415
- var Until$0 = $TS($S($EXPECT($L140, fail, 'Until "until"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10441
+ var Until$0 = $TS($S($EXPECT($L141, fail, 'Until "until"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10416
10442
  return { $loc, token: $1 };
10417
10443
  });
10418
10444
  function Until(state) {
@@ -10433,7 +10459,7 @@ ${input.slice(result.pos)}
10433
10459
  return result;
10434
10460
  }
10435
10461
  }
10436
- var Var$0 = $TS($S($EXPECT($L141, fail, 'Var "var"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10462
+ var Var$0 = $TS($S($EXPECT($L142, fail, 'Var "var"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10437
10463
  return { $loc, token: $1 };
10438
10464
  });
10439
10465
  function Var(state) {
@@ -10454,7 +10480,7 @@ ${input.slice(result.pos)}
10454
10480
  return result;
10455
10481
  }
10456
10482
  }
10457
- var Void$0 = $TS($S($EXPECT($L142, fail, 'Void "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10483
+ var Void$0 = $TS($S($EXPECT($L143, fail, 'Void "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10458
10484
  return { $loc, token: $1 };
10459
10485
  });
10460
10486
  function Void(state) {
@@ -10475,7 +10501,7 @@ ${input.slice(result.pos)}
10475
10501
  return result;
10476
10502
  }
10477
10503
  }
10478
- var When$0 = $TS($S($EXPECT($L143, fail, 'When "when"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10504
+ var When$0 = $TS($S($EXPECT($L144, fail, 'When "when"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10479
10505
  return { $loc, token: "case" };
10480
10506
  });
10481
10507
  function When(state) {
@@ -10496,7 +10522,7 @@ ${input.slice(result.pos)}
10496
10522
  return result;
10497
10523
  }
10498
10524
  }
10499
- var While$0 = $TS($S($EXPECT($L144, fail, 'While "while"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10525
+ var While$0 = $TS($S($EXPECT($L145, fail, 'While "while"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10500
10526
  return { $loc, token: $1 };
10501
10527
  });
10502
10528
  function While(state) {
@@ -10517,7 +10543,7 @@ ${input.slice(result.pos)}
10517
10543
  return result;
10518
10544
  }
10519
10545
  }
10520
- var Yield$0 = $TS($S($EXPECT($L145, fail, 'Yield "yield"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10546
+ var Yield$0 = $TS($S($EXPECT($L146, fail, 'Yield "yield"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10521
10547
  return { $loc, token: $1 };
10522
10548
  });
10523
10549
  function Yield(state) {
@@ -10574,7 +10600,7 @@ ${input.slice(result.pos)}
10574
10600
  return result;
10575
10601
  }
10576
10602
  }
10577
- var JSXSelfClosingElement$0 = $S($EXPECT($L5, fail, 'JSXSelfClosingElement "<"'), $TEXT(JSXElementName), $E(JSXAttributes), __, $EXPECT($L146, fail, 'JSXSelfClosingElement "/>"'));
10603
+ var JSXSelfClosingElement$0 = $S($EXPECT($L5, fail, 'JSXSelfClosingElement "<"'), $TEXT(JSXElementName), $E(JSXAttributes), __, $EXPECT($L147, fail, 'JSXSelfClosingElement "/>"'));
10578
10604
  function JSXSelfClosingElement(state) {
10579
10605
  if (state.events) {
10580
10606
  const result = state.events.enter?.("JSXSelfClosingElement", state);
@@ -10612,7 +10638,7 @@ ${input.slice(result.pos)}
10612
10638
  return result;
10613
10639
  }
10614
10640
  }
10615
- var JSXClosingElement$0 = $S($EXPECT($L147, fail, 'JSXClosingElement "</"'), __, $TEXT(JSXElementName), __, $EXPECT($L27, fail, 'JSXClosingElement ">"'));
10641
+ var JSXClosingElement$0 = $S($EXPECT($L148, fail, 'JSXClosingElement "</"'), __, $TEXT(JSXElementName), __, $EXPECT($L27, fail, 'JSXClosingElement ">"'));
10616
10642
  function JSXClosingElement(state) {
10617
10643
  if (state.events) {
10618
10644
  const result = state.events.enter?.("JSXClosingElement", state);
@@ -10631,8 +10657,8 @@ ${input.slice(result.pos)}
10631
10657
  return result;
10632
10658
  }
10633
10659
  }
10634
- var JSXFragment$0 = $S($EXPECT($L148, fail, 'JSXFragment "<>"'), $E(JSXChildren), $EXPECT($L149, fail, 'JSXFragment "</>"'));
10635
- var JSXFragment$1 = $TS($S($EXPECT($L148, fail, 'JSXFragment "<>"'), JSXMixedChildren, InsertNewline, InsertIndent), function($skip, $loc, $0, $1, $2, $3, $4) {
10660
+ var JSXFragment$0 = $S($EXPECT($L149, fail, 'JSXFragment "<>"'), $E(JSXChildren), $EXPECT($L150, fail, 'JSXFragment "</>"'));
10661
+ var JSXFragment$1 = $TS($S($EXPECT($L149, fail, 'JSXFragment "<>"'), JSXMixedChildren, InsertNewline, InsertIndent), function($skip, $loc, $0, $1, $2, $3, $4) {
10636
10662
  return [...$0, "</>"];
10637
10663
  });
10638
10664
  function JSXFragment(state) {
@@ -10765,6 +10791,7 @@ ${input.slice(result.pos)}
10765
10791
  return $0;
10766
10792
  }
10767
10793
  });
10794
+ var JSXAttribute$2 = $S(InsertInlineOpenBrace, DotDotDot, InlineJSXAttributeValue, InsertCloseBrace);
10768
10795
  function JSXAttribute(state) {
10769
10796
  if (state.events) {
10770
10797
  const result = state.events.enter?.("JSXAttribute", state);
@@ -10772,12 +10799,12 @@ ${input.slice(result.pos)}
10772
10799
  return result.cache;
10773
10800
  }
10774
10801
  if (state.tokenize) {
10775
- const result = $TOKEN("JSXAttribute", state, JSXAttribute$0(state) || JSXAttribute$1(state));
10802
+ const result = $TOKEN("JSXAttribute", state, JSXAttribute$0(state) || JSXAttribute$1(state) || JSXAttribute$2(state));
10776
10803
  if (state.events)
10777
10804
  state.events.exit?.("JSXAttribute", state, result);
10778
10805
  return result;
10779
10806
  } else {
10780
- const result = JSXAttribute$0(state) || JSXAttribute$1(state);
10807
+ const result = JSXAttribute$0(state) || JSXAttribute$1(state) || JSXAttribute$2(state);
10781
10808
  if (state.events)
10782
10809
  state.events.exit?.("JSXAttribute", state, result);
10783
10810
  return result;
@@ -11259,7 +11286,7 @@ ${input.slice(result.pos)}
11259
11286
  return result;
11260
11287
  }
11261
11288
  }
11262
- var TypeDeclarationModifier$0 = $S($EXPECT($L150, fail, 'TypeDeclarationModifier "declare"'), NonIdContinue);
11289
+ var TypeDeclarationModifier$0 = $S($EXPECT($L151, fail, 'TypeDeclarationModifier "declare"'), NonIdContinue);
11263
11290
  var TypeDeclarationModifier$1 = Export;
11264
11291
  function TypeDeclarationModifier(state) {
11265
11292
  if (state.events) {
@@ -11301,7 +11328,7 @@ ${input.slice(result.pos)}
11301
11328
  return result;
11302
11329
  }
11303
11330
  }
11304
- var TypeKeyword$0 = $S($EXPECT($L151, fail, 'TypeKeyword "type"'), NonIdContinue);
11331
+ var TypeKeyword$0 = $S($EXPECT($L152, fail, 'TypeKeyword "type"'), NonIdContinue);
11305
11332
  function TypeKeyword(state) {
11306
11333
  if (state.events) {
11307
11334
  const result = state.events.enter?.("TypeKeyword", state);
@@ -11320,7 +11347,7 @@ ${input.slice(result.pos)}
11320
11347
  return result;
11321
11348
  }
11322
11349
  }
11323
- var Interface$0 = $S($EXPECT($L152, fail, 'Interface "interface"'), NonIdContinue);
11350
+ var Interface$0 = $S($EXPECT($L153, fail, 'Interface "interface"'), NonIdContinue);
11324
11351
  function Interface(state) {
11325
11352
  if (state.events) {
11326
11353
  const result = state.events.enter?.("Interface", state);
@@ -11339,7 +11366,7 @@ ${input.slice(result.pos)}
11339
11366
  return result;
11340
11367
  }
11341
11368
  }
11342
- var Namespace$0 = $S($EXPECT($L153, fail, 'Namespace "namespace"'), NonIdContinue);
11369
+ var Namespace$0 = $S($EXPECT($L154, fail, 'Namespace "namespace"'), NonIdContinue);
11343
11370
  function Namespace(state) {
11344
11371
  if (state.events) {
11345
11372
  const result = state.events.enter?.("Namespace", state);
@@ -11528,7 +11555,7 @@ ${input.slice(result.pos)}
11528
11555
  return result;
11529
11556
  }
11530
11557
  }
11531
- var TypeIndexSignature$0 = $S($E($S($R$0($EXPECT($R47, fail, "TypeIndexSignature /[+-]?/")), $EXPECT($L154, fail, 'TypeIndexSignature "readonly"'), __)), OpenBracket, TypeIndex, CloseBracket, $E($S(__, $R$0($EXPECT($R4, fail, "TypeIndexSignature /[+-]/")), QuestionMark)));
11558
+ var TypeIndexSignature$0 = $S($E($S($R$0($EXPECT($R47, fail, "TypeIndexSignature /[+-]?/")), $EXPECT($L155, fail, 'TypeIndexSignature "readonly"'), __)), OpenBracket, TypeIndex, CloseBracket, $E($S(__, $R$0($EXPECT($R4, fail, "TypeIndexSignature /[+-]/")), QuestionMark)));
11532
11559
  function TypeIndexSignature(state) {
11533
11560
  if (state.events) {
11534
11561
  const result = state.events.enter?.("TypeIndexSignature", state);
@@ -11588,7 +11615,7 @@ ${input.slice(result.pos)}
11588
11615
  return result;
11589
11616
  }
11590
11617
  }
11591
- var ReturnTypeSuffix$0 = $TS($S(__, Colon, $E($S(__, $EXPECT($L155, fail, 'ReturnTypeSuffix "asserts"'), NonIdContinue)), TypePredicate), function($skip, $loc, $0, $1, $2, $3, $4) {
11618
+ var ReturnTypeSuffix$0 = $TS($S(__, Colon, $E($S(__, $EXPECT($L156, fail, 'ReturnTypeSuffix "asserts"'), NonIdContinue)), TypePredicate), function($skip, $loc, $0, $1, $2, $3, $4) {
11592
11619
  const children = [...$1, $2];
11593
11620
  if ($3)
11594
11621
  children.push($3);
@@ -11723,10 +11750,10 @@ ${input.slice(result.pos)}
11723
11750
  return result;
11724
11751
  }
11725
11752
  }
11726
- var TypeUnaryOp$0 = $EXPECT($L156, fail, 'TypeUnaryOp "keyof"');
11727
- var TypeUnaryOp$1 = $EXPECT($L138, fail, 'TypeUnaryOp "typeof"');
11728
- var TypeUnaryOp$2 = $EXPECT($L157, fail, 'TypeUnaryOp "infer"');
11729
- var TypeUnaryOp$3 = $EXPECT($L154, fail, 'TypeUnaryOp "readonly"');
11753
+ var TypeUnaryOp$0 = $EXPECT($L157, fail, 'TypeUnaryOp "keyof"');
11754
+ var TypeUnaryOp$1 = $EXPECT($L139, fail, 'TypeUnaryOp "typeof"');
11755
+ var TypeUnaryOp$2 = $EXPECT($L158, fail, 'TypeUnaryOp "infer"');
11756
+ var TypeUnaryOp$3 = $EXPECT($L155, fail, 'TypeUnaryOp "readonly"');
11730
11757
  function TypeUnaryOp(state) {
11731
11758
  if (state.events) {
11732
11759
  const result = state.events.enter?.("TypeUnaryOp", state);
@@ -11895,10 +11922,10 @@ ${input.slice(result.pos)}
11895
11922
  }
11896
11923
  var TypeLiteral$0 = Literal;
11897
11924
  var TypeLiteral$1 = TemplateLiteral;
11898
- var TypeLiteral$2 = $TV($EXPECT($L142, fail, 'TypeLiteral "void"'), function($skip, $loc, $0, $1) {
11925
+ var TypeLiteral$2 = $TV($EXPECT($L143, fail, 'TypeLiteral "void"'), function($skip, $loc, $0, $1) {
11899
11926
  return { $loc, token: "void" };
11900
11927
  });
11901
- var TypeLiteral$3 = $TV($EXPECT($L158, fail, 'TypeLiteral "[]"'), function($skip, $loc, $0, $1) {
11928
+ var TypeLiteral$3 = $TV($EXPECT($L159, fail, 'TypeLiteral "[]"'), function($skip, $loc, $0, $1) {
11902
11929
  return { $loc, token: "[]" };
11903
11930
  });
11904
11931
  function TypeLiteral(state) {
@@ -12110,7 +12137,7 @@ ${input.slice(result.pos)}
12110
12137
  return result;
12111
12138
  }
12112
12139
  }
12113
- var CivetPrologueContent$0 = $TS($S($EXPECT($L159, fail, 'CivetPrologueContent "civet"'), $Q(CivetOption), $EXPECT($R50, fail, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3) {
12140
+ var CivetPrologueContent$0 = $TS($S($EXPECT($L160, fail, 'CivetPrologueContent "civet"'), $Q(CivetOption), $EXPECT($R50, fail, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3) {
12114
12141
  var options = $2;
12115
12142
  return {
12116
12143
  type: "CivetPrologue",
@@ -13688,11 +13715,10 @@ ${input.slice(result.pos)}
13688
13715
  gatherRecursiveAll(statements, (n) => n.type === "IterationExpression").forEach((e) => expressionizeIteration(e));
13689
13716
  checkSpliceRef(statements);
13690
13717
  statements.unshift(...module2.prelude);
13691
- if (module2.config.autoVar) {
13692
- createVarDecs(statements, []);
13693
- }
13694
13718
  if (module2.config.autoLet) {
13695
13719
  createLetDecs(statements, []);
13720
+ } else if (module2.config.autoVar) {
13721
+ createVarDecs(statements, []);
13696
13722
  }
13697
13723
  populateRefs(statements);
13698
13724
  adjustAtBindings(statements);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danielx/civet",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "CoffeeScript style syntax for TypeScript",
5
5
  "main": "dist/main.js",
6
6
  "exports": {
@@ -21,8 +21,9 @@
21
21
  "node": "^18.6.0 || ^16.17.0"
22
22
  },
23
23
  "scripts": {
24
- "prepublishOnly": "yarn build && yarn test",
25
24
  "build": "bash ./build/build.sh",
25
+ "npm-release": "bash ./build/npm-release.sh",
26
+ "prepublishOnly": "yarn build && yarn test",
26
27
  "test": "c8 mocha"
27
28
  },
28
29
  "author": "Daniel X. Moore",
@@ -74,4 +75,4 @@
74
75
  "test"
75
76
  ]
76
77
  }
77
- }
78
+ }
package/register.mjs CHANGED
@@ -31,7 +31,7 @@ export async function load(url, context, next) {
31
31
 
32
32
  // NOTE: Assuming ts-node hook follows load hook
33
33
  // NOTE: This causes .civet files to show up as .ts in ts-node error reporting (TODO: May be able to add a sourcemapping)
34
- const result = await next(url.replace(extensionsRegex, ".ts"), {
34
+ const result = await next(url.replace(extensionsRegex, ".tsx"), {
35
35
  // ts-node won't transpile unless this is module
36
36
  // can't use commonjs since we don't rewrite imports
37
37
  format: "module",