@danielx/civet 0.6.36 → 0.6.37

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
@@ -3962,6 +3962,7 @@ ${input.slice(result.pos)}
3962
3962
  Typeof,
3963
3963
  Unless,
3964
3964
  Until,
3965
+ Using,
3965
3966
  Var,
3966
3967
  Void,
3967
3968
  When,
@@ -4012,6 +4013,9 @@ ${input.slice(result.pos)}
4012
4013
  JSXChildExpression,
4013
4014
  IndentedJSXChildExpression,
4014
4015
  NestedJSXChildExpression,
4016
+ UsingDeclaration,
4017
+ UsingBinding,
4018
+ UsingJSModeError,
4015
4019
  TypeDeclaration,
4016
4020
  TypeDeclarationRest,
4017
4021
  OptionalEquals,
@@ -4329,29 +4333,30 @@ ${input.slice(result.pos)}
4329
4333
  var $L184 = $L("typeof");
4330
4334
  var $L185 = $L("unless");
4331
4335
  var $L186 = $L("until");
4332
- var $L187 = $L("var");
4333
- var $L188 = $L("void");
4334
- var $L189 = $L("when");
4335
- var $L190 = $L("while");
4336
- var $L191 = $L("yield");
4337
- var $L192 = $L("/>");
4338
- var $L193 = $L("</");
4339
- var $L194 = $L("<>");
4340
- var $L195 = $L("</>");
4341
- var $L196 = $L("<!--");
4342
- var $L197 = $L("-->");
4343
- var $L198 = $L("type");
4344
- var $L199 = $L("enum");
4345
- var $L200 = $L("interface");
4346
- var $L201 = $L("global");
4347
- var $L202 = $L("module");
4348
- var $L203 = $L("namespace");
4349
- var $L204 = $L("asserts");
4350
- var $L205 = $L("keyof");
4351
- var $L206 = $L("infer");
4352
- var $L207 = $L("???");
4353
- var $L208 = $L("[]");
4354
- var $L209 = $L("civet");
4336
+ var $L187 = $L("using");
4337
+ var $L188 = $L("var");
4338
+ var $L189 = $L("void");
4339
+ var $L190 = $L("when");
4340
+ var $L191 = $L("while");
4341
+ var $L192 = $L("yield");
4342
+ var $L193 = $L("/>");
4343
+ var $L194 = $L("</");
4344
+ var $L195 = $L("<>");
4345
+ var $L196 = $L("</>");
4346
+ var $L197 = $L("<!--");
4347
+ var $L198 = $L("-->");
4348
+ var $L199 = $L("type");
4349
+ var $L200 = $L("enum");
4350
+ var $L201 = $L("interface");
4351
+ var $L202 = $L("global");
4352
+ var $L203 = $L("module");
4353
+ var $L204 = $L("namespace");
4354
+ var $L205 = $L("asserts");
4355
+ var $L206 = $L("keyof");
4356
+ var $L207 = $L("infer");
4357
+ var $L208 = $L("???");
4358
+ var $L209 = $L("[]");
4359
+ var $L210 = $L("civet");
4355
4360
  var $R0 = $R(new RegExp("(as|of|satisfies|then|when|implements|xor|xnor)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
4356
4361
  var $R1 = $R(new RegExp("[0-9]", "suy"));
4357
4362
  var $R2 = $R(new RegExp("[)}]", "suy"));
@@ -9541,7 +9546,8 @@ ${input.slice(result.pos)}
9541
9546
  var Declaration$3 = TypeDeclaration;
9542
9547
  var Declaration$4 = EnumDeclaration;
9543
9548
  var Declaration$5 = OperatorDeclaration;
9544
- var Declaration$$ = [Declaration$0, Declaration$1, Declaration$2, Declaration$3, Declaration$4, Declaration$5];
9549
+ var Declaration$6 = UsingDeclaration;
9550
+ var Declaration$$ = [Declaration$0, Declaration$1, Declaration$2, Declaration$3, Declaration$4, Declaration$5, Declaration$6];
9545
9551
  function Declaration(ctx, state) {
9546
9552
  return $EVENT_C(ctx, state, "Declaration", Declaration$$);
9547
9553
  }
@@ -10614,31 +10620,37 @@ ${input.slice(result.pos)}
10614
10620
  function Until(ctx, state) {
10615
10621
  return $EVENT(ctx, state, "Until", Until$0);
10616
10622
  }
10617
- var Var$0 = $TS($S($EXPECT($L187, 'Var "var"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10623
+ var Using$0 = $TS($S($EXPECT($L187, 'Using "using"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10624
+ return { $loc, token: $1 };
10625
+ });
10626
+ function Using(ctx, state) {
10627
+ return $EVENT(ctx, state, "Using", Using$0);
10628
+ }
10629
+ var Var$0 = $TS($S($EXPECT($L188, 'Var "var"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10618
10630
  return { $loc, token: $1 };
10619
10631
  });
10620
10632
  function Var(ctx, state) {
10621
10633
  return $EVENT(ctx, state, "Var", Var$0);
10622
10634
  }
10623
- var Void$0 = $TS($S($EXPECT($L188, 'Void "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10635
+ var Void$0 = $TS($S($EXPECT($L189, 'Void "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10624
10636
  return { $loc, token: $1 };
10625
10637
  });
10626
10638
  function Void(ctx, state) {
10627
10639
  return $EVENT(ctx, state, "Void", Void$0);
10628
10640
  }
10629
- var When$0 = $TS($S($EXPECT($L189, 'When "when"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10641
+ var When$0 = $TS($S($EXPECT($L190, 'When "when"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10630
10642
  return { $loc, token: "case" };
10631
10643
  });
10632
10644
  function When(ctx, state) {
10633
10645
  return $EVENT(ctx, state, "When", When$0);
10634
10646
  }
10635
- var While$0 = $TS($S($EXPECT($L190, 'While "while"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10647
+ var While$0 = $TS($S($EXPECT($L191, 'While "while"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10636
10648
  return { $loc, token: $1 };
10637
10649
  });
10638
10650
  function While(ctx, state) {
10639
10651
  return $EVENT(ctx, state, "While", While$0);
10640
10652
  }
10641
- var Yield$0 = $TS($S($EXPECT($L191, 'Yield "yield"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10653
+ var Yield$0 = $TS($S($EXPECT($L192, 'Yield "yield"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10642
10654
  return { $loc, token: $1, type: "Yield" };
10643
10655
  });
10644
10656
  function Yield(ctx, state) {
@@ -10711,7 +10723,7 @@ ${input.slice(result.pos)}
10711
10723
  function JSXElement(ctx, state) {
10712
10724
  return $EVENT_C(ctx, state, "JSXElement", JSXElement$$);
10713
10725
  }
10714
- var JSXSelfClosingElement$0 = $TS($S($EXPECT($L155, 'JSXSelfClosingElement "<"'), JSXElementName, $E(TypeArguments), $E(JSXAttributes), $E(Whitespace), $EXPECT($L192, 'JSXSelfClosingElement "/>"')), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
10726
+ var JSXSelfClosingElement$0 = $TS($S($EXPECT($L155, 'JSXSelfClosingElement "<"'), JSXElementName, $E(TypeArguments), $E(JSXAttributes), $E(Whitespace), $EXPECT($L193, 'JSXSelfClosingElement "/>"')), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
10715
10727
  return { type: "JSXElement", children: $0, tag: $2 };
10716
10728
  });
10717
10729
  function JSXSelfClosingElement(ctx, state) {
@@ -10745,7 +10757,7 @@ ${input.slice(result.pos)}
10745
10757
  function JSXOptionalClosingElement(ctx, state) {
10746
10758
  return $EVENT_C(ctx, state, "JSXOptionalClosingElement", JSXOptionalClosingElement$$);
10747
10759
  }
10748
- var JSXClosingElement$0 = $S($EXPECT($L193, 'JSXClosingElement "</"'), $E(Whitespace), JSXElementName, $E(Whitespace), $EXPECT($L33, 'JSXClosingElement ">"'));
10760
+ var JSXClosingElement$0 = $S($EXPECT($L194, 'JSXClosingElement "</"'), $E(Whitespace), JSXElementName, $E(Whitespace), $EXPECT($L33, 'JSXClosingElement ">"'));
10749
10761
  function JSXClosingElement(ctx, state) {
10750
10762
  return $EVENT(ctx, state, "JSXClosingElement", JSXClosingElement$0);
10751
10763
  }
@@ -10766,7 +10778,7 @@ ${input.slice(result.pos)}
10766
10778
  ];
10767
10779
  return { type: "JSXFragment", children: parts, jsxChildren: children.jsxChildren };
10768
10780
  });
10769
- var JSXFragment$1 = $TS($S(CoffeeJSXEnabled, $EXPECT($L194, 'JSXFragment "<>"'), $E(JSXChildren), $E(Whitespace), JSXClosingFragment), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
10781
+ var JSXFragment$1 = $TS($S(CoffeeJSXEnabled, $EXPECT($L195, 'JSXFragment "<>"'), $E(JSXChildren), $E(Whitespace), JSXClosingFragment), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
10770
10782
  var children = $3;
10771
10783
  $0 = $0.slice(1);
10772
10784
  return {
@@ -10779,7 +10791,7 @@ ${input.slice(result.pos)}
10779
10791
  function JSXFragment(ctx, state) {
10780
10792
  return $EVENT_C(ctx, state, "JSXFragment", JSXFragment$$);
10781
10793
  }
10782
- var PushJSXOpeningFragment$0 = $TV($EXPECT($L194, 'PushJSXOpeningFragment "<>"'), function($skip, $loc, $0, $1) {
10794
+ var PushJSXOpeningFragment$0 = $TV($EXPECT($L195, 'PushJSXOpeningFragment "<>"'), function($skip, $loc, $0, $1) {
10783
10795
  module.JSXTagStack.push("");
10784
10796
  return $1;
10785
10797
  });
@@ -10796,7 +10808,7 @@ ${input.slice(result.pos)}
10796
10808
  function JSXOptionalClosingFragment(ctx, state) {
10797
10809
  return $EVENT_C(ctx, state, "JSXOptionalClosingFragment", JSXOptionalClosingFragment$$);
10798
10810
  }
10799
- var JSXClosingFragment$0 = $EXPECT($L195, 'JSXClosingFragment "</>"');
10811
+ var JSXClosingFragment$0 = $EXPECT($L196, 'JSXClosingFragment "</>"');
10800
10812
  function JSXClosingFragment(ctx, state) {
10801
10813
  return $EVENT(ctx, state, "JSXClosingFragment", JSXClosingFragment$0);
10802
10814
  }
@@ -11265,7 +11277,7 @@ ${input.slice(result.pos)}
11265
11277
  function JSXChild(ctx, state) {
11266
11278
  return $EVENT_C(ctx, state, "JSXChild", JSXChild$$);
11267
11279
  }
11268
- var JSXComment$0 = $TS($S($EXPECT($L196, 'JSXComment "<!--"'), JSXCommentContent, $EXPECT($L197, 'JSXComment "-->"')), function($skip, $loc, $0, $1, $2, $3) {
11280
+ var JSXComment$0 = $TS($S($EXPECT($L197, 'JSXComment "<!--"'), JSXCommentContent, $EXPECT($L198, 'JSXComment "-->"')), function($skip, $loc, $0, $1, $2, $3) {
11269
11281
  return ["{/*", $2, "*/}"];
11270
11282
  });
11271
11283
  function JSXComment(ctx, state) {
@@ -11303,6 +11315,52 @@ ${input.slice(result.pos)}
11303
11315
  function NestedJSXChildExpression(ctx, state) {
11304
11316
  return $EVENT(ctx, state, "NestedJSXChildExpression", NestedJSXChildExpression$0);
11305
11317
  }
11318
+ var UsingDeclaration$0 = $TS($S(Using, $E(_), UsingBinding, $Q($S(__, Comma, __, UsingBinding)), UsingJSModeError), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
11319
+ var decl = $1;
11320
+ var binding = $3;
11321
+ var tail = $4;
11322
+ const bindings = [binding].concat(tail.map(([, , , b]) => b));
11323
+ return {
11324
+ type: "Declaration",
11325
+ children: $0,
11326
+ names: bindings.flatMap((b) => b.names),
11327
+ bindings,
11328
+ decl,
11329
+ splices: bindings.flatMap((b) => b.splices),
11330
+ thisAssignments: bindings.flatMap((b) => b.thisAssignments)
11331
+ };
11332
+ });
11333
+ function UsingDeclaration(ctx, state) {
11334
+ return $EVENT(ctx, state, "UsingDeclaration", UsingDeclaration$0);
11335
+ }
11336
+ var UsingBinding$0 = $TS($S(BindingIdentifier, $E(TypeSuffix), Initializer), function($skip, $loc, $0, $1, $2, $3) {
11337
+ var pattern = $1;
11338
+ var suffix = $2;
11339
+ var initializer = $3;
11340
+ return {
11341
+ type: "Binding",
11342
+ children: $0,
11343
+ names: pattern.names,
11344
+ pattern,
11345
+ suffix,
11346
+ initializer,
11347
+ splices: [],
11348
+ thisAssignments: []
11349
+ };
11350
+ });
11351
+ function UsingBinding(ctx, state) {
11352
+ return $EVENT(ctx, state, "UsingBinding", UsingBinding$0);
11353
+ }
11354
+ var UsingJSModeError$0 = $TV($EXPECT($L0, 'UsingJSModeError ""'), function($skip, $loc, $0, $1) {
11355
+ return {
11356
+ type: "Error",
11357
+ js: true,
11358
+ message: "`using` is not currently transpiled in JS mode."
11359
+ };
11360
+ });
11361
+ function UsingJSModeError(ctx, state) {
11362
+ return $EVENT(ctx, state, "UsingJSModeError", UsingJSModeError$0);
11363
+ }
11306
11364
  var TypeDeclaration$0 = $T($S($E($S(Export, $E(_))), $S(Declare, $E(_)), TypeLexicalDeclaration), function(value) {
11307
11365
  return { "ts": true, "children": value };
11308
11366
  });
@@ -11351,37 +11409,37 @@ ${input.slice(result.pos)}
11351
11409
  function InterfaceExtendsTarget(ctx, state) {
11352
11410
  return $EVENT(ctx, state, "InterfaceExtendsTarget", InterfaceExtendsTarget$0);
11353
11411
  }
11354
- var TypeKeyword$0 = $TS($S($EXPECT($L198, 'TypeKeyword "type"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11412
+ var TypeKeyword$0 = $TS($S($EXPECT($L199, 'TypeKeyword "type"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11355
11413
  return { $loc, token: $1 };
11356
11414
  });
11357
11415
  function TypeKeyword(ctx, state) {
11358
11416
  return $EVENT(ctx, state, "TypeKeyword", TypeKeyword$0);
11359
11417
  }
11360
- var Enum$0 = $TS($S($EXPECT($L199, 'Enum "enum"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11418
+ var Enum$0 = $TS($S($EXPECT($L200, 'Enum "enum"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11361
11419
  return { $loc, token: $1 };
11362
11420
  });
11363
11421
  function Enum(ctx, state) {
11364
11422
  return $EVENT(ctx, state, "Enum", Enum$0);
11365
11423
  }
11366
- var Interface$0 = $TS($S($EXPECT($L200, 'Interface "interface"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11424
+ var Interface$0 = $TS($S($EXPECT($L201, 'Interface "interface"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11367
11425
  return { $loc, token: $1 };
11368
11426
  });
11369
11427
  function Interface(ctx, state) {
11370
11428
  return $EVENT(ctx, state, "Interface", Interface$0);
11371
11429
  }
11372
- var Global$0 = $TS($S($EXPECT($L201, 'Global "global"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11430
+ var Global$0 = $TS($S($EXPECT($L202, 'Global "global"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11373
11431
  return { $loc, token: $1 };
11374
11432
  });
11375
11433
  function Global(ctx, state) {
11376
11434
  return $EVENT(ctx, state, "Global", Global$0);
11377
11435
  }
11378
- var Module$0 = $TS($S($EXPECT($L202, 'Module "module"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11436
+ var Module$0 = $TS($S($EXPECT($L203, 'Module "module"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11379
11437
  return { $loc, token: $1 };
11380
11438
  });
11381
11439
  function Module(ctx, state) {
11382
11440
  return $EVENT(ctx, state, "Module", Module$0);
11383
11441
  }
11384
- var Namespace$0 = $TS($S($EXPECT($L203, 'Namespace "namespace"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11442
+ var Namespace$0 = $TS($S($EXPECT($L204, 'Namespace "namespace"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11385
11443
  return { $loc, token: $1 };
11386
11444
  });
11387
11445
  function Namespace(ctx, state) {
@@ -11626,7 +11684,7 @@ ${input.slice(result.pos)}
11626
11684
  function ReturnTypeSuffix(ctx, state) {
11627
11685
  return $EVENT(ctx, state, "ReturnTypeSuffix", ReturnTypeSuffix$0);
11628
11686
  }
11629
- var ReturnType$0 = $TS($S($E($S(__, $EXPECT($L204, 'ReturnType "asserts"'), NonIdContinue)), TypePredicate), function($skip, $loc, $0, $1, $2) {
11687
+ var ReturnType$0 = $TS($S($E($S(__, $EXPECT($L205, 'ReturnType "asserts"'), NonIdContinue)), TypePredicate), function($skip, $loc, $0, $1, $2) {
11630
11688
  var asserts = $1;
11631
11689
  var t = $2;
11632
11690
  if (asserts) {
@@ -11695,9 +11753,9 @@ ${input.slice(result.pos)}
11695
11753
  function TypeUnarySuffix(ctx, state) {
11696
11754
  return $EVENT_C(ctx, state, "TypeUnarySuffix", TypeUnarySuffix$$);
11697
11755
  }
11698
- var TypeUnaryOp$0 = $S($EXPECT($L205, 'TypeUnaryOp "keyof"'), NonIdContinue);
11756
+ var TypeUnaryOp$0 = $S($EXPECT($L206, 'TypeUnaryOp "keyof"'), NonIdContinue);
11699
11757
  var TypeUnaryOp$1 = $S($EXPECT($L184, 'TypeUnaryOp "typeof"'), NonIdContinue);
11700
- var TypeUnaryOp$2 = $S($EXPECT($L206, 'TypeUnaryOp "infer"'), NonIdContinue);
11758
+ var TypeUnaryOp$2 = $S($EXPECT($L207, 'TypeUnaryOp "infer"'), NonIdContinue);
11701
11759
  var TypeUnaryOp$3 = $S($EXPECT($L167, 'TypeUnaryOp "readonly"'), NonIdContinue);
11702
11760
  var TypeUnaryOp$$ = [TypeUnaryOp$0, TypeUnaryOp$1, TypeUnaryOp$2, TypeUnaryOp$3];
11703
11761
  function TypeUnaryOp(ctx, state) {
@@ -11707,7 +11765,7 @@ ${input.slice(result.pos)}
11707
11765
  function TypeIndexedAccess(ctx, state) {
11708
11766
  return $EVENT(ctx, state, "TypeIndexedAccess", TypeIndexedAccess$0);
11709
11767
  }
11710
- var UnknownAlias$0 = $TV($EXPECT($L207, 'UnknownAlias "???"'), function($skip, $loc, $0, $1) {
11768
+ var UnknownAlias$0 = $TV($EXPECT($L208, 'UnknownAlias "???"'), function($skip, $loc, $0, $1) {
11711
11769
  return { $loc, token: "unknown" };
11712
11770
  });
11713
11771
  function UnknownAlias(ctx, state) {
@@ -11847,10 +11905,10 @@ ${input.slice(result.pos)}
11847
11905
  }
11848
11906
  var TypeLiteral$0 = TypeTemplateLiteral;
11849
11907
  var TypeLiteral$1 = Literal;
11850
- var TypeLiteral$2 = $TS($S($EXPECT($L188, 'TypeLiteral "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11908
+ var TypeLiteral$2 = $TS($S($EXPECT($L189, 'TypeLiteral "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11851
11909
  return { type: "VoidType", $loc, token: $1 };
11852
11910
  });
11853
- var TypeLiteral$3 = $TV($EXPECT($L208, 'TypeLiteral "[]"'), function($skip, $loc, $0, $1) {
11911
+ var TypeLiteral$3 = $TV($EXPECT($L209, 'TypeLiteral "[]"'), function($skip, $loc, $0, $1) {
11854
11912
  return { $loc, token: "[]" };
11855
11913
  });
11856
11914
  var TypeLiteral$$ = [TypeLiteral$0, TypeLiteral$1, TypeLiteral$2, TypeLiteral$3];
@@ -11971,7 +12029,7 @@ ${input.slice(result.pos)}
11971
12029
  function CivetPrologue(ctx, state) {
11972
12030
  return $EVENT_C(ctx, state, "CivetPrologue", CivetPrologue$$);
11973
12031
  }
11974
- var CivetPrologueContent$0 = $TS($S($EXPECT($L209, 'CivetPrologueContent "civet"'), NonIdContinue, $Q(CivetOption), $EXPECT($R63, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3, $4) {
12032
+ var CivetPrologueContent$0 = $TS($S($EXPECT($L210, 'CivetPrologueContent "civet"'), NonIdContinue, $Q(CivetOption), $EXPECT($R63, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3, $4) {
11975
12033
  var options = $3;
11976
12034
  return {
11977
12035
  type: "CivetPrologue",
@@ -13127,6 +13185,7 @@ ${input.slice(result.pos)}
13127
13185
  exports.Typeof = Typeof;
13128
13186
  exports.Unless = Unless;
13129
13187
  exports.Until = Until;
13188
+ exports.Using = Using;
13130
13189
  exports.Var = Var;
13131
13190
  exports.Void = Void;
13132
13191
  exports.When = When;
@@ -13177,6 +13236,9 @@ ${input.slice(result.pos)}
13177
13236
  exports.JSXChildExpression = JSXChildExpression;
13178
13237
  exports.IndentedJSXChildExpression = IndentedJSXChildExpression;
13179
13238
  exports.NestedJSXChildExpression = NestedJSXChildExpression;
13239
+ exports.UsingDeclaration = UsingDeclaration;
13240
+ exports.UsingBinding = UsingBinding;
13241
+ exports.UsingJSModeError = UsingJSModeError;
13180
13242
  exports.TypeDeclaration = TypeDeclaration;
13181
13243
  exports.TypeDeclarationRest = TypeDeclarationRest;
13182
13244
  exports.OptionalEquals = OptionalEquals;
@@ -13375,17 +13437,17 @@ ${input.slice(result.pos)}
13375
13437
  }).join("");
13376
13438
  }
13377
13439
  if (typeof node === "object") {
13378
- if (node.type === "Error") {
13379
- options.errors ?? (options.errors = []);
13380
- options.errors.push(node);
13381
- return "";
13382
- }
13383
13440
  if (options.js && node.ts) {
13384
13441
  return "";
13385
13442
  }
13386
13443
  if (!options.js && node.js) {
13387
13444
  return "";
13388
13445
  }
13446
+ if (node.type === "Error") {
13447
+ options.errors ?? (options.errors = []);
13448
+ options.errors.push(node);
13449
+ return "";
13450
+ }
13389
13451
  if (node.$loc != null) {
13390
13452
  const { token, $loc } = node;
13391
13453
  options?.updateSourceMap?.(token, $loc.pos);
@@ -2,11 +2,11 @@ import { plugin } from "bun";
2
2
  await plugin({
3
3
  name: "Civet loader",
4
4
  setup: async function(builder) {
5
- ({ compile } = await import("./main.mjs"));
6
- ({ readFileSync } = await import("fs"));
5
+ const { compile } = await import("./main.mjs");
6
+ const { readFileSync } = await import("fs");
7
7
  return builder.onLoad({ filter: /\.civet$/ }, function({ path }) {
8
- source = readFileSync(path, "utf8");
9
- contents = compile(source);
8
+ const source = readFileSync(path, "utf8");
9
+ const contents = compile(source);
10
10
  return {
11
11
  contents,
12
12
  loader: "tsx"
package/dist/main.js CHANGED
@@ -3961,6 +3961,7 @@ var require_parser = __commonJS({
3961
3961
  Typeof,
3962
3962
  Unless,
3963
3963
  Until,
3964
+ Using,
3964
3965
  Var,
3965
3966
  Void,
3966
3967
  When,
@@ -4011,6 +4012,9 @@ var require_parser = __commonJS({
4011
4012
  JSXChildExpression,
4012
4013
  IndentedJSXChildExpression,
4013
4014
  NestedJSXChildExpression,
4015
+ UsingDeclaration,
4016
+ UsingBinding,
4017
+ UsingJSModeError,
4014
4018
  TypeDeclaration,
4015
4019
  TypeDeclarationRest,
4016
4020
  OptionalEquals,
@@ -4328,29 +4332,30 @@ var require_parser = __commonJS({
4328
4332
  var $L184 = $L("typeof");
4329
4333
  var $L185 = $L("unless");
4330
4334
  var $L186 = $L("until");
4331
- var $L187 = $L("var");
4332
- var $L188 = $L("void");
4333
- var $L189 = $L("when");
4334
- var $L190 = $L("while");
4335
- var $L191 = $L("yield");
4336
- var $L192 = $L("/>");
4337
- var $L193 = $L("</");
4338
- var $L194 = $L("<>");
4339
- var $L195 = $L("</>");
4340
- var $L196 = $L("<!--");
4341
- var $L197 = $L("-->");
4342
- var $L198 = $L("type");
4343
- var $L199 = $L("enum");
4344
- var $L200 = $L("interface");
4345
- var $L201 = $L("global");
4346
- var $L202 = $L("module");
4347
- var $L203 = $L("namespace");
4348
- var $L204 = $L("asserts");
4349
- var $L205 = $L("keyof");
4350
- var $L206 = $L("infer");
4351
- var $L207 = $L("???");
4352
- var $L208 = $L("[]");
4353
- var $L209 = $L("civet");
4335
+ var $L187 = $L("using");
4336
+ var $L188 = $L("var");
4337
+ var $L189 = $L("void");
4338
+ var $L190 = $L("when");
4339
+ var $L191 = $L("while");
4340
+ var $L192 = $L("yield");
4341
+ var $L193 = $L("/>");
4342
+ var $L194 = $L("</");
4343
+ var $L195 = $L("<>");
4344
+ var $L196 = $L("</>");
4345
+ var $L197 = $L("<!--");
4346
+ var $L198 = $L("-->");
4347
+ var $L199 = $L("type");
4348
+ var $L200 = $L("enum");
4349
+ var $L201 = $L("interface");
4350
+ var $L202 = $L("global");
4351
+ var $L203 = $L("module");
4352
+ var $L204 = $L("namespace");
4353
+ var $L205 = $L("asserts");
4354
+ var $L206 = $L("keyof");
4355
+ var $L207 = $L("infer");
4356
+ var $L208 = $L("???");
4357
+ var $L209 = $L("[]");
4358
+ var $L210 = $L("civet");
4354
4359
  var $R0 = $R(new RegExp("(as|of|satisfies|then|when|implements|xor|xnor)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
4355
4360
  var $R1 = $R(new RegExp("[0-9]", "suy"));
4356
4361
  var $R2 = $R(new RegExp("[)}]", "suy"));
@@ -9540,7 +9545,8 @@ var require_parser = __commonJS({
9540
9545
  var Declaration$3 = TypeDeclaration;
9541
9546
  var Declaration$4 = EnumDeclaration;
9542
9547
  var Declaration$5 = OperatorDeclaration;
9543
- var Declaration$$ = [Declaration$0, Declaration$1, Declaration$2, Declaration$3, Declaration$4, Declaration$5];
9548
+ var Declaration$6 = UsingDeclaration;
9549
+ var Declaration$$ = [Declaration$0, Declaration$1, Declaration$2, Declaration$3, Declaration$4, Declaration$5, Declaration$6];
9544
9550
  function Declaration(ctx, state) {
9545
9551
  return $EVENT_C(ctx, state, "Declaration", Declaration$$);
9546
9552
  }
@@ -10613,31 +10619,37 @@ var require_parser = __commonJS({
10613
10619
  function Until(ctx, state) {
10614
10620
  return $EVENT(ctx, state, "Until", Until$0);
10615
10621
  }
10616
- var Var$0 = $TS($S($EXPECT($L187, 'Var "var"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10622
+ var Using$0 = $TS($S($EXPECT($L187, 'Using "using"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10623
+ return { $loc, token: $1 };
10624
+ });
10625
+ function Using(ctx, state) {
10626
+ return $EVENT(ctx, state, "Using", Using$0);
10627
+ }
10628
+ var Var$0 = $TS($S($EXPECT($L188, 'Var "var"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10617
10629
  return { $loc, token: $1 };
10618
10630
  });
10619
10631
  function Var(ctx, state) {
10620
10632
  return $EVENT(ctx, state, "Var", Var$0);
10621
10633
  }
10622
- var Void$0 = $TS($S($EXPECT($L188, 'Void "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10634
+ var Void$0 = $TS($S($EXPECT($L189, 'Void "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10623
10635
  return { $loc, token: $1 };
10624
10636
  });
10625
10637
  function Void(ctx, state) {
10626
10638
  return $EVENT(ctx, state, "Void", Void$0);
10627
10639
  }
10628
- var When$0 = $TS($S($EXPECT($L189, 'When "when"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10640
+ var When$0 = $TS($S($EXPECT($L190, 'When "when"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10629
10641
  return { $loc, token: "case" };
10630
10642
  });
10631
10643
  function When(ctx, state) {
10632
10644
  return $EVENT(ctx, state, "When", When$0);
10633
10645
  }
10634
- var While$0 = $TS($S($EXPECT($L190, 'While "while"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10646
+ var While$0 = $TS($S($EXPECT($L191, 'While "while"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10635
10647
  return { $loc, token: $1 };
10636
10648
  });
10637
10649
  function While(ctx, state) {
10638
10650
  return $EVENT(ctx, state, "While", While$0);
10639
10651
  }
10640
- var Yield$0 = $TS($S($EXPECT($L191, 'Yield "yield"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10652
+ var Yield$0 = $TS($S($EXPECT($L192, 'Yield "yield"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10641
10653
  return { $loc, token: $1, type: "Yield" };
10642
10654
  });
10643
10655
  function Yield(ctx, state) {
@@ -10710,7 +10722,7 @@ var require_parser = __commonJS({
10710
10722
  function JSXElement(ctx, state) {
10711
10723
  return $EVENT_C(ctx, state, "JSXElement", JSXElement$$);
10712
10724
  }
10713
- var JSXSelfClosingElement$0 = $TS($S($EXPECT($L155, 'JSXSelfClosingElement "<"'), JSXElementName, $E(TypeArguments), $E(JSXAttributes), $E(Whitespace), $EXPECT($L192, 'JSXSelfClosingElement "/>"')), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
10725
+ var JSXSelfClosingElement$0 = $TS($S($EXPECT($L155, 'JSXSelfClosingElement "<"'), JSXElementName, $E(TypeArguments), $E(JSXAttributes), $E(Whitespace), $EXPECT($L193, 'JSXSelfClosingElement "/>"')), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
10714
10726
  return { type: "JSXElement", children: $0, tag: $2 };
10715
10727
  });
10716
10728
  function JSXSelfClosingElement(ctx, state) {
@@ -10744,7 +10756,7 @@ var require_parser = __commonJS({
10744
10756
  function JSXOptionalClosingElement(ctx, state) {
10745
10757
  return $EVENT_C(ctx, state, "JSXOptionalClosingElement", JSXOptionalClosingElement$$);
10746
10758
  }
10747
- var JSXClosingElement$0 = $S($EXPECT($L193, 'JSXClosingElement "</"'), $E(Whitespace), JSXElementName, $E(Whitespace), $EXPECT($L33, 'JSXClosingElement ">"'));
10759
+ var JSXClosingElement$0 = $S($EXPECT($L194, 'JSXClosingElement "</"'), $E(Whitespace), JSXElementName, $E(Whitespace), $EXPECT($L33, 'JSXClosingElement ">"'));
10748
10760
  function JSXClosingElement(ctx, state) {
10749
10761
  return $EVENT(ctx, state, "JSXClosingElement", JSXClosingElement$0);
10750
10762
  }
@@ -10765,7 +10777,7 @@ var require_parser = __commonJS({
10765
10777
  ];
10766
10778
  return { type: "JSXFragment", children: parts, jsxChildren: children.jsxChildren };
10767
10779
  });
10768
- var JSXFragment$1 = $TS($S(CoffeeJSXEnabled, $EXPECT($L194, 'JSXFragment "<>"'), $E(JSXChildren), $E(Whitespace), JSXClosingFragment), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
10780
+ var JSXFragment$1 = $TS($S(CoffeeJSXEnabled, $EXPECT($L195, 'JSXFragment "<>"'), $E(JSXChildren), $E(Whitespace), JSXClosingFragment), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
10769
10781
  var children = $3;
10770
10782
  $0 = $0.slice(1);
10771
10783
  return {
@@ -10778,7 +10790,7 @@ var require_parser = __commonJS({
10778
10790
  function JSXFragment(ctx, state) {
10779
10791
  return $EVENT_C(ctx, state, "JSXFragment", JSXFragment$$);
10780
10792
  }
10781
- var PushJSXOpeningFragment$0 = $TV($EXPECT($L194, 'PushJSXOpeningFragment "<>"'), function($skip, $loc, $0, $1) {
10793
+ var PushJSXOpeningFragment$0 = $TV($EXPECT($L195, 'PushJSXOpeningFragment "<>"'), function($skip, $loc, $0, $1) {
10782
10794
  module2.JSXTagStack.push("");
10783
10795
  return $1;
10784
10796
  });
@@ -10795,7 +10807,7 @@ var require_parser = __commonJS({
10795
10807
  function JSXOptionalClosingFragment(ctx, state) {
10796
10808
  return $EVENT_C(ctx, state, "JSXOptionalClosingFragment", JSXOptionalClosingFragment$$);
10797
10809
  }
10798
- var JSXClosingFragment$0 = $EXPECT($L195, 'JSXClosingFragment "</>"');
10810
+ var JSXClosingFragment$0 = $EXPECT($L196, 'JSXClosingFragment "</>"');
10799
10811
  function JSXClosingFragment(ctx, state) {
10800
10812
  return $EVENT(ctx, state, "JSXClosingFragment", JSXClosingFragment$0);
10801
10813
  }
@@ -11264,7 +11276,7 @@ var require_parser = __commonJS({
11264
11276
  function JSXChild(ctx, state) {
11265
11277
  return $EVENT_C(ctx, state, "JSXChild", JSXChild$$);
11266
11278
  }
11267
- var JSXComment$0 = $TS($S($EXPECT($L196, 'JSXComment "<!--"'), JSXCommentContent, $EXPECT($L197, 'JSXComment "-->"')), function($skip, $loc, $0, $1, $2, $3) {
11279
+ var JSXComment$0 = $TS($S($EXPECT($L197, 'JSXComment "<!--"'), JSXCommentContent, $EXPECT($L198, 'JSXComment "-->"')), function($skip, $loc, $0, $1, $2, $3) {
11268
11280
  return ["{/*", $2, "*/}"];
11269
11281
  });
11270
11282
  function JSXComment(ctx, state) {
@@ -11302,6 +11314,52 @@ var require_parser = __commonJS({
11302
11314
  function NestedJSXChildExpression(ctx, state) {
11303
11315
  return $EVENT(ctx, state, "NestedJSXChildExpression", NestedJSXChildExpression$0);
11304
11316
  }
11317
+ var UsingDeclaration$0 = $TS($S(Using, $E(_), UsingBinding, $Q($S(__, Comma, __, UsingBinding)), UsingJSModeError), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
11318
+ var decl = $1;
11319
+ var binding = $3;
11320
+ var tail = $4;
11321
+ const bindings = [binding].concat(tail.map(([, , , b]) => b));
11322
+ return {
11323
+ type: "Declaration",
11324
+ children: $0,
11325
+ names: bindings.flatMap((b) => b.names),
11326
+ bindings,
11327
+ decl,
11328
+ splices: bindings.flatMap((b) => b.splices),
11329
+ thisAssignments: bindings.flatMap((b) => b.thisAssignments)
11330
+ };
11331
+ });
11332
+ function UsingDeclaration(ctx, state) {
11333
+ return $EVENT(ctx, state, "UsingDeclaration", UsingDeclaration$0);
11334
+ }
11335
+ var UsingBinding$0 = $TS($S(BindingIdentifier, $E(TypeSuffix), Initializer), function($skip, $loc, $0, $1, $2, $3) {
11336
+ var pattern = $1;
11337
+ var suffix = $2;
11338
+ var initializer = $3;
11339
+ return {
11340
+ type: "Binding",
11341
+ children: $0,
11342
+ names: pattern.names,
11343
+ pattern,
11344
+ suffix,
11345
+ initializer,
11346
+ splices: [],
11347
+ thisAssignments: []
11348
+ };
11349
+ });
11350
+ function UsingBinding(ctx, state) {
11351
+ return $EVENT(ctx, state, "UsingBinding", UsingBinding$0);
11352
+ }
11353
+ var UsingJSModeError$0 = $TV($EXPECT($L0, 'UsingJSModeError ""'), function($skip, $loc, $0, $1) {
11354
+ return {
11355
+ type: "Error",
11356
+ js: true,
11357
+ message: "`using` is not currently transpiled in JS mode."
11358
+ };
11359
+ });
11360
+ function UsingJSModeError(ctx, state) {
11361
+ return $EVENT(ctx, state, "UsingJSModeError", UsingJSModeError$0);
11362
+ }
11305
11363
  var TypeDeclaration$0 = $T($S($E($S(Export, $E(_))), $S(Declare, $E(_)), TypeLexicalDeclaration), function(value) {
11306
11364
  return { "ts": true, "children": value };
11307
11365
  });
@@ -11350,37 +11408,37 @@ var require_parser = __commonJS({
11350
11408
  function InterfaceExtendsTarget(ctx, state) {
11351
11409
  return $EVENT(ctx, state, "InterfaceExtendsTarget", InterfaceExtendsTarget$0);
11352
11410
  }
11353
- var TypeKeyword$0 = $TS($S($EXPECT($L198, 'TypeKeyword "type"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11411
+ var TypeKeyword$0 = $TS($S($EXPECT($L199, 'TypeKeyword "type"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11354
11412
  return { $loc, token: $1 };
11355
11413
  });
11356
11414
  function TypeKeyword(ctx, state) {
11357
11415
  return $EVENT(ctx, state, "TypeKeyword", TypeKeyword$0);
11358
11416
  }
11359
- var Enum$0 = $TS($S($EXPECT($L199, 'Enum "enum"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11417
+ var Enum$0 = $TS($S($EXPECT($L200, 'Enum "enum"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11360
11418
  return { $loc, token: $1 };
11361
11419
  });
11362
11420
  function Enum(ctx, state) {
11363
11421
  return $EVENT(ctx, state, "Enum", Enum$0);
11364
11422
  }
11365
- var Interface$0 = $TS($S($EXPECT($L200, 'Interface "interface"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11423
+ var Interface$0 = $TS($S($EXPECT($L201, 'Interface "interface"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11366
11424
  return { $loc, token: $1 };
11367
11425
  });
11368
11426
  function Interface(ctx, state) {
11369
11427
  return $EVENT(ctx, state, "Interface", Interface$0);
11370
11428
  }
11371
- var Global$0 = $TS($S($EXPECT($L201, 'Global "global"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11429
+ var Global$0 = $TS($S($EXPECT($L202, 'Global "global"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11372
11430
  return { $loc, token: $1 };
11373
11431
  });
11374
11432
  function Global(ctx, state) {
11375
11433
  return $EVENT(ctx, state, "Global", Global$0);
11376
11434
  }
11377
- var Module$0 = $TS($S($EXPECT($L202, 'Module "module"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11435
+ var Module$0 = $TS($S($EXPECT($L203, 'Module "module"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11378
11436
  return { $loc, token: $1 };
11379
11437
  });
11380
11438
  function Module(ctx, state) {
11381
11439
  return $EVENT(ctx, state, "Module", Module$0);
11382
11440
  }
11383
- var Namespace$0 = $TS($S($EXPECT($L203, 'Namespace "namespace"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11441
+ var Namespace$0 = $TS($S($EXPECT($L204, 'Namespace "namespace"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11384
11442
  return { $loc, token: $1 };
11385
11443
  });
11386
11444
  function Namespace(ctx, state) {
@@ -11625,7 +11683,7 @@ var require_parser = __commonJS({
11625
11683
  function ReturnTypeSuffix(ctx, state) {
11626
11684
  return $EVENT(ctx, state, "ReturnTypeSuffix", ReturnTypeSuffix$0);
11627
11685
  }
11628
- var ReturnType$0 = $TS($S($E($S(__, $EXPECT($L204, 'ReturnType "asserts"'), NonIdContinue)), TypePredicate), function($skip, $loc, $0, $1, $2) {
11686
+ var ReturnType$0 = $TS($S($E($S(__, $EXPECT($L205, 'ReturnType "asserts"'), NonIdContinue)), TypePredicate), function($skip, $loc, $0, $1, $2) {
11629
11687
  var asserts = $1;
11630
11688
  var t = $2;
11631
11689
  if (asserts) {
@@ -11694,9 +11752,9 @@ var require_parser = __commonJS({
11694
11752
  function TypeUnarySuffix(ctx, state) {
11695
11753
  return $EVENT_C(ctx, state, "TypeUnarySuffix", TypeUnarySuffix$$);
11696
11754
  }
11697
- var TypeUnaryOp$0 = $S($EXPECT($L205, 'TypeUnaryOp "keyof"'), NonIdContinue);
11755
+ var TypeUnaryOp$0 = $S($EXPECT($L206, 'TypeUnaryOp "keyof"'), NonIdContinue);
11698
11756
  var TypeUnaryOp$1 = $S($EXPECT($L184, 'TypeUnaryOp "typeof"'), NonIdContinue);
11699
- var TypeUnaryOp$2 = $S($EXPECT($L206, 'TypeUnaryOp "infer"'), NonIdContinue);
11757
+ var TypeUnaryOp$2 = $S($EXPECT($L207, 'TypeUnaryOp "infer"'), NonIdContinue);
11700
11758
  var TypeUnaryOp$3 = $S($EXPECT($L167, 'TypeUnaryOp "readonly"'), NonIdContinue);
11701
11759
  var TypeUnaryOp$$ = [TypeUnaryOp$0, TypeUnaryOp$1, TypeUnaryOp$2, TypeUnaryOp$3];
11702
11760
  function TypeUnaryOp(ctx, state) {
@@ -11706,7 +11764,7 @@ var require_parser = __commonJS({
11706
11764
  function TypeIndexedAccess(ctx, state) {
11707
11765
  return $EVENT(ctx, state, "TypeIndexedAccess", TypeIndexedAccess$0);
11708
11766
  }
11709
- var UnknownAlias$0 = $TV($EXPECT($L207, 'UnknownAlias "???"'), function($skip, $loc, $0, $1) {
11767
+ var UnknownAlias$0 = $TV($EXPECT($L208, 'UnknownAlias "???"'), function($skip, $loc, $0, $1) {
11710
11768
  return { $loc, token: "unknown" };
11711
11769
  });
11712
11770
  function UnknownAlias(ctx, state) {
@@ -11846,10 +11904,10 @@ var require_parser = __commonJS({
11846
11904
  }
11847
11905
  var TypeLiteral$0 = TypeTemplateLiteral;
11848
11906
  var TypeLiteral$1 = Literal;
11849
- var TypeLiteral$2 = $TS($S($EXPECT($L188, 'TypeLiteral "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11907
+ var TypeLiteral$2 = $TS($S($EXPECT($L189, 'TypeLiteral "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11850
11908
  return { type: "VoidType", $loc, token: $1 };
11851
11909
  });
11852
- var TypeLiteral$3 = $TV($EXPECT($L208, 'TypeLiteral "[]"'), function($skip, $loc, $0, $1) {
11910
+ var TypeLiteral$3 = $TV($EXPECT($L209, 'TypeLiteral "[]"'), function($skip, $loc, $0, $1) {
11853
11911
  return { $loc, token: "[]" };
11854
11912
  });
11855
11913
  var TypeLiteral$$ = [TypeLiteral$0, TypeLiteral$1, TypeLiteral$2, TypeLiteral$3];
@@ -11970,7 +12028,7 @@ var require_parser = __commonJS({
11970
12028
  function CivetPrologue(ctx, state) {
11971
12029
  return $EVENT_C(ctx, state, "CivetPrologue", CivetPrologue$$);
11972
12030
  }
11973
- var CivetPrologueContent$0 = $TS($S($EXPECT($L209, 'CivetPrologueContent "civet"'), NonIdContinue, $Q(CivetOption), $EXPECT($R63, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3, $4) {
12031
+ var CivetPrologueContent$0 = $TS($S($EXPECT($L210, 'CivetPrologueContent "civet"'), NonIdContinue, $Q(CivetOption), $EXPECT($R63, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3, $4) {
11974
12032
  var options = $3;
11975
12033
  return {
11976
12034
  type: "CivetPrologue",
@@ -13126,6 +13184,7 @@ var require_parser = __commonJS({
13126
13184
  exports.Typeof = Typeof;
13127
13185
  exports.Unless = Unless;
13128
13186
  exports.Until = Until;
13187
+ exports.Using = Using;
13129
13188
  exports.Var = Var;
13130
13189
  exports.Void = Void;
13131
13190
  exports.When = When;
@@ -13176,6 +13235,9 @@ var require_parser = __commonJS({
13176
13235
  exports.JSXChildExpression = JSXChildExpression;
13177
13236
  exports.IndentedJSXChildExpression = IndentedJSXChildExpression;
13178
13237
  exports.NestedJSXChildExpression = NestedJSXChildExpression;
13238
+ exports.UsingDeclaration = UsingDeclaration;
13239
+ exports.UsingBinding = UsingBinding;
13240
+ exports.UsingJSModeError = UsingJSModeError;
13179
13241
  exports.TypeDeclaration = TypeDeclaration;
13180
13242
  exports.TypeDeclarationRest = TypeDeclarationRest;
13181
13243
  exports.OptionalEquals = OptionalEquals;
@@ -13375,17 +13437,17 @@ function gen(node, options) {
13375
13437
  }).join("");
13376
13438
  }
13377
13439
  if (typeof node === "object") {
13378
- if (node.type === "Error") {
13379
- options.errors ?? (options.errors = []);
13380
- options.errors.push(node);
13381
- return "";
13382
- }
13383
13440
  if (options.js && node.ts) {
13384
13441
  return "";
13385
13442
  }
13386
13443
  if (!options.js && node.js) {
13387
13444
  return "";
13388
13445
  }
13446
+ if (node.type === "Error") {
13447
+ options.errors ?? (options.errors = []);
13448
+ options.errors.push(node);
13449
+ return "";
13450
+ }
13389
13451
  if (node.$loc != null) {
13390
13452
  const { token, $loc } = node;
13391
13453
  options?.updateSourceMap?.(token, $loc.pos);
package/dist/main.mjs CHANGED
@@ -3959,6 +3959,7 @@ var require_parser = __commonJS({
3959
3959
  Typeof,
3960
3960
  Unless,
3961
3961
  Until,
3962
+ Using,
3962
3963
  Var,
3963
3964
  Void,
3964
3965
  When,
@@ -4009,6 +4010,9 @@ var require_parser = __commonJS({
4009
4010
  JSXChildExpression,
4010
4011
  IndentedJSXChildExpression,
4011
4012
  NestedJSXChildExpression,
4013
+ UsingDeclaration,
4014
+ UsingBinding,
4015
+ UsingJSModeError,
4012
4016
  TypeDeclaration,
4013
4017
  TypeDeclarationRest,
4014
4018
  OptionalEquals,
@@ -4326,29 +4330,30 @@ var require_parser = __commonJS({
4326
4330
  var $L184 = $L("typeof");
4327
4331
  var $L185 = $L("unless");
4328
4332
  var $L186 = $L("until");
4329
- var $L187 = $L("var");
4330
- var $L188 = $L("void");
4331
- var $L189 = $L("when");
4332
- var $L190 = $L("while");
4333
- var $L191 = $L("yield");
4334
- var $L192 = $L("/>");
4335
- var $L193 = $L("</");
4336
- var $L194 = $L("<>");
4337
- var $L195 = $L("</>");
4338
- var $L196 = $L("<!--");
4339
- var $L197 = $L("-->");
4340
- var $L198 = $L("type");
4341
- var $L199 = $L("enum");
4342
- var $L200 = $L("interface");
4343
- var $L201 = $L("global");
4344
- var $L202 = $L("module");
4345
- var $L203 = $L("namespace");
4346
- var $L204 = $L("asserts");
4347
- var $L205 = $L("keyof");
4348
- var $L206 = $L("infer");
4349
- var $L207 = $L("???");
4350
- var $L208 = $L("[]");
4351
- var $L209 = $L("civet");
4333
+ var $L187 = $L("using");
4334
+ var $L188 = $L("var");
4335
+ var $L189 = $L("void");
4336
+ var $L190 = $L("when");
4337
+ var $L191 = $L("while");
4338
+ var $L192 = $L("yield");
4339
+ var $L193 = $L("/>");
4340
+ var $L194 = $L("</");
4341
+ var $L195 = $L("<>");
4342
+ var $L196 = $L("</>");
4343
+ var $L197 = $L("<!--");
4344
+ var $L198 = $L("-->");
4345
+ var $L199 = $L("type");
4346
+ var $L200 = $L("enum");
4347
+ var $L201 = $L("interface");
4348
+ var $L202 = $L("global");
4349
+ var $L203 = $L("module");
4350
+ var $L204 = $L("namespace");
4351
+ var $L205 = $L("asserts");
4352
+ var $L206 = $L("keyof");
4353
+ var $L207 = $L("infer");
4354
+ var $L208 = $L("???");
4355
+ var $L209 = $L("[]");
4356
+ var $L210 = $L("civet");
4352
4357
  var $R0 = $R(new RegExp("(as|of|satisfies|then|when|implements|xor|xnor)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
4353
4358
  var $R1 = $R(new RegExp("[0-9]", "suy"));
4354
4359
  var $R2 = $R(new RegExp("[)}]", "suy"));
@@ -9538,7 +9543,8 @@ var require_parser = __commonJS({
9538
9543
  var Declaration$3 = TypeDeclaration;
9539
9544
  var Declaration$4 = EnumDeclaration;
9540
9545
  var Declaration$5 = OperatorDeclaration;
9541
- var Declaration$$ = [Declaration$0, Declaration$1, Declaration$2, Declaration$3, Declaration$4, Declaration$5];
9546
+ var Declaration$6 = UsingDeclaration;
9547
+ var Declaration$$ = [Declaration$0, Declaration$1, Declaration$2, Declaration$3, Declaration$4, Declaration$5, Declaration$6];
9542
9548
  function Declaration(ctx, state) {
9543
9549
  return $EVENT_C(ctx, state, "Declaration", Declaration$$);
9544
9550
  }
@@ -10611,31 +10617,37 @@ var require_parser = __commonJS({
10611
10617
  function Until(ctx, state) {
10612
10618
  return $EVENT(ctx, state, "Until", Until$0);
10613
10619
  }
10614
- var Var$0 = $TS($S($EXPECT($L187, 'Var "var"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10620
+ var Using$0 = $TS($S($EXPECT($L187, 'Using "using"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10621
+ return { $loc, token: $1 };
10622
+ });
10623
+ function Using(ctx, state) {
10624
+ return $EVENT(ctx, state, "Using", Using$0);
10625
+ }
10626
+ var Var$0 = $TS($S($EXPECT($L188, 'Var "var"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10615
10627
  return { $loc, token: $1 };
10616
10628
  });
10617
10629
  function Var(ctx, state) {
10618
10630
  return $EVENT(ctx, state, "Var", Var$0);
10619
10631
  }
10620
- var Void$0 = $TS($S($EXPECT($L188, 'Void "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10632
+ var Void$0 = $TS($S($EXPECT($L189, 'Void "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10621
10633
  return { $loc, token: $1 };
10622
10634
  });
10623
10635
  function Void(ctx, state) {
10624
10636
  return $EVENT(ctx, state, "Void", Void$0);
10625
10637
  }
10626
- var When$0 = $TS($S($EXPECT($L189, 'When "when"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10638
+ var When$0 = $TS($S($EXPECT($L190, 'When "when"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10627
10639
  return { $loc, token: "case" };
10628
10640
  });
10629
10641
  function When(ctx, state) {
10630
10642
  return $EVENT(ctx, state, "When", When$0);
10631
10643
  }
10632
- var While$0 = $TS($S($EXPECT($L190, 'While "while"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10644
+ var While$0 = $TS($S($EXPECT($L191, 'While "while"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10633
10645
  return { $loc, token: $1 };
10634
10646
  });
10635
10647
  function While(ctx, state) {
10636
10648
  return $EVENT(ctx, state, "While", While$0);
10637
10649
  }
10638
- var Yield$0 = $TS($S($EXPECT($L191, 'Yield "yield"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10650
+ var Yield$0 = $TS($S($EXPECT($L192, 'Yield "yield"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
10639
10651
  return { $loc, token: $1, type: "Yield" };
10640
10652
  });
10641
10653
  function Yield(ctx, state) {
@@ -10708,7 +10720,7 @@ var require_parser = __commonJS({
10708
10720
  function JSXElement(ctx, state) {
10709
10721
  return $EVENT_C(ctx, state, "JSXElement", JSXElement$$);
10710
10722
  }
10711
- var JSXSelfClosingElement$0 = $TS($S($EXPECT($L155, 'JSXSelfClosingElement "<"'), JSXElementName, $E(TypeArguments), $E(JSXAttributes), $E(Whitespace), $EXPECT($L192, 'JSXSelfClosingElement "/>"')), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
10723
+ var JSXSelfClosingElement$0 = $TS($S($EXPECT($L155, 'JSXSelfClosingElement "<"'), JSXElementName, $E(TypeArguments), $E(JSXAttributes), $E(Whitespace), $EXPECT($L193, 'JSXSelfClosingElement "/>"')), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
10712
10724
  return { type: "JSXElement", children: $0, tag: $2 };
10713
10725
  });
10714
10726
  function JSXSelfClosingElement(ctx, state) {
@@ -10742,7 +10754,7 @@ var require_parser = __commonJS({
10742
10754
  function JSXOptionalClosingElement(ctx, state) {
10743
10755
  return $EVENT_C(ctx, state, "JSXOptionalClosingElement", JSXOptionalClosingElement$$);
10744
10756
  }
10745
- var JSXClosingElement$0 = $S($EXPECT($L193, 'JSXClosingElement "</"'), $E(Whitespace), JSXElementName, $E(Whitespace), $EXPECT($L33, 'JSXClosingElement ">"'));
10757
+ var JSXClosingElement$0 = $S($EXPECT($L194, 'JSXClosingElement "</"'), $E(Whitespace), JSXElementName, $E(Whitespace), $EXPECT($L33, 'JSXClosingElement ">"'));
10746
10758
  function JSXClosingElement(ctx, state) {
10747
10759
  return $EVENT(ctx, state, "JSXClosingElement", JSXClosingElement$0);
10748
10760
  }
@@ -10763,7 +10775,7 @@ var require_parser = __commonJS({
10763
10775
  ];
10764
10776
  return { type: "JSXFragment", children: parts, jsxChildren: children.jsxChildren };
10765
10777
  });
10766
- var JSXFragment$1 = $TS($S(CoffeeJSXEnabled, $EXPECT($L194, 'JSXFragment "<>"'), $E(JSXChildren), $E(Whitespace), JSXClosingFragment), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
10778
+ var JSXFragment$1 = $TS($S(CoffeeJSXEnabled, $EXPECT($L195, 'JSXFragment "<>"'), $E(JSXChildren), $E(Whitespace), JSXClosingFragment), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
10767
10779
  var children = $3;
10768
10780
  $0 = $0.slice(1);
10769
10781
  return {
@@ -10776,7 +10788,7 @@ var require_parser = __commonJS({
10776
10788
  function JSXFragment(ctx, state) {
10777
10789
  return $EVENT_C(ctx, state, "JSXFragment", JSXFragment$$);
10778
10790
  }
10779
- var PushJSXOpeningFragment$0 = $TV($EXPECT($L194, 'PushJSXOpeningFragment "<>"'), function($skip, $loc, $0, $1) {
10791
+ var PushJSXOpeningFragment$0 = $TV($EXPECT($L195, 'PushJSXOpeningFragment "<>"'), function($skip, $loc, $0, $1) {
10780
10792
  module.JSXTagStack.push("");
10781
10793
  return $1;
10782
10794
  });
@@ -10793,7 +10805,7 @@ var require_parser = __commonJS({
10793
10805
  function JSXOptionalClosingFragment(ctx, state) {
10794
10806
  return $EVENT_C(ctx, state, "JSXOptionalClosingFragment", JSXOptionalClosingFragment$$);
10795
10807
  }
10796
- var JSXClosingFragment$0 = $EXPECT($L195, 'JSXClosingFragment "</>"');
10808
+ var JSXClosingFragment$0 = $EXPECT($L196, 'JSXClosingFragment "</>"');
10797
10809
  function JSXClosingFragment(ctx, state) {
10798
10810
  return $EVENT(ctx, state, "JSXClosingFragment", JSXClosingFragment$0);
10799
10811
  }
@@ -11262,7 +11274,7 @@ var require_parser = __commonJS({
11262
11274
  function JSXChild(ctx, state) {
11263
11275
  return $EVENT_C(ctx, state, "JSXChild", JSXChild$$);
11264
11276
  }
11265
- var JSXComment$0 = $TS($S($EXPECT($L196, 'JSXComment "<!--"'), JSXCommentContent, $EXPECT($L197, 'JSXComment "-->"')), function($skip, $loc, $0, $1, $2, $3) {
11277
+ var JSXComment$0 = $TS($S($EXPECT($L197, 'JSXComment "<!--"'), JSXCommentContent, $EXPECT($L198, 'JSXComment "-->"')), function($skip, $loc, $0, $1, $2, $3) {
11266
11278
  return ["{/*", $2, "*/}"];
11267
11279
  });
11268
11280
  function JSXComment(ctx, state) {
@@ -11300,6 +11312,52 @@ var require_parser = __commonJS({
11300
11312
  function NestedJSXChildExpression(ctx, state) {
11301
11313
  return $EVENT(ctx, state, "NestedJSXChildExpression", NestedJSXChildExpression$0);
11302
11314
  }
11315
+ var UsingDeclaration$0 = $TS($S(Using, $E(_), UsingBinding, $Q($S(__, Comma, __, UsingBinding)), UsingJSModeError), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
11316
+ var decl = $1;
11317
+ var binding = $3;
11318
+ var tail = $4;
11319
+ const bindings = [binding].concat(tail.map(([, , , b]) => b));
11320
+ return {
11321
+ type: "Declaration",
11322
+ children: $0,
11323
+ names: bindings.flatMap((b) => b.names),
11324
+ bindings,
11325
+ decl,
11326
+ splices: bindings.flatMap((b) => b.splices),
11327
+ thisAssignments: bindings.flatMap((b) => b.thisAssignments)
11328
+ };
11329
+ });
11330
+ function UsingDeclaration(ctx, state) {
11331
+ return $EVENT(ctx, state, "UsingDeclaration", UsingDeclaration$0);
11332
+ }
11333
+ var UsingBinding$0 = $TS($S(BindingIdentifier, $E(TypeSuffix), Initializer), function($skip, $loc, $0, $1, $2, $3) {
11334
+ var pattern = $1;
11335
+ var suffix = $2;
11336
+ var initializer = $3;
11337
+ return {
11338
+ type: "Binding",
11339
+ children: $0,
11340
+ names: pattern.names,
11341
+ pattern,
11342
+ suffix,
11343
+ initializer,
11344
+ splices: [],
11345
+ thisAssignments: []
11346
+ };
11347
+ });
11348
+ function UsingBinding(ctx, state) {
11349
+ return $EVENT(ctx, state, "UsingBinding", UsingBinding$0);
11350
+ }
11351
+ var UsingJSModeError$0 = $TV($EXPECT($L0, 'UsingJSModeError ""'), function($skip, $loc, $0, $1) {
11352
+ return {
11353
+ type: "Error",
11354
+ js: true,
11355
+ message: "`using` is not currently transpiled in JS mode."
11356
+ };
11357
+ });
11358
+ function UsingJSModeError(ctx, state) {
11359
+ return $EVENT(ctx, state, "UsingJSModeError", UsingJSModeError$0);
11360
+ }
11303
11361
  var TypeDeclaration$0 = $T($S($E($S(Export, $E(_))), $S(Declare, $E(_)), TypeLexicalDeclaration), function(value) {
11304
11362
  return { "ts": true, "children": value };
11305
11363
  });
@@ -11348,37 +11406,37 @@ var require_parser = __commonJS({
11348
11406
  function InterfaceExtendsTarget(ctx, state) {
11349
11407
  return $EVENT(ctx, state, "InterfaceExtendsTarget", InterfaceExtendsTarget$0);
11350
11408
  }
11351
- var TypeKeyword$0 = $TS($S($EXPECT($L198, 'TypeKeyword "type"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11409
+ var TypeKeyword$0 = $TS($S($EXPECT($L199, 'TypeKeyword "type"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11352
11410
  return { $loc, token: $1 };
11353
11411
  });
11354
11412
  function TypeKeyword(ctx, state) {
11355
11413
  return $EVENT(ctx, state, "TypeKeyword", TypeKeyword$0);
11356
11414
  }
11357
- var Enum$0 = $TS($S($EXPECT($L199, 'Enum "enum"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11415
+ var Enum$0 = $TS($S($EXPECT($L200, 'Enum "enum"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11358
11416
  return { $loc, token: $1 };
11359
11417
  });
11360
11418
  function Enum(ctx, state) {
11361
11419
  return $EVENT(ctx, state, "Enum", Enum$0);
11362
11420
  }
11363
- var Interface$0 = $TS($S($EXPECT($L200, 'Interface "interface"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11421
+ var Interface$0 = $TS($S($EXPECT($L201, 'Interface "interface"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11364
11422
  return { $loc, token: $1 };
11365
11423
  });
11366
11424
  function Interface(ctx, state) {
11367
11425
  return $EVENT(ctx, state, "Interface", Interface$0);
11368
11426
  }
11369
- var Global$0 = $TS($S($EXPECT($L201, 'Global "global"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11427
+ var Global$0 = $TS($S($EXPECT($L202, 'Global "global"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11370
11428
  return { $loc, token: $1 };
11371
11429
  });
11372
11430
  function Global(ctx, state) {
11373
11431
  return $EVENT(ctx, state, "Global", Global$0);
11374
11432
  }
11375
- var Module$0 = $TS($S($EXPECT($L202, 'Module "module"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11433
+ var Module$0 = $TS($S($EXPECT($L203, 'Module "module"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11376
11434
  return { $loc, token: $1 };
11377
11435
  });
11378
11436
  function Module(ctx, state) {
11379
11437
  return $EVENT(ctx, state, "Module", Module$0);
11380
11438
  }
11381
- var Namespace$0 = $TS($S($EXPECT($L203, 'Namespace "namespace"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11439
+ var Namespace$0 = $TS($S($EXPECT($L204, 'Namespace "namespace"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11382
11440
  return { $loc, token: $1 };
11383
11441
  });
11384
11442
  function Namespace(ctx, state) {
@@ -11623,7 +11681,7 @@ var require_parser = __commonJS({
11623
11681
  function ReturnTypeSuffix(ctx, state) {
11624
11682
  return $EVENT(ctx, state, "ReturnTypeSuffix", ReturnTypeSuffix$0);
11625
11683
  }
11626
- var ReturnType$0 = $TS($S($E($S(__, $EXPECT($L204, 'ReturnType "asserts"'), NonIdContinue)), TypePredicate), function($skip, $loc, $0, $1, $2) {
11684
+ var ReturnType$0 = $TS($S($E($S(__, $EXPECT($L205, 'ReturnType "asserts"'), NonIdContinue)), TypePredicate), function($skip, $loc, $0, $1, $2) {
11627
11685
  var asserts = $1;
11628
11686
  var t = $2;
11629
11687
  if (asserts) {
@@ -11692,9 +11750,9 @@ var require_parser = __commonJS({
11692
11750
  function TypeUnarySuffix(ctx, state) {
11693
11751
  return $EVENT_C(ctx, state, "TypeUnarySuffix", TypeUnarySuffix$$);
11694
11752
  }
11695
- var TypeUnaryOp$0 = $S($EXPECT($L205, 'TypeUnaryOp "keyof"'), NonIdContinue);
11753
+ var TypeUnaryOp$0 = $S($EXPECT($L206, 'TypeUnaryOp "keyof"'), NonIdContinue);
11696
11754
  var TypeUnaryOp$1 = $S($EXPECT($L184, 'TypeUnaryOp "typeof"'), NonIdContinue);
11697
- var TypeUnaryOp$2 = $S($EXPECT($L206, 'TypeUnaryOp "infer"'), NonIdContinue);
11755
+ var TypeUnaryOp$2 = $S($EXPECT($L207, 'TypeUnaryOp "infer"'), NonIdContinue);
11698
11756
  var TypeUnaryOp$3 = $S($EXPECT($L167, 'TypeUnaryOp "readonly"'), NonIdContinue);
11699
11757
  var TypeUnaryOp$$ = [TypeUnaryOp$0, TypeUnaryOp$1, TypeUnaryOp$2, TypeUnaryOp$3];
11700
11758
  function TypeUnaryOp(ctx, state) {
@@ -11704,7 +11762,7 @@ var require_parser = __commonJS({
11704
11762
  function TypeIndexedAccess(ctx, state) {
11705
11763
  return $EVENT(ctx, state, "TypeIndexedAccess", TypeIndexedAccess$0);
11706
11764
  }
11707
- var UnknownAlias$0 = $TV($EXPECT($L207, 'UnknownAlias "???"'), function($skip, $loc, $0, $1) {
11765
+ var UnknownAlias$0 = $TV($EXPECT($L208, 'UnknownAlias "???"'), function($skip, $loc, $0, $1) {
11708
11766
  return { $loc, token: "unknown" };
11709
11767
  });
11710
11768
  function UnknownAlias(ctx, state) {
@@ -11844,10 +11902,10 @@ var require_parser = __commonJS({
11844
11902
  }
11845
11903
  var TypeLiteral$0 = TypeTemplateLiteral;
11846
11904
  var TypeLiteral$1 = Literal;
11847
- var TypeLiteral$2 = $TS($S($EXPECT($L188, 'TypeLiteral "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11905
+ var TypeLiteral$2 = $TS($S($EXPECT($L189, 'TypeLiteral "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
11848
11906
  return { type: "VoidType", $loc, token: $1 };
11849
11907
  });
11850
- var TypeLiteral$3 = $TV($EXPECT($L208, 'TypeLiteral "[]"'), function($skip, $loc, $0, $1) {
11908
+ var TypeLiteral$3 = $TV($EXPECT($L209, 'TypeLiteral "[]"'), function($skip, $loc, $0, $1) {
11851
11909
  return { $loc, token: "[]" };
11852
11910
  });
11853
11911
  var TypeLiteral$$ = [TypeLiteral$0, TypeLiteral$1, TypeLiteral$2, TypeLiteral$3];
@@ -11968,7 +12026,7 @@ var require_parser = __commonJS({
11968
12026
  function CivetPrologue(ctx, state) {
11969
12027
  return $EVENT_C(ctx, state, "CivetPrologue", CivetPrologue$$);
11970
12028
  }
11971
- var CivetPrologueContent$0 = $TS($S($EXPECT($L209, 'CivetPrologueContent "civet"'), NonIdContinue, $Q(CivetOption), $EXPECT($R63, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3, $4) {
12029
+ var CivetPrologueContent$0 = $TS($S($EXPECT($L210, 'CivetPrologueContent "civet"'), NonIdContinue, $Q(CivetOption), $EXPECT($R63, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3, $4) {
11972
12030
  var options = $3;
11973
12031
  return {
11974
12032
  type: "CivetPrologue",
@@ -13124,6 +13182,7 @@ var require_parser = __commonJS({
13124
13182
  exports.Typeof = Typeof;
13125
13183
  exports.Unless = Unless;
13126
13184
  exports.Until = Until;
13185
+ exports.Using = Using;
13127
13186
  exports.Var = Var;
13128
13187
  exports.Void = Void;
13129
13188
  exports.When = When;
@@ -13174,6 +13233,9 @@ var require_parser = __commonJS({
13174
13233
  exports.JSXChildExpression = JSXChildExpression;
13175
13234
  exports.IndentedJSXChildExpression = IndentedJSXChildExpression;
13176
13235
  exports.NestedJSXChildExpression = NestedJSXChildExpression;
13236
+ exports.UsingDeclaration = UsingDeclaration;
13237
+ exports.UsingBinding = UsingBinding;
13238
+ exports.UsingJSModeError = UsingJSModeError;
13177
13239
  exports.TypeDeclaration = TypeDeclaration;
13178
13240
  exports.TypeDeclarationRest = TypeDeclarationRest;
13179
13241
  exports.OptionalEquals = OptionalEquals;
@@ -13363,17 +13425,17 @@ function gen(node, options) {
13363
13425
  }).join("");
13364
13426
  }
13365
13427
  if (typeof node === "object") {
13366
- if (node.type === "Error") {
13367
- options.errors ?? (options.errors = []);
13368
- options.errors.push(node);
13369
- return "";
13370
- }
13371
13428
  if (options.js && node.ts) {
13372
13429
  return "";
13373
13430
  }
13374
13431
  if (!options.js && node.js) {
13375
13432
  return "";
13376
13433
  }
13434
+ if (node.type === "Error") {
13435
+ options.errors ?? (options.errors = []);
13436
+ options.errors.push(node);
13437
+ return "";
13438
+ }
13377
13439
  if (node.$loc != null) {
13378
13440
  const { token, $loc } = node;
13379
13441
  options?.updateSourceMap?.(token, $loc.pos);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@danielx/civet",
3
3
  "type": "commonjs",
4
- "version": "0.6.36",
4
+ "version": "0.6.37",
5
5
  "description": "CoffeeScript style syntax for TypeScript",
6
6
  "main": "dist/main.js",
7
7
  "module": "dist/main.mjs",