@danielx/civet 0.6.84 → 0.6.86

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
@@ -2111,7 +2111,7 @@ function prependStatementExpressionBlock(initializer, statement) {
2111
2111
  ws = exp[0];
2112
2112
  exp = exp[1];
2113
2113
  }
2114
- if (!(exp.type === "StatementExpression")) {
2114
+ if (!(exp?.type === "StatementExpression")) {
2115
2115
  return;
2116
2116
  }
2117
2117
  const pre = [];
@@ -2129,7 +2129,8 @@ function prependStatementExpressionBlock(initializer, statement) {
2129
2129
  assignResults(blockStatement, (resultNode) => {
2130
2130
  return makeNode({
2131
2131
  type: "AssignmentExpression",
2132
- children: [ref, " = ", resultNode]
2132
+ children: [ref, " = ", resultNode],
2133
+ parent: statement2
2133
2134
  });
2134
2135
  });
2135
2136
  const refDec = {
@@ -2147,7 +2148,8 @@ function prependStatementExpressionBlock(initializer, statement) {
2147
2148
  assignResults(blockStatement, (resultNode) => {
2148
2149
  return makeNode({
2149
2150
  type: "AssignmentExpression",
2150
- children: [ref, " = ", resultNode]
2151
+ children: [ref, " = ", resultNode],
2152
+ parent: statement
2151
2153
  });
2152
2154
  });
2153
2155
  const refDec = {
@@ -3130,6 +3132,7 @@ var lib_exports = {};
3130
3132
  __export(lib_exports, {
3131
3133
  addPostfixStatement: () => addPostfixStatement,
3132
3134
  adjustBindingElements: () => adjustBindingElements,
3135
+ adjustIndexAccess: () => adjustIndexAccess,
3133
3136
  attachPostfixStatementAsExpression: () => attachPostfixStatementAsExpression,
3134
3137
  blockWithPrefix: () => blockWithPrefix,
3135
3138
  convertObjectToJSXAttributes: () => convertObjectToJSXAttributes,
@@ -3193,6 +3196,18 @@ function addPostfixStatement(statement, ws, post) {
3193
3196
  }
3194
3197
  return post;
3195
3198
  }
3199
+ function adjustIndexAccess(dot) {
3200
+ if (gatherRecursive(dot, (node) => node.token === "?").length) {
3201
+ dot = [...dot, "["];
3202
+ } else {
3203
+ dot = replaceNodes(
3204
+ deepCopy(dot),
3205
+ (node) => node.token === ".",
3206
+ (node) => ({ ...node, token: "[" })
3207
+ );
3208
+ }
3209
+ return dot;
3210
+ }
3196
3211
  function negateCondition(condition) {
3197
3212
  let { expression } = condition;
3198
3213
  const children = condition.children.slice();
@@ -3220,6 +3235,7 @@ function isExpression(node) {
3220
3235
  case "BlockStatement":
3221
3236
  case "DebuggerStatement":
3222
3237
  case "Declaration":
3238
+ case "ForStatement":
3223
3239
  case "IfStatement":
3224
3240
  case "IterationStatement":
3225
3241
  case "ReturnStatement":
@@ -3898,6 +3914,40 @@ function processStatementExpressions(statements) {
3898
3914
  return;
3899
3915
  });
3900
3916
  }
3917
+ function processNegativeIndexAccess(statements) {
3918
+ gatherRecursiveAll(statements, (n) => n.type === "NegativeIndex").forEach((exp) => {
3919
+ const { parent } = exp;
3920
+ const index = parent.children.indexOf(exp);
3921
+ let ref, subexp;
3922
+ if (index === 1) {
3923
+ const child = parent.children[0];
3924
+ ref = maybeRef(child);
3925
+ if (ref !== child) {
3926
+ subexp = parent.children.splice(0, 1);
3927
+ }
3928
+ } else if (index > 1) {
3929
+ ref = makeRef();
3930
+ subexp = parent.children.splice(0, index);
3931
+ } else {
3932
+ throw new Error("Invalid parse tree for negative index access");
3933
+ }
3934
+ if (subexp) {
3935
+ exp.hoistDec = {
3936
+ type: "Declaration",
3937
+ children: ["let ", ref],
3938
+ names: []
3939
+ };
3940
+ parent.children.unshift(makeLeftHandSideExpression({
3941
+ type: "AssignmentExpression",
3942
+ children: [ref, " = ", subexp]
3943
+ }));
3944
+ }
3945
+ return exp.len.children = [
3946
+ ref,
3947
+ ".length"
3948
+ ];
3949
+ });
3950
+ }
3901
3951
  function processProgram(root, config, m, ReservedWord) {
3902
3952
  assert.equal(m.forbidBracedApplication.length, 1, "forbidBracedApplication");
3903
3953
  assert.equal(m.forbidClassImplicitCall.length, 1, "forbidClassImplicitCall");
@@ -3907,6 +3957,7 @@ function processProgram(root, config, m, ReservedWord) {
3907
3957
  assert.equal(m.JSXTagStack.length, 1, "JSXTagStack");
3908
3958
  addParentPointers(root);
3909
3959
  const { expressions: statements } = root;
3960
+ processNegativeIndexAccess(statements);
3910
3961
  processTypes(statements);
3911
3962
  processDeclarationConditions(statements, m.getRef);
3912
3963
  processPipelineExpressions(statements);
@@ -5587,7 +5638,7 @@ var require_parser = __commonJS({
5587
5638
  var $R13 = $R(new RegExp("(?=\\p{ID_Start}|[_$])", "suy"));
5588
5639
  var $R14 = $R(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$])*", "suy"));
5589
5640
  var $R15 = $R(new RegExp("(?=\\[)", "suy"));
5590
- var $R16 = $R(new RegExp("[!+-]", "suy"));
5641
+ var $R16 = $R(new RegExp("[!+-]?", "suy"));
5591
5642
  var $R17 = $R(new RegExp("[+-]", "suy"));
5592
5643
  var $R18 = $R(new RegExp("(?=\\p{ID_Start}|[_$^\xAB\xBB\u22D9\u2264\u2265\u2208\u220B\u2209\u220C\u2263\u2261\u2262\u2260=\u2016\u2047&|*\\/!?%<>\u29FA+-])", "suy"));
5593
5644
  var $R19 = $R(new RegExp("!\\^\\^?", "suy"));
@@ -5644,24 +5695,25 @@ var require_parser = __commonJS({
5644
5695
  var $R70 = $R(new RegExp("\\s", "suy"));
5645
5696
  var $R71 = $R(new RegExp("(?=[<])", "suy"));
5646
5697
  var $R72 = $R(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*", "suy"));
5647
- var $R73 = $R(new RegExp("[\\s>]|\\/>", "suy"));
5648
- var $R74 = $R(new RegExp("(?:[\\w\\-:]+|\\([^()]*\\)|\\[[^\\[\\]]*\\])+", "suy"));
5649
- var $R75 = $R(new RegExp(`"[^"]*"|'[^']*'`, "suy"));
5650
- var $R76 = $R(new RegExp("[<>]", "suy"));
5651
- var $R77 = $R(new RegExp("[!~+-](?!\\s|[!~+-]*&)", "suy"));
5652
- var $R78 = $R(new RegExp("(?:-[^-]|[^-]*)*", "suy"));
5653
- var $R79 = $R(new RegExp("[^{}<>\\r\\n]+", "suy"));
5654
- var $R80 = $R(new RegExp("[+-]?", "suy"));
5655
- var $R81 = $R(new RegExp("(?=if|unless)", "suy"));
5656
- var $R82 = $R(new RegExp("#![^\\r\\n]*", "suy"));
5657
- var $R83 = $R(new RegExp("[\\t ]*", "suy"));
5658
- var $R84 = $R(new RegExp("[ \\t]*", "suy"));
5659
- var $R85 = $R(new RegExp("[\\s]*", "suy"));
5660
- var $R86 = $R(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?", "suy"));
5661
- var $R87 = $R(new RegExp("\\/\\/\\/[^\\r\\n]*", "suy"));
5662
- var $R88 = $R(new RegExp("(?=[ \\t\\r\\n\\/#]|$)", "suy"));
5663
- var $R89 = $R(new RegExp("\\r\\n|\\n|\\r|$", "suy"));
5664
- var $R90 = $R(new RegExp("[^]*", "suy"));
5698
+ var $R73 = $R(new RegExp("[!+-]", "suy"));
5699
+ var $R74 = $R(new RegExp("[\\s>]|\\/>", "suy"));
5700
+ var $R75 = $R(new RegExp("(?:[\\w\\-:]+|\\([^()]*\\)|\\[[^\\[\\]]*\\])+", "suy"));
5701
+ var $R76 = $R(new RegExp(`"[^"]*"|'[^']*'`, "suy"));
5702
+ var $R77 = $R(new RegExp("[<>]", "suy"));
5703
+ var $R78 = $R(new RegExp("[!~+-](?!\\s|[!~+-]*&)", "suy"));
5704
+ var $R79 = $R(new RegExp("(?:-[^-]|[^-]*)*", "suy"));
5705
+ var $R80 = $R(new RegExp("[^{}<>\\r\\n]+", "suy"));
5706
+ var $R81 = $R(new RegExp("[+-]?", "suy"));
5707
+ var $R82 = $R(new RegExp("(?=if|unless)", "suy"));
5708
+ var $R83 = $R(new RegExp("#![^\\r\\n]*", "suy"));
5709
+ var $R84 = $R(new RegExp("[\\t ]*", "suy"));
5710
+ var $R85 = $R(new RegExp("[ \\t]*", "suy"));
5711
+ var $R86 = $R(new RegExp("[\\s]*", "suy"));
5712
+ var $R87 = $R(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?", "suy"));
5713
+ var $R88 = $R(new RegExp("\\/\\/\\/[^\\r\\n]*", "suy"));
5714
+ var $R89 = $R(new RegExp("(?=[ \\t\\r\\n\\/#]|$)", "suy"));
5715
+ var $R90 = $R(new RegExp("\\r\\n|\\n|\\r|$", "suy"));
5716
+ var $R91 = $R(new RegExp("[^]*", "suy"));
5665
5717
  var Program$0 = $TS($S(Reset, Init, $E(EOS), TopLevelStatements, __), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
5666
5718
  var statements = $4;
5667
5719
  processProgram({
@@ -6127,9 +6179,7 @@ var require_parser = __commonJS({
6127
6179
  return $EVENT_C(ctx, state, "UnaryWithoutParenthesizedAssignmentBody", UnaryWithoutParenthesizedAssignmentBody$$);
6128
6180
  }
6129
6181
  var UnaryPostfix$0 = QuestionMark;
6130
- var UnaryPostfix$1 = $T($P(TypePostfix), function(value) {
6131
- return { "ts": true, "children": value };
6132
- });
6182
+ var UnaryPostfix$1 = $P(TypePostfix);
6133
6183
  var UnaryPostfix$$ = [UnaryPostfix$0, UnaryPostfix$1];
6134
6184
  function UnaryPostfix(ctx, state) {
6135
6185
  return $EVENT_C(ctx, state, "UnaryPostfix", UnaryPostfix$$);
@@ -6137,7 +6187,7 @@ var require_parser = __commonJS({
6137
6187
  var TypePostfix$0 = $TS($S(_, NWTypePostfix), function($skip, $loc, $0, $1, $2) {
6138
6188
  var ws = $1;
6139
6189
  var postfix = $2;
6140
- return [ws, ...postfix];
6190
+ return [ws, postfix];
6141
6191
  });
6142
6192
  function TypePostfix(ctx, state) {
6143
6193
  return $EVENT(ctx, state, "TypePostfix", TypePostfix$0);
@@ -6152,18 +6202,26 @@ var require_parser = __commonJS({
6152
6202
  return $EVENT(ctx, state, "Tuple", Tuple$0);
6153
6203
  }
6154
6204
  var NWTypePostfix$0 = $TS($S(As, _, Tuple), function($skip, $loc, $0, $1, $2, $3) {
6155
- return [{ $loc: $1.$loc, token: "satisfies" }, $2, $3];
6205
+ return {
6206
+ ts: true,
6207
+ children: [{ $loc: $1.$loc, token: "satisfies" }, $2, $3]
6208
+ };
6156
6209
  });
6157
6210
  var NWTypePostfix$1 = $TS($S(As, $E(ExclamationPoint), Type), function($skip, $loc, $0, $1, $2, $3) {
6158
6211
  var as = $1;
6159
6212
  var ex = $2;
6160
6213
  var type = $3;
6214
+ let children;
6161
6215
  if (ex) {
6162
- return [{ $loc: ex.$loc, token: "as unknown " }, as, type];
6216
+ children = [{ $loc: ex.$loc, token: "as unknown " }, as, type];
6217
+ } else {
6218
+ children = [as, type];
6163
6219
  }
6164
- return [as, type];
6220
+ return { ts: true, children };
6221
+ });
6222
+ var NWTypePostfix$2 = $TS($S(Satisfies, Type), function($skip, $loc, $0, $1, $2) {
6223
+ return { ts: true, children: $0 };
6165
6224
  });
6166
- var NWTypePostfix$2 = $S(Satisfies, Type);
6167
6225
  var NWTypePostfix$$ = [NWTypePostfix$0, NWTypePostfix$1, NWTypePostfix$2];
6168
6226
  function NWTypePostfix(ctx, state) {
6169
6227
  return $EVENT_C(ctx, state, "NWTypePostfix", NWTypePostfix$$);
@@ -7106,19 +7164,10 @@ var require_parser = __commonJS({
7106
7164
  var PropertyAccess$0 = $TS($S(AccessStart, $C(TemplateLiteral, StringLiteral, IntegerLiteral)), function($skip, $loc, $0, $1, $2) {
7107
7165
  var dot = $1;
7108
7166
  var literal = $2;
7109
- if (gatherRecursive(dot, (node) => node.token === "?").length) {
7110
- dot = [...dot, "["];
7111
- } else {
7112
- dot = replaceNodes(
7113
- deepCopy(dot),
7114
- (node) => node.token === ".",
7115
- (node) => ({ ...node, token: "[" })
7116
- );
7117
- }
7118
7167
  return {
7119
7168
  type: "Index",
7120
7169
  children: [
7121
- dot,
7170
+ adjustIndexAccess(dot),
7122
7171
  literal,
7123
7172
  "]"
7124
7173
  ]
@@ -7128,11 +7177,20 @@ var require_parser = __commonJS({
7128
7177
  var dot = $1;
7129
7178
  var neg = $2;
7130
7179
  var num = $3;
7131
- return [
7132
- { type: "PropertyAccess", children: [dot, "at"] },
7133
- // not including `name` so that `{x.-1}` doesn't use it
7134
- { type: "Call", children: ["(", neg, num, ")"] }
7180
+ const len = {
7181
+ children: []
7182
+ }, children = [
7183
+ adjustIndexAccess(dot),
7184
+ len,
7185
+ neg,
7186
+ num,
7187
+ "]"
7135
7188
  ];
7189
+ return {
7190
+ type: "NegativeIndex",
7191
+ children,
7192
+ len
7193
+ };
7136
7194
  });
7137
7195
  var PropertyAccess$2 = $TS($S(AccessStart, $Q(InlineComment), $C(IdentifierName, PrivateIdentifier, LengthShorthand)), function($skip, $loc, $0, $1, $2, $3) {
7138
7196
  var access = $1;
@@ -9077,17 +9135,26 @@ var require_parser = __commonJS({
9077
9135
  children: [ws, ...prop.children]
9078
9136
  };
9079
9137
  });
9080
- var PropertyDefinition$1 = $TS($S($E(_), $TEXT($EXPECT($R16, "PropertyDefinition /[!+-]/")), PropertyName), function($skip, $loc, $0, $1, $2, $3) {
9138
+ var PropertyDefinition$1 = $TS($S($E(_), $TEXT($EXPECT($R16, "PropertyDefinition /[!+-]?/")), PropertyName, $Y(ObjectPropertyDelimiter)), function($skip, $loc, $0, $1, $2, $3, $4) {
9081
9139
  var ws = $1;
9082
9140
  var toggle = $2;
9083
9141
  var id = $3;
9084
- const value = toggle === "+" ? "true" : "false";
9142
+ if (toggle) {
9143
+ const value = toggle === "+" ? "true" : "false";
9144
+ return {
9145
+ type: "Property",
9146
+ children: [ws, id, ": ", value],
9147
+ name: id,
9148
+ names: id.names,
9149
+ value
9150
+ };
9151
+ }
9085
9152
  return {
9086
9153
  type: "Property",
9087
- children: [ws, id, ": ", value],
9154
+ children: [ws, id],
9088
9155
  name: id,
9089
9156
  names: id.names,
9090
- value
9157
+ value: id
9091
9158
  };
9092
9159
  });
9093
9160
  var PropertyDefinition$2 = $TS($S($E(_), MethodDefinition), function($skip, $loc, $0, $1, $2) {
@@ -12964,7 +13031,7 @@ var require_parser = __commonJS({
12964
13031
  class: $2
12965
13032
  };
12966
13033
  });
12967
- var JSXAttribute$7 = $TS($S($TEXT($EXPECT($R16, "JSXAttribute /[!+-]/")), JSXAttributeName, $Y(JSXAttributeSpace)), function($skip, $loc, $0, $1, $2, $3) {
13034
+ var JSXAttribute$7 = $TS($S($TEXT($EXPECT($R73, "JSXAttribute /[!+-]/")), JSXAttributeName, $Y(JSXAttributeSpace)), function($skip, $loc, $0, $1, $2, $3) {
12968
13035
  var toggle = $1;
12969
13036
  var id = $2;
12970
13037
  const value = toggle === "+" ? "true" : "false";
@@ -12974,11 +13041,11 @@ var require_parser = __commonJS({
12974
13041
  function JSXAttribute(ctx, state) {
12975
13042
  return $EVENT_C(ctx, state, "JSXAttribute", JSXAttribute$$);
12976
13043
  }
12977
- var JSXAttributeSpace$0 = $R$0($EXPECT($R73, "JSXAttributeSpace /[\\s>]|\\/>/"));
13044
+ var JSXAttributeSpace$0 = $R$0($EXPECT($R74, "JSXAttributeSpace /[\\s>]|\\/>/"));
12978
13045
  function JSXAttributeSpace(ctx, state) {
12979
13046
  return $EVENT(ctx, state, "JSXAttributeSpace", JSXAttributeSpace$0);
12980
13047
  }
12981
- var JSXShorthandString$0 = $TR($EXPECT($R74, "JSXShorthandString /(?:[\\w\\-:]+|\\([^()]*\\)|\\[[^\\[\\]]*\\])+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
13048
+ var JSXShorthandString$0 = $TR($EXPECT($R75, "JSXShorthandString /(?:[\\w\\-:]+|\\([^()]*\\)|\\[[^\\[\\]]*\\])+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
12982
13049
  return quoteString($0);
12983
13050
  });
12984
13051
  var JSXShorthandString$1 = $TS($S(TemplateLiteral), function($skip, $loc, $0, $1) {
@@ -13012,7 +13079,7 @@ var require_parser = __commonJS({
13012
13079
  }
13013
13080
  return [open, value, close];
13014
13081
  });
13015
- var JSXAttributeValue$4 = $R$0($EXPECT($R75, `JSXAttributeValue /"[^"]*"|'[^']*'/`));
13082
+ var JSXAttributeValue$4 = $R$0($EXPECT($R76, `JSXAttributeValue /"[^"]*"|'[^']*'/`));
13016
13083
  var JSXAttributeValue$$ = [JSXAttributeValue$0, JSXAttributeValue$1, JSXAttributeValue$2, JSXAttributeValue$3, JSXAttributeValue$4];
13017
13084
  function JSXAttributeValue(ctx, state) {
13018
13085
  return $EVENT_C(ctx, state, "JSXAttributeValue", JSXAttributeValue$$);
@@ -13025,7 +13092,7 @@ var require_parser = __commonJS({
13025
13092
  function InlineJSXAttributeValue(ctx, state) {
13026
13093
  return $EVENT(ctx, state, "InlineJSXAttributeValue", InlineJSXAttributeValue$0);
13027
13094
  }
13028
- var InlineJSXBinaryOpRHS$0 = $TS($S($N($EXPECT($R76, "InlineJSXBinaryOpRHS /[<>]/")), BinaryOp, InlineJSXUnaryExpression), function($skip, $loc, $0, $1, $2, $3) {
13095
+ var InlineJSXBinaryOpRHS$0 = $TS($S($N($EXPECT($R77, "InlineJSXBinaryOpRHS /[<>]/")), BinaryOp, InlineJSXUnaryExpression), function($skip, $loc, $0, $1, $2, $3) {
13029
13096
  var op = $2;
13030
13097
  var rhs = $3;
13031
13098
  return [[], op, [], rhs];
@@ -13042,7 +13109,7 @@ var require_parser = __commonJS({
13042
13109
  function InlineJSXUnaryExpression(ctx, state) {
13043
13110
  return $EVENT(ctx, state, "InlineJSXUnaryExpression", InlineJSXUnaryExpression$0);
13044
13111
  }
13045
- var InlineJSXUnaryOp$0 = $TR($EXPECT($R77, "InlineJSXUnaryOp /[!~+-](?!\\s|[!~+-]*&)/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
13112
+ var InlineJSXUnaryOp$0 = $TR($EXPECT($R78, "InlineJSXUnaryOp /[!~+-](?!\\s|[!~+-]*&)/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
13046
13113
  return { $loc, token: $0 };
13047
13114
  });
13048
13115
  function InlineJSXUnaryOp(ctx, state) {
@@ -13258,13 +13325,13 @@ var require_parser = __commonJS({
13258
13325
  function JSXComment(ctx, state) {
13259
13326
  return $EVENT(ctx, state, "JSXComment", JSXComment$0);
13260
13327
  }
13261
- var JSXCommentContent$0 = $TR($EXPECT($R78, "JSXCommentContent /(?:-[^-]|[^-]*)*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
13328
+ var JSXCommentContent$0 = $TR($EXPECT($R79, "JSXCommentContent /(?:-[^-]|[^-]*)*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
13262
13329
  return { $loc, token: $0.replace(/\*\//g, "* /") };
13263
13330
  });
13264
13331
  function JSXCommentContent(ctx, state) {
13265
13332
  return $EVENT(ctx, state, "JSXCommentContent", JSXCommentContent$0);
13266
13333
  }
13267
- var JSXText$0 = $TR($EXPECT($R79, "JSXText /[^{}<>\\r\\n]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
13334
+ var JSXText$0 = $TR($EXPECT($R80, "JSXText /[^{}<>\\r\\n]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
13268
13335
  return {
13269
13336
  type: "JSXText",
13270
13337
  token: $0,
@@ -13685,7 +13752,7 @@ var require_parser = __commonJS({
13685
13752
  function TypeProperty(ctx, state) {
13686
13753
  return $EVENT(ctx, state, "TypeProperty", TypeProperty$0);
13687
13754
  }
13688
- var TypeIndexSignature$0 = $S($E($S($R$0($EXPECT($R80, "TypeIndexSignature /[+-]?/")), Readonly, NotDedented)), OpenBracket, TypeIndex, CloseBracket, $E($S(__, $R$0($EXPECT($R17, "TypeIndexSignature /[+-]/")), $Y($S($E(_), QuestionMark)))));
13755
+ var TypeIndexSignature$0 = $S($E($S($R$0($EXPECT($R81, "TypeIndexSignature /[+-]?/")), Readonly, NotDedented)), OpenBracket, TypeIndex, CloseBracket, $E($S(__, $R$0($EXPECT($R17, "TypeIndexSignature /[+-]/")), $Y($S($E(_), QuestionMark)))));
13689
13756
  function TypeIndexSignature(ctx, state) {
13690
13757
  return $EVENT(ctx, state, "TypeIndexSignature", TypeIndexSignature$0);
13691
13758
  }
@@ -13979,7 +14046,7 @@ var require_parser = __commonJS({
13979
14046
  function NestedType(ctx, state) {
13980
14047
  return $EVENT(ctx, state, "NestedType", NestedType$0);
13981
14048
  }
13982
- var TypeConditional$0 = $TS($S($E(_), $EXPECT($R81, "TypeConditional /(?=if|unless)/"), TypeIfThenElse), function($skip, $loc, $0, $1, $2, $3) {
14049
+ var TypeConditional$0 = $TS($S($E(_), $EXPECT($R82, "TypeConditional /(?=if|unless)/"), TypeIfThenElse), function($skip, $loc, $0, $1, $2, $3) {
13983
14050
  return [$1, expressionizeTypeIf($3)];
13984
14051
  });
13985
14052
  var TypeConditional$1 = $TS($S(TypeCondition, NotDedented, QuestionMark, Type, __, Colon, Type), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
@@ -14172,15 +14239,15 @@ var require_parser = __commonJS({
14172
14239
  function ThisType(ctx, state) {
14173
14240
  return $EVENT(ctx, state, "ThisType", ThisType$0);
14174
14241
  }
14175
- var Shebang$0 = $S($R$0($EXPECT($R82, "Shebang /#![^\\r\\n]*/")), EOL);
14242
+ var Shebang$0 = $S($R$0($EXPECT($R83, "Shebang /#![^\\r\\n]*/")), EOL);
14176
14243
  function Shebang(ctx, state) {
14177
14244
  return $EVENT(ctx, state, "Shebang", Shebang$0);
14178
14245
  }
14179
- var CivetPrologue$0 = $T($S($EXPECT($R83, "CivetPrologue /[\\t ]*/"), DoubleQuote, CivetPrologueContent, DoubleQuote, SimpleStatementDelimiter, $EXPECT($R84, "CivetPrologue /[ \\t]*/"), $C(EOL, $Y(RestOfLine))), function(value) {
14246
+ var CivetPrologue$0 = $T($S($EXPECT($R84, "CivetPrologue /[\\t ]*/"), DoubleQuote, CivetPrologueContent, DoubleQuote, SimpleStatementDelimiter, $EXPECT($R85, "CivetPrologue /[ \\t]*/"), $C(EOL, $Y(RestOfLine))), function(value) {
14180
14247
  var content = value[2];
14181
14248
  return content;
14182
14249
  });
14183
- var CivetPrologue$1 = $T($S($EXPECT($R83, "CivetPrologue /[\\t ]*/"), SingleQuote, CivetPrologueContent, SingleQuote, SimpleStatementDelimiter, $EXPECT($R84, "CivetPrologue /[ \\t]*/"), $C(EOL, $Y(RestOfLine))), function(value) {
14250
+ var CivetPrologue$1 = $T($S($EXPECT($R84, "CivetPrologue /[\\t ]*/"), SingleQuote, CivetPrologueContent, SingleQuote, SimpleStatementDelimiter, $EXPECT($R85, "CivetPrologue /[ \\t]*/"), $C(EOL, $Y(RestOfLine))), function(value) {
14184
14251
  var content = value[2];
14185
14252
  return content;
14186
14253
  });
@@ -14188,7 +14255,7 @@ var require_parser = __commonJS({
14188
14255
  function CivetPrologue(ctx, state) {
14189
14256
  return $EVENT_C(ctx, state, "CivetPrologue", CivetPrologue$$);
14190
14257
  }
14191
- var CivetPrologueContent$0 = $TS($S($EXPECT($L225, 'CivetPrologueContent "civet"'), NonIdContinue, $Q(CivetOption), $EXPECT($R85, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3, $4) {
14258
+ var CivetPrologueContent$0 = $TS($S($EXPECT($L225, 'CivetPrologueContent "civet"'), NonIdContinue, $Q(CivetOption), $EXPECT($R86, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3, $4) {
14192
14259
  var options = $3;
14193
14260
  return {
14194
14261
  type: "CivetPrologue",
@@ -14199,7 +14266,7 @@ var require_parser = __commonJS({
14199
14266
  function CivetPrologueContent(ctx, state) {
14200
14267
  return $EVENT(ctx, state, "CivetPrologueContent", CivetPrologueContent$0);
14201
14268
  }
14202
- var CivetOption$0 = $TR($EXPECT($R86, "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) {
14269
+ var CivetOption$0 = $TR($EXPECT($R87, "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) {
14203
14270
  const optionName = $2.replace(/-+([a-z]?)/g, (_2, l) => {
14204
14271
  if (l)
14205
14272
  return l.toUpperCase();
@@ -14216,11 +14283,11 @@ var require_parser = __commonJS({
14216
14283
  function CivetOption(ctx, state) {
14217
14284
  return $EVENT(ctx, state, "CivetOption", CivetOption$0);
14218
14285
  }
14219
- var UnknownPrologue$0 = $S($R$0($EXPECT($R83, "UnknownPrologue /[\\t ]*/")), StringLiteral, $TEXT(SimpleStatementDelimiter), EOS);
14286
+ var UnknownPrologue$0 = $S($R$0($EXPECT($R84, "UnknownPrologue /[\\t ]*/")), StringLiteral, $TEXT(SimpleStatementDelimiter), EOS);
14220
14287
  function UnknownPrologue(ctx, state) {
14221
14288
  return $EVENT(ctx, state, "UnknownPrologue", UnknownPrologue$0);
14222
14289
  }
14223
- var TripleSlashDirective$0 = $S($R$0($EXPECT($R87, "TripleSlashDirective /\\/\\/\\/[^\\r\\n]*/")), $E(EOS));
14290
+ var TripleSlashDirective$0 = $S($R$0($EXPECT($R88, "TripleSlashDirective /\\/\\/\\/[^\\r\\n]*/")), $E(EOS));
14224
14291
  function TripleSlashDirective(ctx, state) {
14225
14292
  return $EVENT(ctx, state, "TripleSlashDirective", TripleSlashDirective$0);
14226
14293
  }
@@ -14236,13 +14303,13 @@ var require_parser = __commonJS({
14236
14303
  function PrologueString(ctx, state) {
14237
14304
  return $EVENT_C(ctx, state, "PrologueString", PrologueString$$);
14238
14305
  }
14239
- var EOS$0 = $T($S($EXPECT($R88, "EOS /(?=[ \\t\\r\\n\\/#]|$)/"), $P(RestOfLine)), function(value) {
14306
+ var EOS$0 = $T($S($EXPECT($R89, "EOS /(?=[ \\t\\r\\n\\/#]|$)/"), $P(RestOfLine)), function(value) {
14240
14307
  return value[1];
14241
14308
  });
14242
14309
  function EOS(ctx, state) {
14243
14310
  return $EVENT(ctx, state, "EOS", EOS$0);
14244
14311
  }
14245
- var EOL$0 = $TR($EXPECT($R89, "EOL /\\r\\n|\\n|\\r|$/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
14312
+ var EOL$0 = $TR($EXPECT($R90, "EOL /\\r\\n|\\n|\\r|$/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
14246
14313
  return { $loc, token: $0 };
14247
14314
  });
14248
14315
  function EOL(ctx, state) {
@@ -14814,11 +14881,11 @@ var require_parser = __commonJS({
14814
14881
  function Prologue(ctx, state) {
14815
14882
  return $EVENT(ctx, state, "Prologue", Prologue$0);
14816
14883
  }
14817
- var ProloguePrefix$0 = $S(Prologue, $R$0($EXPECT($R90, "ProloguePrefix /[^]*/")));
14884
+ var ProloguePrefix$0 = $S(Prologue, $R$0($EXPECT($R91, "ProloguePrefix /[^]*/")));
14818
14885
  function ProloguePrefix(ctx, state) {
14819
14886
  return $EVENT(ctx, state, "ProloguePrefix", ProloguePrefix$0);
14820
14887
  }
14821
- var Indent$0 = $TR($EXPECT($R84, "Indent /[ \\t]*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
14888
+ var Indent$0 = $TR($EXPECT($R85, "Indent /[ \\t]*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
14822
14889
  const level = getIndentLevel($0, module.config.tab);
14823
14890
  return {
14824
14891
  $loc,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@danielx/civet",
3
3
  "type": "commonjs",
4
- "version": "0.6.84",
4
+ "version": "0.6.86",
5
5
  "description": "CoffeeScript style syntax for TypeScript",
6
6
  "main": "dist/main.js",
7
7
  "module": "dist/main.mjs",