@danielx/civet 0.6.40 → 0.6.42
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 +127 -84
- package/dist/civet +28 -28
- package/dist/main.js +127 -84
- package/dist/main.mjs +127 -84
- package/dist/ts-diagnostic.js +0 -61
- package/dist/ts-diagnostic.mjs +0 -49
- package/package.json +2 -2
package/dist/main.js
CHANGED
|
@@ -851,14 +851,36 @@ var require_lib = __commonJS({
|
|
|
851
851
|
})
|
|
852
852
|
);
|
|
853
853
|
}
|
|
854
|
+
function negateCondition(condition) {
|
|
855
|
+
let { expression } = condition;
|
|
856
|
+
const children = condition.children.slice();
|
|
857
|
+
const i = children.indexOf(expression);
|
|
858
|
+
if (i < 0) {
|
|
859
|
+
throw new Error(`Could not find expression in condition`);
|
|
860
|
+
}
|
|
861
|
+
children[i] = expression = {
|
|
862
|
+
type: "UnaryExpression",
|
|
863
|
+
children: [
|
|
864
|
+
"!",
|
|
865
|
+
makeLeftHandSideExpression(expression)
|
|
866
|
+
]
|
|
867
|
+
};
|
|
868
|
+
return { ...condition, expression, children };
|
|
869
|
+
}
|
|
854
870
|
function expressionizeIfClause(clause, b, e) {
|
|
855
|
-
const
|
|
856
|
-
children.
|
|
871
|
+
const { condition } = clause;
|
|
872
|
+
const [...condRest] = condition.children, [closeParen] = condRest.splice(-1);
|
|
873
|
+
const children = [
|
|
874
|
+
...condRest,
|
|
875
|
+
"?",
|
|
876
|
+
b
|
|
877
|
+
];
|
|
857
878
|
if (e) {
|
|
858
879
|
children.push(e[0], ":", ...e.slice(2));
|
|
859
880
|
} else {
|
|
860
881
|
children.push(":void 0");
|
|
861
882
|
}
|
|
883
|
+
children.push(closeParen);
|
|
862
884
|
return {
|
|
863
885
|
type: "IfExpression",
|
|
864
886
|
children
|
|
@@ -1542,7 +1564,6 @@ var require_lib = __commonJS({
|
|
|
1542
1564
|
const [, exp, semi] = node;
|
|
1543
1565
|
if (semi?.type === "SemicolonDelimiter")
|
|
1544
1566
|
return;
|
|
1545
|
-
let indent = getIndent(node);
|
|
1546
1567
|
if (!exp)
|
|
1547
1568
|
return;
|
|
1548
1569
|
switch (exp.type) {
|
|
@@ -1967,6 +1988,7 @@ var require_lib = __commonJS({
|
|
|
1967
1988
|
case "CallExpression":
|
|
1968
1989
|
case "MemberExpression":
|
|
1969
1990
|
case "ParenthesizedExpression":
|
|
1991
|
+
case "IfExpression":
|
|
1970
1992
|
case "DebuggerExpression":
|
|
1971
1993
|
case "SwitchExpression":
|
|
1972
1994
|
case "ThrowExpression":
|
|
@@ -2206,7 +2228,7 @@ var require_lib = __commonJS({
|
|
|
2206
2228
|
children
|
|
2207
2229
|
};
|
|
2208
2230
|
}
|
|
2209
|
-
function processDeclarationCondition(condition) {
|
|
2231
|
+
function processDeclarationCondition(condition, rootCondition) {
|
|
2210
2232
|
if (!(condition.type === "DeclarationCondition")) {
|
|
2211
2233
|
return;
|
|
2212
2234
|
}
|
|
@@ -2214,7 +2236,7 @@ var require_lib = __commonJS({
|
|
|
2214
2236
|
const { decl, bindings } = condition.declaration;
|
|
2215
2237
|
const binding = bindings[0];
|
|
2216
2238
|
const { pattern, suffix, initializer, splices, thisAssignments } = binding;
|
|
2217
|
-
|
|
2239
|
+
Object.assign(condition, {
|
|
2218
2240
|
type: "AssignmentExpression",
|
|
2219
2241
|
children: [ref, initializer],
|
|
2220
2242
|
hoistDec: {
|
|
@@ -2222,14 +2244,15 @@ var require_lib = __commonJS({
|
|
|
2222
2244
|
children: ["let ", ref, suffix],
|
|
2223
2245
|
names: []
|
|
2224
2246
|
},
|
|
2247
|
+
pattern,
|
|
2248
|
+
ref
|
|
2249
|
+
});
|
|
2250
|
+
Object.assign(rootCondition, {
|
|
2225
2251
|
blockPrefix: [
|
|
2226
2252
|
["", [decl, pattern, suffix, " = ", ref, ...splices], ";"],
|
|
2227
2253
|
...thisAssignments
|
|
2228
|
-
]
|
|
2229
|
-
|
|
2230
|
-
ref
|
|
2231
|
-
};
|
|
2232
|
-
Object.assign(condition, initCondition);
|
|
2254
|
+
]
|
|
2255
|
+
});
|
|
2233
2256
|
}
|
|
2234
2257
|
function processDeclarationConditions(node) {
|
|
2235
2258
|
gatherRecursiveAll(node, (n) => {
|
|
@@ -2241,8 +2264,15 @@ var require_lib = __commonJS({
|
|
|
2241
2264
|
if (!condition?.expression) {
|
|
2242
2265
|
return;
|
|
2243
2266
|
}
|
|
2244
|
-
|
|
2245
|
-
|
|
2267
|
+
;
|
|
2268
|
+
let { expression } = condition;
|
|
2269
|
+
if (typeof expression === "object" && expression != null && "type" in expression && expression.type === "UnaryExpression" && "children" in expression && Array.isArray(expression.children) && expression.children.length === 2 && expression.children[0] === "!" && typeof expression.children[1] === "object" && expression.children[1] != null && "type" in expression.children[1] && expression.children[1].type === "ParenthesizedExpression" && "expression" in expression.children[1]) {
|
|
2270
|
+
const { type: type1, children: [, { type: type2, expression: expression2 }] } = expression;
|
|
2271
|
+
const type = [type1, type2];
|
|
2272
|
+
expression = expression2;
|
|
2273
|
+
}
|
|
2274
|
+
processDeclarationCondition(expression, condition.expression);
|
|
2275
|
+
const { ref, pattern } = expression;
|
|
2246
2276
|
if (pattern) {
|
|
2247
2277
|
let conditions = [];
|
|
2248
2278
|
getPatternConditions(pattern, ref, conditions);
|
|
@@ -3534,6 +3564,7 @@ var require_lib = __commonJS({
|
|
|
3534
3564
|
maybeRef,
|
|
3535
3565
|
modifyString,
|
|
3536
3566
|
needsRef,
|
|
3567
|
+
negateCondition,
|
|
3537
3568
|
processAssignmentDeclaration,
|
|
3538
3569
|
processBinaryOpExpression,
|
|
3539
3570
|
processCallMemberExpression,
|
|
@@ -3976,6 +4007,7 @@ var require_parser = __commonJS({
|
|
|
3976
4007
|
TemplateBlockCharacters,
|
|
3977
4008
|
ReservedWord,
|
|
3978
4009
|
Comment,
|
|
4010
|
+
_Comment,
|
|
3979
4011
|
SingleLineComment,
|
|
3980
4012
|
JSSingleLineComment,
|
|
3981
4013
|
MultiLineComment,
|
|
@@ -4516,33 +4548,36 @@ var require_parser = __commonJS({
|
|
|
4516
4548
|
var $R38 = $R(new RegExp("(?:by)(?!\\p{ID_Continue})", "suy"));
|
|
4517
4549
|
var $R39 = $R(new RegExp("(?:of)(?!\\p{ID_Continue})", "suy"));
|
|
4518
4550
|
var $R40 = $R(new RegExp("(?:and|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|function|if|import|in|instanceof|interface|is|let|loop|new|not|null|or|private|protected|public|return|static|super|switch|this|throw|true|try|typeof|unless|until|var|void|while|with|yield)(?!\\p{ID_Continue})", "suy"));
|
|
4519
|
-
var $R41 = $R(new RegExp("
|
|
4520
|
-
var $R42 = $R(new RegExp("
|
|
4521
|
-
var $R43 = $R(new RegExp("
|
|
4522
|
-
var $R44 = $R(new RegExp("[
|
|
4523
|
-
var $R45 = $R(new RegExp("
|
|
4524
|
-
var $R46 = $R(new RegExp("
|
|
4525
|
-
var $R47 = $R(new RegExp("[
|
|
4526
|
-
var $R48 = $R(new RegExp("(
|
|
4527
|
-
var $R49 = $R(new RegExp("[
|
|
4528
|
-
var $R50 = $R(new RegExp("
|
|
4529
|
-
var $R51 = $R(new RegExp("
|
|
4530
|
-
var $R52 = $R(new RegExp("
|
|
4531
|
-
var $R53 = $R(new RegExp("(
|
|
4532
|
-
var $R54 = $R(new RegExp(
|
|
4533
|
-
var $R55 = $R(new RegExp("[
|
|
4534
|
-
var $R56 = $R(new RegExp("[
|
|
4535
|
-
var $R57 = $R(new RegExp("
|
|
4536
|
-
var $R58 = $R(new RegExp("[
|
|
4537
|
-
var $R59 = $R(new RegExp("[
|
|
4538
|
-
var $R60 = $R(new RegExp("[
|
|
4539
|
-
var $R61 = $R(new RegExp("
|
|
4540
|
-
var $R62 = $R(new RegExp("[
|
|
4541
|
-
var $R63 = $R(new RegExp("[\\
|
|
4542
|
-
var $R64 = $R(new RegExp("
|
|
4543
|
-
var $R65 = $R(new RegExp("
|
|
4544
|
-
var $R66 = $R(new RegExp("\\
|
|
4545
|
-
var $R67 = $R(new RegExp("[
|
|
4551
|
+
var $R41 = $R(new RegExp("(?=\\/|#)", "suy"));
|
|
4552
|
+
var $R42 = $R(new RegExp("\\/\\/(?!\\/)[^\\r\\n]*", "suy"));
|
|
4553
|
+
var $R43 = $R(new RegExp(".", "suy"));
|
|
4554
|
+
var $R44 = $R(new RegExp("#(?!##(?!#))([^\\r\\n]*)", "suy"));
|
|
4555
|
+
var $R45 = $R(new RegExp("[^]*?###", "suy"));
|
|
4556
|
+
var $R46 = $R(new RegExp("###(?!#)", "suy"));
|
|
4557
|
+
var $R47 = $R(new RegExp("\\/\\*(?:(?!\\*\\/)[^\\r\\n])*\\*\\/", "suy"));
|
|
4558
|
+
var $R48 = $R(new RegExp("(?=[ \\t\\/])", "suy"));
|
|
4559
|
+
var $R49 = $R(new RegExp("[ \\t]+", "suy"));
|
|
4560
|
+
var $R50 = $R(new RegExp("(?!\\p{ID_Continue})", "suy"));
|
|
4561
|
+
var $R51 = $R(new RegExp("['\u2019]s", "suy"));
|
|
4562
|
+
var $R52 = $R(new RegExp("\\s", "suy"));
|
|
4563
|
+
var $R53 = $R(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*", "suy"));
|
|
4564
|
+
var $R54 = $R(new RegExp("[\\s>]|\\/>", "suy"));
|
|
4565
|
+
var $R55 = $R(new RegExp("(?:[\\w\\-:]+|\\([^()]*\\)|\\[[^\\[\\]]*\\])+", "suy"));
|
|
4566
|
+
var $R56 = $R(new RegExp(`"[^"]*"|'[^']*'`, "suy"));
|
|
4567
|
+
var $R57 = $R(new RegExp("[<>]", "suy"));
|
|
4568
|
+
var $R58 = $R(new RegExp("[!~+-](?!\\s|[!~+-]*&)", "suy"));
|
|
4569
|
+
var $R59 = $R(new RegExp("(?:-[^-]|[^-]*)*", "suy"));
|
|
4570
|
+
var $R60 = $R(new RegExp("[^{}<>\\r\\n]+", "suy"));
|
|
4571
|
+
var $R61 = $R(new RegExp("[+-]?", "suy"));
|
|
4572
|
+
var $R62 = $R(new RegExp("[+-]", "suy"));
|
|
4573
|
+
var $R63 = $R(new RegExp("#![^\\r\\n]*", "suy"));
|
|
4574
|
+
var $R64 = $R(new RegExp("[\\t ]*", "suy"));
|
|
4575
|
+
var $R65 = $R(new RegExp("[\\s]*", "suy"));
|
|
4576
|
+
var $R66 = $R(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?", "suy"));
|
|
4577
|
+
var $R67 = $R(new RegExp("\\/\\/\\/[^\\r\\n]*", "suy"));
|
|
4578
|
+
var $R68 = $R(new RegExp("(?=[ \\t\\r\\n\\/#]|$)", "suy"));
|
|
4579
|
+
var $R69 = $R(new RegExp("\\r\\n|\\n|\\r|$", "suy"));
|
|
4580
|
+
var $R70 = $R(new RegExp("[ \\t]*", "suy"));
|
|
4546
4581
|
var Program$0 = $TS($S(Reset, Init, $E(EOS), TopLevelStatements, __), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
4547
4582
|
var statements = $4;
|
|
4548
4583
|
processProgram({
|
|
@@ -5949,8 +5984,8 @@ var require_parser = __commonJS({
|
|
|
5949
5984
|
function NonEmptyParameters(ctx, state) {
|
|
5950
5985
|
return $EVENT(ctx, state, "NonEmptyParameters", NonEmptyParameters$0);
|
|
5951
5986
|
}
|
|
5952
|
-
var FunctionRestParameter$0 = $TS($S(BindingRestElement, $E(TypeSuffix), ParameterElementDelimiter), function($skip, $loc, $0, $1, $2, $3) {
|
|
5953
|
-
var id = $
|
|
5987
|
+
var FunctionRestParameter$0 = $TS($S(__, BindingRestElement, $E(TypeSuffix), ParameterElementDelimiter), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
5988
|
+
var id = $2;
|
|
5954
5989
|
return {
|
|
5955
5990
|
type: "FunctionRestParameter",
|
|
5956
5991
|
children: $0,
|
|
@@ -8313,10 +8348,10 @@ var require_parser = __commonJS({
|
|
|
8313
8348
|
kind = { ...kind, token: "if" };
|
|
8314
8349
|
kind.token += getTrimmingSpace(condition);
|
|
8315
8350
|
condition = insertTrimmingSpace(condition, "");
|
|
8351
|
+
condition = negateCondition(condition);
|
|
8316
8352
|
return {
|
|
8317
8353
|
type: "IfStatement",
|
|
8318
|
-
|
|
8319
|
-
children: [kind, ["(!", condition, ")"]],
|
|
8354
|
+
children: [kind, condition],
|
|
8320
8355
|
condition
|
|
8321
8356
|
};
|
|
8322
8357
|
});
|
|
@@ -8519,16 +8554,12 @@ var require_parser = __commonJS({
|
|
|
8519
8554
|
var ws = $2;
|
|
8520
8555
|
var condition = $3;
|
|
8521
8556
|
if (kind.token === "until") {
|
|
8522
|
-
kind
|
|
8523
|
-
|
|
8524
|
-
type: "IterationStatement",
|
|
8525
|
-
children: [kind, ...ws, ["(!", ...condition.children, ")"]],
|
|
8526
|
-
condition
|
|
8527
|
-
};
|
|
8557
|
+
kind = { ...kind, token: "while" };
|
|
8558
|
+
condition = negateCondition(condition);
|
|
8528
8559
|
}
|
|
8529
8560
|
return {
|
|
8530
8561
|
type: "IterationStatement",
|
|
8531
|
-
children: [kind,
|
|
8562
|
+
children: [kind, ws, condition],
|
|
8532
8563
|
condition
|
|
8533
8564
|
};
|
|
8534
8565
|
});
|
|
@@ -10069,11 +10100,17 @@ var require_parser = __commonJS({
|
|
|
10069
10100
|
function ReservedWord(ctx, state) {
|
|
10070
10101
|
return $EVENT_C(ctx, state, "ReservedWord", ReservedWord$$);
|
|
10071
10102
|
}
|
|
10072
|
-
var Comment$0 =
|
|
10073
|
-
|
|
10074
|
-
|
|
10103
|
+
var Comment$0 = $T($S($EXPECT($R41, "Comment /(?=\\/|#)/"), _Comment), function(value) {
|
|
10104
|
+
return value[1];
|
|
10105
|
+
});
|
|
10075
10106
|
function Comment(ctx, state) {
|
|
10076
|
-
return $
|
|
10107
|
+
return $EVENT(ctx, state, "Comment", Comment$0);
|
|
10108
|
+
}
|
|
10109
|
+
var _Comment$0 = MultiLineComment;
|
|
10110
|
+
var _Comment$1 = SingleLineComment;
|
|
10111
|
+
var _Comment$$ = [_Comment$0, _Comment$1];
|
|
10112
|
+
function _Comment(ctx, state) {
|
|
10113
|
+
return $EVENT_C(ctx, state, "_Comment", _Comment$$);
|
|
10077
10114
|
}
|
|
10078
10115
|
var SingleLineComment$0 = JSSingleLineComment;
|
|
10079
10116
|
var SingleLineComment$1 = $S(CoffeeCommentEnabled, CoffeeSingleLineComment);
|
|
@@ -10081,7 +10118,7 @@ var require_parser = __commonJS({
|
|
|
10081
10118
|
function SingleLineComment(ctx, state) {
|
|
10082
10119
|
return $EVENT_C(ctx, state, "SingleLineComment", SingleLineComment$$);
|
|
10083
10120
|
}
|
|
10084
|
-
var JSSingleLineComment$0 = $TR($EXPECT($
|
|
10121
|
+
var JSSingleLineComment$0 = $TR($EXPECT($R42, "JSSingleLineComment /\\/\\/(?!\\/)[^\\r\\n]*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
|
|
10085
10122
|
return { type: "Comment", $loc, token: $0 };
|
|
10086
10123
|
});
|
|
10087
10124
|
function JSSingleLineComment(ctx, state) {
|
|
@@ -10093,30 +10130,30 @@ var require_parser = __commonJS({
|
|
|
10093
10130
|
function MultiLineComment(ctx, state) {
|
|
10094
10131
|
return $EVENT_C(ctx, state, "MultiLineComment", MultiLineComment$$);
|
|
10095
10132
|
}
|
|
10096
|
-
var JSMultiLineComment$0 = $TV($TEXT($S($EXPECT($L109, 'JSMultiLineComment "/*"'), $Q($S($N($EXPECT($L110, 'JSMultiLineComment "*/"')), $EXPECT($
|
|
10133
|
+
var JSMultiLineComment$0 = $TV($TEXT($S($EXPECT($L109, 'JSMultiLineComment "/*"'), $Q($S($N($EXPECT($L110, 'JSMultiLineComment "*/"')), $EXPECT($R43, "JSMultiLineComment /./"))), $EXPECT($L110, 'JSMultiLineComment "*/"'))), function($skip, $loc, $0, $1) {
|
|
10097
10134
|
return { type: "Comment", $loc, token: $1 };
|
|
10098
10135
|
});
|
|
10099
10136
|
function JSMultiLineComment(ctx, state) {
|
|
10100
10137
|
return $EVENT(ctx, state, "JSMultiLineComment", JSMultiLineComment$0);
|
|
10101
10138
|
}
|
|
10102
|
-
var CoffeeSingleLineComment$0 = $TR($EXPECT($
|
|
10139
|
+
var CoffeeSingleLineComment$0 = $TR($EXPECT($R44, "CoffeeSingleLineComment /#(?!##(?!#))([^\\r\\n]*)/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
|
|
10103
10140
|
return { type: "Comment", $loc, token: `//${$1}` };
|
|
10104
10141
|
});
|
|
10105
10142
|
function CoffeeSingleLineComment(ctx, state) {
|
|
10106
10143
|
return $EVENT(ctx, state, "CoffeeSingleLineComment", CoffeeSingleLineComment$0);
|
|
10107
10144
|
}
|
|
10108
|
-
var CoffeeMultiLineComment$0 = $TS($S(CoffeeHereCommentStart, $TEXT($EXPECT($
|
|
10145
|
+
var CoffeeMultiLineComment$0 = $TS($S(CoffeeHereCommentStart, $TEXT($EXPECT($R45, "CoffeeMultiLineComment /[^]*?###/"))), function($skip, $loc, $0, $1, $2) {
|
|
10109
10146
|
$2 = $2.slice(0, $2.length - 3).replace(/\*\//g, "* /");
|
|
10110
10147
|
return { type: "Comment", $loc, token: `/*${$2}*/` };
|
|
10111
10148
|
});
|
|
10112
10149
|
function CoffeeMultiLineComment(ctx, state) {
|
|
10113
10150
|
return $EVENT(ctx, state, "CoffeeMultiLineComment", CoffeeMultiLineComment$0);
|
|
10114
10151
|
}
|
|
10115
|
-
var CoffeeHereCommentStart$0 = $R$0($EXPECT($
|
|
10152
|
+
var CoffeeHereCommentStart$0 = $R$0($EXPECT($R46, "CoffeeHereCommentStart /###(?!#)/"));
|
|
10116
10153
|
function CoffeeHereCommentStart(ctx, state) {
|
|
10117
10154
|
return $EVENT(ctx, state, "CoffeeHereCommentStart", CoffeeHereCommentStart$0);
|
|
10118
10155
|
}
|
|
10119
|
-
var InlineComment$0 = $TR($EXPECT($
|
|
10156
|
+
var InlineComment$0 = $TR($EXPECT($R47, "InlineComment /\\/\\*(?:(?!\\*\\/)[^\\r\\n])*\\*\\//"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
|
|
10120
10157
|
return { $loc, token: $0 };
|
|
10121
10158
|
});
|
|
10122
10159
|
function InlineComment(ctx, state) {
|
|
@@ -10130,11 +10167,13 @@ var require_parser = __commonJS({
|
|
|
10130
10167
|
function TrailingComment(ctx, state) {
|
|
10131
10168
|
return $EVENT(ctx, state, "TrailingComment", TrailingComment$0);
|
|
10132
10169
|
}
|
|
10133
|
-
var _$0 = $P($C(NonNewlineWhitespace, InlineComment))
|
|
10170
|
+
var _$0 = $T($S($EXPECT($R48, "_ /(?=[ \\t\\/])/"), $P($C(NonNewlineWhitespace, InlineComment))), function(value) {
|
|
10171
|
+
return value[1];
|
|
10172
|
+
});
|
|
10134
10173
|
function _(ctx, state) {
|
|
10135
10174
|
return $EVENT(ctx, state, "_", _$0);
|
|
10136
10175
|
}
|
|
10137
|
-
var NonNewlineWhitespace$0 = $TR($EXPECT($
|
|
10176
|
+
var NonNewlineWhitespace$0 = $TR($EXPECT($R49, "NonNewlineWhitespace /[ \\t]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
|
|
10138
10177
|
return { $loc, token: $0 };
|
|
10139
10178
|
});
|
|
10140
10179
|
var NonNewlineWhitespace$1 = $T($S(CoffeeLineContinuationEnabled, $EXPECT($L111, 'NonNewlineWhitespace "\\\\\\\\"'), EOL), function(value) {
|
|
@@ -10194,7 +10233,7 @@ var require_parser = __commonJS({
|
|
|
10194
10233
|
function SemicolonDelimiter(ctx, state) {
|
|
10195
10234
|
return $EVENT(ctx, state, "SemicolonDelimiter", SemicolonDelimiter$0);
|
|
10196
10235
|
}
|
|
10197
|
-
var NonIdContinue$0 = $R$0($EXPECT($
|
|
10236
|
+
var NonIdContinue$0 = $R$0($EXPECT($R50, "NonIdContinue /(?!\\p{ID_Continue})/"));
|
|
10198
10237
|
function NonIdContinue(ctx, state) {
|
|
10199
10238
|
return $EVENT(ctx, state, "NonIdContinue", NonIdContinue$0);
|
|
10200
10239
|
}
|
|
@@ -10345,7 +10384,7 @@ var require_parser = __commonJS({
|
|
|
10345
10384
|
var Dot$0 = $TV($EXPECT($L6, 'Dot "."'), function($skip, $loc, $0, $1) {
|
|
10346
10385
|
return { $loc, token: $1 };
|
|
10347
10386
|
});
|
|
10348
|
-
var Dot$1 = $TS($S($EXPECT($
|
|
10387
|
+
var Dot$1 = $TS($S($EXPECT($R51, "Dot /['\u2019]s/"), _), function($skip, $loc, $0, $1, $2) {
|
|
10349
10388
|
var ws = $2;
|
|
10350
10389
|
return [
|
|
10351
10390
|
{ $loc, token: "." },
|
|
@@ -10460,7 +10499,7 @@ var require_parser = __commonJS({
|
|
|
10460
10499
|
function If(ctx, state) {
|
|
10461
10500
|
return $EVENT(ctx, state, "If", If$0);
|
|
10462
10501
|
}
|
|
10463
|
-
var Import$0 = $TS($S($EXPECT($L15, 'Import "import"'), $Y($EXPECT($
|
|
10502
|
+
var Import$0 = $TS($S($EXPECT($L15, 'Import "import"'), $Y($EXPECT($R52, "Import /\\s/"))), function($skip, $loc, $0, $1, $2) {
|
|
10464
10503
|
return { $loc, token: $1 };
|
|
10465
10504
|
});
|
|
10466
10505
|
function Import(ctx, state) {
|
|
@@ -10929,7 +10968,7 @@ var require_parser = __commonJS({
|
|
|
10929
10968
|
function JSXElementName(ctx, state) {
|
|
10930
10969
|
return $EVENT_C(ctx, state, "JSXElementName", JSXElementName$$);
|
|
10931
10970
|
}
|
|
10932
|
-
var JSXIdentifierName$0 = $R$0($EXPECT($
|
|
10971
|
+
var JSXIdentifierName$0 = $R$0($EXPECT($R53, "JSXIdentifierName /(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*/"));
|
|
10933
10972
|
function JSXIdentifierName(ctx, state) {
|
|
10934
10973
|
return $EVENT(ctx, state, "JSXIdentifierName", JSXIdentifierName$0);
|
|
10935
10974
|
}
|
|
@@ -11112,11 +11151,11 @@ var require_parser = __commonJS({
|
|
|
11112
11151
|
function JSXAttribute(ctx, state) {
|
|
11113
11152
|
return $EVENT_C(ctx, state, "JSXAttribute", JSXAttribute$$);
|
|
11114
11153
|
}
|
|
11115
|
-
var JSXAttributeSpace$0 = $R$0($EXPECT($
|
|
11154
|
+
var JSXAttributeSpace$0 = $R$0($EXPECT($R54, "JSXAttributeSpace /[\\s>]|\\/>/"));
|
|
11116
11155
|
function JSXAttributeSpace(ctx, state) {
|
|
11117
11156
|
return $EVENT(ctx, state, "JSXAttributeSpace", JSXAttributeSpace$0);
|
|
11118
11157
|
}
|
|
11119
|
-
var JSXShorthandString$0 = $TR($EXPECT($
|
|
11158
|
+
var JSXShorthandString$0 = $TR($EXPECT($R55, "JSXShorthandString /(?:[\\w\\-:]+|\\([^()]*\\)|\\[[^\\[\\]]*\\])+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
|
|
11120
11159
|
return quoteString($0);
|
|
11121
11160
|
});
|
|
11122
11161
|
var JSXShorthandString$1 = $TS($S(TemplateLiteral), function($skip, $loc, $0, $1) {
|
|
@@ -11150,7 +11189,7 @@ var require_parser = __commonJS({
|
|
|
11150
11189
|
}
|
|
11151
11190
|
return [open, value, close];
|
|
11152
11191
|
});
|
|
11153
|
-
var JSXAttributeValue$4 = $R$0($EXPECT($
|
|
11192
|
+
var JSXAttributeValue$4 = $R$0($EXPECT($R56, `JSXAttributeValue /"[^"]*"|'[^']*'/`));
|
|
11154
11193
|
var JSXAttributeValue$$ = [JSXAttributeValue$0, JSXAttributeValue$1, JSXAttributeValue$2, JSXAttributeValue$3, JSXAttributeValue$4];
|
|
11155
11194
|
function JSXAttributeValue(ctx, state) {
|
|
11156
11195
|
return $EVENT_C(ctx, state, "JSXAttributeValue", JSXAttributeValue$$);
|
|
@@ -11163,7 +11202,7 @@ var require_parser = __commonJS({
|
|
|
11163
11202
|
function InlineJSXAttributeValue(ctx, state) {
|
|
11164
11203
|
return $EVENT(ctx, state, "InlineJSXAttributeValue", InlineJSXAttributeValue$0);
|
|
11165
11204
|
}
|
|
11166
|
-
var InlineJSXBinaryOpRHS$0 = $TS($S($N($EXPECT($
|
|
11205
|
+
var InlineJSXBinaryOpRHS$0 = $TS($S($N($EXPECT($R57, "InlineJSXBinaryOpRHS /[<>]/")), BinaryOp, InlineJSXUnaryExpression), function($skip, $loc, $0, $1, $2, $3) {
|
|
11167
11206
|
var op = $2;
|
|
11168
11207
|
var rhs = $3;
|
|
11169
11208
|
return [[], op, [], rhs];
|
|
@@ -11180,7 +11219,7 @@ var require_parser = __commonJS({
|
|
|
11180
11219
|
function InlineJSXUnaryExpression(ctx, state) {
|
|
11181
11220
|
return $EVENT(ctx, state, "InlineJSXUnaryExpression", InlineJSXUnaryExpression$0);
|
|
11182
11221
|
}
|
|
11183
|
-
var InlineJSXUnaryOp$0 = $TR($EXPECT($
|
|
11222
|
+
var InlineJSXUnaryOp$0 = $TR($EXPECT($R58, "InlineJSXUnaryOp /[!~+-](?!\\s|[!~+-]*&)/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
|
|
11184
11223
|
return { $loc, token: $0 };
|
|
11185
11224
|
});
|
|
11186
11225
|
function InlineJSXUnaryOp(ctx, state) {
|
|
@@ -11392,13 +11431,13 @@ var require_parser = __commonJS({
|
|
|
11392
11431
|
function JSXComment(ctx, state) {
|
|
11393
11432
|
return $EVENT(ctx, state, "JSXComment", JSXComment$0);
|
|
11394
11433
|
}
|
|
11395
|
-
var JSXCommentContent$0 = $TR($EXPECT($
|
|
11434
|
+
var JSXCommentContent$0 = $TR($EXPECT($R59, "JSXCommentContent /(?:-[^-]|[^-]*)*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
|
|
11396
11435
|
return { $loc, token: $0.replace(/\*\//g, "* /") };
|
|
11397
11436
|
});
|
|
11398
11437
|
function JSXCommentContent(ctx, state) {
|
|
11399
11438
|
return $EVENT(ctx, state, "JSXCommentContent", JSXCommentContent$0);
|
|
11400
11439
|
}
|
|
11401
|
-
var JSXText$0 = $TR($EXPECT($
|
|
11440
|
+
var JSXText$0 = $TR($EXPECT($R60, "JSXText /[^{}<>\\r\\n]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
|
|
11402
11441
|
return {
|
|
11403
11442
|
type: "JSXText",
|
|
11404
11443
|
token: $0,
|
|
@@ -11763,7 +11802,7 @@ var require_parser = __commonJS({
|
|
|
11763
11802
|
function TypeProperty(ctx, state) {
|
|
11764
11803
|
return $EVENT(ctx, state, "TypeProperty", TypeProperty$0);
|
|
11765
11804
|
}
|
|
11766
|
-
var TypeIndexSignature$0 = $S($E($S($R$0($EXPECT($
|
|
11805
|
+
var TypeIndexSignature$0 = $S($E($S($R$0($EXPECT($R61, "TypeIndexSignature /[+-]?/")), Readonly, NotDedented)), OpenBracket, TypeIndex, CloseBracket, $E($S(__, $R$0($EXPECT($R62, "TypeIndexSignature /[+-]/")), $Y($S($E(_), QuestionMark)))));
|
|
11767
11806
|
function TypeIndexSignature(ctx, state) {
|
|
11768
11807
|
return $EVENT(ctx, state, "TypeIndexSignature", TypeIndexSignature$0);
|
|
11769
11808
|
}
|
|
@@ -12122,15 +12161,15 @@ var require_parser = __commonJS({
|
|
|
12122
12161
|
function ThisType(ctx, state) {
|
|
12123
12162
|
return $EVENT(ctx, state, "ThisType", ThisType$0);
|
|
12124
12163
|
}
|
|
12125
|
-
var Shebang$0 = $S($R$0($EXPECT($
|
|
12164
|
+
var Shebang$0 = $S($R$0($EXPECT($R63, "Shebang /#![^\\r\\n]*/")), EOL);
|
|
12126
12165
|
function Shebang(ctx, state) {
|
|
12127
12166
|
return $EVENT(ctx, state, "Shebang", Shebang$0);
|
|
12128
12167
|
}
|
|
12129
|
-
var CivetPrologue$0 = $T($S($EXPECT($
|
|
12168
|
+
var CivetPrologue$0 = $T($S($EXPECT($R64, "CivetPrologue /[\\t ]*/"), DoubleQuote, CivetPrologueContent, DoubleQuote, SimpleStatementDelimiter, $E(EOS)), function(value) {
|
|
12130
12169
|
var content = value[2];
|
|
12131
12170
|
return content;
|
|
12132
12171
|
});
|
|
12133
|
-
var CivetPrologue$1 = $T($S($EXPECT($
|
|
12172
|
+
var CivetPrologue$1 = $T($S($EXPECT($R64, "CivetPrologue /[\\t ]*/"), SingleQuote, CivetPrologueContent, SingleQuote, SimpleStatementDelimiter, $E(EOS)), function(value) {
|
|
12134
12173
|
var content = value[2];
|
|
12135
12174
|
return content;
|
|
12136
12175
|
});
|
|
@@ -12138,7 +12177,7 @@ var require_parser = __commonJS({
|
|
|
12138
12177
|
function CivetPrologue(ctx, state) {
|
|
12139
12178
|
return $EVENT_C(ctx, state, "CivetPrologue", CivetPrologue$$);
|
|
12140
12179
|
}
|
|
12141
|
-
var CivetPrologueContent$0 = $TS($S($EXPECT($L210, 'CivetPrologueContent "civet"'), NonIdContinue, $Q(CivetOption), $EXPECT($
|
|
12180
|
+
var CivetPrologueContent$0 = $TS($S($EXPECT($L210, 'CivetPrologueContent "civet"'), NonIdContinue, $Q(CivetOption), $EXPECT($R65, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
12142
12181
|
var options = $3;
|
|
12143
12182
|
return {
|
|
12144
12183
|
type: "CivetPrologue",
|
|
@@ -12149,7 +12188,7 @@ var require_parser = __commonJS({
|
|
|
12149
12188
|
function CivetPrologueContent(ctx, state) {
|
|
12150
12189
|
return $EVENT(ctx, state, "CivetPrologueContent", CivetPrologueContent$0);
|
|
12151
12190
|
}
|
|
12152
|
-
var CivetOption$0 = $TR($EXPECT($
|
|
12191
|
+
var CivetOption$0 = $TR($EXPECT($R66, "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) {
|
|
12153
12192
|
const optionName = $2.replace(/-+([a-z]?)/g, (_2, l) => {
|
|
12154
12193
|
if (l)
|
|
12155
12194
|
return l.toUpperCase();
|
|
@@ -12166,11 +12205,11 @@ var require_parser = __commonJS({
|
|
|
12166
12205
|
function CivetOption(ctx, state) {
|
|
12167
12206
|
return $EVENT(ctx, state, "CivetOption", CivetOption$0);
|
|
12168
12207
|
}
|
|
12169
|
-
var UnknownPrologue$0 = $S($R$0($EXPECT($
|
|
12208
|
+
var UnknownPrologue$0 = $S($R$0($EXPECT($R64, "UnknownPrologue /[\\t ]*/")), StringLiteral, $TEXT(SimpleStatementDelimiter), EOS);
|
|
12170
12209
|
function UnknownPrologue(ctx, state) {
|
|
12171
12210
|
return $EVENT(ctx, state, "UnknownPrologue", UnknownPrologue$0);
|
|
12172
12211
|
}
|
|
12173
|
-
var TripleSlashDirective$0 = $S($R$0($EXPECT($
|
|
12212
|
+
var TripleSlashDirective$0 = $S($R$0($EXPECT($R67, "TripleSlashDirective /\\/\\/\\/[^\\r\\n]*/")), $E(EOS));
|
|
12174
12213
|
function TripleSlashDirective(ctx, state) {
|
|
12175
12214
|
return $EVENT(ctx, state, "TripleSlashDirective", TripleSlashDirective$0);
|
|
12176
12215
|
}
|
|
@@ -12184,11 +12223,13 @@ var require_parser = __commonJS({
|
|
|
12184
12223
|
function PrologueString(ctx, state) {
|
|
12185
12224
|
return $EVENT_C(ctx, state, "PrologueString", PrologueString$$);
|
|
12186
12225
|
}
|
|
12187
|
-
var EOS$0 = $P(RestOfLine)
|
|
12226
|
+
var EOS$0 = $T($S($EXPECT($R68, "EOS /(?=[ \\t\\r\\n\\/#]|$)/"), $P(RestOfLine)), function(value) {
|
|
12227
|
+
return value[1];
|
|
12228
|
+
});
|
|
12188
12229
|
function EOS(ctx, state) {
|
|
12189
12230
|
return $EVENT(ctx, state, "EOS", EOS$0);
|
|
12190
12231
|
}
|
|
12191
|
-
var EOL$0 = $TR($EXPECT($
|
|
12232
|
+
var EOL$0 = $TR($EXPECT($R69, "EOL /\\r\\n|\\n|\\r|$/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
|
|
12192
12233
|
return { $loc, token: $0 };
|
|
12193
12234
|
});
|
|
12194
12235
|
function EOL(ctx, state) {
|
|
@@ -12682,7 +12723,7 @@ var require_parser = __commonJS({
|
|
|
12682
12723
|
function Init(ctx, state) {
|
|
12683
12724
|
return $EVENT(ctx, state, "Init", Init$0);
|
|
12684
12725
|
}
|
|
12685
|
-
var Indent$0 = $TR($EXPECT($
|
|
12726
|
+
var Indent$0 = $TR($EXPECT($R70, "Indent /[ \\t]*/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
|
|
12686
12727
|
const level = getIndentLevel($0, module2.config.tab);
|
|
12687
12728
|
return {
|
|
12688
12729
|
$loc,
|
|
@@ -13182,6 +13223,7 @@ var require_parser = __commonJS({
|
|
|
13182
13223
|
exports.TemplateBlockCharacters = TemplateBlockCharacters;
|
|
13183
13224
|
exports.ReservedWord = ReservedWord;
|
|
13184
13225
|
exports.Comment = Comment;
|
|
13226
|
+
exports._Comment = _Comment;
|
|
13185
13227
|
exports.SingleLineComment = SingleLineComment;
|
|
13186
13228
|
exports.JSSingleLineComment = JSSingleLineComment;
|
|
13187
13229
|
exports.MultiLineComment = MultiLineComment;
|
|
@@ -13496,6 +13538,7 @@ var require_parser = __commonJS({
|
|
|
13496
13538
|
makeRef,
|
|
13497
13539
|
maybeRef,
|
|
13498
13540
|
modifyString,
|
|
13541
|
+
negateCondition,
|
|
13499
13542
|
processAssignmentDeclaration,
|
|
13500
13543
|
processBinaryOpExpression,
|
|
13501
13544
|
processCallMemberExpression,
|