@danielx/civet 0.5.49 → 0.5.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.mjs CHANGED
@@ -875,6 +875,7 @@ ${input.slice(result.pos)}
875
875
  NestedInterfaceProperties,
876
876
  NestedInterfaceProperty,
877
877
  InterfaceProperty,
878
+ BasicInterfaceProperty,
878
879
  InterfacePropertyDelimiter,
879
880
  NamespaceBlock,
880
881
  NestedTypeDeclarations,
@@ -898,6 +899,9 @@ ${input.slice(result.pos)}
898
899
  NestedType,
899
900
  TypeConditional,
900
901
  TypeLiteral,
902
+ InlineInterfaceLiteral,
903
+ InlineBasicInterfaceProperty,
904
+ InlineInterfacePropertyDelimiter,
901
905
  TypeBinaryOp,
902
906
  FunctionType,
903
907
  TypeArguments,
@@ -946,6 +950,7 @@ ${input.slice(result.pos)}
946
950
  CoffeeNotEnabled,
947
951
  CoffeeOfEnabled,
948
952
  CoffeePrototypeEnabled,
953
+ ObjectIsEnabled,
949
954
  Reset,
950
955
  Init,
951
956
  Indent,
@@ -1126,7 +1131,7 @@ ${input.slice(result.pos)}
1126
1131
  var $L167 = $L("infer");
1127
1132
  var $L168 = $L("[]");
1128
1133
  var $L169 = $L("civet");
1129
- var $R0 = $R(new RegExp("(as|for|of|satisfies|then|when)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
1134
+ var $R0 = $R(new RegExp("(as|for|of|satisfies|then|when|implements)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
1130
1135
  var $R1 = $R(new RegExp("[&]", "suy"));
1131
1136
  var $R2 = $R(new RegExp("[!~+-]+", "suy"));
1132
1137
  var $R3 = $R(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$])*", "suy"));
@@ -1479,7 +1484,7 @@ ${input.slice(result.pos)}
1479
1484
  return result;
1480
1485
  }
1481
1486
  }
1482
- var ForbiddenImplicitCalls$0 = $R$0($EXPECT($R0, fail, "ForbiddenImplicitCalls /(as|for|of|satisfies|then|when)(?!\\p{ID_Continue}|[\\u200C\\u200D$])/"));
1487
+ var ForbiddenImplicitCalls$0 = $R$0($EXPECT($R0, fail, "ForbiddenImplicitCalls /(as|for|of|satisfies|then|when|implements)(?!\\p{ID_Continue}|[\\u200C\\u200D$])/"));
1483
1488
  var ForbiddenImplicitCalls$1 = $EXPECT($L0, fail, 'ForbiddenImplicitCalls "/ "');
1484
1489
  var ForbiddenImplicitCalls$2 = AtAt;
1485
1490
  function ForbiddenImplicitCalls(state) {
@@ -6539,8 +6544,13 @@ ${input.slice(result.pos)}
6539
6544
  var BinaryOpSymbol$6 = $EXPECT($L54, fail, 'BinaryOpSymbol "-"');
6540
6545
  var BinaryOpSymbol$7 = $EXPECT($L55, fail, 'BinaryOpSymbol "<="');
6541
6546
  var BinaryOpSymbol$8 = $EXPECT($L56, fail, 'BinaryOpSymbol ">="');
6542
- var BinaryOpSymbol$9 = $TS($S($EXPECT($L57, fail, 'BinaryOpSymbol "<?"'), $E($EXPECT($L6, fail, 'BinaryOpSymbol " "'))), function($skip, $loc, $0, $1, $2) {
6543
- return "instanceof ";
6547
+ var BinaryOpSymbol$9 = $TV($EXPECT($L57, fail, 'BinaryOpSymbol "<?"'), function($skip, $loc, $0, $1) {
6548
+ return {
6549
+ $loc,
6550
+ token: "instanceof",
6551
+ relational: true,
6552
+ special: true
6553
+ };
6544
6554
  });
6545
6555
  var BinaryOpSymbol$10 = $EXPECT($L58, fail, 'BinaryOpSymbol "<<"');
6546
6556
  var BinaryOpSymbol$11 = $TR($EXPECT($R5, fail, "BinaryOpSymbol /<(?!\\p{ID_Start}|[_$])/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
@@ -6588,17 +6598,28 @@ ${input.slice(result.pos)}
6588
6598
  return {
6589
6599
  $loc,
6590
6600
  token: "instanceof",
6591
- special: true
6601
+ relational: true,
6602
+ special: true,
6603
+ negated: true
6592
6604
  };
6593
6605
  });
6594
6606
  var BinaryOpSymbol$29 = $TV($C($S($N(CoffeeOfEnabled), $EXPECT($L73, fail, 'BinaryOpSymbol "not"'), NonIdContinue, __, $EXPECT($L74, fail, 'BinaryOpSymbol "in"'), NonIdContinue), $S(CoffeeOfEnabled, $EXPECT($L73, fail, 'BinaryOpSymbol "not"'), NonIdContinue, __, $EXPECT($L68, fail, 'BinaryOpSymbol "of"'), NonIdContinue)), function($skip, $loc, $0, $1) {
6595
6607
  return {
6596
6608
  $loc,
6597
6609
  token: "in",
6610
+ special: true,
6611
+ negated: true
6612
+ };
6613
+ });
6614
+ var BinaryOpSymbol$30 = $TS($S($EXPECT($L75, fail, 'BinaryOpSymbol "is"'), NonIdContinue, __, $EXPECT($L74, fail, 'BinaryOpSymbol "in"'), NonIdContinue), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
6615
+ return {
6616
+ method: "includes",
6617
+ relational: true,
6618
+ reversed: true,
6598
6619
  special: true
6599
6620
  };
6600
6621
  });
6601
- var BinaryOpSymbol$30 = $TV($C($S($EXPECT($L75, fail, 'BinaryOpSymbol "is"'), NonIdContinue, __, $EXPECT($L74, fail, 'BinaryOpSymbol "in"'), NonIdContinue), $S(CoffeeOfEnabled, $EXPECT($L74, fail, 'BinaryOpSymbol "in"'), NonIdContinue)), function($skip, $loc, $0, $1) {
6622
+ var BinaryOpSymbol$31 = $TS($S(CoffeeOfEnabled, $EXPECT($L74, fail, 'BinaryOpSymbol "in"'), NonIdContinue), function($skip, $loc, $0, $1, $2, $3) {
6602
6623
  return {
6603
6624
  call: [module.getRef("indexOf"), ".call"],
6604
6625
  relational: true,
@@ -6607,7 +6628,16 @@ ${input.slice(result.pos)}
6607
6628
  special: true
6608
6629
  };
6609
6630
  });
6610
- var BinaryOpSymbol$31 = $TV($C($S($EXPECT($L75, fail, 'BinaryOpSymbol "is"'), NonIdContinue, __, $EXPECT($L73, fail, 'BinaryOpSymbol "not"'), NonIdContinue, __, $EXPECT($L74, fail, 'BinaryOpSymbol "in"'), NonIdContinue), $S(CoffeeOfEnabled, $EXPECT($L73, fail, 'BinaryOpSymbol "not"'), NonIdContinue, __, $EXPECT($L74, fail, 'BinaryOpSymbol "in"'), NonIdContinue)), function($skip, $loc, $0, $1) {
6631
+ var BinaryOpSymbol$32 = $TS($S($EXPECT($L75, fail, 'BinaryOpSymbol "is"'), NonIdContinue, __, $EXPECT($L73, fail, 'BinaryOpSymbol "not"'), NonIdContinue, __, $EXPECT($L74, fail, 'BinaryOpSymbol "in"'), NonIdContinue), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8) {
6632
+ return {
6633
+ method: "includes",
6634
+ relational: true,
6635
+ reversed: true,
6636
+ special: true,
6637
+ negated: true
6638
+ };
6639
+ });
6640
+ var BinaryOpSymbol$33 = $TS($S(CoffeeOfEnabled, $EXPECT($L73, fail, 'BinaryOpSymbol "not"'), NonIdContinue, __, $EXPECT($L74, fail, 'BinaryOpSymbol "in"'), NonIdContinue), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
6611
6641
  return {
6612
6642
  call: [module.getRef("indexOf"), ".call"],
6613
6643
  relational: true,
@@ -6616,18 +6646,35 @@ ${input.slice(result.pos)}
6616
6646
  special: true
6617
6647
  };
6618
6648
  });
6619
- var BinaryOpSymbol$32 = $T($S($N(CoffeeNotEnabled), $EXPECT($L75, fail, 'BinaryOpSymbol "is"'), NonIdContinue, __, $EXPECT($L73, fail, 'BinaryOpSymbol "not"'), NonIdContinue), function(value) {
6649
+ var BinaryOpSymbol$34 = $TS($S($N(CoffeeNotEnabled), $EXPECT($L75, fail, 'BinaryOpSymbol "is"'), NonIdContinue, __, $EXPECT($L73, fail, 'BinaryOpSymbol "not"'), NonIdContinue), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
6650
+ if (module.config.objectIs) {
6651
+ return {
6652
+ call: module.getRef("is"),
6653
+ relational: true,
6654
+ special: true,
6655
+ asConst: true,
6656
+ negated: true
6657
+ };
6658
+ }
6620
6659
  return "!==";
6621
6660
  });
6622
- var BinaryOpSymbol$33 = $T($S($EXPECT($L75, fail, 'BinaryOpSymbol "is"'), NonIdContinue), function(value) {
6661
+ var BinaryOpSymbol$35 = $TS($S($EXPECT($L75, fail, 'BinaryOpSymbol "is"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
6662
+ if (module.config.objectIs) {
6663
+ return {
6664
+ call: module.getRef("is"),
6665
+ relational: true,
6666
+ special: true,
6667
+ asConst: true
6668
+ };
6669
+ }
6623
6670
  return "===";
6624
6671
  });
6625
- var BinaryOpSymbol$34 = $TS($S($EXPECT($L74, fail, 'BinaryOpSymbol "in"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
6672
+ var BinaryOpSymbol$36 = $TS($S($EXPECT($L74, fail, 'BinaryOpSymbol "in"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
6626
6673
  return $1;
6627
6674
  });
6628
- var BinaryOpSymbol$35 = $EXPECT($L76, fail, 'BinaryOpSymbol "&"');
6629
- var BinaryOpSymbol$36 = $EXPECT($L77, fail, 'BinaryOpSymbol "^"');
6630
- var BinaryOpSymbol$37 = $EXPECT($L78, fail, 'BinaryOpSymbol "|"');
6675
+ var BinaryOpSymbol$37 = $EXPECT($L76, fail, 'BinaryOpSymbol "&"');
6676
+ var BinaryOpSymbol$38 = $EXPECT($L77, fail, 'BinaryOpSymbol "^"');
6677
+ var BinaryOpSymbol$39 = $EXPECT($L78, fail, 'BinaryOpSymbol "|"');
6631
6678
  function BinaryOpSymbol(state) {
6632
6679
  let eventData;
6633
6680
  if (state.events) {
@@ -6639,12 +6686,12 @@ ${input.slice(result.pos)}
6639
6686
  }
6640
6687
  }
6641
6688
  if (state.tokenize) {
6642
- const result = $TOKEN("BinaryOpSymbol", state, BinaryOpSymbol$0(state) || BinaryOpSymbol$1(state) || BinaryOpSymbol$2(state) || BinaryOpSymbol$3(state) || BinaryOpSymbol$4(state) || BinaryOpSymbol$5(state) || BinaryOpSymbol$6(state) || BinaryOpSymbol$7(state) || BinaryOpSymbol$8(state) || BinaryOpSymbol$9(state) || BinaryOpSymbol$10(state) || BinaryOpSymbol$11(state) || BinaryOpSymbol$12(state) || BinaryOpSymbol$13(state) || BinaryOpSymbol$14(state) || BinaryOpSymbol$15(state) || BinaryOpSymbol$16(state) || BinaryOpSymbol$17(state) || BinaryOpSymbol$18(state) || BinaryOpSymbol$19(state) || BinaryOpSymbol$20(state) || BinaryOpSymbol$21(state) || BinaryOpSymbol$22(state) || BinaryOpSymbol$23(state) || BinaryOpSymbol$24(state) || BinaryOpSymbol$25(state) || BinaryOpSymbol$26(state) || BinaryOpSymbol$27(state) || BinaryOpSymbol$28(state) || BinaryOpSymbol$29(state) || BinaryOpSymbol$30(state) || BinaryOpSymbol$31(state) || BinaryOpSymbol$32(state) || BinaryOpSymbol$33(state) || BinaryOpSymbol$34(state) || BinaryOpSymbol$35(state) || BinaryOpSymbol$36(state) || BinaryOpSymbol$37(state));
6689
+ const result = $TOKEN("BinaryOpSymbol", state, BinaryOpSymbol$0(state) || BinaryOpSymbol$1(state) || BinaryOpSymbol$2(state) || BinaryOpSymbol$3(state) || BinaryOpSymbol$4(state) || BinaryOpSymbol$5(state) || BinaryOpSymbol$6(state) || BinaryOpSymbol$7(state) || BinaryOpSymbol$8(state) || BinaryOpSymbol$9(state) || BinaryOpSymbol$10(state) || BinaryOpSymbol$11(state) || BinaryOpSymbol$12(state) || BinaryOpSymbol$13(state) || BinaryOpSymbol$14(state) || BinaryOpSymbol$15(state) || BinaryOpSymbol$16(state) || BinaryOpSymbol$17(state) || BinaryOpSymbol$18(state) || BinaryOpSymbol$19(state) || BinaryOpSymbol$20(state) || BinaryOpSymbol$21(state) || BinaryOpSymbol$22(state) || BinaryOpSymbol$23(state) || BinaryOpSymbol$24(state) || BinaryOpSymbol$25(state) || BinaryOpSymbol$26(state) || BinaryOpSymbol$27(state) || BinaryOpSymbol$28(state) || BinaryOpSymbol$29(state) || BinaryOpSymbol$30(state) || BinaryOpSymbol$31(state) || BinaryOpSymbol$32(state) || BinaryOpSymbol$33(state) || BinaryOpSymbol$34(state) || BinaryOpSymbol$35(state) || BinaryOpSymbol$36(state) || BinaryOpSymbol$37(state) || BinaryOpSymbol$38(state) || BinaryOpSymbol$39(state));
6643
6690
  if (state.events)
6644
6691
  state.events.exit?.("BinaryOpSymbol", state, result, eventData);
6645
6692
  return result;
6646
6693
  } else {
6647
- const result = BinaryOpSymbol$0(state) || BinaryOpSymbol$1(state) || BinaryOpSymbol$2(state) || BinaryOpSymbol$3(state) || BinaryOpSymbol$4(state) || BinaryOpSymbol$5(state) || BinaryOpSymbol$6(state) || BinaryOpSymbol$7(state) || BinaryOpSymbol$8(state) || BinaryOpSymbol$9(state) || BinaryOpSymbol$10(state) || BinaryOpSymbol$11(state) || BinaryOpSymbol$12(state) || BinaryOpSymbol$13(state) || BinaryOpSymbol$14(state) || BinaryOpSymbol$15(state) || BinaryOpSymbol$16(state) || BinaryOpSymbol$17(state) || BinaryOpSymbol$18(state) || BinaryOpSymbol$19(state) || BinaryOpSymbol$20(state) || BinaryOpSymbol$21(state) || BinaryOpSymbol$22(state) || BinaryOpSymbol$23(state) || BinaryOpSymbol$24(state) || BinaryOpSymbol$25(state) || BinaryOpSymbol$26(state) || BinaryOpSymbol$27(state) || BinaryOpSymbol$28(state) || BinaryOpSymbol$29(state) || BinaryOpSymbol$30(state) || BinaryOpSymbol$31(state) || BinaryOpSymbol$32(state) || BinaryOpSymbol$33(state) || BinaryOpSymbol$34(state) || BinaryOpSymbol$35(state) || BinaryOpSymbol$36(state) || BinaryOpSymbol$37(state);
6694
+ const result = BinaryOpSymbol$0(state) || BinaryOpSymbol$1(state) || BinaryOpSymbol$2(state) || BinaryOpSymbol$3(state) || BinaryOpSymbol$4(state) || BinaryOpSymbol$5(state) || BinaryOpSymbol$6(state) || BinaryOpSymbol$7(state) || BinaryOpSymbol$8(state) || BinaryOpSymbol$9(state) || BinaryOpSymbol$10(state) || BinaryOpSymbol$11(state) || BinaryOpSymbol$12(state) || BinaryOpSymbol$13(state) || BinaryOpSymbol$14(state) || BinaryOpSymbol$15(state) || BinaryOpSymbol$16(state) || BinaryOpSymbol$17(state) || BinaryOpSymbol$18(state) || BinaryOpSymbol$19(state) || BinaryOpSymbol$20(state) || BinaryOpSymbol$21(state) || BinaryOpSymbol$22(state) || BinaryOpSymbol$23(state) || BinaryOpSymbol$24(state) || BinaryOpSymbol$25(state) || BinaryOpSymbol$26(state) || BinaryOpSymbol$27(state) || BinaryOpSymbol$28(state) || BinaryOpSymbol$29(state) || BinaryOpSymbol$30(state) || BinaryOpSymbol$31(state) || BinaryOpSymbol$32(state) || BinaryOpSymbol$33(state) || BinaryOpSymbol$34(state) || BinaryOpSymbol$35(state) || BinaryOpSymbol$36(state) || BinaryOpSymbol$37(state) || BinaryOpSymbol$38(state) || BinaryOpSymbol$39(state);
6648
6695
  if (state.events)
6649
6696
  state.events.exit?.("BinaryOpSymbol", state, result, eventData);
6650
6697
  return result;
@@ -14506,7 +14553,7 @@ ${input.slice(result.pos)}
14506
14553
  return result;
14507
14554
  }
14508
14555
  }
14509
- var TypeDeclarationRest$0 = $S(TypeKeyword, $Q(TrailingComment), IdentifierName, $E(TypeParameters), __, Equals, __, Type);
14556
+ var TypeDeclarationRest$0 = $S(TypeKeyword, $Q(TrailingComment), IdentifierName, $E(TypeParameters), __, Equals, $C($S($E(_), Type), $S(__, Type)));
14510
14557
  var TypeDeclarationRest$1 = $S(Interface, $Q(TrailingComment), IdentifierName, $E(TypeParameters), $E(InterfaceExtendsClause), InterfaceBlock);
14511
14558
  var TypeDeclarationRest$2 = $S(Namespace, $Q(TrailingComment), IdentifierName, NamespaceBlock);
14512
14559
  var TypeDeclarationRest$3 = FunctionSignature;
@@ -14578,7 +14625,7 @@ ${input.slice(result.pos)}
14578
14625
  return result;
14579
14626
  }
14580
14627
  }
14581
- var InterfaceExtendsClause$0 = $S(ExtendsToken, InterfaceExtendsTarget);
14628
+ var InterfaceExtendsClause$0 = $S(ExtendsToken, InterfaceExtendsTarget, $Q($S(Comma, InterfaceExtendsTarget)));
14582
14629
  function InterfaceExtendsClause(state) {
14583
14630
  let eventData;
14584
14631
  if (state.events) {
@@ -14769,7 +14816,7 @@ ${input.slice(result.pos)}
14769
14816
  return result;
14770
14817
  }
14771
14818
  }
14772
- var InterfaceProperty$0 = $S($C(TypeIndexSignature, PropertyName), TypeSuffix, InterfacePropertyDelimiter);
14819
+ var InterfaceProperty$0 = BasicInterfaceProperty;
14773
14820
  var InterfaceProperty$1 = $S(NonEmptyParameters, TypeSuffix, InterfacePropertyDelimiter);
14774
14821
  var InterfaceProperty$2 = $S(MethodSignature, InterfacePropertyDelimiter);
14775
14822
  function InterfaceProperty(state) {
@@ -14794,6 +14841,29 @@ ${input.slice(result.pos)}
14794
14841
  return result;
14795
14842
  }
14796
14843
  }
14844
+ var BasicInterfaceProperty$0 = $S($C(TypeIndexSignature, PropertyName), TypeSuffix, InterfacePropertyDelimiter);
14845
+ function BasicInterfaceProperty(state) {
14846
+ let eventData;
14847
+ if (state.events) {
14848
+ const result = state.events.enter?.("BasicInterfaceProperty", state);
14849
+ if (result) {
14850
+ if (result.cache)
14851
+ return result.cache;
14852
+ eventData = result.data;
14853
+ }
14854
+ }
14855
+ if (state.tokenize) {
14856
+ const result = $TOKEN("BasicInterfaceProperty", state, BasicInterfaceProperty$0(state));
14857
+ if (state.events)
14858
+ state.events.exit?.("BasicInterfaceProperty", state, result, eventData);
14859
+ return result;
14860
+ } else {
14861
+ const result = BasicInterfaceProperty$0(state);
14862
+ if (state.events)
14863
+ state.events.exit?.("BasicInterfaceProperty", state, result, eventData);
14864
+ return result;
14865
+ }
14866
+ }
14797
14867
  var InterfacePropertyDelimiter$0 = $S($Q(_), $C(Semicolon, Comma));
14798
14868
  var InterfacePropertyDelimiter$1 = $Y($S(__, CloseBrace));
14799
14869
  var InterfacePropertyDelimiter$2 = $Y(EOS);
@@ -15176,12 +15246,13 @@ ${input.slice(result.pos)}
15176
15246
  }
15177
15247
  }
15178
15248
  var TypePrimary$0 = InterfaceBlock;
15179
- var TypePrimary$1 = $S(__, OpenParen, Type, __, CloseParen);
15180
- var TypePrimary$2 = $S($E(_), TypeTuple);
15181
- var TypePrimary$3 = $S($E(_), ImportType);
15182
- var TypePrimary$4 = $S($E(_), FunctionType);
15249
+ var TypePrimary$1 = $S($E(_), FunctionType);
15250
+ var TypePrimary$2 = $S($E(_), InlineInterfaceLiteral);
15251
+ var TypePrimary$3 = $S($E(_), TypeTuple);
15252
+ var TypePrimary$4 = $S($E(_), ImportType);
15183
15253
  var TypePrimary$5 = $S($E(_), TypeLiteral);
15184
15254
  var TypePrimary$6 = $S($E(_), IdentifierName, $Q($S(Dot, IdentifierName)), $E(TypeArguments));
15255
+ var TypePrimary$7 = $S(__, OpenParen, Type, __, CloseParen);
15185
15256
  function TypePrimary(state) {
15186
15257
  let eventData;
15187
15258
  if (state.events) {
@@ -15193,12 +15264,12 @@ ${input.slice(result.pos)}
15193
15264
  }
15194
15265
  }
15195
15266
  if (state.tokenize) {
15196
- const result = $TOKEN("TypePrimary", state, TypePrimary$0(state) || TypePrimary$1(state) || TypePrimary$2(state) || TypePrimary$3(state) || TypePrimary$4(state) || TypePrimary$5(state) || TypePrimary$6(state));
15267
+ const result = $TOKEN("TypePrimary", state, TypePrimary$0(state) || TypePrimary$1(state) || TypePrimary$2(state) || TypePrimary$3(state) || TypePrimary$4(state) || TypePrimary$5(state) || TypePrimary$6(state) || TypePrimary$7(state));
15197
15268
  if (state.events)
15198
15269
  state.events.exit?.("TypePrimary", state, result, eventData);
15199
15270
  return result;
15200
15271
  } else {
15201
- const result = TypePrimary$0(state) || TypePrimary$1(state) || TypePrimary$2(state) || TypePrimary$3(state) || TypePrimary$4(state) || TypePrimary$5(state) || TypePrimary$6(state);
15272
+ const result = TypePrimary$0(state) || TypePrimary$1(state) || TypePrimary$2(state) || TypePrimary$3(state) || TypePrimary$4(state) || TypePrimary$5(state) || TypePrimary$6(state) || TypePrimary$7(state);
15202
15273
  if (state.events)
15203
15274
  state.events.exit?.("TypePrimary", state, result, eventData);
15204
15275
  return result;
@@ -15383,6 +15454,80 @@ ${input.slice(result.pos)}
15383
15454
  return result;
15384
15455
  }
15385
15456
  }
15457
+ var InlineInterfaceLiteral$0 = $S(InsertInlineOpenBrace, InlineBasicInterfaceProperty, $Q($S($C(IndentedFurther, $E(_)), InlineBasicInterfaceProperty)), InsertCloseBrace);
15458
+ function InlineInterfaceLiteral(state) {
15459
+ let eventData;
15460
+ if (state.events) {
15461
+ const result = state.events.enter?.("InlineInterfaceLiteral", state);
15462
+ if (result) {
15463
+ if (result.cache)
15464
+ return result.cache;
15465
+ eventData = result.data;
15466
+ }
15467
+ }
15468
+ if (state.tokenize) {
15469
+ const result = $TOKEN("InlineInterfaceLiteral", state, InlineInterfaceLiteral$0(state));
15470
+ if (state.events)
15471
+ state.events.exit?.("InlineInterfaceLiteral", state, result, eventData);
15472
+ return result;
15473
+ } else {
15474
+ const result = InlineInterfaceLiteral$0(state);
15475
+ if (state.events)
15476
+ state.events.exit?.("InlineInterfaceLiteral", state, result, eventData);
15477
+ return result;
15478
+ }
15479
+ }
15480
+ var InlineBasicInterfaceProperty$0 = $S($C(TypeIndexSignature, PropertyName), $E(QuestionMark), Colon, Type, InlineInterfacePropertyDelimiter);
15481
+ function InlineBasicInterfaceProperty(state) {
15482
+ let eventData;
15483
+ if (state.events) {
15484
+ const result = state.events.enter?.("InlineBasicInterfaceProperty", state);
15485
+ if (result) {
15486
+ if (result.cache)
15487
+ return result.cache;
15488
+ eventData = result.data;
15489
+ }
15490
+ }
15491
+ if (state.tokenize) {
15492
+ const result = $TOKEN("InlineBasicInterfaceProperty", state, InlineBasicInterfaceProperty$0(state));
15493
+ if (state.events)
15494
+ state.events.exit?.("InlineBasicInterfaceProperty", state, result, eventData);
15495
+ return result;
15496
+ } else {
15497
+ const result = InlineBasicInterfaceProperty$0(state);
15498
+ if (state.events)
15499
+ state.events.exit?.("InlineBasicInterfaceProperty", state, result, eventData);
15500
+ return result;
15501
+ }
15502
+ }
15503
+ var InlineInterfacePropertyDelimiter$0 = $C($S($E(_), Semicolon), CommaDelimiter);
15504
+ var InlineInterfacePropertyDelimiter$1 = $T($S($Y($S($C(IndentedFurther, $E(_)), InlineBasicInterfaceProperty)), InsertComma), function(value) {
15505
+ return value[1];
15506
+ });
15507
+ var InlineInterfacePropertyDelimiter$2 = $Y($S(__, $C($EXPECT($L29, fail, 'InlineInterfacePropertyDelimiter ":"'), $EXPECT($L15, fail, 'InlineInterfacePropertyDelimiter ")"'), $EXPECT($L28, fail, 'InlineInterfacePropertyDelimiter "]"'), $EXPECT($L17, fail, 'InlineInterfacePropertyDelimiter "}"'))));
15508
+ var InlineInterfacePropertyDelimiter$3 = $Y(EOS);
15509
+ function InlineInterfacePropertyDelimiter(state) {
15510
+ let eventData;
15511
+ if (state.events) {
15512
+ const result = state.events.enter?.("InlineInterfacePropertyDelimiter", state);
15513
+ if (result) {
15514
+ if (result.cache)
15515
+ return result.cache;
15516
+ eventData = result.data;
15517
+ }
15518
+ }
15519
+ if (state.tokenize) {
15520
+ const result = $TOKEN("InlineInterfacePropertyDelimiter", state, InlineInterfacePropertyDelimiter$0(state) || InlineInterfacePropertyDelimiter$1(state) || InlineInterfacePropertyDelimiter$2(state) || InlineInterfacePropertyDelimiter$3(state));
15521
+ if (state.events)
15522
+ state.events.exit?.("InlineInterfacePropertyDelimiter", state, result, eventData);
15523
+ return result;
15524
+ } else {
15525
+ const result = InlineInterfacePropertyDelimiter$0(state) || InlineInterfacePropertyDelimiter$1(state) || InlineInterfacePropertyDelimiter$2(state) || InlineInterfacePropertyDelimiter$3(state);
15526
+ if (state.events)
15527
+ state.events.exit?.("InlineInterfacePropertyDelimiter", state, result, eventData);
15528
+ return result;
15529
+ }
15530
+ }
15386
15531
  var TypeBinaryOp$0 = $TV($EXPECT($L78, fail, 'TypeBinaryOp "|"'), function($skip, $loc, $0, $1) {
15387
15532
  return { $loc, token: "|" };
15388
15533
  });
@@ -16628,6 +16773,33 @@ ${input.slice(result.pos)}
16628
16773
  return result;
16629
16774
  }
16630
16775
  }
16776
+ var ObjectIsEnabled$0 = $TV($EXPECT($L14, fail, 'ObjectIsEnabled ""'), function($skip, $loc, $0, $1) {
16777
+ if (module.config.objectIs)
16778
+ return;
16779
+ return $skip;
16780
+ });
16781
+ function ObjectIsEnabled(state) {
16782
+ let eventData;
16783
+ if (state.events) {
16784
+ const result = state.events.enter?.("ObjectIsEnabled", state);
16785
+ if (result) {
16786
+ if (result.cache)
16787
+ return result.cache;
16788
+ eventData = result.data;
16789
+ }
16790
+ }
16791
+ if (state.tokenize) {
16792
+ const result = $TOKEN("ObjectIsEnabled", state, ObjectIsEnabled$0(state));
16793
+ if (state.events)
16794
+ state.events.exit?.("ObjectIsEnabled", state, result, eventData);
16795
+ return result;
16796
+ } else {
16797
+ const result = ObjectIsEnabled$0(state);
16798
+ if (state.events)
16799
+ state.events.exit?.("ObjectIsEnabled", state, result, eventData);
16800
+ return result;
16801
+ }
16802
+ }
16631
16803
  var Reset$0 = $TV($EXPECT($L14, fail, 'Reset ""'), function($skip, $loc, $0, $1) {
16632
16804
  module.indentLevels = [{
16633
16805
  level: 0,
@@ -16676,6 +16848,7 @@ ${input.slice(result.pos)}
16676
16848
  coffeeOf: false,
16677
16849
  coffeePrototype: false,
16678
16850
  implicitReturns: true,
16851
+ objectIs: false,
16679
16852
  react: false,
16680
16853
  solid: false,
16681
16854
  client: false,
@@ -16687,6 +16860,10 @@ ${input.slice(result.pos)}
16687
16860
  ts: true,
16688
16861
  children: [" as any"]
16689
16862
  };
16863
+ module.asConst = {
16864
+ ts: true,
16865
+ children: [" as const"]
16866
+ };
16690
16867
  module.prelude = [];
16691
16868
  const declareRef = {
16692
16869
  indexOf(indexOfRef) {
@@ -16703,6 +16880,13 @@ ${input.slice(result.pos)}
16703
16880
  };
16704
16881
  module.prelude.push(["", ["const ", hasPropRef, typeSuffix, " = {}.hasOwnProperty", module.asAny, "\n"]]);
16705
16882
  },
16883
+ is(isRef) {
16884
+ const typeSuffix = {
16885
+ ts: true,
16886
+ children: [": { <B, A extends B> (a: A, b: B): b is A, <A, B> (a: A, b: B): a is A & B }"]
16887
+ };
16888
+ module.prelude.push(["", ["const ", isRef, typeSuffix, " = Object.is", module.asAny, "\n"]]);
16889
+ },
16706
16890
  modulo(moduloRef) {
16707
16891
  const typeSuffix = {
16708
16892
  ts: true,
@@ -16762,6 +16946,12 @@ ${input.slice(result.pos)}
16762
16946
  declareRef[base](ref);
16763
16947
  return refs[base] = ref;
16764
16948
  };
16949
+ module.makeAsConst = function(node) {
16950
+ if (node.type === "Literal" && node.raw !== "null" || node.type === "ArrayExpression" || node.type === "ObjectExpression") {
16951
+ return { ...node, children: [...node.children, module.asConst] };
16952
+ }
16953
+ return node;
16954
+ };
16765
16955
  module.typeOfJSX = function(node) {
16766
16956
  switch (node.type) {
16767
16957
  case "JSXElement":
@@ -16841,6 +17031,9 @@ ${input.slice(result.pos)}
16841
17031
  ]) {
16842
17032
  module.config[option] = b;
16843
17033
  }
17034
+ if (b) {
17035
+ module.config.objectIs = false;
17036
+ }
16844
17037
  }
16845
17038
  });
16846
17039
  module.modifyString = function(str) {
@@ -17184,6 +17377,10 @@ ${input.slice(result.pos)}
17184
17377
  const op = expandedOps[i];
17185
17378
  if (op.special) {
17186
17379
  let [a, wsOp, op2, wsB, b] = expandedOps.slice(i - 2, i + 3);
17380
+ if (op2.asConst) {
17381
+ a = module.makeAsConst(a);
17382
+ b = module.makeAsConst(b);
17383
+ }
17187
17384
  let children;
17188
17385
  if (op2.call) {
17189
17386
  wsOp = module.insertTrimmingSpace(wsOp, "");
@@ -17193,11 +17390,21 @@ ${input.slice(result.pos)}
17193
17390
  } else {
17194
17391
  children = [wsOp, op2.call, "(", a, ",", wsB, b, ")", op2.suffix];
17195
17392
  }
17196
- } else if (op2.token === "instanceof" || op2.token === "in") {
17197
- children = ["!(", a, wsOp, op2, wsB, b, ")"];
17393
+ } else if (op2.method) {
17394
+ wsOp = module.insertTrimmingSpace(wsOp, "");
17395
+ wsB = module.insertTrimmingSpace(wsB, "");
17396
+ if (op2.reversed) {
17397
+ children = [wsB, b, wsOp, ".", op2.method, "(", a, ")"];
17398
+ } else {
17399
+ children = [a, wsOp, ".", op2.method, "(", wsB, b, ")"];
17400
+ }
17401
+ } else if (op2.token) {
17402
+ children = ["(", a, wsOp, op2, wsB, b, ")"];
17198
17403
  } else {
17199
17404
  throw new Error("Unknown operator: " + JSON.stringify(op2));
17200
17405
  }
17406
+ if (op2.negated)
17407
+ children.unshift("!");
17201
17408
  expandedOps.splice(i - 2, 5, {
17202
17409
  children
17203
17410
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danielx/civet",
3
- "version": "0.5.49",
3
+ "version": "0.5.51",
4
4
  "description": "CoffeeScript style syntax for TypeScript",
5
5
  "main": "dist/main.js",
6
6
  "module": "dist/main.mjs",