@danielx/civet 0.5.18 → 0.5.19

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
@@ -239,6 +239,7 @@ Things Added that CoffeeScript didn't
239
239
  `"civet solid server"` for server-only code (SSR only), or
240
240
  `"civet solid client server"` for isomorphic code that runs on
241
241
  client and server (SSR + hydration).
242
+ - XML comments: `<!-- ... -->` → `{/* ... */}`
242
243
  - CoffeeScript improvements
243
244
  - Postfix loop `run() loop` → `while(true) run()`
244
245
  - Character range literals `["a".."z"]`, `['f'..'a']`, `['0'..'9']`
package/dist/browser.js CHANGED
@@ -799,6 +799,8 @@ ${input.slice(result.pos)}
799
799
  JSXChildren,
800
800
  JSXNestedChildren,
801
801
  JSXChild,
802
+ JSXComment,
803
+ JSXCommentContent,
802
804
  JSXText,
803
805
  JSXChildExpression,
804
806
  TypeDeclaration,
@@ -1045,15 +1047,17 @@ ${input.slice(result.pos)}
1045
1047
  var $L154 = $L("</");
1046
1048
  var $L155 = $L("<>");
1047
1049
  var $L156 = $L("</>");
1048
- var $L157 = $L("declare");
1049
- var $L158 = $L("type");
1050
- var $L159 = $L("interface");
1051
- var $L160 = $L("namespace");
1052
- var $L161 = $L("asserts");
1053
- var $L162 = $L("keyof");
1054
- var $L163 = $L("infer");
1055
- var $L164 = $L("[]");
1056
- var $L165 = $L("civet");
1050
+ var $L157 = $L("<!--");
1051
+ var $L158 = $L("-->");
1052
+ var $L159 = $L("declare");
1053
+ var $L160 = $L("type");
1054
+ var $L161 = $L("interface");
1055
+ var $L162 = $L("namespace");
1056
+ var $L163 = $L("asserts");
1057
+ var $L164 = $L("keyof");
1058
+ var $L165 = $L("infer");
1059
+ var $L166 = $L("[]");
1060
+ var $L167 = $L("civet");
1057
1061
  var $R0 = $R(new RegExp("(for|of|then|when)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
1058
1062
  var $R1 = $R(new RegExp("[&]", "suy"));
1059
1063
  var $R2 = $R(new RegExp("[!~+-]+", "suy"));
@@ -1101,14 +1105,15 @@ ${input.slice(result.pos)}
1101
1105
  var $R44 = $R(new RegExp("\\s", "suy"));
1102
1106
  var $R45 = $R(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*", "suy"));
1103
1107
  var $R46 = $R(new RegExp("(?:[\\w\\-:]+|\\([^()]*\\)|\\[[^\\[\\]]*\\])+", "suy"));
1104
- var $R47 = $R(new RegExp("[^{}<>\\r\\n]+", "suy"));
1105
- var $R48 = $R(new RegExp("[+-]?", "suy"));
1106
- var $R49 = $R(new RegExp("#![^\\r\\n]*", "suy"));
1107
- var $R50 = $R(new RegExp("[\\t ]*", "suy"));
1108
- var $R51 = $R(new RegExp("[\\s]*", "suy"));
1109
- var $R52 = $R(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?", "suy"));
1110
- var $R53 = $R(new RegExp("\\r\\n|\\n|\\r|$", "suy"));
1111
- var $R54 = $R(new RegExp("[ \\t]*", "suy"));
1108
+ var $R47 = $R(new RegExp("(?:-[^-]|[^-]*)*", "suy"));
1109
+ var $R48 = $R(new RegExp("[^{}<>\\r\\n]+", "suy"));
1110
+ var $R49 = $R(new RegExp("[+-]?", "suy"));
1111
+ var $R50 = $R(new RegExp("#![^\\r\\n]*", "suy"));
1112
+ var $R51 = $R(new RegExp("[\\t ]*", "suy"));
1113
+ var $R52 = $R(new RegExp("[\\s]*", "suy"));
1114
+ var $R53 = $R(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?", "suy"));
1115
+ var $R54 = $R(new RegExp("\\r\\n|\\n|\\r|$", "suy"));
1116
+ var $R55 = $R(new RegExp("[ \\t]*", "suy"));
1112
1117
  var Program$0 = $TS($S(Reset, Init, __, $Q(TopLevelStatement), __), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
1113
1118
  var statements = $4;
1114
1119
  module.processProgram(statements);
@@ -11706,7 +11711,8 @@ ${input.slice(result.pos)}
11706
11711
  }
11707
11712
  var JSXChild$0 = JSXElement;
11708
11713
  var JSXChild$1 = JSXFragment;
11709
- var JSXChild$2 = $TS($S(OpenBrace, $E(JSXChildExpression), __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4) {
11714
+ var JSXChild$2 = JSXComment;
11715
+ var JSXChild$3 = $TS($S(OpenBrace, $E(JSXChildExpression), __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4) {
11710
11716
  var expression = $2;
11711
11717
  return {
11712
11718
  type: "JSXChildExpression",
@@ -11714,7 +11720,7 @@ ${input.slice(result.pos)}
11714
11720
  expression
11715
11721
  };
11716
11722
  });
11717
- var JSXChild$3 = $TS($S(InsertInlineOpenBrace, ArrowFunction, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3) {
11723
+ var JSXChild$4 = $TS($S(InsertInlineOpenBrace, ArrowFunction, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3) {
11718
11724
  var expression = $2;
11719
11725
  return {
11720
11726
  type: "JSXChildExpression",
@@ -11722,7 +11728,7 @@ ${input.slice(result.pos)}
11722
11728
  expression
11723
11729
  };
11724
11730
  });
11725
- var JSXChild$4 = JSXText;
11731
+ var JSXChild$5 = JSXText;
11726
11732
  function JSXChild(state) {
11727
11733
  if (state.events) {
11728
11734
  const result = state.events.enter?.("JSXChild", state);
@@ -11730,18 +11736,60 @@ ${input.slice(result.pos)}
11730
11736
  return result.cache;
11731
11737
  }
11732
11738
  if (state.tokenize) {
11733
- const result = $TOKEN("JSXChild", state, JSXChild$0(state) || JSXChild$1(state) || JSXChild$2(state) || JSXChild$3(state) || JSXChild$4(state));
11739
+ const result = $TOKEN("JSXChild", state, JSXChild$0(state) || JSXChild$1(state) || JSXChild$2(state) || JSXChild$3(state) || JSXChild$4(state) || JSXChild$5(state));
11734
11740
  if (state.events)
11735
11741
  state.events.exit?.("JSXChild", state, result);
11736
11742
  return result;
11737
11743
  } else {
11738
- const result = JSXChild$0(state) || JSXChild$1(state) || JSXChild$2(state) || JSXChild$3(state) || JSXChild$4(state);
11744
+ const result = JSXChild$0(state) || JSXChild$1(state) || JSXChild$2(state) || JSXChild$3(state) || JSXChild$4(state) || JSXChild$5(state);
11739
11745
  if (state.events)
11740
11746
  state.events.exit?.("JSXChild", state, result);
11741
11747
  return result;
11742
11748
  }
11743
11749
  }
11744
- var JSXText$0 = $TR($EXPECT($R47, fail, "JSXText /[^{}<>\\r\\n]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
11750
+ var JSXComment$0 = $TS($S($EXPECT($L157, fail, 'JSXComment "<!--"'), JSXCommentContent, $EXPECT($L158, fail, 'JSXComment "-->"')), function($skip, $loc, $0, $1, $2, $3) {
11751
+ return ["{/*", $2, "*/}"];
11752
+ });
11753
+ function JSXComment(state) {
11754
+ if (state.events) {
11755
+ const result = state.events.enter?.("JSXComment", state);
11756
+ if (result)
11757
+ return result.cache;
11758
+ }
11759
+ if (state.tokenize) {
11760
+ const result = $TOKEN("JSXComment", state, JSXComment$0(state));
11761
+ if (state.events)
11762
+ state.events.exit?.("JSXComment", state, result);
11763
+ return result;
11764
+ } else {
11765
+ const result = JSXComment$0(state);
11766
+ if (state.events)
11767
+ state.events.exit?.("JSXComment", state, result);
11768
+ return result;
11769
+ }
11770
+ }
11771
+ var JSXCommentContent$0 = $TR($EXPECT($R47, fail, "JSXCommentContent /(?:-[^-]|[^-]*)*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
11772
+ return { $loc, token: $0.replace(/\*\//g, "* /") };
11773
+ });
11774
+ function JSXCommentContent(state) {
11775
+ if (state.events) {
11776
+ const result = state.events.enter?.("JSXCommentContent", state);
11777
+ if (result)
11778
+ return result.cache;
11779
+ }
11780
+ if (state.tokenize) {
11781
+ const result = $TOKEN("JSXCommentContent", state, JSXCommentContent$0(state));
11782
+ if (state.events)
11783
+ state.events.exit?.("JSXCommentContent", state, result);
11784
+ return result;
11785
+ } else {
11786
+ const result = JSXCommentContent$0(state);
11787
+ if (state.events)
11788
+ state.events.exit?.("JSXCommentContent", state, result);
11789
+ return result;
11790
+ }
11791
+ }
11792
+ var JSXText$0 = $TR($EXPECT($R48, fail, "JSXText /[^{}<>\\r\\n]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
11745
11793
  return {
11746
11794
  type: "JSXText",
11747
11795
  token: $0,
@@ -11806,7 +11854,7 @@ ${input.slice(result.pos)}
11806
11854
  return result;
11807
11855
  }
11808
11856
  }
11809
- var TypeDeclarationModifier$0 = $S($EXPECT($L157, fail, 'TypeDeclarationModifier "declare"'), NonIdContinue);
11857
+ var TypeDeclarationModifier$0 = $S($EXPECT($L159, fail, 'TypeDeclarationModifier "declare"'), NonIdContinue);
11810
11858
  var TypeDeclarationModifier$1 = Export;
11811
11859
  function TypeDeclarationModifier(state) {
11812
11860
  if (state.events) {
@@ -11848,7 +11896,7 @@ ${input.slice(result.pos)}
11848
11896
  return result;
11849
11897
  }
11850
11898
  }
11851
- var TypeKeyword$0 = $S($EXPECT($L158, fail, 'TypeKeyword "type"'), NonIdContinue);
11899
+ var TypeKeyword$0 = $S($EXPECT($L160, fail, 'TypeKeyword "type"'), NonIdContinue);
11852
11900
  function TypeKeyword(state) {
11853
11901
  if (state.events) {
11854
11902
  const result = state.events.enter?.("TypeKeyword", state);
@@ -11867,7 +11915,7 @@ ${input.slice(result.pos)}
11867
11915
  return result;
11868
11916
  }
11869
11917
  }
11870
- var Interface$0 = $S($EXPECT($L159, fail, 'Interface "interface"'), NonIdContinue);
11918
+ var Interface$0 = $S($EXPECT($L161, fail, 'Interface "interface"'), NonIdContinue);
11871
11919
  function Interface(state) {
11872
11920
  if (state.events) {
11873
11921
  const result = state.events.enter?.("Interface", state);
@@ -11886,7 +11934,7 @@ ${input.slice(result.pos)}
11886
11934
  return result;
11887
11935
  }
11888
11936
  }
11889
- var Namespace$0 = $S($EXPECT($L160, fail, 'Namespace "namespace"'), NonIdContinue);
11937
+ var Namespace$0 = $S($EXPECT($L162, fail, 'Namespace "namespace"'), NonIdContinue);
11890
11938
  function Namespace(state) {
11891
11939
  if (state.events) {
11892
11940
  const result = state.events.enter?.("Namespace", state);
@@ -12075,7 +12123,7 @@ ${input.slice(result.pos)}
12075
12123
  return result;
12076
12124
  }
12077
12125
  }
12078
- var TypeIndexSignature$0 = $S($E($S($R$0($EXPECT($R48, fail, "TypeIndexSignature /[+-]?/")), $EXPECT($L129, fail, 'TypeIndexSignature "readonly"'), __)), OpenBracket, TypeIndex, CloseBracket, $E($S(__, $R$0($EXPECT($R4, fail, "TypeIndexSignature /[+-]/")), QuestionMark)));
12126
+ var TypeIndexSignature$0 = $S($E($S($R$0($EXPECT($R49, fail, "TypeIndexSignature /[+-]?/")), $EXPECT($L129, fail, 'TypeIndexSignature "readonly"'), __)), OpenBracket, TypeIndex, CloseBracket, $E($S(__, $R$0($EXPECT($R4, fail, "TypeIndexSignature /[+-]/")), QuestionMark)));
12079
12127
  function TypeIndexSignature(state) {
12080
12128
  if (state.events) {
12081
12129
  const result = state.events.enter?.("TypeIndexSignature", state);
@@ -12135,7 +12183,7 @@ ${input.slice(result.pos)}
12135
12183
  return result;
12136
12184
  }
12137
12185
  }
12138
- var ReturnTypeSuffix$0 = $TS($S(__, Colon, $E($S(__, $EXPECT($L161, fail, 'ReturnTypeSuffix "asserts"'), NonIdContinue)), TypePredicate), function($skip, $loc, $0, $1, $2, $3, $4) {
12186
+ var ReturnTypeSuffix$0 = $TS($S(__, Colon, $E($S(__, $EXPECT($L163, fail, 'ReturnTypeSuffix "asserts"'), NonIdContinue)), TypePredicate), function($skip, $loc, $0, $1, $2, $3, $4) {
12139
12187
  const children = [...$1, $2];
12140
12188
  if ($3)
12141
12189
  children.push($3);
@@ -12270,9 +12318,9 @@ ${input.slice(result.pos)}
12270
12318
  return result;
12271
12319
  }
12272
12320
  }
12273
- var TypeUnaryOp$0 = $EXPECT($L162, fail, 'TypeUnaryOp "keyof"');
12321
+ var TypeUnaryOp$0 = $EXPECT($L164, fail, 'TypeUnaryOp "keyof"');
12274
12322
  var TypeUnaryOp$1 = $EXPECT($L145, fail, 'TypeUnaryOp "typeof"');
12275
- var TypeUnaryOp$2 = $EXPECT($L163, fail, 'TypeUnaryOp "infer"');
12323
+ var TypeUnaryOp$2 = $EXPECT($L165, fail, 'TypeUnaryOp "infer"');
12276
12324
  var TypeUnaryOp$3 = $EXPECT($L129, fail, 'TypeUnaryOp "readonly"');
12277
12325
  function TypeUnaryOp(state) {
12278
12326
  if (state.events) {
@@ -12445,7 +12493,7 @@ ${input.slice(result.pos)}
12445
12493
  var TypeLiteral$2 = $TV($EXPECT($L149, fail, 'TypeLiteral "void"'), function($skip, $loc, $0, $1) {
12446
12494
  return { $loc, token: "void" };
12447
12495
  });
12448
- var TypeLiteral$3 = $TV($EXPECT($L164, fail, 'TypeLiteral "[]"'), function($skip, $loc, $0, $1) {
12496
+ var TypeLiteral$3 = $TV($EXPECT($L166, fail, 'TypeLiteral "[]"'), function($skip, $loc, $0, $1) {
12449
12497
  return { $loc, token: "[]" };
12450
12498
  });
12451
12499
  function TypeLiteral(state) {
@@ -12677,7 +12725,7 @@ ${input.slice(result.pos)}
12677
12725
  return result;
12678
12726
  }
12679
12727
  }
12680
- var Shebang$0 = $S($R$0($EXPECT($R49, fail, "Shebang /#![^\\r\\n]*/")), EOL);
12728
+ var Shebang$0 = $S($R$0($EXPECT($R50, fail, "Shebang /#![^\\r\\n]*/")), EOL);
12681
12729
  function Shebang(state) {
12682
12730
  if (state.events) {
12683
12731
  const result = state.events.enter?.("Shebang", state);
@@ -12696,11 +12744,11 @@ ${input.slice(result.pos)}
12696
12744
  return result;
12697
12745
  }
12698
12746
  }
12699
- var CivetPrologue$0 = $T($S($EXPECT($R50, fail, "CivetPrologue /[\\t ]*/"), DoubleQuote, CivetPrologueContent, DoubleQuote, $TEXT(StatementDelimiter), $E(EOS)), function(value) {
12747
+ var CivetPrologue$0 = $T($S($EXPECT($R51, fail, "CivetPrologue /[\\t ]*/"), DoubleQuote, CivetPrologueContent, DoubleQuote, $TEXT(StatementDelimiter), $E(EOS)), function(value) {
12700
12748
  var content = value[2];
12701
12749
  return content;
12702
12750
  });
12703
- var CivetPrologue$1 = $T($S($EXPECT($R50, fail, "CivetPrologue /[\\t ]*/"), SingleQuote, CivetPrologueContent, SingleQuote, $TEXT(StatementDelimiter), $E(EOS)), function(value) {
12751
+ var CivetPrologue$1 = $T($S($EXPECT($R51, fail, "CivetPrologue /[\\t ]*/"), SingleQuote, CivetPrologueContent, SingleQuote, $TEXT(StatementDelimiter), $E(EOS)), function(value) {
12704
12752
  var content = value[2];
12705
12753
  return content;
12706
12754
  });
@@ -12722,7 +12770,7 @@ ${input.slice(result.pos)}
12722
12770
  return result;
12723
12771
  }
12724
12772
  }
12725
- var CivetPrologueContent$0 = $TS($S($EXPECT($L165, fail, 'CivetPrologueContent "civet"'), $Q(CivetOption), $EXPECT($R51, fail, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3) {
12773
+ var CivetPrologueContent$0 = $TS($S($EXPECT($L167, fail, 'CivetPrologueContent "civet"'), $Q(CivetOption), $EXPECT($R52, fail, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3) {
12726
12774
  var options = $2;
12727
12775
  return {
12728
12776
  type: "CivetPrologue",
@@ -12748,7 +12796,7 @@ ${input.slice(result.pos)}
12748
12796
  return result;
12749
12797
  }
12750
12798
  }
12751
- var CivetOption$0 = $TR($EXPECT($R52, fail, "CivetOption /\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
12799
+ var CivetOption$0 = $TR($EXPECT($R53, fail, "CivetOption /\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
12752
12800
  const optionName = $2.replace(/-+([a-z]?)/g, (_2, l) => {
12753
12801
  if (l)
12754
12802
  return l.toUpperCase();
@@ -12780,7 +12828,7 @@ ${input.slice(result.pos)}
12780
12828
  return result;
12781
12829
  }
12782
12830
  }
12783
- var UnknownPrologue$0 = $S($R$0($EXPECT($R50, fail, "UnknownPrologue /[\\t ]*/")), BasicStringLiteral, $TEXT(StatementDelimiter), EOS);
12831
+ var UnknownPrologue$0 = $S($R$0($EXPECT($R51, fail, "UnknownPrologue /[\\t ]*/")), BasicStringLiteral, $TEXT(StatementDelimiter), EOS);
12784
12832
  function UnknownPrologue(state) {
12785
12833
  if (state.events) {
12786
12834
  const result = state.events.enter?.("UnknownPrologue", state);
@@ -12838,7 +12886,7 @@ ${input.slice(result.pos)}
12838
12886
  return result;
12839
12887
  }
12840
12888
  }
12841
- var EOL$0 = $TR($EXPECT($R53, fail, "EOL /\\r\\n|\\n|\\r|$/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
12889
+ var EOL$0 = $TR($EXPECT($R54, fail, "EOL /\\r\\n|\\n|\\r|$/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
12842
12890
  return { $loc, token: $0 };
12843
12891
  });
12844
12892
  function EOL(state) {
@@ -14623,7 +14671,7 @@ ${input.slice(result.pos)}
14623
14671
  return result;
14624
14672
  }
14625
14673
  }
14626
- var Indent$0 = $TR($EXPECT($R54, fail, "Indent /[ \\t]*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
14674
+ var Indent$0 = $TR($EXPECT($R55, fail, "Indent /[ \\t]*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
14627
14675
  let level;
14628
14676
  if (module.config.tab) {
14629
14677
  const tabs = $0.match(/\t/g);
package/dist/main.js CHANGED
@@ -798,6 +798,8 @@ ${input.slice(result.pos)}
798
798
  JSXChildren,
799
799
  JSXNestedChildren,
800
800
  JSXChild,
801
+ JSXComment,
802
+ JSXCommentContent,
801
803
  JSXText,
802
804
  JSXChildExpression,
803
805
  TypeDeclaration,
@@ -1044,15 +1046,17 @@ ${input.slice(result.pos)}
1044
1046
  var $L154 = $L("</");
1045
1047
  var $L155 = $L("<>");
1046
1048
  var $L156 = $L("</>");
1047
- var $L157 = $L("declare");
1048
- var $L158 = $L("type");
1049
- var $L159 = $L("interface");
1050
- var $L160 = $L("namespace");
1051
- var $L161 = $L("asserts");
1052
- var $L162 = $L("keyof");
1053
- var $L163 = $L("infer");
1054
- var $L164 = $L("[]");
1055
- var $L165 = $L("civet");
1049
+ var $L157 = $L("<!--");
1050
+ var $L158 = $L("-->");
1051
+ var $L159 = $L("declare");
1052
+ var $L160 = $L("type");
1053
+ var $L161 = $L("interface");
1054
+ var $L162 = $L("namespace");
1055
+ var $L163 = $L("asserts");
1056
+ var $L164 = $L("keyof");
1057
+ var $L165 = $L("infer");
1058
+ var $L166 = $L("[]");
1059
+ var $L167 = $L("civet");
1056
1060
  var $R0 = $R(new RegExp("(for|of|then|when)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
1057
1061
  var $R1 = $R(new RegExp("[&]", "suy"));
1058
1062
  var $R2 = $R(new RegExp("[!~+-]+", "suy"));
@@ -1100,14 +1104,15 @@ ${input.slice(result.pos)}
1100
1104
  var $R44 = $R(new RegExp("\\s", "suy"));
1101
1105
  var $R45 = $R(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*", "suy"));
1102
1106
  var $R46 = $R(new RegExp("(?:[\\w\\-:]+|\\([^()]*\\)|\\[[^\\[\\]]*\\])+", "suy"));
1103
- var $R47 = $R(new RegExp("[^{}<>\\r\\n]+", "suy"));
1104
- var $R48 = $R(new RegExp("[+-]?", "suy"));
1105
- var $R49 = $R(new RegExp("#![^\\r\\n]*", "suy"));
1106
- var $R50 = $R(new RegExp("[\\t ]*", "suy"));
1107
- var $R51 = $R(new RegExp("[\\s]*", "suy"));
1108
- var $R52 = $R(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?", "suy"));
1109
- var $R53 = $R(new RegExp("\\r\\n|\\n|\\r|$", "suy"));
1110
- var $R54 = $R(new RegExp("[ \\t]*", "suy"));
1107
+ var $R47 = $R(new RegExp("(?:-[^-]|[^-]*)*", "suy"));
1108
+ var $R48 = $R(new RegExp("[^{}<>\\r\\n]+", "suy"));
1109
+ var $R49 = $R(new RegExp("[+-]?", "suy"));
1110
+ var $R50 = $R(new RegExp("#![^\\r\\n]*", "suy"));
1111
+ var $R51 = $R(new RegExp("[\\t ]*", "suy"));
1112
+ var $R52 = $R(new RegExp("[\\s]*", "suy"));
1113
+ var $R53 = $R(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?", "suy"));
1114
+ var $R54 = $R(new RegExp("\\r\\n|\\n|\\r|$", "suy"));
1115
+ var $R55 = $R(new RegExp("[ \\t]*", "suy"));
1111
1116
  var Program$0 = $TS($S(Reset, Init, __, $Q(TopLevelStatement), __), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
1112
1117
  var statements = $4;
1113
1118
  module2.processProgram(statements);
@@ -11705,7 +11710,8 @@ ${input.slice(result.pos)}
11705
11710
  }
11706
11711
  var JSXChild$0 = JSXElement;
11707
11712
  var JSXChild$1 = JSXFragment;
11708
- var JSXChild$2 = $TS($S(OpenBrace, $E(JSXChildExpression), __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4) {
11713
+ var JSXChild$2 = JSXComment;
11714
+ var JSXChild$3 = $TS($S(OpenBrace, $E(JSXChildExpression), __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4) {
11709
11715
  var expression = $2;
11710
11716
  return {
11711
11717
  type: "JSXChildExpression",
@@ -11713,7 +11719,7 @@ ${input.slice(result.pos)}
11713
11719
  expression
11714
11720
  };
11715
11721
  });
11716
- var JSXChild$3 = $TS($S(InsertInlineOpenBrace, ArrowFunction, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3) {
11722
+ var JSXChild$4 = $TS($S(InsertInlineOpenBrace, ArrowFunction, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3) {
11717
11723
  var expression = $2;
11718
11724
  return {
11719
11725
  type: "JSXChildExpression",
@@ -11721,7 +11727,7 @@ ${input.slice(result.pos)}
11721
11727
  expression
11722
11728
  };
11723
11729
  });
11724
- var JSXChild$4 = JSXText;
11730
+ var JSXChild$5 = JSXText;
11725
11731
  function JSXChild(state) {
11726
11732
  if (state.events) {
11727
11733
  const result = state.events.enter?.("JSXChild", state);
@@ -11729,18 +11735,60 @@ ${input.slice(result.pos)}
11729
11735
  return result.cache;
11730
11736
  }
11731
11737
  if (state.tokenize) {
11732
- const result = $TOKEN("JSXChild", state, JSXChild$0(state) || JSXChild$1(state) || JSXChild$2(state) || JSXChild$3(state) || JSXChild$4(state));
11738
+ const result = $TOKEN("JSXChild", state, JSXChild$0(state) || JSXChild$1(state) || JSXChild$2(state) || JSXChild$3(state) || JSXChild$4(state) || JSXChild$5(state));
11733
11739
  if (state.events)
11734
11740
  state.events.exit?.("JSXChild", state, result);
11735
11741
  return result;
11736
11742
  } else {
11737
- const result = JSXChild$0(state) || JSXChild$1(state) || JSXChild$2(state) || JSXChild$3(state) || JSXChild$4(state);
11743
+ const result = JSXChild$0(state) || JSXChild$1(state) || JSXChild$2(state) || JSXChild$3(state) || JSXChild$4(state) || JSXChild$5(state);
11738
11744
  if (state.events)
11739
11745
  state.events.exit?.("JSXChild", state, result);
11740
11746
  return result;
11741
11747
  }
11742
11748
  }
11743
- var JSXText$0 = $TR($EXPECT($R47, fail, "JSXText /[^{}<>\\r\\n]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
11749
+ var JSXComment$0 = $TS($S($EXPECT($L157, fail, 'JSXComment "<!--"'), JSXCommentContent, $EXPECT($L158, fail, 'JSXComment "-->"')), function($skip, $loc, $0, $1, $2, $3) {
11750
+ return ["{/*", $2, "*/}"];
11751
+ });
11752
+ function JSXComment(state) {
11753
+ if (state.events) {
11754
+ const result = state.events.enter?.("JSXComment", state);
11755
+ if (result)
11756
+ return result.cache;
11757
+ }
11758
+ if (state.tokenize) {
11759
+ const result = $TOKEN("JSXComment", state, JSXComment$0(state));
11760
+ if (state.events)
11761
+ state.events.exit?.("JSXComment", state, result);
11762
+ return result;
11763
+ } else {
11764
+ const result = JSXComment$0(state);
11765
+ if (state.events)
11766
+ state.events.exit?.("JSXComment", state, result);
11767
+ return result;
11768
+ }
11769
+ }
11770
+ var JSXCommentContent$0 = $TR($EXPECT($R47, fail, "JSXCommentContent /(?:-[^-]|[^-]*)*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
11771
+ return { $loc, token: $0.replace(/\*\//g, "* /") };
11772
+ });
11773
+ function JSXCommentContent(state) {
11774
+ if (state.events) {
11775
+ const result = state.events.enter?.("JSXCommentContent", state);
11776
+ if (result)
11777
+ return result.cache;
11778
+ }
11779
+ if (state.tokenize) {
11780
+ const result = $TOKEN("JSXCommentContent", state, JSXCommentContent$0(state));
11781
+ if (state.events)
11782
+ state.events.exit?.("JSXCommentContent", state, result);
11783
+ return result;
11784
+ } else {
11785
+ const result = JSXCommentContent$0(state);
11786
+ if (state.events)
11787
+ state.events.exit?.("JSXCommentContent", state, result);
11788
+ return result;
11789
+ }
11790
+ }
11791
+ var JSXText$0 = $TR($EXPECT($R48, fail, "JSXText /[^{}<>\\r\\n]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
11744
11792
  return {
11745
11793
  type: "JSXText",
11746
11794
  token: $0,
@@ -11805,7 +11853,7 @@ ${input.slice(result.pos)}
11805
11853
  return result;
11806
11854
  }
11807
11855
  }
11808
- var TypeDeclarationModifier$0 = $S($EXPECT($L157, fail, 'TypeDeclarationModifier "declare"'), NonIdContinue);
11856
+ var TypeDeclarationModifier$0 = $S($EXPECT($L159, fail, 'TypeDeclarationModifier "declare"'), NonIdContinue);
11809
11857
  var TypeDeclarationModifier$1 = Export;
11810
11858
  function TypeDeclarationModifier(state) {
11811
11859
  if (state.events) {
@@ -11847,7 +11895,7 @@ ${input.slice(result.pos)}
11847
11895
  return result;
11848
11896
  }
11849
11897
  }
11850
- var TypeKeyword$0 = $S($EXPECT($L158, fail, 'TypeKeyword "type"'), NonIdContinue);
11898
+ var TypeKeyword$0 = $S($EXPECT($L160, fail, 'TypeKeyword "type"'), NonIdContinue);
11851
11899
  function TypeKeyword(state) {
11852
11900
  if (state.events) {
11853
11901
  const result = state.events.enter?.("TypeKeyword", state);
@@ -11866,7 +11914,7 @@ ${input.slice(result.pos)}
11866
11914
  return result;
11867
11915
  }
11868
11916
  }
11869
- var Interface$0 = $S($EXPECT($L159, fail, 'Interface "interface"'), NonIdContinue);
11917
+ var Interface$0 = $S($EXPECT($L161, fail, 'Interface "interface"'), NonIdContinue);
11870
11918
  function Interface(state) {
11871
11919
  if (state.events) {
11872
11920
  const result = state.events.enter?.("Interface", state);
@@ -11885,7 +11933,7 @@ ${input.slice(result.pos)}
11885
11933
  return result;
11886
11934
  }
11887
11935
  }
11888
- var Namespace$0 = $S($EXPECT($L160, fail, 'Namespace "namespace"'), NonIdContinue);
11936
+ var Namespace$0 = $S($EXPECT($L162, fail, 'Namespace "namespace"'), NonIdContinue);
11889
11937
  function Namespace(state) {
11890
11938
  if (state.events) {
11891
11939
  const result = state.events.enter?.("Namespace", state);
@@ -12074,7 +12122,7 @@ ${input.slice(result.pos)}
12074
12122
  return result;
12075
12123
  }
12076
12124
  }
12077
- var TypeIndexSignature$0 = $S($E($S($R$0($EXPECT($R48, fail, "TypeIndexSignature /[+-]?/")), $EXPECT($L129, fail, 'TypeIndexSignature "readonly"'), __)), OpenBracket, TypeIndex, CloseBracket, $E($S(__, $R$0($EXPECT($R4, fail, "TypeIndexSignature /[+-]/")), QuestionMark)));
12125
+ var TypeIndexSignature$0 = $S($E($S($R$0($EXPECT($R49, fail, "TypeIndexSignature /[+-]?/")), $EXPECT($L129, fail, 'TypeIndexSignature "readonly"'), __)), OpenBracket, TypeIndex, CloseBracket, $E($S(__, $R$0($EXPECT($R4, fail, "TypeIndexSignature /[+-]/")), QuestionMark)));
12078
12126
  function TypeIndexSignature(state) {
12079
12127
  if (state.events) {
12080
12128
  const result = state.events.enter?.("TypeIndexSignature", state);
@@ -12134,7 +12182,7 @@ ${input.slice(result.pos)}
12134
12182
  return result;
12135
12183
  }
12136
12184
  }
12137
- var ReturnTypeSuffix$0 = $TS($S(__, Colon, $E($S(__, $EXPECT($L161, fail, 'ReturnTypeSuffix "asserts"'), NonIdContinue)), TypePredicate), function($skip, $loc, $0, $1, $2, $3, $4) {
12185
+ var ReturnTypeSuffix$0 = $TS($S(__, Colon, $E($S(__, $EXPECT($L163, fail, 'ReturnTypeSuffix "asserts"'), NonIdContinue)), TypePredicate), function($skip, $loc, $0, $1, $2, $3, $4) {
12138
12186
  const children = [...$1, $2];
12139
12187
  if ($3)
12140
12188
  children.push($3);
@@ -12269,9 +12317,9 @@ ${input.slice(result.pos)}
12269
12317
  return result;
12270
12318
  }
12271
12319
  }
12272
- var TypeUnaryOp$0 = $EXPECT($L162, fail, 'TypeUnaryOp "keyof"');
12320
+ var TypeUnaryOp$0 = $EXPECT($L164, fail, 'TypeUnaryOp "keyof"');
12273
12321
  var TypeUnaryOp$1 = $EXPECT($L145, fail, 'TypeUnaryOp "typeof"');
12274
- var TypeUnaryOp$2 = $EXPECT($L163, fail, 'TypeUnaryOp "infer"');
12322
+ var TypeUnaryOp$2 = $EXPECT($L165, fail, 'TypeUnaryOp "infer"');
12275
12323
  var TypeUnaryOp$3 = $EXPECT($L129, fail, 'TypeUnaryOp "readonly"');
12276
12324
  function TypeUnaryOp(state) {
12277
12325
  if (state.events) {
@@ -12444,7 +12492,7 @@ ${input.slice(result.pos)}
12444
12492
  var TypeLiteral$2 = $TV($EXPECT($L149, fail, 'TypeLiteral "void"'), function($skip, $loc, $0, $1) {
12445
12493
  return { $loc, token: "void" };
12446
12494
  });
12447
- var TypeLiteral$3 = $TV($EXPECT($L164, fail, 'TypeLiteral "[]"'), function($skip, $loc, $0, $1) {
12495
+ var TypeLiteral$3 = $TV($EXPECT($L166, fail, 'TypeLiteral "[]"'), function($skip, $loc, $0, $1) {
12448
12496
  return { $loc, token: "[]" };
12449
12497
  });
12450
12498
  function TypeLiteral(state) {
@@ -12676,7 +12724,7 @@ ${input.slice(result.pos)}
12676
12724
  return result;
12677
12725
  }
12678
12726
  }
12679
- var Shebang$0 = $S($R$0($EXPECT($R49, fail, "Shebang /#![^\\r\\n]*/")), EOL);
12727
+ var Shebang$0 = $S($R$0($EXPECT($R50, fail, "Shebang /#![^\\r\\n]*/")), EOL);
12680
12728
  function Shebang(state) {
12681
12729
  if (state.events) {
12682
12730
  const result = state.events.enter?.("Shebang", state);
@@ -12695,11 +12743,11 @@ ${input.slice(result.pos)}
12695
12743
  return result;
12696
12744
  }
12697
12745
  }
12698
- var CivetPrologue$0 = $T($S($EXPECT($R50, fail, "CivetPrologue /[\\t ]*/"), DoubleQuote, CivetPrologueContent, DoubleQuote, $TEXT(StatementDelimiter), $E(EOS)), function(value) {
12746
+ var CivetPrologue$0 = $T($S($EXPECT($R51, fail, "CivetPrologue /[\\t ]*/"), DoubleQuote, CivetPrologueContent, DoubleQuote, $TEXT(StatementDelimiter), $E(EOS)), function(value) {
12699
12747
  var content = value[2];
12700
12748
  return content;
12701
12749
  });
12702
- var CivetPrologue$1 = $T($S($EXPECT($R50, fail, "CivetPrologue /[\\t ]*/"), SingleQuote, CivetPrologueContent, SingleQuote, $TEXT(StatementDelimiter), $E(EOS)), function(value) {
12750
+ var CivetPrologue$1 = $T($S($EXPECT($R51, fail, "CivetPrologue /[\\t ]*/"), SingleQuote, CivetPrologueContent, SingleQuote, $TEXT(StatementDelimiter), $E(EOS)), function(value) {
12703
12751
  var content = value[2];
12704
12752
  return content;
12705
12753
  });
@@ -12721,7 +12769,7 @@ ${input.slice(result.pos)}
12721
12769
  return result;
12722
12770
  }
12723
12771
  }
12724
- var CivetPrologueContent$0 = $TS($S($EXPECT($L165, fail, 'CivetPrologueContent "civet"'), $Q(CivetOption), $EXPECT($R51, fail, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3) {
12772
+ var CivetPrologueContent$0 = $TS($S($EXPECT($L167, fail, 'CivetPrologueContent "civet"'), $Q(CivetOption), $EXPECT($R52, fail, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3) {
12725
12773
  var options = $2;
12726
12774
  return {
12727
12775
  type: "CivetPrologue",
@@ -12747,7 +12795,7 @@ ${input.slice(result.pos)}
12747
12795
  return result;
12748
12796
  }
12749
12797
  }
12750
- var CivetOption$0 = $TR($EXPECT($R52, fail, "CivetOption /\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
12798
+ var CivetOption$0 = $TR($EXPECT($R53, fail, "CivetOption /\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
12751
12799
  const optionName = $2.replace(/-+([a-z]?)/g, (_2, l) => {
12752
12800
  if (l)
12753
12801
  return l.toUpperCase();
@@ -12779,7 +12827,7 @@ ${input.slice(result.pos)}
12779
12827
  return result;
12780
12828
  }
12781
12829
  }
12782
- var UnknownPrologue$0 = $S($R$0($EXPECT($R50, fail, "UnknownPrologue /[\\t ]*/")), BasicStringLiteral, $TEXT(StatementDelimiter), EOS);
12830
+ var UnknownPrologue$0 = $S($R$0($EXPECT($R51, fail, "UnknownPrologue /[\\t ]*/")), BasicStringLiteral, $TEXT(StatementDelimiter), EOS);
12783
12831
  function UnknownPrologue(state) {
12784
12832
  if (state.events) {
12785
12833
  const result = state.events.enter?.("UnknownPrologue", state);
@@ -12837,7 +12885,7 @@ ${input.slice(result.pos)}
12837
12885
  return result;
12838
12886
  }
12839
12887
  }
12840
- var EOL$0 = $TR($EXPECT($R53, fail, "EOL /\\r\\n|\\n|\\r|$/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
12888
+ var EOL$0 = $TR($EXPECT($R54, fail, "EOL /\\r\\n|\\n|\\r|$/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
12841
12889
  return { $loc, token: $0 };
12842
12890
  });
12843
12891
  function EOL(state) {
@@ -14622,7 +14670,7 @@ ${input.slice(result.pos)}
14622
14670
  return result;
14623
14671
  }
14624
14672
  }
14625
- var Indent$0 = $TR($EXPECT($R54, fail, "Indent /[ \\t]*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
14673
+ var Indent$0 = $TR($EXPECT($R55, fail, "Indent /[ \\t]*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
14626
14674
  let level;
14627
14675
  if (module2.config.tab) {
14628
14676
  const tabs = $0.match(/\t/g);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danielx/civet",
3
- "version": "0.5.18",
3
+ "version": "0.5.19",
4
4
  "description": "CoffeeScript style syntax for TypeScript",
5
5
  "main": "dist/main.js",
6
6
  "exports": {