@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/browser.js CHANGED
@@ -2121,7 +2121,7 @@ var Civet = (() => {
2121
2121
  ws = exp[0];
2122
2122
  exp = exp[1];
2123
2123
  }
2124
- if (!(exp.type === "StatementExpression")) {
2124
+ if (!(exp?.type === "StatementExpression")) {
2125
2125
  return;
2126
2126
  }
2127
2127
  const pre = [];
@@ -2139,7 +2139,8 @@ var Civet = (() => {
2139
2139
  assignResults(blockStatement, (resultNode) => {
2140
2140
  return makeNode({
2141
2141
  type: "AssignmentExpression",
2142
- children: [ref, " = ", resultNode]
2142
+ children: [ref, " = ", resultNode],
2143
+ parent: statement2
2143
2144
  });
2144
2145
  });
2145
2146
  const refDec = {
@@ -2157,7 +2158,8 @@ var Civet = (() => {
2157
2158
  assignResults(blockStatement, (resultNode) => {
2158
2159
  return makeNode({
2159
2160
  type: "AssignmentExpression",
2160
- children: [ref, " = ", resultNode]
2161
+ children: [ref, " = ", resultNode],
2162
+ parent: statement
2161
2163
  });
2162
2164
  });
2163
2165
  const refDec = {
@@ -3140,6 +3142,7 @@ var Civet = (() => {
3140
3142
  __export(lib_exports, {
3141
3143
  addPostfixStatement: () => addPostfixStatement,
3142
3144
  adjustBindingElements: () => adjustBindingElements,
3145
+ adjustIndexAccess: () => adjustIndexAccess,
3143
3146
  attachPostfixStatementAsExpression: () => attachPostfixStatementAsExpression,
3144
3147
  blockWithPrefix: () => blockWithPrefix,
3145
3148
  convertObjectToJSXAttributes: () => convertObjectToJSXAttributes,
@@ -3203,6 +3206,18 @@ var Civet = (() => {
3203
3206
  }
3204
3207
  return post;
3205
3208
  }
3209
+ function adjustIndexAccess(dot) {
3210
+ if (gatherRecursive(dot, (node) => node.token === "?").length) {
3211
+ dot = [...dot, "["];
3212
+ } else {
3213
+ dot = replaceNodes(
3214
+ deepCopy(dot),
3215
+ (node) => node.token === ".",
3216
+ (node) => ({ ...node, token: "[" })
3217
+ );
3218
+ }
3219
+ return dot;
3220
+ }
3206
3221
  function negateCondition(condition) {
3207
3222
  let { expression } = condition;
3208
3223
  const children = condition.children.slice();
@@ -3230,6 +3245,7 @@ var Civet = (() => {
3230
3245
  case "BlockStatement":
3231
3246
  case "DebuggerStatement":
3232
3247
  case "Declaration":
3248
+ case "ForStatement":
3233
3249
  case "IfStatement":
3234
3250
  case "IterationStatement":
3235
3251
  case "ReturnStatement":
@@ -3908,6 +3924,40 @@ var Civet = (() => {
3908
3924
  return;
3909
3925
  });
3910
3926
  }
3927
+ function processNegativeIndexAccess(statements) {
3928
+ gatherRecursiveAll(statements, (n) => n.type === "NegativeIndex").forEach((exp) => {
3929
+ const { parent } = exp;
3930
+ const index = parent.children.indexOf(exp);
3931
+ let ref, subexp;
3932
+ if (index === 1) {
3933
+ const child = parent.children[0];
3934
+ ref = maybeRef(child);
3935
+ if (ref !== child) {
3936
+ subexp = parent.children.splice(0, 1);
3937
+ }
3938
+ } else if (index > 1) {
3939
+ ref = makeRef();
3940
+ subexp = parent.children.splice(0, index);
3941
+ } else {
3942
+ throw new Error("Invalid parse tree for negative index access");
3943
+ }
3944
+ if (subexp) {
3945
+ exp.hoistDec = {
3946
+ type: "Declaration",
3947
+ children: ["let ", ref],
3948
+ names: []
3949
+ };
3950
+ parent.children.unshift(makeLeftHandSideExpression({
3951
+ type: "AssignmentExpression",
3952
+ children: [ref, " = ", subexp]
3953
+ }));
3954
+ }
3955
+ return exp.len.children = [
3956
+ ref,
3957
+ ".length"
3958
+ ];
3959
+ });
3960
+ }
3911
3961
  function processProgram(root, config, m, ReservedWord) {
3912
3962
  assert.equal(m.forbidBracedApplication.length, 1, "forbidBracedApplication");
3913
3963
  assert.equal(m.forbidClassImplicitCall.length, 1, "forbidClassImplicitCall");
@@ -3917,6 +3967,7 @@ var Civet = (() => {
3917
3967
  assert.equal(m.JSXTagStack.length, 1, "JSXTagStack");
3918
3968
  addParentPointers(root);
3919
3969
  const { expressions: statements } = root;
3970
+ processNegativeIndexAccess(statements);
3920
3971
  processTypes(statements);
3921
3972
  processDeclarationConditions(statements, m.getRef);
3922
3973
  processPipelineExpressions(statements);
@@ -5597,7 +5648,7 @@ ${input.slice(result.pos)}
5597
5648
  var $R13 = $R(new RegExp("(?=\\p{ID_Start}|[_$])", "suy"));
5598
5649
  var $R14 = $R(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$])*", "suy"));
5599
5650
  var $R15 = $R(new RegExp("(?=\\[)", "suy"));
5600
- var $R16 = $R(new RegExp("[!+-]", "suy"));
5651
+ var $R16 = $R(new RegExp("[!+-]?", "suy"));
5601
5652
  var $R17 = $R(new RegExp("[+-]", "suy"));
5602
5653
  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"));
5603
5654
  var $R19 = $R(new RegExp("!\\^\\^?", "suy"));
@@ -5654,24 +5705,25 @@ ${input.slice(result.pos)}
5654
5705
  var $R70 = $R(new RegExp("\\s", "suy"));
5655
5706
  var $R71 = $R(new RegExp("(?=[<])", "suy"));
5656
5707
  var $R72 = $R(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*", "suy"));
5657
- var $R73 = $R(new RegExp("[\\s>]|\\/>", "suy"));
5658
- var $R74 = $R(new RegExp("(?:[\\w\\-:]+|\\([^()]*\\)|\\[[^\\[\\]]*\\])+", "suy"));
5659
- var $R75 = $R(new RegExp(`"[^"]*"|'[^']*'`, "suy"));
5660
- var $R76 = $R(new RegExp("[<>]", "suy"));
5661
- var $R77 = $R(new RegExp("[!~+-](?!\\s|[!~+-]*&)", "suy"));
5662
- var $R78 = $R(new RegExp("(?:-[^-]|[^-]*)*", "suy"));
5663
- var $R79 = $R(new RegExp("[^{}<>\\r\\n]+", "suy"));
5664
- var $R80 = $R(new RegExp("[+-]?", "suy"));
5665
- var $R81 = $R(new RegExp("(?=if|unless)", "suy"));
5666
- var $R82 = $R(new RegExp("#![^\\r\\n]*", "suy"));
5667
- var $R83 = $R(new RegExp("[\\t ]*", "suy"));
5668
- var $R84 = $R(new RegExp("[ \\t]*", "suy"));
5669
- var $R85 = $R(new RegExp("[\\s]*", "suy"));
5670
- var $R86 = $R(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?", "suy"));
5671
- var $R87 = $R(new RegExp("\\/\\/\\/[^\\r\\n]*", "suy"));
5672
- var $R88 = $R(new RegExp("(?=[ \\t\\r\\n\\/#]|$)", "suy"));
5673
- var $R89 = $R(new RegExp("\\r\\n|\\n|\\r|$", "suy"));
5674
- var $R90 = $R(new RegExp("[^]*", "suy"));
5708
+ var $R73 = $R(new RegExp("[!+-]", "suy"));
5709
+ var $R74 = $R(new RegExp("[\\s>]|\\/>", "suy"));
5710
+ var $R75 = $R(new RegExp("(?:[\\w\\-:]+|\\([^()]*\\)|\\[[^\\[\\]]*\\])+", "suy"));
5711
+ var $R76 = $R(new RegExp(`"[^"]*"|'[^']*'`, "suy"));
5712
+ var $R77 = $R(new RegExp("[<>]", "suy"));
5713
+ var $R78 = $R(new RegExp("[!~+-](?!\\s|[!~+-]*&)", "suy"));
5714
+ var $R79 = $R(new RegExp("(?:-[^-]|[^-]*)*", "suy"));
5715
+ var $R80 = $R(new RegExp("[^{}<>\\r\\n]+", "suy"));
5716
+ var $R81 = $R(new RegExp("[+-]?", "suy"));
5717
+ var $R82 = $R(new RegExp("(?=if|unless)", "suy"));
5718
+ var $R83 = $R(new RegExp("#![^\\r\\n]*", "suy"));
5719
+ var $R84 = $R(new RegExp("[\\t ]*", "suy"));
5720
+ var $R85 = $R(new RegExp("[ \\t]*", "suy"));
5721
+ var $R86 = $R(new RegExp("[\\s]*", "suy"));
5722
+ var $R87 = $R(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?", "suy"));
5723
+ var $R88 = $R(new RegExp("\\/\\/\\/[^\\r\\n]*", "suy"));
5724
+ var $R89 = $R(new RegExp("(?=[ \\t\\r\\n\\/#]|$)", "suy"));
5725
+ var $R90 = $R(new RegExp("\\r\\n|\\n|\\r|$", "suy"));
5726
+ var $R91 = $R(new RegExp("[^]*", "suy"));
5675
5727
  var Program$0 = $TS($S(Reset, Init, $E(EOS), TopLevelStatements, __), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
5676
5728
  var statements = $4;
5677
5729
  processProgram({
@@ -6137,9 +6189,7 @@ ${input.slice(result.pos)}
6137
6189
  return $EVENT_C(ctx, state, "UnaryWithoutParenthesizedAssignmentBody", UnaryWithoutParenthesizedAssignmentBody$$);
6138
6190
  }
6139
6191
  var UnaryPostfix$0 = QuestionMark;
6140
- var UnaryPostfix$1 = $T($P(TypePostfix), function(value) {
6141
- return { "ts": true, "children": value };
6142
- });
6192
+ var UnaryPostfix$1 = $P(TypePostfix);
6143
6193
  var UnaryPostfix$$ = [UnaryPostfix$0, UnaryPostfix$1];
6144
6194
  function UnaryPostfix(ctx, state) {
6145
6195
  return $EVENT_C(ctx, state, "UnaryPostfix", UnaryPostfix$$);
@@ -6147,7 +6197,7 @@ ${input.slice(result.pos)}
6147
6197
  var TypePostfix$0 = $TS($S(_, NWTypePostfix), function($skip, $loc, $0, $1, $2) {
6148
6198
  var ws = $1;
6149
6199
  var postfix = $2;
6150
- return [ws, ...postfix];
6200
+ return [ws, postfix];
6151
6201
  });
6152
6202
  function TypePostfix(ctx, state) {
6153
6203
  return $EVENT(ctx, state, "TypePostfix", TypePostfix$0);
@@ -6162,18 +6212,26 @@ ${input.slice(result.pos)}
6162
6212
  return $EVENT(ctx, state, "Tuple", Tuple$0);
6163
6213
  }
6164
6214
  var NWTypePostfix$0 = $TS($S(As, _, Tuple), function($skip, $loc, $0, $1, $2, $3) {
6165
- return [{ $loc: $1.$loc, token: "satisfies" }, $2, $3];
6215
+ return {
6216
+ ts: true,
6217
+ children: [{ $loc: $1.$loc, token: "satisfies" }, $2, $3]
6218
+ };
6166
6219
  });
6167
6220
  var NWTypePostfix$1 = $TS($S(As, $E(ExclamationPoint), Type), function($skip, $loc, $0, $1, $2, $3) {
6168
6221
  var as = $1;
6169
6222
  var ex = $2;
6170
6223
  var type = $3;
6224
+ let children;
6171
6225
  if (ex) {
6172
- return [{ $loc: ex.$loc, token: "as unknown " }, as, type];
6226
+ children = [{ $loc: ex.$loc, token: "as unknown " }, as, type];
6227
+ } else {
6228
+ children = [as, type];
6173
6229
  }
6174
- return [as, type];
6230
+ return { ts: true, children };
6231
+ });
6232
+ var NWTypePostfix$2 = $TS($S(Satisfies, Type), function($skip, $loc, $0, $1, $2) {
6233
+ return { ts: true, children: $0 };
6175
6234
  });
6176
- var NWTypePostfix$2 = $S(Satisfies, Type);
6177
6235
  var NWTypePostfix$$ = [NWTypePostfix$0, NWTypePostfix$1, NWTypePostfix$2];
6178
6236
  function NWTypePostfix(ctx, state) {
6179
6237
  return $EVENT_C(ctx, state, "NWTypePostfix", NWTypePostfix$$);
@@ -7116,19 +7174,10 @@ ${input.slice(result.pos)}
7116
7174
  var PropertyAccess$0 = $TS($S(AccessStart, $C(TemplateLiteral, StringLiteral, IntegerLiteral)), function($skip, $loc, $0, $1, $2) {
7117
7175
  var dot = $1;
7118
7176
  var literal = $2;
7119
- if (gatherRecursive(dot, (node) => node.token === "?").length) {
7120
- dot = [...dot, "["];
7121
- } else {
7122
- dot = replaceNodes(
7123
- deepCopy(dot),
7124
- (node) => node.token === ".",
7125
- (node) => ({ ...node, token: "[" })
7126
- );
7127
- }
7128
7177
  return {
7129
7178
  type: "Index",
7130
7179
  children: [
7131
- dot,
7180
+ adjustIndexAccess(dot),
7132
7181
  literal,
7133
7182
  "]"
7134
7183
  ]
@@ -7138,11 +7187,20 @@ ${input.slice(result.pos)}
7138
7187
  var dot = $1;
7139
7188
  var neg = $2;
7140
7189
  var num = $3;
7141
- return [
7142
- { type: "PropertyAccess", children: [dot, "at"] },
7143
- // not including `name` so that `{x.-1}` doesn't use it
7144
- { type: "Call", children: ["(", neg, num, ")"] }
7190
+ const len = {
7191
+ children: []
7192
+ }, children = [
7193
+ adjustIndexAccess(dot),
7194
+ len,
7195
+ neg,
7196
+ num,
7197
+ "]"
7145
7198
  ];
7199
+ return {
7200
+ type: "NegativeIndex",
7201
+ children,
7202
+ len
7203
+ };
7146
7204
  });
7147
7205
  var PropertyAccess$2 = $TS($S(AccessStart, $Q(InlineComment), $C(IdentifierName, PrivateIdentifier, LengthShorthand)), function($skip, $loc, $0, $1, $2, $3) {
7148
7206
  var access = $1;
@@ -9087,17 +9145,26 @@ ${input.slice(result.pos)}
9087
9145
  children: [ws, ...prop.children]
9088
9146
  };
9089
9147
  });
9090
- var PropertyDefinition$1 = $TS($S($E(_), $TEXT($EXPECT($R16, "PropertyDefinition /[!+-]/")), PropertyName), function($skip, $loc, $0, $1, $2, $3) {
9148
+ var PropertyDefinition$1 = $TS($S($E(_), $TEXT($EXPECT($R16, "PropertyDefinition /[!+-]?/")), PropertyName, $Y(ObjectPropertyDelimiter)), function($skip, $loc, $0, $1, $2, $3, $4) {
9091
9149
  var ws = $1;
9092
9150
  var toggle = $2;
9093
9151
  var id = $3;
9094
- const value = toggle === "+" ? "true" : "false";
9152
+ if (toggle) {
9153
+ const value = toggle === "+" ? "true" : "false";
9154
+ return {
9155
+ type: "Property",
9156
+ children: [ws, id, ": ", value],
9157
+ name: id,
9158
+ names: id.names,
9159
+ value
9160
+ };
9161
+ }
9095
9162
  return {
9096
9163
  type: "Property",
9097
- children: [ws, id, ": ", value],
9164
+ children: [ws, id],
9098
9165
  name: id,
9099
9166
  names: id.names,
9100
- value
9167
+ value: id
9101
9168
  };
9102
9169
  });
9103
9170
  var PropertyDefinition$2 = $TS($S($E(_), MethodDefinition), function($skip, $loc, $0, $1, $2) {
@@ -12974,7 +13041,7 @@ ${input.slice(result.pos)}
12974
13041
  class: $2
12975
13042
  };
12976
13043
  });
12977
- var JSXAttribute$7 = $TS($S($TEXT($EXPECT($R16, "JSXAttribute /[!+-]/")), JSXAttributeName, $Y(JSXAttributeSpace)), function($skip, $loc, $0, $1, $2, $3) {
13044
+ var JSXAttribute$7 = $TS($S($TEXT($EXPECT($R73, "JSXAttribute /[!+-]/")), JSXAttributeName, $Y(JSXAttributeSpace)), function($skip, $loc, $0, $1, $2, $3) {
12978
13045
  var toggle = $1;
12979
13046
  var id = $2;
12980
13047
  const value = toggle === "+" ? "true" : "false";
@@ -12984,11 +13051,11 @@ ${input.slice(result.pos)}
12984
13051
  function JSXAttribute(ctx, state) {
12985
13052
  return $EVENT_C(ctx, state, "JSXAttribute", JSXAttribute$$);
12986
13053
  }
12987
- var JSXAttributeSpace$0 = $R$0($EXPECT($R73, "JSXAttributeSpace /[\\s>]|\\/>/"));
13054
+ var JSXAttributeSpace$0 = $R$0($EXPECT($R74, "JSXAttributeSpace /[\\s>]|\\/>/"));
12988
13055
  function JSXAttributeSpace(ctx, state) {
12989
13056
  return $EVENT(ctx, state, "JSXAttributeSpace", JSXAttributeSpace$0);
12990
13057
  }
12991
- var JSXShorthandString$0 = $TR($EXPECT($R74, "JSXShorthandString /(?:[\\w\\-:]+|\\([^()]*\\)|\\[[^\\[\\]]*\\])+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
13058
+ var JSXShorthandString$0 = $TR($EXPECT($R75, "JSXShorthandString /(?:[\\w\\-:]+|\\([^()]*\\)|\\[[^\\[\\]]*\\])+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
12992
13059
  return quoteString($0);
12993
13060
  });
12994
13061
  var JSXShorthandString$1 = $TS($S(TemplateLiteral), function($skip, $loc, $0, $1) {
@@ -13022,7 +13089,7 @@ ${input.slice(result.pos)}
13022
13089
  }
13023
13090
  return [open, value, close];
13024
13091
  });
13025
- var JSXAttributeValue$4 = $R$0($EXPECT($R75, `JSXAttributeValue /"[^"]*"|'[^']*'/`));
13092
+ var JSXAttributeValue$4 = $R$0($EXPECT($R76, `JSXAttributeValue /"[^"]*"|'[^']*'/`));
13026
13093
  var JSXAttributeValue$$ = [JSXAttributeValue$0, JSXAttributeValue$1, JSXAttributeValue$2, JSXAttributeValue$3, JSXAttributeValue$4];
13027
13094
  function JSXAttributeValue(ctx, state) {
13028
13095
  return $EVENT_C(ctx, state, "JSXAttributeValue", JSXAttributeValue$$);
@@ -13035,7 +13102,7 @@ ${input.slice(result.pos)}
13035
13102
  function InlineJSXAttributeValue(ctx, state) {
13036
13103
  return $EVENT(ctx, state, "InlineJSXAttributeValue", InlineJSXAttributeValue$0);
13037
13104
  }
13038
- var InlineJSXBinaryOpRHS$0 = $TS($S($N($EXPECT($R76, "InlineJSXBinaryOpRHS /[<>]/")), BinaryOp, InlineJSXUnaryExpression), function($skip, $loc, $0, $1, $2, $3) {
13105
+ var InlineJSXBinaryOpRHS$0 = $TS($S($N($EXPECT($R77, "InlineJSXBinaryOpRHS /[<>]/")), BinaryOp, InlineJSXUnaryExpression), function($skip, $loc, $0, $1, $2, $3) {
13039
13106
  var op = $2;
13040
13107
  var rhs = $3;
13041
13108
  return [[], op, [], rhs];
@@ -13052,7 +13119,7 @@ ${input.slice(result.pos)}
13052
13119
  function InlineJSXUnaryExpression(ctx, state) {
13053
13120
  return $EVENT(ctx, state, "InlineJSXUnaryExpression", InlineJSXUnaryExpression$0);
13054
13121
  }
13055
- var InlineJSXUnaryOp$0 = $TR($EXPECT($R77, "InlineJSXUnaryOp /[!~+-](?!\\s|[!~+-]*&)/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
13122
+ var InlineJSXUnaryOp$0 = $TR($EXPECT($R78, "InlineJSXUnaryOp /[!~+-](?!\\s|[!~+-]*&)/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
13056
13123
  return { $loc, token: $0 };
13057
13124
  });
13058
13125
  function InlineJSXUnaryOp(ctx, state) {
@@ -13268,13 +13335,13 @@ ${input.slice(result.pos)}
13268
13335
  function JSXComment(ctx, state) {
13269
13336
  return $EVENT(ctx, state, "JSXComment", JSXComment$0);
13270
13337
  }
13271
- var JSXCommentContent$0 = $TR($EXPECT($R78, "JSXCommentContent /(?:-[^-]|[^-]*)*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
13338
+ var JSXCommentContent$0 = $TR($EXPECT($R79, "JSXCommentContent /(?:-[^-]|[^-]*)*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
13272
13339
  return { $loc, token: $0.replace(/\*\//g, "* /") };
13273
13340
  });
13274
13341
  function JSXCommentContent(ctx, state) {
13275
13342
  return $EVENT(ctx, state, "JSXCommentContent", JSXCommentContent$0);
13276
13343
  }
13277
- var JSXText$0 = $TR($EXPECT($R79, "JSXText /[^{}<>\\r\\n]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
13344
+ var JSXText$0 = $TR($EXPECT($R80, "JSXText /[^{}<>\\r\\n]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
13278
13345
  return {
13279
13346
  type: "JSXText",
13280
13347
  token: $0,
@@ -13695,7 +13762,7 @@ ${input.slice(result.pos)}
13695
13762
  function TypeProperty(ctx, state) {
13696
13763
  return $EVENT(ctx, state, "TypeProperty", TypeProperty$0);
13697
13764
  }
13698
- 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)))));
13765
+ 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)))));
13699
13766
  function TypeIndexSignature(ctx, state) {
13700
13767
  return $EVENT(ctx, state, "TypeIndexSignature", TypeIndexSignature$0);
13701
13768
  }
@@ -13989,7 +14056,7 @@ ${input.slice(result.pos)}
13989
14056
  function NestedType(ctx, state) {
13990
14057
  return $EVENT(ctx, state, "NestedType", NestedType$0);
13991
14058
  }
13992
- var TypeConditional$0 = $TS($S($E(_), $EXPECT($R81, "TypeConditional /(?=if|unless)/"), TypeIfThenElse), function($skip, $loc, $0, $1, $2, $3) {
14059
+ var TypeConditional$0 = $TS($S($E(_), $EXPECT($R82, "TypeConditional /(?=if|unless)/"), TypeIfThenElse), function($skip, $loc, $0, $1, $2, $3) {
13993
14060
  return [$1, expressionizeTypeIf($3)];
13994
14061
  });
13995
14062
  var TypeConditional$1 = $TS($S(TypeCondition, NotDedented, QuestionMark, Type, __, Colon, Type), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
@@ -14182,15 +14249,15 @@ ${input.slice(result.pos)}
14182
14249
  function ThisType(ctx, state) {
14183
14250
  return $EVENT(ctx, state, "ThisType", ThisType$0);
14184
14251
  }
14185
- var Shebang$0 = $S($R$0($EXPECT($R82, "Shebang /#![^\\r\\n]*/")), EOL);
14252
+ var Shebang$0 = $S($R$0($EXPECT($R83, "Shebang /#![^\\r\\n]*/")), EOL);
14186
14253
  function Shebang(ctx, state) {
14187
14254
  return $EVENT(ctx, state, "Shebang", Shebang$0);
14188
14255
  }
14189
- var CivetPrologue$0 = $T($S($EXPECT($R83, "CivetPrologue /[\\t ]*/"), DoubleQuote, CivetPrologueContent, DoubleQuote, SimpleStatementDelimiter, $EXPECT($R84, "CivetPrologue /[ \\t]*/"), $C(EOL, $Y(RestOfLine))), function(value) {
14256
+ var CivetPrologue$0 = $T($S($EXPECT($R84, "CivetPrologue /[\\t ]*/"), DoubleQuote, CivetPrologueContent, DoubleQuote, SimpleStatementDelimiter, $EXPECT($R85, "CivetPrologue /[ \\t]*/"), $C(EOL, $Y(RestOfLine))), function(value) {
14190
14257
  var content = value[2];
14191
14258
  return content;
14192
14259
  });
14193
- var CivetPrologue$1 = $T($S($EXPECT($R83, "CivetPrologue /[\\t ]*/"), SingleQuote, CivetPrologueContent, SingleQuote, SimpleStatementDelimiter, $EXPECT($R84, "CivetPrologue /[ \\t]*/"), $C(EOL, $Y(RestOfLine))), function(value) {
14260
+ var CivetPrologue$1 = $T($S($EXPECT($R84, "CivetPrologue /[\\t ]*/"), SingleQuote, CivetPrologueContent, SingleQuote, SimpleStatementDelimiter, $EXPECT($R85, "CivetPrologue /[ \\t]*/"), $C(EOL, $Y(RestOfLine))), function(value) {
14194
14261
  var content = value[2];
14195
14262
  return content;
14196
14263
  });
@@ -14198,7 +14265,7 @@ ${input.slice(result.pos)}
14198
14265
  function CivetPrologue(ctx, state) {
14199
14266
  return $EVENT_C(ctx, state, "CivetPrologue", CivetPrologue$$);
14200
14267
  }
14201
- var CivetPrologueContent$0 = $TS($S($EXPECT($L225, 'CivetPrologueContent "civet"'), NonIdContinue, $Q(CivetOption), $EXPECT($R85, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3, $4) {
14268
+ var CivetPrologueContent$0 = $TS($S($EXPECT($L225, 'CivetPrologueContent "civet"'), NonIdContinue, $Q(CivetOption), $EXPECT($R86, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3, $4) {
14202
14269
  var options = $3;
14203
14270
  return {
14204
14271
  type: "CivetPrologue",
@@ -14209,7 +14276,7 @@ ${input.slice(result.pos)}
14209
14276
  function CivetPrologueContent(ctx, state) {
14210
14277
  return $EVENT(ctx, state, "CivetPrologueContent", CivetPrologueContent$0);
14211
14278
  }
14212
- 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) {
14279
+ 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) {
14213
14280
  const optionName = $2.replace(/-+([a-z]?)/g, (_2, l) => {
14214
14281
  if (l)
14215
14282
  return l.toUpperCase();
@@ -14226,11 +14293,11 @@ ${input.slice(result.pos)}
14226
14293
  function CivetOption(ctx, state) {
14227
14294
  return $EVENT(ctx, state, "CivetOption", CivetOption$0);
14228
14295
  }
14229
- var UnknownPrologue$0 = $S($R$0($EXPECT($R83, "UnknownPrologue /[\\t ]*/")), StringLiteral, $TEXT(SimpleStatementDelimiter), EOS);
14296
+ var UnknownPrologue$0 = $S($R$0($EXPECT($R84, "UnknownPrologue /[\\t ]*/")), StringLiteral, $TEXT(SimpleStatementDelimiter), EOS);
14230
14297
  function UnknownPrologue(ctx, state) {
14231
14298
  return $EVENT(ctx, state, "UnknownPrologue", UnknownPrologue$0);
14232
14299
  }
14233
- var TripleSlashDirective$0 = $S($R$0($EXPECT($R87, "TripleSlashDirective /\\/\\/\\/[^\\r\\n]*/")), $E(EOS));
14300
+ var TripleSlashDirective$0 = $S($R$0($EXPECT($R88, "TripleSlashDirective /\\/\\/\\/[^\\r\\n]*/")), $E(EOS));
14234
14301
  function TripleSlashDirective(ctx, state) {
14235
14302
  return $EVENT(ctx, state, "TripleSlashDirective", TripleSlashDirective$0);
14236
14303
  }
@@ -14246,13 +14313,13 @@ ${input.slice(result.pos)}
14246
14313
  function PrologueString(ctx, state) {
14247
14314
  return $EVENT_C(ctx, state, "PrologueString", PrologueString$$);
14248
14315
  }
14249
- var EOS$0 = $T($S($EXPECT($R88, "EOS /(?=[ \\t\\r\\n\\/#]|$)/"), $P(RestOfLine)), function(value) {
14316
+ var EOS$0 = $T($S($EXPECT($R89, "EOS /(?=[ \\t\\r\\n\\/#]|$)/"), $P(RestOfLine)), function(value) {
14250
14317
  return value[1];
14251
14318
  });
14252
14319
  function EOS(ctx, state) {
14253
14320
  return $EVENT(ctx, state, "EOS", EOS$0);
14254
14321
  }
14255
- var EOL$0 = $TR($EXPECT($R89, "EOL /\\r\\n|\\n|\\r|$/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
14322
+ var EOL$0 = $TR($EXPECT($R90, "EOL /\\r\\n|\\n|\\r|$/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
14256
14323
  return { $loc, token: $0 };
14257
14324
  });
14258
14325
  function EOL(ctx, state) {
@@ -14824,11 +14891,11 @@ ${input.slice(result.pos)}
14824
14891
  function Prologue(ctx, state) {
14825
14892
  return $EVENT(ctx, state, "Prologue", Prologue$0);
14826
14893
  }
14827
- var ProloguePrefix$0 = $S(Prologue, $R$0($EXPECT($R90, "ProloguePrefix /[^]*/")));
14894
+ var ProloguePrefix$0 = $S(Prologue, $R$0($EXPECT($R91, "ProloguePrefix /[^]*/")));
14828
14895
  function ProloguePrefix(ctx, state) {
14829
14896
  return $EVENT(ctx, state, "ProloguePrefix", ProloguePrefix$0);
14830
14897
  }
14831
- var Indent$0 = $TR($EXPECT($R84, "Indent /[ \\t]*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
14898
+ var Indent$0 = $TR($EXPECT($R85, "Indent /[ \\t]*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
14832
14899
  const level = getIndentLevel($0, module.config.tab);
14833
14900
  return {
14834
14901
  $loc,