@danielx/civet 0.6.18 → 0.6.20
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 +413 -593
- package/dist/main.js +413 -593
- package/dist/main.mjs +413 -593
- package/package.json +1 -1
package/dist/main.mjs
CHANGED
|
@@ -154,15 +154,8 @@ var require_lib = __commonJS({
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
function arrayElementHasTrailingComma(elementNode) {
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
if (lastChild) {
|
|
160
|
-
const l2 = lastChild.length;
|
|
161
|
-
if (lastChild[l2 - 1]?.token === ",") {
|
|
162
|
-
return true;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
return false;
|
|
157
|
+
const lastChild = elementNode.children.at(-1);
|
|
158
|
+
return lastChild && lastChild[lastChild.length - 1]?.token === ",";
|
|
166
159
|
}
|
|
167
160
|
var assert = {
|
|
168
161
|
equal(a, b, msg) {
|
|
@@ -589,7 +582,15 @@ var require_lib = __commonJS({
|
|
|
589
582
|
case "EmptyStatement":
|
|
590
583
|
case "ReturnStatement":
|
|
591
584
|
case "ThrowStatement":
|
|
585
|
+
return;
|
|
592
586
|
case "Declaration":
|
|
587
|
+
exp.children.push(["", [
|
|
588
|
+
";",
|
|
589
|
+
ref,
|
|
590
|
+
".push(",
|
|
591
|
+
patternAsValue(exp.bindings.at(-1).pattern),
|
|
592
|
+
")"
|
|
593
|
+
]]);
|
|
593
594
|
return;
|
|
594
595
|
case "ForStatement":
|
|
595
596
|
case "IterationStatement":
|
|
@@ -842,6 +843,39 @@ var require_lib = __commonJS({
|
|
|
842
843
|
const indent = expressions[index][0];
|
|
843
844
|
expressions.splice(index, 0, [indent, dec, ";"]);
|
|
844
845
|
}
|
|
846
|
+
function patternAsValue(pattern) {
|
|
847
|
+
switch (pattern.type) {
|
|
848
|
+
case "ArrayBindingPattern": {
|
|
849
|
+
const children = [...pattern.children];
|
|
850
|
+
const index = children.indexOf(pattern.elements);
|
|
851
|
+
if (index < 0)
|
|
852
|
+
throw new Error("failed to find elements in ArrayBindingPattern");
|
|
853
|
+
children[index] = pattern.elements.map((el) => {
|
|
854
|
+
const [ws, e, delim] = el.children;
|
|
855
|
+
return { ...el, children: [ws, patternAsValue(e), delim] };
|
|
856
|
+
});
|
|
857
|
+
return { ...pattern, children };
|
|
858
|
+
}
|
|
859
|
+
case "ObjectBindingPattern": {
|
|
860
|
+
const children = [...pattern.children];
|
|
861
|
+
const index = children.indexOf(pattern.properties);
|
|
862
|
+
if (index < 0)
|
|
863
|
+
throw new Error("failed to find properties in ArrayBindingPattern");
|
|
864
|
+
children[index] = pattern.properties.map(patternAsValue);
|
|
865
|
+
return { ...pattern, children };
|
|
866
|
+
}
|
|
867
|
+
case "Identifier":
|
|
868
|
+
case "BindingProperty": {
|
|
869
|
+
const children = [pattern.name, pattern.delim];
|
|
870
|
+
if (isWhitespaceOrEmpty(pattern.children[0])) {
|
|
871
|
+
children.unshift(pattern.children[0]);
|
|
872
|
+
}
|
|
873
|
+
return { ...pattern, children };
|
|
874
|
+
}
|
|
875
|
+
default:
|
|
876
|
+
return pattern;
|
|
877
|
+
}
|
|
878
|
+
}
|
|
845
879
|
function insertReturn(node) {
|
|
846
880
|
if (!node)
|
|
847
881
|
return;
|
|
@@ -883,7 +917,12 @@ var require_lib = __commonJS({
|
|
|
883
917
|
case "EmptyStatement":
|
|
884
918
|
case "ReturnStatement":
|
|
885
919
|
case "ThrowStatement":
|
|
920
|
+
return;
|
|
886
921
|
case "Declaration":
|
|
922
|
+
exp.children.push(["", {
|
|
923
|
+
type: "ReturnStatement",
|
|
924
|
+
children: [";return ", patternAsValue(exp.bindings.at(-1).pattern)]
|
|
925
|
+
}]);
|
|
887
926
|
return;
|
|
888
927
|
case "ForStatement":
|
|
889
928
|
case "IterationStatement":
|
|
@@ -1298,72 +1337,59 @@ var require_lib = __commonJS({
|
|
|
1298
1337
|
children: [s, parts, e]
|
|
1299
1338
|
};
|
|
1300
1339
|
}
|
|
1301
|
-
function
|
|
1302
|
-
|
|
1303
|
-
...
|
|
1340
|
+
function processAssignmentDeclaration(decl, id, suffix, ws, assign, e) {
|
|
1341
|
+
decl = {
|
|
1342
|
+
...decl,
|
|
1304
1343
|
$loc: {
|
|
1305
|
-
pos:
|
|
1306
|
-
length:
|
|
1344
|
+
pos: assign.$loc.pos - 1,
|
|
1345
|
+
length: assign.$loc.length + 1
|
|
1307
1346
|
}
|
|
1308
1347
|
};
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
exp
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1348
|
+
if (decl.token.startsWith("const")) {
|
|
1349
|
+
let exp;
|
|
1350
|
+
if (e.type === "FunctionExpression") {
|
|
1351
|
+
exp = e;
|
|
1352
|
+
} else {
|
|
1353
|
+
exp = e[1];
|
|
1354
|
+
}
|
|
1355
|
+
if (exp?.children?.[0]?.token?.match(/^\s+$/))
|
|
1356
|
+
exp.children.shift();
|
|
1357
|
+
if (id.type === "Identifier" && exp?.type === "FunctionExpression" && !exp.id) {
|
|
1358
|
+
const i = exp.children.findIndex((c) => c?.token === "function") + 1;
|
|
1359
|
+
exp = {
|
|
1360
|
+
...exp,
|
|
1361
|
+
children: [...exp.children.slice(0, i), " ", id, suffix, ws, ...exp.children.slice(i)]
|
|
1362
|
+
};
|
|
1363
|
+
return {
|
|
1364
|
+
type: "Declaration",
|
|
1365
|
+
decl,
|
|
1366
|
+
children: [exp],
|
|
1367
|
+
names: id.names
|
|
1368
|
+
};
|
|
1369
|
+
}
|
|
1328
1370
|
}
|
|
1329
1371
|
let [splices, thisAssignments] = gatherBindingCode(id);
|
|
1330
1372
|
splices = splices.map((s) => [", ", s]);
|
|
1331
1373
|
thisAssignments = thisAssignments.map((a) => ["", a, ";"]);
|
|
1332
|
-
const
|
|
1333
|
-
const
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
type: "Declaration",
|
|
1337
|
-
names: id.names,
|
|
1338
|
-
children,
|
|
1339
|
-
binding,
|
|
1374
|
+
const initializer = [ws, assign, e];
|
|
1375
|
+
const binding = {
|
|
1376
|
+
type: "Binding",
|
|
1377
|
+
pattern: id,
|
|
1340
1378
|
initializer,
|
|
1341
1379
|
splices,
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
function processLetAssignmentDeclaration(l, id, suffix, ws, la, e) {
|
|
1346
|
-
l = {
|
|
1347
|
-
...l,
|
|
1348
|
-
$loc: {
|
|
1349
|
-
pos: la.$loc.pos - 1,
|
|
1350
|
-
length: la.$loc.length + 1
|
|
1351
|
-
}
|
|
1380
|
+
suffix,
|
|
1381
|
+
thisAssignments,
|
|
1382
|
+
children: [id, suffix, initializer]
|
|
1352
1383
|
};
|
|
1353
|
-
|
|
1354
|
-
splices = splices.map((s) => [", ", s]);
|
|
1355
|
-
thisAssignments = thisAssignments.map((a) => ["", a, ";"]);
|
|
1356
|
-
const binding = [l, id, suffix, ...ws];
|
|
1357
|
-
const initializer = [la, e];
|
|
1358
|
-
const children = [binding, initializer];
|
|
1384
|
+
const children = [decl, binding];
|
|
1359
1385
|
return {
|
|
1360
1386
|
type: "Declaration",
|
|
1361
1387
|
names: id.names,
|
|
1362
|
-
|
|
1363
|
-
binding,
|
|
1364
|
-
initializer,
|
|
1388
|
+
decl,
|
|
1389
|
+
bindings: [binding],
|
|
1365
1390
|
splices,
|
|
1366
|
-
thisAssignments
|
|
1391
|
+
thisAssignments,
|
|
1392
|
+
children
|
|
1367
1393
|
};
|
|
1368
1394
|
}
|
|
1369
1395
|
function implicitFunctionBlock(f) {
|
|
@@ -1574,9 +1600,9 @@ var require_lib = __commonJS({
|
|
|
1574
1600
|
const subRef = [ref, "[", i.toString(), "]"];
|
|
1575
1601
|
getPatternConditions(e, subRef, conditions);
|
|
1576
1602
|
});
|
|
1577
|
-
const
|
|
1578
|
-
if (
|
|
1579
|
-
const postElements =
|
|
1603
|
+
const { blockPrefix } = pattern;
|
|
1604
|
+
if (blockPrefix) {
|
|
1605
|
+
const postElements = blockPrefix.children[1], { length: postLength } = postElements;
|
|
1580
1606
|
postElements.forEach(({ children: [, e] }, i) => {
|
|
1581
1607
|
const subRef = [ref, "[", ref, ".length - ", (postLength + i).toString(), "]"];
|
|
1582
1608
|
getPatternConditions(e, subRef, conditions);
|
|
@@ -1663,15 +1689,15 @@ var require_lib = __commonJS({
|
|
|
1663
1689
|
if (el.type === "BindingRestElement") {
|
|
1664
1690
|
return ["", el, void 0];
|
|
1665
1691
|
}
|
|
1666
|
-
const { children: [ws, e,
|
|
1692
|
+
const { children: [ws, e, delim] } = el;
|
|
1667
1693
|
switch (e.type) {
|
|
1668
1694
|
case "Literal":
|
|
1669
1695
|
case "RegularExpressionLiteral":
|
|
1670
1696
|
case "StringLiteral":
|
|
1671
1697
|
case "PinPattern":
|
|
1672
|
-
return
|
|
1698
|
+
return delim;
|
|
1673
1699
|
default:
|
|
1674
|
-
return [ws, nonMatcherBindings(e),
|
|
1700
|
+
return [ws, nonMatcherBindings(e), delim];
|
|
1675
1701
|
}
|
|
1676
1702
|
});
|
|
1677
1703
|
}
|
|
@@ -1681,13 +1707,12 @@ var require_lib = __commonJS({
|
|
|
1681
1707
|
case "BindingProperty": {
|
|
1682
1708
|
const { children, name, value } = p;
|
|
1683
1709
|
const [ws] = children;
|
|
1684
|
-
const sep = children[children.length - 1];
|
|
1685
1710
|
switch (value && value.type) {
|
|
1686
1711
|
case "ArrayBindingPattern":
|
|
1687
1712
|
case "ObjectBindingPattern":
|
|
1688
1713
|
return {
|
|
1689
1714
|
...p,
|
|
1690
|
-
children: [ws, name, ": ", nonMatcherBindings(value)]
|
|
1715
|
+
children: [ws, name, ": ", nonMatcherBindings(value), p.delim]
|
|
1691
1716
|
};
|
|
1692
1717
|
case "Identifier":
|
|
1693
1718
|
return p;
|
|
@@ -1697,7 +1722,7 @@ var require_lib = __commonJS({
|
|
|
1697
1722
|
default:
|
|
1698
1723
|
return {
|
|
1699
1724
|
...p,
|
|
1700
|
-
children: [ws, name,
|
|
1725
|
+
children: [ws, name, p.delim]
|
|
1701
1726
|
};
|
|
1702
1727
|
}
|
|
1703
1728
|
}
|
|
@@ -2037,10 +2062,11 @@ var require_lib = __commonJS({
|
|
|
2037
2062
|
});
|
|
2038
2063
|
}
|
|
2039
2064
|
function processProgram(root, config, m, ReservedWord) {
|
|
2065
|
+
assert.equal(m.forbidBracedApplication.length, 1, "forbidBracedApplication");
|
|
2040
2066
|
assert.equal(m.forbidClassImplicitCall.length, 1, "forbidClassImplicitCall");
|
|
2041
2067
|
assert.equal(m.forbidIndentedApplication.length, 1, "forbidIndentedApplication");
|
|
2068
|
+
assert.equal(m.forbidNewlineBinaryOp.length, 1, "forbidNewlineBinaryOp");
|
|
2042
2069
|
assert.equal(m.forbidTrailingMemberProperty.length, 1, "forbidTrailingMemberProperty");
|
|
2043
|
-
assert.equal(m.forbidMultiLineImplicitObjectLiteral.length, 1, "forbidMultiLineImplicitObjectLiteral");
|
|
2044
2070
|
assert.equal(m.JSXTagStack.length, 0, "JSXTagStack should be empty");
|
|
2045
2071
|
addParentPointers(root);
|
|
2046
2072
|
const { expressions: statements } = root;
|
|
@@ -2367,9 +2393,20 @@ var require_lib = __commonJS({
|
|
|
2367
2393
|
let rest = props[restIndex];
|
|
2368
2394
|
props = props.slice(0, restIndex);
|
|
2369
2395
|
if (after.length) {
|
|
2370
|
-
const
|
|
2371
|
-
rest = {
|
|
2372
|
-
|
|
2396
|
+
const { delim: restDelim } = rest, lastAfterProp = after[after.length - 1], { delim: lastDelim, children: lastAfterChildren } = lastAfterProp;
|
|
2397
|
+
rest = {
|
|
2398
|
+
...rest,
|
|
2399
|
+
delim: lastDelim,
|
|
2400
|
+
children: [...rest.children.slice(0, -1), lastDelim]
|
|
2401
|
+
};
|
|
2402
|
+
after = [
|
|
2403
|
+
...after.slice(0, -1),
|
|
2404
|
+
{
|
|
2405
|
+
...lastAfterProp,
|
|
2406
|
+
delim: restDelim,
|
|
2407
|
+
children: [...lastAfterChildren.slice(0, -1), restDelim]
|
|
2408
|
+
}
|
|
2409
|
+
];
|
|
2373
2410
|
}
|
|
2374
2411
|
const children = [...props, ...after, rest];
|
|
2375
2412
|
return {
|
|
@@ -2549,8 +2586,7 @@ var require_lib = __commonJS({
|
|
|
2549
2586
|
processBinaryOpExpression,
|
|
2550
2587
|
processCallMemberExpression,
|
|
2551
2588
|
processCoffeeInterpolation,
|
|
2552
|
-
|
|
2553
|
-
processLetAssignmentDeclaration,
|
|
2589
|
+
processAssignmentDeclaration,
|
|
2554
2590
|
processParams,
|
|
2555
2591
|
processProgram,
|
|
2556
2592
|
processReturnValue,
|
|
@@ -3091,7 +3127,6 @@ ${input.slice(result.pos)}
|
|
|
3091
3127
|
BindingProperty,
|
|
3092
3128
|
BindingRestProperty,
|
|
3093
3129
|
NestedBindingElements,
|
|
3094
|
-
NestedBindingElement,
|
|
3095
3130
|
BindingElement,
|
|
3096
3131
|
BindingRestElement,
|
|
3097
3132
|
EmptyBindingPattern,
|
|
@@ -3155,10 +3190,8 @@ ${input.slice(result.pos)}
|
|
|
3155
3190
|
InlineObjectLiteral,
|
|
3156
3191
|
ImplicitInlineObjectPropertyDelimiter,
|
|
3157
3192
|
ObjectPropertyDelimiter,
|
|
3158
|
-
PropertyDefinitionList,
|
|
3159
3193
|
PropertyDefinition,
|
|
3160
3194
|
NamedProperty,
|
|
3161
|
-
ImplicitNamedProperty,
|
|
3162
3195
|
SnugNamedProperty,
|
|
3163
3196
|
PropertyName,
|
|
3164
3197
|
ComputedPropertyName,
|
|
@@ -3264,10 +3297,6 @@ ${input.slice(result.pos)}
|
|
|
3264
3297
|
AllowTrailingMemberProperty,
|
|
3265
3298
|
RestoreTrailingMemberProperty,
|
|
3266
3299
|
TrailingMemberPropertyAllowed,
|
|
3267
|
-
ForbidMultiLineImplicitObjectLiteral,
|
|
3268
|
-
AllowMultiLineImplicitObjectLiteral,
|
|
3269
|
-
RestoreMultiLineImplicitObjectLiteral,
|
|
3270
|
-
MultiLineImplicitObjectLiteralAllowed,
|
|
3271
3300
|
AllowNewlineBinaryOp,
|
|
3272
3301
|
ForbidNewlineBinaryOp,
|
|
3273
3302
|
RestoreNewlineBinaryOp,
|
|
@@ -3313,7 +3342,6 @@ ${input.slice(result.pos)}
|
|
|
3313
3342
|
Initializer,
|
|
3314
3343
|
VariableStatement,
|
|
3315
3344
|
VariableDeclarationList,
|
|
3316
|
-
VariableDeclaration,
|
|
3317
3345
|
NumericLiteral,
|
|
3318
3346
|
NumericLiteralKind,
|
|
3319
3347
|
DecimalBigIntegerLiteral,
|
|
@@ -3502,6 +3530,7 @@ ${input.slice(result.pos)}
|
|
|
3502
3530
|
NestedJSXChildExpression,
|
|
3503
3531
|
TypeDeclaration,
|
|
3504
3532
|
TypeDeclarationRest,
|
|
3533
|
+
OptionalEquals,
|
|
3505
3534
|
TypeLexicalDeclaration,
|
|
3506
3535
|
TypeDeclarationBinding,
|
|
3507
3536
|
InterfaceExtendsClause,
|
|
@@ -3590,6 +3619,7 @@ ${input.slice(result.pos)}
|
|
|
3590
3619
|
InsertOpenBracket,
|
|
3591
3620
|
InsertCloseBracket,
|
|
3592
3621
|
InsertComma,
|
|
3622
|
+
InsertSpaceEquals,
|
|
3593
3623
|
InsertConst,
|
|
3594
3624
|
InsertLet,
|
|
3595
3625
|
InsertReadonly,
|
|
@@ -3617,13 +3647,13 @@ ${input.slice(result.pos)}
|
|
|
3617
3647
|
Init,
|
|
3618
3648
|
Indent,
|
|
3619
3649
|
TrackIndented,
|
|
3620
|
-
Samedent,
|
|
3621
|
-
IndentedFurther,
|
|
3622
|
-
NotDedented,
|
|
3623
|
-
Dedented,
|
|
3624
3650
|
PushIndent,
|
|
3625
3651
|
PopIndent,
|
|
3626
|
-
Nested
|
|
3652
|
+
Nested,
|
|
3653
|
+
IndentedFurther,
|
|
3654
|
+
IndentedAtLeast,
|
|
3655
|
+
NotDedented,
|
|
3656
|
+
Dedented
|
|
3627
3657
|
});
|
|
3628
3658
|
var $L0 = $L("");
|
|
3629
3659
|
var $L1 = $L("{");
|
|
@@ -4467,7 +4497,7 @@ ${input.slice(result.pos)}
|
|
|
4467
4497
|
return result;
|
|
4468
4498
|
}
|
|
4469
4499
|
}
|
|
4470
|
-
var TrailingMemberExpressions$0 = $TS($S($Q(MemberExpressionRest), $Q($S(
|
|
4500
|
+
var TrailingMemberExpressions$0 = $TS($S($Q(MemberExpressionRest), $Q($S(IndentedAtLeast, $Y($S($E($EXPECT($L5, fail, 'TrailingMemberExpressions "?"')), $EXPECT($L6, fail, 'TrailingMemberExpressions "."'), $N($EXPECT($R1, fail, "TrailingMemberExpressions /[0-9]/")))), MemberExpressionRest))), function($skip, $loc, $0, $1, $2) {
|
|
4471
4501
|
return $1.concat($2);
|
|
4472
4502
|
});
|
|
4473
4503
|
function TrailingMemberExpressions(state) {
|
|
@@ -4518,7 +4548,7 @@ ${input.slice(result.pos)}
|
|
|
4518
4548
|
return result;
|
|
4519
4549
|
}
|
|
4520
4550
|
}
|
|
4521
|
-
var TrailingCallExpressions$0 = $P($S(
|
|
4551
|
+
var TrailingCallExpressions$0 = $P($S(IndentedAtLeast, $Y($S($E($EXPECT($L5, fail, 'TrailingCallExpressions "?"')), $EXPECT($L6, fail, 'TrailingCallExpressions "."'), $N($R$0($EXPECT($R1, fail, "TrailingCallExpressions /[0-9]/"))))), $P(CallExpressionRest)));
|
|
4522
4552
|
function TrailingCallExpressions(state) {
|
|
4523
4553
|
let eventData;
|
|
4524
4554
|
if (state.events) {
|
|
@@ -4566,7 +4596,7 @@ ${input.slice(result.pos)}
|
|
|
4566
4596
|
return result;
|
|
4567
4597
|
}
|
|
4568
4598
|
}
|
|
4569
|
-
var CommaDelimiter$0 = $S(
|
|
4599
|
+
var CommaDelimiter$0 = $S(NotDedented, Comma);
|
|
4570
4600
|
function CommaDelimiter(state) {
|
|
4571
4601
|
let eventData;
|
|
4572
4602
|
if (state.events) {
|
|
@@ -7339,7 +7369,7 @@ ${input.slice(result.pos)}
|
|
|
7339
7369
|
var c = $3;
|
|
7340
7370
|
return {
|
|
7341
7371
|
type: "ObjectBindingPattern",
|
|
7342
|
-
children: $
|
|
7372
|
+
children: [$1, $2, c.children, $4, $5],
|
|
7343
7373
|
names: c.names,
|
|
7344
7374
|
properties: c.children
|
|
7345
7375
|
};
|
|
@@ -7400,6 +7430,7 @@ ${input.slice(result.pos)}
|
|
|
7400
7430
|
return props.map(([prop, delim]) => {
|
|
7401
7431
|
return {
|
|
7402
7432
|
...prop,
|
|
7433
|
+
delim,
|
|
7403
7434
|
children: [...prop.children, delim]
|
|
7404
7435
|
};
|
|
7405
7436
|
});
|
|
@@ -7429,11 +7460,10 @@ ${input.slice(result.pos)}
|
|
|
7429
7460
|
var ArrayBindingPattern$0 = $TS($S($E(_), OpenBracket, ArrayBindingPatternContent, __, CloseBracket), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
7430
7461
|
var c = $3;
|
|
7431
7462
|
return {
|
|
7463
|
+
...c,
|
|
7432
7464
|
type: "ArrayBindingPattern",
|
|
7433
|
-
children: $0,
|
|
7434
|
-
names: c.names,
|
|
7435
7465
|
elements: c.children,
|
|
7436
|
-
|
|
7466
|
+
children: [$1, $2, c.children, $4, $5]
|
|
7437
7467
|
};
|
|
7438
7468
|
});
|
|
7439
7469
|
function ArrayBindingPattern(state) {
|
|
@@ -7519,14 +7549,14 @@ ${input.slice(result.pos)}
|
|
|
7519
7549
|
}
|
|
7520
7550
|
}
|
|
7521
7551
|
var NestedBindingElementList$0 = $TS($S(Nested, BindingElementList), function($skip, $loc, $0, $1, $2) {
|
|
7522
|
-
var
|
|
7552
|
+
var indent = $1;
|
|
7523
7553
|
var elements = $2;
|
|
7524
7554
|
return elements.map((element, i) => {
|
|
7525
7555
|
if (i > 0)
|
|
7526
7556
|
return element;
|
|
7527
7557
|
return {
|
|
7528
7558
|
...element,
|
|
7529
|
-
children: [
|
|
7559
|
+
children: [indent, ...element.children.slice(1)]
|
|
7530
7560
|
};
|
|
7531
7561
|
});
|
|
7532
7562
|
});
|
|
@@ -7641,13 +7671,13 @@ ${input.slice(result.pos)}
|
|
|
7641
7671
|
var BindingProperty$1 = $TS($S($E(_), PropertyName, $E(_), Colon, $E(_), $C(BindingIdentifier, BindingPattern), $E(Initializer)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
|
|
7642
7672
|
var name = $2;
|
|
7643
7673
|
var value = $6;
|
|
7644
|
-
var
|
|
7674
|
+
var initializer = $7;
|
|
7645
7675
|
return {
|
|
7646
7676
|
type: "BindingProperty",
|
|
7647
7677
|
children: $0,
|
|
7648
7678
|
name,
|
|
7649
7679
|
value,
|
|
7650
|
-
|
|
7680
|
+
initializer,
|
|
7651
7681
|
names: value.names
|
|
7652
7682
|
};
|
|
7653
7683
|
});
|
|
@@ -7655,14 +7685,14 @@ ${input.slice(result.pos)}
|
|
|
7655
7685
|
var ws = $1;
|
|
7656
7686
|
var pin = $2;
|
|
7657
7687
|
var binding = $3;
|
|
7658
|
-
var
|
|
7688
|
+
var initializer = $4;
|
|
7659
7689
|
if (binding.type === "AtBinding") {
|
|
7660
7690
|
return {
|
|
7661
7691
|
type: "AtBindingProperty",
|
|
7662
7692
|
children: $0,
|
|
7663
7693
|
binding,
|
|
7664
7694
|
ref: binding.ref,
|
|
7665
|
-
|
|
7695
|
+
initializer,
|
|
7666
7696
|
names: []
|
|
7667
7697
|
};
|
|
7668
7698
|
}
|
|
@@ -7682,7 +7712,7 @@ ${input.slice(result.pos)}
|
|
|
7682
7712
|
children: $0,
|
|
7683
7713
|
name: binding,
|
|
7684
7714
|
value: void 0,
|
|
7685
|
-
|
|
7715
|
+
initializer,
|
|
7686
7716
|
names: binding.names,
|
|
7687
7717
|
identifier: binding
|
|
7688
7718
|
};
|
|
@@ -7779,36 +7809,6 @@ ${input.slice(result.pos)}
|
|
|
7779
7809
|
return result;
|
|
7780
7810
|
}
|
|
7781
7811
|
}
|
|
7782
|
-
var NestedBindingElement$0 = $TS($S(Nested, BindingElement), function($skip, $loc, $0, $1, $2) {
|
|
7783
|
-
var indent = $1;
|
|
7784
|
-
var element = $2;
|
|
7785
|
-
return {
|
|
7786
|
-
...element,
|
|
7787
|
-
children: [indent, ...element.children]
|
|
7788
|
-
};
|
|
7789
|
-
});
|
|
7790
|
-
function NestedBindingElement(state) {
|
|
7791
|
-
let eventData;
|
|
7792
|
-
if (state.events) {
|
|
7793
|
-
const result = state.events.enter?.("NestedBindingElement", state);
|
|
7794
|
-
if (result) {
|
|
7795
|
-
if (result.cache)
|
|
7796
|
-
return result.cache;
|
|
7797
|
-
eventData = result.data;
|
|
7798
|
-
}
|
|
7799
|
-
}
|
|
7800
|
-
if (state.tokenize) {
|
|
7801
|
-
const result = $TOKEN("NestedBindingElement", state, NestedBindingElement$0(state));
|
|
7802
|
-
if (state.events)
|
|
7803
|
-
state.events.exit?.("NestedBindingElement", state, result, eventData);
|
|
7804
|
-
return result;
|
|
7805
|
-
} else {
|
|
7806
|
-
const result = NestedBindingElement$0(state);
|
|
7807
|
-
if (state.events)
|
|
7808
|
-
state.events.exit?.("NestedBindingElement", state, result, eventData);
|
|
7809
|
-
return result;
|
|
7810
|
-
}
|
|
7811
|
-
}
|
|
7812
7812
|
var BindingElement$0 = BindingRestElement;
|
|
7813
7813
|
var BindingElement$1 = $TS($S($E(_), $C(BindingIdentifier, BindingPattern), $E(Initializer)), function($skip, $loc, $0, $1, $2, $3) {
|
|
7814
7814
|
var ws = $1;
|
|
@@ -7817,6 +7817,7 @@ ${input.slice(result.pos)}
|
|
|
7817
7817
|
if (binding.children) {
|
|
7818
7818
|
binding = {
|
|
7819
7819
|
...binding,
|
|
7820
|
+
initializer,
|
|
7820
7821
|
children: [...binding.children, initializer]
|
|
7821
7822
|
};
|
|
7822
7823
|
}
|
|
@@ -7862,7 +7863,7 @@ ${input.slice(result.pos)}
|
|
|
7862
7863
|
var binding = $3;
|
|
7863
7864
|
return {
|
|
7864
7865
|
type: "BindingRestElement",
|
|
7865
|
-
children: [
|
|
7866
|
+
children: [ws, [dots, binding]],
|
|
7866
7867
|
binding,
|
|
7867
7868
|
name: binding.name,
|
|
7868
7869
|
names: binding.names,
|
|
@@ -8751,7 +8752,7 @@ ${input.slice(result.pos)}
|
|
|
8751
8752
|
var s = $3;
|
|
8752
8753
|
var ws = $4;
|
|
8753
8754
|
var c = $5;
|
|
8754
|
-
if (!s.
|
|
8755
|
+
if (!s.expressions.length)
|
|
8755
8756
|
return $skip;
|
|
8756
8757
|
return {
|
|
8757
8758
|
type: "BlockStatement",
|
|
@@ -8826,16 +8827,16 @@ ${input.slice(result.pos)}
|
|
|
8826
8827
|
return result;
|
|
8827
8828
|
}
|
|
8828
8829
|
}
|
|
8829
|
-
var SingleLineStatements$0 = $TS($S($Q($S($S($E(_), $N(EOS)), Statement, SemicolonDelimiter)), $E($S($S($E(_), $N(EOS)), Statement, $E(SemicolonDelimiter)))), function($skip, $loc, $0, $1, $2) {
|
|
8830
|
-
var stmts = $
|
|
8831
|
-
var last = $
|
|
8832
|
-
const
|
|
8830
|
+
var SingleLineStatements$0 = $TS($S(ForbidNewlineBinaryOp, $Q($S($S($E(_), $N(EOS)), Statement, SemicolonDelimiter)), $E($S($S($E(_), $N(EOS)), Statement, $E(SemicolonDelimiter))), RestoreNewlineBinaryOp), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
8831
|
+
var stmts = $2;
|
|
8832
|
+
var last = $3;
|
|
8833
|
+
const expressions = [...stmts];
|
|
8833
8834
|
if (last)
|
|
8834
|
-
|
|
8835
|
+
expressions.push(last);
|
|
8835
8836
|
return {
|
|
8836
8837
|
type: "BlockStatement",
|
|
8837
|
-
expressions
|
|
8838
|
-
children,
|
|
8838
|
+
expressions,
|
|
8839
|
+
children: [expressions],
|
|
8839
8840
|
bare: true
|
|
8840
8841
|
};
|
|
8841
8842
|
});
|
|
@@ -9291,9 +9292,7 @@ ${input.slice(result.pos)}
|
|
|
9291
9292
|
} else {
|
|
9292
9293
|
children = [open, content, ...ws, close];
|
|
9293
9294
|
}
|
|
9294
|
-
const names = children.flatMap((c) =>
|
|
9295
|
-
return c.names || [];
|
|
9296
|
-
});
|
|
9295
|
+
const names = children.flatMap((c) => c?.names || []);
|
|
9297
9296
|
return {
|
|
9298
9297
|
type: "ArrayExpression",
|
|
9299
9298
|
children,
|
|
@@ -9409,17 +9408,17 @@ ${input.slice(result.pos)}
|
|
|
9409
9408
|
}
|
|
9410
9409
|
}
|
|
9411
9410
|
var ArrayLiteralContent$0 = RangeExpression;
|
|
9412
|
-
var ArrayLiteralContent$1 = $S(
|
|
9413
|
-
var ArrayLiteralContent$2 = NestedElementList
|
|
9414
|
-
var ArrayLiteralContent$3 = $TS($S(ElementListWithIndentedApplicationForbidden, InsertComma, $E(NestedElementList)), function($skip, $loc, $0, $1, $2, $3) {
|
|
9411
|
+
var ArrayLiteralContent$1 = $S(NestedElementList, $Y($S(__, CloseBracket)));
|
|
9412
|
+
var ArrayLiteralContent$2 = $TS($S(ElementListWithIndentedApplicationForbidden, ArrayElementDelimiter, $E(NestedElementList), $Y($S(__, CloseBracket))), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
9415
9413
|
var list = $1;
|
|
9416
|
-
var
|
|
9414
|
+
var delimiter = $2;
|
|
9417
9415
|
var nested = $3;
|
|
9418
|
-
if (nested)
|
|
9419
|
-
return [...list, comma, ...nested];
|
|
9420
|
-
} else {
|
|
9416
|
+
if (!nested)
|
|
9421
9417
|
return list;
|
|
9422
|
-
|
|
9418
|
+
return [...list, delimiter, ...nested];
|
|
9419
|
+
});
|
|
9420
|
+
var ArrayLiteralContent$3 = $TV($Q($S(__, ElementListWithIndentedApplicationForbidden, ArrayElementDelimiter)), function($skip, $loc, $0, $1) {
|
|
9421
|
+
return $1.flat();
|
|
9423
9422
|
});
|
|
9424
9423
|
function ArrayLiteralContent(state) {
|
|
9425
9424
|
let eventData;
|
|
@@ -9567,9 +9566,9 @@ ${input.slice(result.pos)}
|
|
|
9567
9566
|
return result;
|
|
9568
9567
|
}
|
|
9569
9568
|
}
|
|
9570
|
-
var ElementList$0 = $TS($S(ArrayElementExpression, $Q(ElementListRest)), function($skip, $loc, $0, $1, $2) {
|
|
9571
|
-
var first = $
|
|
9572
|
-
var rest = $
|
|
9569
|
+
var ElementList$0 = $TS($S($N(EOS), ArrayElementExpression, $Q(ElementListRest)), function($skip, $loc, $0, $1, $2, $3) {
|
|
9570
|
+
var first = $2;
|
|
9571
|
+
var rest = $3;
|
|
9573
9572
|
if (rest.length) {
|
|
9574
9573
|
return [{
|
|
9575
9574
|
...first,
|
|
@@ -9606,7 +9605,7 @@ ${input.slice(result.pos)}
|
|
|
9606
9605
|
return result;
|
|
9607
9606
|
}
|
|
9608
9607
|
}
|
|
9609
|
-
var ElementListRest$0 = $S($S(
|
|
9608
|
+
var ElementListRest$0 = $S($S($E(_), Comma, $N(EOS)), ArrayElementExpression);
|
|
9610
9609
|
function ElementListRest(state) {
|
|
9611
9610
|
let eventData;
|
|
9612
9611
|
if (state.events) {
|
|
@@ -9721,26 +9720,16 @@ ${input.slice(result.pos)}
|
|
|
9721
9720
|
return result;
|
|
9722
9721
|
}
|
|
9723
9722
|
}
|
|
9724
|
-
var BracedObjectLiteral$0 = $TS($S(OpenBrace, AllowAll, $E($S(
|
|
9723
|
+
var BracedObjectLiteral$0 = $TS($S(OpenBrace, AllowAll, $E($S(BracedObjectLiteralContent, __, CloseBrace)), RestoreAll), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
9725
9724
|
var open = $1;
|
|
9726
9725
|
if (!$3)
|
|
9727
9726
|
return $skip;
|
|
9728
9727
|
const [properties, ...close] = $3;
|
|
9729
|
-
if (properties) {
|
|
9730
|
-
const children = [open, ...properties, close];
|
|
9731
|
-
return {
|
|
9732
|
-
type: "ObjectExpression",
|
|
9733
|
-
children,
|
|
9734
|
-
names: children.flatMap((c) => {
|
|
9735
|
-
return c.names || [];
|
|
9736
|
-
}),
|
|
9737
|
-
properties
|
|
9738
|
-
};
|
|
9739
|
-
}
|
|
9740
9728
|
return {
|
|
9741
9729
|
type: "ObjectExpression",
|
|
9742
|
-
children: [open, close],
|
|
9743
|
-
names: []
|
|
9730
|
+
children: [open, properties, close],
|
|
9731
|
+
names: properties.flatMap((c) => c.names || []),
|
|
9732
|
+
properties
|
|
9744
9733
|
};
|
|
9745
9734
|
});
|
|
9746
9735
|
function BracedObjectLiteral(state) {
|
|
@@ -9765,8 +9754,33 @@ ${input.slice(result.pos)}
|
|
|
9765
9754
|
return result;
|
|
9766
9755
|
}
|
|
9767
9756
|
}
|
|
9768
|
-
var BracedObjectLiteralContent$0 = NestedPropertyDefinitions
|
|
9769
|
-
|
|
9757
|
+
var BracedObjectLiteralContent$0 = $TS($S($Q($S(PropertyDefinition, ObjectPropertyDelimiter)), $E(NestedPropertyDefinitions)), function($skip, $loc, $0, $1, $2) {
|
|
9758
|
+
var line = $1;
|
|
9759
|
+
var nested = $2;
|
|
9760
|
+
line = line.flatMap(([prop, delim]) => {
|
|
9761
|
+
prop = Array.isArray(prop) ? prop : [prop];
|
|
9762
|
+
let last = prop[prop.length - 1];
|
|
9763
|
+
last = {
|
|
9764
|
+
...last,
|
|
9765
|
+
delim,
|
|
9766
|
+
children: [...last.children, delim]
|
|
9767
|
+
};
|
|
9768
|
+
return [...prop.slice(0, prop.length - 1), last];
|
|
9769
|
+
});
|
|
9770
|
+
return line.concat(nested || []);
|
|
9771
|
+
});
|
|
9772
|
+
var BracedObjectLiteralContent$1 = $TV($P($S(__, PropertyDefinition, ObjectPropertyDelimiter)), function($skip, $loc, $0, $1) {
|
|
9773
|
+
return $0.flatMap(([ws, prop, delim]) => {
|
|
9774
|
+
prop = Array.isArray(prop) ? prop : [prop];
|
|
9775
|
+
let last = prop[prop.length - 1];
|
|
9776
|
+
last = {
|
|
9777
|
+
...last,
|
|
9778
|
+
delim,
|
|
9779
|
+
children: [ws, ...last.children.slice(1), delim]
|
|
9780
|
+
};
|
|
9781
|
+
return [...prop.slice(0, prop.length - 1), last];
|
|
9782
|
+
});
|
|
9783
|
+
});
|
|
9770
9784
|
function BracedObjectLiteralContent(state) {
|
|
9771
9785
|
let eventData;
|
|
9772
9786
|
if (state.events) {
|
|
@@ -9790,9 +9804,11 @@ ${input.slice(result.pos)}
|
|
|
9790
9804
|
}
|
|
9791
9805
|
}
|
|
9792
9806
|
var NestedImplicitObjectLiteral$0 = $TS($S(InsertOpenBrace, NestedImplicitPropertyDefinitions, InsertNewline, InsertIndent, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
9807
|
+
var properties = $2;
|
|
9793
9808
|
return {
|
|
9794
9809
|
type: "ObjectExpression",
|
|
9795
|
-
|
|
9810
|
+
properties,
|
|
9811
|
+
children: $0
|
|
9796
9812
|
};
|
|
9797
9813
|
});
|
|
9798
9814
|
function NestedImplicitObjectLiteral(state) {
|
|
@@ -9845,7 +9861,7 @@ ${input.slice(result.pos)}
|
|
|
9845
9861
|
return result;
|
|
9846
9862
|
}
|
|
9847
9863
|
}
|
|
9848
|
-
var NestedImplicitPropertyDefinition$0 = $TS($S(Nested,
|
|
9864
|
+
var NestedImplicitPropertyDefinition$0 = $TS($S(Nested, NamedProperty, ObjectPropertyDelimiter), function($skip, $loc, $0, $1, $2, $3) {
|
|
9849
9865
|
var ws = $1;
|
|
9850
9866
|
var prop = $2;
|
|
9851
9867
|
var delimiter = $3;
|
|
@@ -9948,7 +9964,7 @@ ${input.slice(result.pos)}
|
|
|
9948
9964
|
return result;
|
|
9949
9965
|
}
|
|
9950
9966
|
}
|
|
9951
|
-
var InlineObjectLiteral$0 = $TS($S(InsertInlineOpenBrace, SnugNamedProperty, $Q($S(ImplicitInlineObjectPropertyDelimiter,
|
|
9967
|
+
var InlineObjectLiteral$0 = $TS($S(InsertInlineOpenBrace, SnugNamedProperty, $Q($S(ImplicitInlineObjectPropertyDelimiter, NamedProperty)), $E($S($E(_), Comma, $Y(Dedented))), InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
9952
9968
|
var open = $1;
|
|
9953
9969
|
var first = $2;
|
|
9954
9970
|
var rest = $3;
|
|
@@ -9982,7 +9998,7 @@ ${input.slice(result.pos)}
|
|
|
9982
9998
|
}
|
|
9983
9999
|
}
|
|
9984
10000
|
var ImplicitInlineObjectPropertyDelimiter$0 = $S($E(_), Comma, $C(NotDedented, $E(_)));
|
|
9985
|
-
var ImplicitInlineObjectPropertyDelimiter$1 = $T($S($Y($S(
|
|
10001
|
+
var ImplicitInlineObjectPropertyDelimiter$1 = $T($S($Y($S(Nested, NamedProperty)), InsertComma, $C(Nested, $E(_))), function(value) {
|
|
9986
10002
|
return [value[1], value[2]];
|
|
9987
10003
|
});
|
|
9988
10004
|
function ImplicitInlineObjectPropertyDelimiter(state) {
|
|
@@ -10034,41 +10050,7 @@ ${input.slice(result.pos)}
|
|
|
10034
10050
|
return result;
|
|
10035
10051
|
}
|
|
10036
10052
|
}
|
|
10037
|
-
var
|
|
10038
|
-
return $0.flatMap(([prop, delim]) => {
|
|
10039
|
-
prop = Array.isArray(prop) ? prop : [prop];
|
|
10040
|
-
let last = prop[prop.length - 1];
|
|
10041
|
-
last = {
|
|
10042
|
-
...last,
|
|
10043
|
-
delim,
|
|
10044
|
-
children: [...last.children, delim]
|
|
10045
|
-
};
|
|
10046
|
-
return [...prop.slice(0, prop.length - 1), last];
|
|
10047
|
-
});
|
|
10048
|
-
});
|
|
10049
|
-
function PropertyDefinitionList(state) {
|
|
10050
|
-
let eventData;
|
|
10051
|
-
if (state.events) {
|
|
10052
|
-
const result = state.events.enter?.("PropertyDefinitionList", state);
|
|
10053
|
-
if (result) {
|
|
10054
|
-
if (result.cache)
|
|
10055
|
-
return result.cache;
|
|
10056
|
-
eventData = result.data;
|
|
10057
|
-
}
|
|
10058
|
-
}
|
|
10059
|
-
if (state.tokenize) {
|
|
10060
|
-
const result = $TOKEN("PropertyDefinitionList", state, PropertyDefinitionList$0(state));
|
|
10061
|
-
if (state.events)
|
|
10062
|
-
state.events.exit?.("PropertyDefinitionList", state, result, eventData);
|
|
10063
|
-
return result;
|
|
10064
|
-
} else {
|
|
10065
|
-
const result = PropertyDefinitionList$0(state);
|
|
10066
|
-
if (state.events)
|
|
10067
|
-
state.events.exit?.("PropertyDefinitionList", state, result, eventData);
|
|
10068
|
-
return result;
|
|
10069
|
-
}
|
|
10070
|
-
}
|
|
10071
|
-
var PropertyDefinition$0 = $TS($S(__, AtThis, IdentifierReference), function($skip, $loc, $0, $1, $2, $3) {
|
|
10053
|
+
var PropertyDefinition$0 = $TS($S($E(_), AtThis, IdentifierReference), function($skip, $loc, $0, $1, $2, $3) {
|
|
10072
10054
|
var ws = $1;
|
|
10073
10055
|
var at = $2;
|
|
10074
10056
|
var id = $3;
|
|
@@ -10081,7 +10063,7 @@ ${input.slice(result.pos)}
|
|
|
10081
10063
|
value
|
|
10082
10064
|
};
|
|
10083
10065
|
});
|
|
10084
|
-
var PropertyDefinition$1 = $TS($S(
|
|
10066
|
+
var PropertyDefinition$1 = $TS($S($E(_), NamedProperty), function($skip, $loc, $0, $1, $2) {
|
|
10085
10067
|
var ws = $1;
|
|
10086
10068
|
var prop = $2;
|
|
10087
10069
|
return {
|
|
@@ -10089,7 +10071,7 @@ ${input.slice(result.pos)}
|
|
|
10089
10071
|
children: [ws, ...prop.children]
|
|
10090
10072
|
};
|
|
10091
10073
|
});
|
|
10092
|
-
var PropertyDefinition$2 = $TS($S(
|
|
10074
|
+
var PropertyDefinition$2 = $TS($S($E(_), $TEXT($EXPECT($R6, fail, "PropertyDefinition /[!+-]/")), PropertyName), function($skip, $loc, $0, $1, $2, $3) {
|
|
10093
10075
|
var ws = $1;
|
|
10094
10076
|
var toggle = $2;
|
|
10095
10077
|
var id = $3;
|
|
@@ -10102,7 +10084,7 @@ ${input.slice(result.pos)}
|
|
|
10102
10084
|
value
|
|
10103
10085
|
};
|
|
10104
10086
|
});
|
|
10105
|
-
var PropertyDefinition$3 = $TS($S(
|
|
10087
|
+
var PropertyDefinition$3 = $TS($S($E(_), MethodDefinition), function($skip, $loc, $0, $1, $2) {
|
|
10106
10088
|
var ws = $1;
|
|
10107
10089
|
var def = $2;
|
|
10108
10090
|
if (!def.block || def.block.empty)
|
|
@@ -10112,7 +10094,7 @@ ${input.slice(result.pos)}
|
|
|
10112
10094
|
children: [ws, ...def.children]
|
|
10113
10095
|
};
|
|
10114
10096
|
});
|
|
10115
|
-
var PropertyDefinition$4 = $TS($S(
|
|
10097
|
+
var PropertyDefinition$4 = $TS($S($E(_), DotDotDot, ExtendedExpression), function($skip, $loc, $0, $1, $2, $3) {
|
|
10116
10098
|
var ws = $1;
|
|
10117
10099
|
var dots = $2;
|
|
10118
10100
|
var exp = $3;
|
|
@@ -10124,9 +10106,9 @@ ${input.slice(result.pos)}
|
|
|
10124
10106
|
value: exp
|
|
10125
10107
|
};
|
|
10126
10108
|
});
|
|
10127
|
-
var PropertyDefinition$5 = $TS($S(
|
|
10109
|
+
var PropertyDefinition$5 = $TS($S($E(_), $N(EOS), CallExpression), function($skip, $loc, $0, $1, $2, $3) {
|
|
10128
10110
|
var ws = $1;
|
|
10129
|
-
var value = $
|
|
10111
|
+
var value = $3;
|
|
10130
10112
|
switch (value.type) {
|
|
10131
10113
|
case "Identifier":
|
|
10132
10114
|
return { ...value, children: [ws, ...value.children] };
|
|
@@ -10247,41 +10229,8 @@ ${input.slice(result.pos)}
|
|
|
10247
10229
|
return result;
|
|
10248
10230
|
}
|
|
10249
10231
|
}
|
|
10250
|
-
var
|
|
10251
|
-
var
|
|
10252
|
-
var exp = $5;
|
|
10253
|
-
return {
|
|
10254
|
-
type: "Property",
|
|
10255
|
-
children: $0,
|
|
10256
|
-
name,
|
|
10257
|
-
names: exp.names || [],
|
|
10258
|
-
value: exp
|
|
10259
|
-
};
|
|
10260
|
-
});
|
|
10261
|
-
function ImplicitNamedProperty(state) {
|
|
10262
|
-
let eventData;
|
|
10263
|
-
if (state.events) {
|
|
10264
|
-
const result = state.events.enter?.("ImplicitNamedProperty", state);
|
|
10265
|
-
if (result) {
|
|
10266
|
-
if (result.cache)
|
|
10267
|
-
return result.cache;
|
|
10268
|
-
eventData = result.data;
|
|
10269
|
-
}
|
|
10270
|
-
}
|
|
10271
|
-
if (state.tokenize) {
|
|
10272
|
-
const result = $TOKEN("ImplicitNamedProperty", state, ImplicitNamedProperty$0(state));
|
|
10273
|
-
if (state.events)
|
|
10274
|
-
state.events.exit?.("ImplicitNamedProperty", state, result, eventData);
|
|
10275
|
-
return result;
|
|
10276
|
-
} else {
|
|
10277
|
-
const result = ImplicitNamedProperty$0(state);
|
|
10278
|
-
if (state.events)
|
|
10279
|
-
state.events.exit?.("ImplicitNamedProperty", state, result, eventData);
|
|
10280
|
-
return result;
|
|
10281
|
-
}
|
|
10282
|
-
}
|
|
10283
|
-
var SnugNamedProperty$0 = $TS($S(PropertyName, Colon, $C(MultiLineImplicitObjectLiteralAllowed, $N(EOS)), ExtendedExpression), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
10284
|
-
var exp = $4;
|
|
10232
|
+
var SnugNamedProperty$0 = $TS($S(PropertyName, Colon, ExtendedExpression), function($skip, $loc, $0, $1, $2, $3) {
|
|
10233
|
+
var exp = $3;
|
|
10285
10234
|
return {
|
|
10286
10235
|
type: "Property",
|
|
10287
10236
|
children: $0,
|
|
@@ -10857,7 +10806,7 @@ ${input.slice(result.pos)}
|
|
|
10857
10806
|
ws.push(...$2);
|
|
10858
10807
|
return [ws, $3];
|
|
10859
10808
|
});
|
|
10860
|
-
var NotDedentedBinaryOp$1 = $TS($S(
|
|
10809
|
+
var NotDedentedBinaryOp$1 = $TS($S(Nested, $E(_), $N(Identifier), BinaryOp), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
10861
10810
|
const ws = [...$1];
|
|
10862
10811
|
if ($2)
|
|
10863
10812
|
ws.push(...$2);
|
|
@@ -11645,7 +11594,7 @@ ${input.slice(result.pos)}
|
|
|
11645
11594
|
return result;
|
|
11646
11595
|
}
|
|
11647
11596
|
}
|
|
11648
|
-
var ElseClause$0 = $S(
|
|
11597
|
+
var ElseClause$0 = $S(Nested, Else, Block);
|
|
11649
11598
|
var ElseClause$1 = $S($E(_), Else, Block);
|
|
11650
11599
|
function ElseClause(state) {
|
|
11651
11600
|
let eventData;
|
|
@@ -11789,7 +11738,7 @@ ${input.slice(result.pos)}
|
|
|
11789
11738
|
return result;
|
|
11790
11739
|
}
|
|
11791
11740
|
}
|
|
11792
|
-
var ElseExpressionClause$0 = $TS($S($C($S(
|
|
11741
|
+
var ElseExpressionClause$0 = $TS($S($C($S(Nested, Else), $S($E(_), Else)), ElseExpressionBlock), function($skip, $loc, $0, $1, $2) {
|
|
11793
11742
|
return [...$1, $2];
|
|
11794
11743
|
});
|
|
11795
11744
|
function ElseExpressionClause(state) {
|
|
@@ -12893,7 +12842,7 @@ ${input.slice(result.pos)}
|
|
|
12893
12842
|
return result;
|
|
12894
12843
|
}
|
|
12895
12844
|
}
|
|
12896
|
-
var CaseBlock$0 = $TS($S($E($C(
|
|
12845
|
+
var CaseBlock$0 = $TS($S($E($C(Nested, _)), OpenBrace, NestedCaseClauses, __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
12897
12846
|
var clauses = $3;
|
|
12898
12847
|
return {
|
|
12899
12848
|
type: "CaseBlock",
|
|
@@ -13110,11 +13059,9 @@ ${input.slice(result.pos)}
|
|
|
13110
13059
|
return result;
|
|
13111
13060
|
}
|
|
13112
13061
|
}
|
|
13113
|
-
var CaseExpressionList$0 = $TS($S(
|
|
13114
|
-
var first = $
|
|
13115
|
-
var rest = $
|
|
13116
|
-
if (!first)
|
|
13117
|
-
return $skip;
|
|
13062
|
+
var CaseExpressionList$0 = $TS($S($S($E(_), CaseExpression, InsertColon), $Q($S(__, Comma, CaseExpression, InsertColon))), function($skip, $loc, $0, $1, $2) {
|
|
13063
|
+
var first = $1;
|
|
13064
|
+
var rest = $2;
|
|
13118
13065
|
const result = rest.map(([ws, _comma, exp, col]) => {
|
|
13119
13066
|
exp = insertTrimmingSpace(exp, "");
|
|
13120
13067
|
if (ws.length)
|
|
@@ -13307,7 +13254,7 @@ ${input.slice(result.pos)}
|
|
|
13307
13254
|
return result;
|
|
13308
13255
|
}
|
|
13309
13256
|
}
|
|
13310
|
-
var CatchClause$0 = $TS($S($C(
|
|
13257
|
+
var CatchClause$0 = $TS($S($C(Nested, _), Catch, $E(CatchBind), $C(ThenClause, BracedOrEmptyBlock)), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
13311
13258
|
var block = $4;
|
|
13312
13259
|
return {
|
|
13313
13260
|
type: "CatchClause",
|
|
@@ -13361,7 +13308,7 @@ ${input.slice(result.pos)}
|
|
|
13361
13308
|
return result;
|
|
13362
13309
|
}
|
|
13363
13310
|
}
|
|
13364
|
-
var FinallyClause$0 = $S($C(
|
|
13311
|
+
var FinallyClause$0 = $S($C(Nested, _), Finally, $C(ThenClause, BracedOrEmptyBlock));
|
|
13365
13312
|
function FinallyClause(state) {
|
|
13366
13313
|
let eventData;
|
|
13367
13314
|
if (state.events) {
|
|
@@ -13473,17 +13420,19 @@ ${input.slice(result.pos)}
|
|
|
13473
13420
|
type: "Ref",
|
|
13474
13421
|
base: "ref"
|
|
13475
13422
|
};
|
|
13476
|
-
const {
|
|
13423
|
+
const { decl, bindings } = dec;
|
|
13424
|
+
const binding = bindings[0];
|
|
13425
|
+
const { pattern, suffix, initializer, splices, thisAssignments } = binding;
|
|
13477
13426
|
const initCondition = {
|
|
13478
13427
|
type: "AssignmentExpression",
|
|
13479
|
-
children: [ref,
|
|
13428
|
+
children: [ref, initializer],
|
|
13480
13429
|
hoistDec: {
|
|
13481
13430
|
type: "Declaration",
|
|
13482
|
-
children: ["let ", ref],
|
|
13431
|
+
children: ["let ", ref, suffix],
|
|
13483
13432
|
names: []
|
|
13484
13433
|
},
|
|
13485
13434
|
blockPrefix: [
|
|
13486
|
-
["", [
|
|
13435
|
+
["", [decl, pattern, suffix, " = ", ref, ...splices], ";"],
|
|
13487
13436
|
...thisAssignments
|
|
13488
13437
|
]
|
|
13489
13438
|
};
|
|
@@ -13983,110 +13932,6 @@ ${input.slice(result.pos)}
|
|
|
13983
13932
|
return result;
|
|
13984
13933
|
}
|
|
13985
13934
|
}
|
|
13986
|
-
var ForbidMultiLineImplicitObjectLiteral$0 = $TV($EXPECT($L0, fail, 'ForbidMultiLineImplicitObjectLiteral ""'), function($skip, $loc, $0, $1) {
|
|
13987
|
-
module.forbidMultiLineImplicitObjectLiteral.push(true);
|
|
13988
|
-
});
|
|
13989
|
-
function ForbidMultiLineImplicitObjectLiteral(state) {
|
|
13990
|
-
let eventData;
|
|
13991
|
-
if (state.events) {
|
|
13992
|
-
const result = state.events.enter?.("ForbidMultiLineImplicitObjectLiteral", state);
|
|
13993
|
-
if (result) {
|
|
13994
|
-
if (result.cache)
|
|
13995
|
-
return result.cache;
|
|
13996
|
-
eventData = result.data;
|
|
13997
|
-
}
|
|
13998
|
-
}
|
|
13999
|
-
if (state.tokenize) {
|
|
14000
|
-
const result = $TOKEN("ForbidMultiLineImplicitObjectLiteral", state, ForbidMultiLineImplicitObjectLiteral$0(state));
|
|
14001
|
-
if (state.events)
|
|
14002
|
-
state.events.exit?.("ForbidMultiLineImplicitObjectLiteral", state, result, eventData);
|
|
14003
|
-
return result;
|
|
14004
|
-
} else {
|
|
14005
|
-
const result = ForbidMultiLineImplicitObjectLiteral$0(state);
|
|
14006
|
-
if (state.events)
|
|
14007
|
-
state.events.exit?.("ForbidMultiLineImplicitObjectLiteral", state, result, eventData);
|
|
14008
|
-
return result;
|
|
14009
|
-
}
|
|
14010
|
-
}
|
|
14011
|
-
var AllowMultiLineImplicitObjectLiteral$0 = $TV($EXPECT($L0, fail, 'AllowMultiLineImplicitObjectLiteral ""'), function($skip, $loc, $0, $1) {
|
|
14012
|
-
module.forbidMultiLineImplicitObjectLiteral.push(false);
|
|
14013
|
-
});
|
|
14014
|
-
function AllowMultiLineImplicitObjectLiteral(state) {
|
|
14015
|
-
let eventData;
|
|
14016
|
-
if (state.events) {
|
|
14017
|
-
const result = state.events.enter?.("AllowMultiLineImplicitObjectLiteral", state);
|
|
14018
|
-
if (result) {
|
|
14019
|
-
if (result.cache)
|
|
14020
|
-
return result.cache;
|
|
14021
|
-
eventData = result.data;
|
|
14022
|
-
}
|
|
14023
|
-
}
|
|
14024
|
-
if (state.tokenize) {
|
|
14025
|
-
const result = $TOKEN("AllowMultiLineImplicitObjectLiteral", state, AllowMultiLineImplicitObjectLiteral$0(state));
|
|
14026
|
-
if (state.events)
|
|
14027
|
-
state.events.exit?.("AllowMultiLineImplicitObjectLiteral", state, result, eventData);
|
|
14028
|
-
return result;
|
|
14029
|
-
} else {
|
|
14030
|
-
const result = AllowMultiLineImplicitObjectLiteral$0(state);
|
|
14031
|
-
if (state.events)
|
|
14032
|
-
state.events.exit?.("AllowMultiLineImplicitObjectLiteral", state, result, eventData);
|
|
14033
|
-
return result;
|
|
14034
|
-
}
|
|
14035
|
-
}
|
|
14036
|
-
var RestoreMultiLineImplicitObjectLiteral$0 = $TV($EXPECT($L0, fail, 'RestoreMultiLineImplicitObjectLiteral ""'), function($skip, $loc, $0, $1) {
|
|
14037
|
-
module.forbidMultiLineImplicitObjectLiteral.pop();
|
|
14038
|
-
});
|
|
14039
|
-
function RestoreMultiLineImplicitObjectLiteral(state) {
|
|
14040
|
-
let eventData;
|
|
14041
|
-
if (state.events) {
|
|
14042
|
-
const result = state.events.enter?.("RestoreMultiLineImplicitObjectLiteral", state);
|
|
14043
|
-
if (result) {
|
|
14044
|
-
if (result.cache)
|
|
14045
|
-
return result.cache;
|
|
14046
|
-
eventData = result.data;
|
|
14047
|
-
}
|
|
14048
|
-
}
|
|
14049
|
-
if (state.tokenize) {
|
|
14050
|
-
const result = $TOKEN("RestoreMultiLineImplicitObjectLiteral", state, RestoreMultiLineImplicitObjectLiteral$0(state));
|
|
14051
|
-
if (state.events)
|
|
14052
|
-
state.events.exit?.("RestoreMultiLineImplicitObjectLiteral", state, result, eventData);
|
|
14053
|
-
return result;
|
|
14054
|
-
} else {
|
|
14055
|
-
const result = RestoreMultiLineImplicitObjectLiteral$0(state);
|
|
14056
|
-
if (state.events)
|
|
14057
|
-
state.events.exit?.("RestoreMultiLineImplicitObjectLiteral", state, result, eventData);
|
|
14058
|
-
return result;
|
|
14059
|
-
}
|
|
14060
|
-
}
|
|
14061
|
-
var MultiLineImplicitObjectLiteralAllowed$0 = $TV($EXPECT($L0, fail, 'MultiLineImplicitObjectLiteralAllowed ""'), function($skip, $loc, $0, $1) {
|
|
14062
|
-
if (module.config.verbose) {
|
|
14063
|
-
console.log("forbidMultiLineImplicitObjectLiteral:", module.forbidMultiLineImplicitObjectLiteral);
|
|
14064
|
-
}
|
|
14065
|
-
if (module.multiLineImplicitObjectLiteralForbidden)
|
|
14066
|
-
return $skip;
|
|
14067
|
-
});
|
|
14068
|
-
function MultiLineImplicitObjectLiteralAllowed(state) {
|
|
14069
|
-
let eventData;
|
|
14070
|
-
if (state.events) {
|
|
14071
|
-
const result = state.events.enter?.("MultiLineImplicitObjectLiteralAllowed", state);
|
|
14072
|
-
if (result) {
|
|
14073
|
-
if (result.cache)
|
|
14074
|
-
return result.cache;
|
|
14075
|
-
eventData = result.data;
|
|
14076
|
-
}
|
|
14077
|
-
}
|
|
14078
|
-
if (state.tokenize) {
|
|
14079
|
-
const result = $TOKEN("MultiLineImplicitObjectLiteralAllowed", state, MultiLineImplicitObjectLiteralAllowed$0(state));
|
|
14080
|
-
if (state.events)
|
|
14081
|
-
state.events.exit?.("MultiLineImplicitObjectLiteralAllowed", state, result, eventData);
|
|
14082
|
-
return result;
|
|
14083
|
-
} else {
|
|
14084
|
-
const result = MultiLineImplicitObjectLiteralAllowed$0(state);
|
|
14085
|
-
if (state.events)
|
|
14086
|
-
state.events.exit?.("MultiLineImplicitObjectLiteralAllowed", state, result, eventData);
|
|
14087
|
-
return result;
|
|
14088
|
-
}
|
|
14089
|
-
}
|
|
14090
13935
|
var AllowNewlineBinaryOp$0 = $TV($EXPECT($L0, fail, 'AllowNewlineBinaryOp ""'), function($skip, $loc, $0, $1) {
|
|
14091
13936
|
module.forbidNewlineBinaryOp.push(false);
|
|
14092
13937
|
});
|
|
@@ -14191,7 +14036,7 @@ ${input.slice(result.pos)}
|
|
|
14191
14036
|
return result;
|
|
14192
14037
|
}
|
|
14193
14038
|
}
|
|
14194
|
-
var AllowAll$0 = $S(AllowTrailingMemberProperty, AllowBracedApplication, AllowIndentedApplication,
|
|
14039
|
+
var AllowAll$0 = $S(AllowTrailingMemberProperty, AllowBracedApplication, AllowIndentedApplication, AllowClassImplicitCall, AllowNewlineBinaryOp);
|
|
14195
14040
|
function AllowAll(state) {
|
|
14196
14041
|
let eventData;
|
|
14197
14042
|
if (state.events) {
|
|
@@ -14214,7 +14059,7 @@ ${input.slice(result.pos)}
|
|
|
14214
14059
|
return result;
|
|
14215
14060
|
}
|
|
14216
14061
|
}
|
|
14217
|
-
var RestoreAll$0 = $S(RestoreTrailingMemberProperty, RestoreBracedApplication, RestoreIndentedApplication,
|
|
14062
|
+
var RestoreAll$0 = $S(RestoreTrailingMemberProperty, RestoreBracedApplication, RestoreIndentedApplication, RestoreClassImplicitCall, RestoreNewlineBinaryOp);
|
|
14218
14063
|
function RestoreAll(state) {
|
|
14219
14064
|
let eventData;
|
|
14220
14065
|
if (state.events) {
|
|
@@ -15182,26 +15027,23 @@ ${input.slice(result.pos)}
|
|
|
15182
15027
|
return result;
|
|
15183
15028
|
}
|
|
15184
15029
|
}
|
|
15185
|
-
var LexicalDeclaration$0 = $TS($S(LetOrConst, LexicalBinding, $Q($S(__, Comma, LexicalBinding))), function($skip, $loc, $0, $1, $2, $3) {
|
|
15186
|
-
var
|
|
15030
|
+
var LexicalDeclaration$0 = $TS($S(LetOrConst, LexicalBinding, $Q($S(__, Comma, __, LexicalBinding))), function($skip, $loc, $0, $1, $2, $3) {
|
|
15031
|
+
var decl = $1;
|
|
15187
15032
|
var binding = $2;
|
|
15188
15033
|
var tail = $3;
|
|
15189
|
-
const
|
|
15034
|
+
const bindings = [binding].concat(tail.map(([, , , b]) => b));
|
|
15190
15035
|
return {
|
|
15191
15036
|
type: "Declaration",
|
|
15192
15037
|
children: $0,
|
|
15193
|
-
names:
|
|
15194
|
-
|
|
15195
|
-
|
|
15196
|
-
|
|
15197
|
-
|
|
15198
|
-
initializer: binding.initializer,
|
|
15199
|
-
splices,
|
|
15200
|
-
thisAssignments
|
|
15038
|
+
names: bindings.flatMap((b) => b.names),
|
|
15039
|
+
bindings,
|
|
15040
|
+
decl,
|
|
15041
|
+
splices: bindings.flatMap((b) => b.splices),
|
|
15042
|
+
thisAssignments: bindings.flatMap((b) => b.thisAssignments)
|
|
15201
15043
|
};
|
|
15202
15044
|
});
|
|
15203
15045
|
var LexicalDeclaration$1 = $TS($S(InsertConst, $C(BindingPattern, BindingIdentifier), $E(TypeSuffix), __, ConstAssignment, ExtendedExpression), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
15204
|
-
return
|
|
15046
|
+
return processAssignmentDeclaration(...$0);
|
|
15205
15047
|
});
|
|
15206
15048
|
var LexicalDeclaration$2 = $TS($S(InsertLet, $C(BindingPattern, BindingIdentifier), $E(TypeSuffix), __, LetAssignment, ExtendedExpression), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
15207
15049
|
var l = $1;
|
|
@@ -15210,7 +15052,7 @@ ${input.slice(result.pos)}
|
|
|
15210
15052
|
var ws = $4;
|
|
15211
15053
|
var la = $5;
|
|
15212
15054
|
var e = $6;
|
|
15213
|
-
return
|
|
15055
|
+
return processAssignmentDeclaration(...$0);
|
|
15214
15056
|
});
|
|
15215
15057
|
function LexicalDeclaration(state) {
|
|
15216
15058
|
let eventData;
|
|
@@ -15284,48 +15126,32 @@ ${input.slice(result.pos)}
|
|
|
15284
15126
|
return result;
|
|
15285
15127
|
}
|
|
15286
15128
|
}
|
|
15287
|
-
var LexicalBinding$0 = $TS($S(BindingPattern, $E(TypeSuffix),
|
|
15288
|
-
var
|
|
15129
|
+
var LexicalBinding$0 = $TS($S(BindingPattern, $E(TypeSuffix), Initializer), function($skip, $loc, $0, $1, $2, $3) {
|
|
15130
|
+
var pattern = $1;
|
|
15289
15131
|
var suffix = $2;
|
|
15290
|
-
var
|
|
15291
|
-
|
|
15292
|
-
const bindingChildren = [...binding.children];
|
|
15293
|
-
if (suffix)
|
|
15294
|
-
bindingChildren.push(suffix);
|
|
15295
|
-
if (ws)
|
|
15296
|
-
bindingChildren.push(...ws);
|
|
15297
|
-
binding = {
|
|
15298
|
-
...binding,
|
|
15299
|
-
children: bindingChildren
|
|
15300
|
-
};
|
|
15301
|
-
const [splices, thisAssignments] = gatherBindingCode(binding.children);
|
|
15132
|
+
var initializer = $3;
|
|
15133
|
+
const [splices, thisAssignments] = gatherBindingCode(pattern);
|
|
15302
15134
|
return {
|
|
15303
|
-
|
|
15304
|
-
|
|
15305
|
-
|
|
15135
|
+
type: "Binding",
|
|
15136
|
+
children: $0,
|
|
15137
|
+
names: pattern.names,
|
|
15138
|
+
pattern,
|
|
15139
|
+
suffix,
|
|
15306
15140
|
initializer,
|
|
15307
15141
|
splices: splices.map((s) => [",", s]),
|
|
15308
15142
|
thisAssignments: thisAssignments.map((s) => ["", s, ";"])
|
|
15309
15143
|
};
|
|
15310
15144
|
});
|
|
15311
|
-
var LexicalBinding$1 = $TS($S(BindingIdentifier, $E(TypeSuffix), $E(
|
|
15312
|
-
var
|
|
15145
|
+
var LexicalBinding$1 = $TS($S(BindingIdentifier, $E(TypeSuffix), $E(Initializer)), function($skip, $loc, $0, $1, $2, $3) {
|
|
15146
|
+
var pattern = $1;
|
|
15313
15147
|
var suffix = $2;
|
|
15314
|
-
var
|
|
15315
|
-
var initializer = $4;
|
|
15316
|
-
const bindingChildren = [...binding.children];
|
|
15317
|
-
if (suffix)
|
|
15318
|
-
bindingChildren.push(suffix);
|
|
15319
|
-
if (ws)
|
|
15320
|
-
bindingChildren.push(...ws);
|
|
15321
|
-
binding = {
|
|
15322
|
-
...binding,
|
|
15323
|
-
children: bindingChildren
|
|
15324
|
-
};
|
|
15148
|
+
var initializer = $3;
|
|
15325
15149
|
return {
|
|
15326
|
-
|
|
15327
|
-
|
|
15328
|
-
|
|
15150
|
+
type: "Binding",
|
|
15151
|
+
children: $0,
|
|
15152
|
+
names: pattern.names,
|
|
15153
|
+
pattern,
|
|
15154
|
+
suffix,
|
|
15329
15155
|
initializer,
|
|
15330
15156
|
splices: [],
|
|
15331
15157
|
thisAssignments: []
|
|
@@ -15377,9 +15203,10 @@ ${input.slice(result.pos)}
|
|
|
15377
15203
|
}
|
|
15378
15204
|
}
|
|
15379
15205
|
var VariableStatement$0 = $TS($S(Var, __, VariableDeclarationList), function($skip, $loc, $0, $1, $2, $3) {
|
|
15380
|
-
return
|
|
15206
|
+
return {
|
|
15207
|
+
...$3,
|
|
15381
15208
|
children: [$1, ...$2, ...$3.children]
|
|
15382
|
-
}
|
|
15209
|
+
};
|
|
15383
15210
|
});
|
|
15384
15211
|
function VariableStatement(state) {
|
|
15385
15212
|
let eventData;
|
|
@@ -15403,18 +15230,15 @@ ${input.slice(result.pos)}
|
|
|
15403
15230
|
return result;
|
|
15404
15231
|
}
|
|
15405
15232
|
}
|
|
15406
|
-
var VariableDeclarationList$0 = $TS($S(
|
|
15407
|
-
|
|
15408
|
-
|
|
15409
|
-
|
|
15410
|
-
} else {
|
|
15411
|
-
children = [$1];
|
|
15412
|
-
}
|
|
15413
|
-
const names = children.flatMap((c) => c.names || []);
|
|
15233
|
+
var VariableDeclarationList$0 = $TS($S(LexicalBinding, $Q($S(__, Comma, __, LexicalBinding))), function($skip, $loc, $0, $1, $2) {
|
|
15234
|
+
var binding = $1;
|
|
15235
|
+
var tail = $2;
|
|
15236
|
+
const bindings = [binding].concat(tail.map(([, , , b]) => b));
|
|
15414
15237
|
return {
|
|
15415
15238
|
type: "Declaration",
|
|
15416
|
-
children,
|
|
15417
|
-
|
|
15239
|
+
children: [binding, ...tail],
|
|
15240
|
+
bindings,
|
|
15241
|
+
names: bindings.flatMap((b) => b.names)
|
|
15418
15242
|
};
|
|
15419
15243
|
});
|
|
15420
15244
|
function VariableDeclarationList(state) {
|
|
@@ -15439,49 +15263,6 @@ ${input.slice(result.pos)}
|
|
|
15439
15263
|
return result;
|
|
15440
15264
|
}
|
|
15441
15265
|
}
|
|
15442
|
-
var VariableDeclaration$0 = $TS($S(BindingPattern, $E(TypeSuffix), Initializer), function($skip, $loc, $0, $1, $2, $3) {
|
|
15443
|
-
const children = [...$1.children];
|
|
15444
|
-
if ($2)
|
|
15445
|
-
children.push($2);
|
|
15446
|
-
children.push($3);
|
|
15447
|
-
return {
|
|
15448
|
-
children,
|
|
15449
|
-
names: $1.names
|
|
15450
|
-
};
|
|
15451
|
-
});
|
|
15452
|
-
var VariableDeclaration$1 = $TS($S(BindingIdentifier, $E(TypeSuffix), $E(Initializer)), function($skip, $loc, $0, $1, $2, $3) {
|
|
15453
|
-
const children = [...$1.children];
|
|
15454
|
-
if ($2)
|
|
15455
|
-
children.push($2);
|
|
15456
|
-
if ($3)
|
|
15457
|
-
children.push($3);
|
|
15458
|
-
return {
|
|
15459
|
-
children,
|
|
15460
|
-
names: $1.names
|
|
15461
|
-
};
|
|
15462
|
-
});
|
|
15463
|
-
function VariableDeclaration(state) {
|
|
15464
|
-
let eventData;
|
|
15465
|
-
if (state.events) {
|
|
15466
|
-
const result = state.events.enter?.("VariableDeclaration", state);
|
|
15467
|
-
if (result) {
|
|
15468
|
-
if (result.cache)
|
|
15469
|
-
return result.cache;
|
|
15470
|
-
eventData = result.data;
|
|
15471
|
-
}
|
|
15472
|
-
}
|
|
15473
|
-
if (state.tokenize) {
|
|
15474
|
-
const result = $TOKEN("VariableDeclaration", state, VariableDeclaration$0(state) || VariableDeclaration$1(state));
|
|
15475
|
-
if (state.events)
|
|
15476
|
-
state.events.exit?.("VariableDeclaration", state, result, eventData);
|
|
15477
|
-
return result;
|
|
15478
|
-
} else {
|
|
15479
|
-
const result = VariableDeclaration$0(state) || VariableDeclaration$1(state);
|
|
15480
|
-
if (state.events)
|
|
15481
|
-
state.events.exit?.("VariableDeclaration", state, result, eventData);
|
|
15482
|
-
return result;
|
|
15483
|
-
}
|
|
15484
|
-
}
|
|
15485
15266
|
var NumericLiteral$0 = $TS($S(NumericLiteralKind), function($skip, $loc, $0, $1) {
|
|
15486
15267
|
return { type: "NumericLiteral", $loc, token: $1 };
|
|
15487
15268
|
});
|
|
@@ -16881,7 +16662,7 @@ ${input.slice(result.pos)}
|
|
|
16881
16662
|
}
|
|
16882
16663
|
}
|
|
16883
16664
|
var StatementDelimiter$0 = SemicolonDelimiter;
|
|
16884
|
-
var StatementDelimiter$1 = $S($Y($S(
|
|
16665
|
+
var StatementDelimiter$1 = $S($Y($S(Nested, $C($EXPECT($L4, fail, 'StatementDelimiter "("'), $EXPECT($L114, fail, 'StatementDelimiter "["'), $EXPECT($L115, fail, 'StatementDelimiter "`"'), $EXPECT($L59, fail, 'StatementDelimiter "+"'), $EXPECT($L20, fail, 'StatementDelimiter "-"'), $EXPECT($L55, fail, 'StatementDelimiter "*"'), $EXPECT($L56, fail, 'StatementDelimiter "/"'), ObjectLiteral, Arrow, FatArrow, $S(Function, $E($S($E(_), Star)), $E(_), $EXPECT($L4, fail, 'StatementDelimiter "("'))))), InsertSemicolon);
|
|
16885
16666
|
var StatementDelimiter$2 = $Y(EOS);
|
|
16886
16667
|
function StatementDelimiter(state) {
|
|
16887
16668
|
let eventData;
|
|
@@ -19102,7 +18883,7 @@ ${input.slice(result.pos)}
|
|
|
19102
18883
|
return result;
|
|
19103
18884
|
}
|
|
19104
18885
|
}
|
|
19105
|
-
var JSXImplicitFragment$0 = $TS($S(JSXTag, $Q($S(
|
|
18886
|
+
var JSXImplicitFragment$0 = $TS($S(JSXTag, $Q($S(Nested, JSXTag))), function($skip, $loc, $0, $1, $2) {
|
|
19106
18887
|
const jsx = $2.length === 0 ? $1 : {
|
|
19107
18888
|
type: "JSXFragment",
|
|
19108
18889
|
children: [
|
|
@@ -20622,7 +20403,7 @@ ${input.slice(result.pos)}
|
|
|
20622
20403
|
return result;
|
|
20623
20404
|
}
|
|
20624
20405
|
}
|
|
20625
|
-
var TypeDeclarationRest$0 = $S(TypeKeyword, $E(_), IdentifierName, $E(TypeParameters),
|
|
20406
|
+
var TypeDeclarationRest$0 = $S(TypeKeyword, $E(_), IdentifierName, $E(TypeParameters), OptionalEquals, $C($S($E(_), Type), $S(__, Type)));
|
|
20626
20407
|
var TypeDeclarationRest$1 = $S(Interface, $E(_), IdentifierName, $E(TypeParameters), $E(InterfaceExtendsClause), InterfaceBlock);
|
|
20627
20408
|
var TypeDeclarationRest$2 = $S(Namespace, $E(_), IdentifierName, ModuleBlock);
|
|
20628
20409
|
var TypeDeclarationRest$3 = FunctionSignature;
|
|
@@ -20648,6 +20429,32 @@ ${input.slice(result.pos)}
|
|
|
20648
20429
|
return result;
|
|
20649
20430
|
}
|
|
20650
20431
|
}
|
|
20432
|
+
var OptionalEquals$0 = $S(__, Equals);
|
|
20433
|
+
var OptionalEquals$1 = $T($S($Y(IndentedFurther), InsertSpaceEquals), function(value) {
|
|
20434
|
+
return value[1];
|
|
20435
|
+
});
|
|
20436
|
+
function OptionalEquals(state) {
|
|
20437
|
+
let eventData;
|
|
20438
|
+
if (state.events) {
|
|
20439
|
+
const result = state.events.enter?.("OptionalEquals", state);
|
|
20440
|
+
if (result) {
|
|
20441
|
+
if (result.cache)
|
|
20442
|
+
return result.cache;
|
|
20443
|
+
eventData = result.data;
|
|
20444
|
+
}
|
|
20445
|
+
}
|
|
20446
|
+
if (state.tokenize) {
|
|
20447
|
+
const result = $TOKEN("OptionalEquals", state, OptionalEquals$0(state) || OptionalEquals$1(state));
|
|
20448
|
+
if (state.events)
|
|
20449
|
+
state.events.exit?.("OptionalEquals", state, result, eventData);
|
|
20450
|
+
return result;
|
|
20451
|
+
} else {
|
|
20452
|
+
const result = OptionalEquals$0(state) || OptionalEquals$1(state);
|
|
20453
|
+
if (state.events)
|
|
20454
|
+
state.events.exit?.("OptionalEquals", state, result, eventData);
|
|
20455
|
+
return result;
|
|
20456
|
+
}
|
|
20457
|
+
}
|
|
20651
20458
|
var TypeLexicalDeclaration$0 = $S(__, LetOrConstOrVar, TypeDeclarationBinding, $Q($S(CommaDelimiter, __, TypeDeclarationBinding)));
|
|
20652
20459
|
var TypeLexicalDeclaration$1 = $S(__, EnumDeclaration);
|
|
20653
20460
|
var TypeLexicalDeclaration$2 = ClassSignature;
|
|
@@ -21242,9 +21049,9 @@ ${input.slice(result.pos)}
|
|
|
21242
21049
|
["let ", id, " = {};\n"],
|
|
21243
21050
|
...block.properties.map((property, i) => {
|
|
21244
21051
|
let init, isString;
|
|
21245
|
-
if (property.
|
|
21052
|
+
if (property.initializer) {
|
|
21246
21053
|
init = replaceNodes(
|
|
21247
|
-
deepCopy(property.
|
|
21054
|
+
deepCopy(property.initializer),
|
|
21248
21055
|
(n) => n.type === "Identifier" && names.has(n.name),
|
|
21249
21056
|
(n) => [id, '["', n.name, '"]']
|
|
21250
21057
|
);
|
|
@@ -21407,11 +21214,11 @@ ${input.slice(result.pos)}
|
|
|
21407
21214
|
}
|
|
21408
21215
|
var EnumProperty$0 = $TS($S(Identifier, $E($S(__, Equals, ExtendedExpression)), ObjectPropertyDelimiter), function($skip, $loc, $0, $1, $2, $3) {
|
|
21409
21216
|
var name = $1;
|
|
21410
|
-
var
|
|
21217
|
+
var initializer = $2;
|
|
21411
21218
|
return {
|
|
21412
21219
|
type: "EnumProperty",
|
|
21413
21220
|
name,
|
|
21414
|
-
|
|
21221
|
+
initializer,
|
|
21415
21222
|
children: $0
|
|
21416
21223
|
};
|
|
21417
21224
|
});
|
|
@@ -21795,10 +21602,10 @@ ${input.slice(result.pos)}
|
|
|
21795
21602
|
return result;
|
|
21796
21603
|
}
|
|
21797
21604
|
}
|
|
21798
|
-
var TypePrimary$0 =
|
|
21799
|
-
var TypePrimary$1 =
|
|
21800
|
-
var TypePrimary$2 = $S($E(_),
|
|
21801
|
-
var TypePrimary$3 = $S($E(_),
|
|
21605
|
+
var TypePrimary$0 = $S($E(_), TypeTuple);
|
|
21606
|
+
var TypePrimary$1 = InterfaceBlock;
|
|
21607
|
+
var TypePrimary$2 = $S($E(_), FunctionType);
|
|
21608
|
+
var TypePrimary$3 = $S($E(_), InlineInterfaceLiteral);
|
|
21802
21609
|
var TypePrimary$4 = $S($E(_), ImportType);
|
|
21803
21610
|
var TypePrimary$5 = $TS($S($E(_), TypeLiteral), function($skip, $loc, $0, $1, $2) {
|
|
21804
21611
|
var t = $2;
|
|
@@ -21911,25 +21718,34 @@ ${input.slice(result.pos)}
|
|
|
21911
21718
|
return result;
|
|
21912
21719
|
}
|
|
21913
21720
|
}
|
|
21914
|
-
var TypeElement$0 = $TS($S(__, IdentifierName, $E(_), DotDotDot, $S(__, $E($S(QuestionMark, $E(_))), Colon, __), Type), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
21721
|
+
var TypeElement$0 = $TS($S(__, $E($S(DotDotDot, __)), IdentifierName, $E($S($E(_), DotDotDot)), $S(__, $E($S(QuestionMark, $E(_))), Colon, __), Type), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
21915
21722
|
var ws = $1;
|
|
21916
|
-
var
|
|
21917
|
-
var
|
|
21918
|
-
var
|
|
21723
|
+
var dots1 = $2;
|
|
21724
|
+
var name = $3;
|
|
21725
|
+
var dots2 = $4;
|
|
21919
21726
|
var colon = $5;
|
|
21920
21727
|
var type = $6;
|
|
21921
|
-
|
|
21728
|
+
let dots = dots1 || dots2 && [dots2[1], dots2[0]];
|
|
21729
|
+
if (dots1 && dots2) {
|
|
21730
|
+
dots = [dots, {
|
|
21731
|
+
type: "Error",
|
|
21732
|
+
message: "... both before and after identifier"
|
|
21733
|
+
}];
|
|
21734
|
+
}
|
|
21735
|
+
return [ws, dots, name, colon, type];
|
|
21922
21736
|
});
|
|
21923
|
-
var TypeElement$1 = $
|
|
21737
|
+
var TypeElement$1 = $S(__, DotDotDot, __, Type);
|
|
21738
|
+
var TypeElement$2 = $TS($S(Type, $E($S($E(_), DotDotDot))), function($skip, $loc, $0, $1, $2) {
|
|
21924
21739
|
var type = $1;
|
|
21925
|
-
var
|
|
21926
|
-
|
|
21740
|
+
var spaceDots = $2;
|
|
21741
|
+
if (!spaceDots)
|
|
21742
|
+
return type;
|
|
21743
|
+
const [space, dots] = spaceDots;
|
|
21927
21744
|
const ws = getTrimmingSpace(type);
|
|
21928
21745
|
if (!ws)
|
|
21929
21746
|
return [dots, space, type];
|
|
21930
21747
|
return [ws, dots, space, insertTrimmingSpace(type, "")];
|
|
21931
21748
|
});
|
|
21932
|
-
var TypeElement$2 = $S($E($S(__, DotDotDot)), $E($S(__, IdentifierName, __, $E($S(QuestionMark, $E(_))), Colon, __)), Type);
|
|
21933
21749
|
function TypeElement(state) {
|
|
21934
21750
|
let eventData;
|
|
21935
21751
|
if (state.events) {
|
|
@@ -23032,6 +22848,31 @@ ${input.slice(result.pos)}
|
|
|
23032
22848
|
return result;
|
|
23033
22849
|
}
|
|
23034
22850
|
}
|
|
22851
|
+
var InsertSpaceEquals$0 = $TV($EXPECT($L0, fail, 'InsertSpaceEquals ""'), function($skip, $loc, $0, $1) {
|
|
22852
|
+
return { $loc, token: " =" };
|
|
22853
|
+
});
|
|
22854
|
+
function InsertSpaceEquals(state) {
|
|
22855
|
+
let eventData;
|
|
22856
|
+
if (state.events) {
|
|
22857
|
+
const result = state.events.enter?.("InsertSpaceEquals", state);
|
|
22858
|
+
if (result) {
|
|
22859
|
+
if (result.cache)
|
|
22860
|
+
return result.cache;
|
|
22861
|
+
eventData = result.data;
|
|
22862
|
+
}
|
|
22863
|
+
}
|
|
22864
|
+
if (state.tokenize) {
|
|
22865
|
+
const result = $TOKEN("InsertSpaceEquals", state, InsertSpaceEquals$0(state));
|
|
22866
|
+
if (state.events)
|
|
22867
|
+
state.events.exit?.("InsertSpaceEquals", state, result, eventData);
|
|
22868
|
+
return result;
|
|
22869
|
+
} else {
|
|
22870
|
+
const result = InsertSpaceEquals$0(state);
|
|
22871
|
+
if (state.events)
|
|
22872
|
+
state.events.exit?.("InsertSpaceEquals", state, result, eventData);
|
|
22873
|
+
return result;
|
|
22874
|
+
}
|
|
22875
|
+
}
|
|
23035
22876
|
var InsertConst$0 = $TV($EXPECT($L0, fail, 'InsertConst ""'), function($skip, $loc, $0, $1) {
|
|
23036
22877
|
return { $loc, token: "const " };
|
|
23037
22878
|
});
|
|
@@ -23644,7 +23485,6 @@ ${input.slice(result.pos)}
|
|
|
23644
23485
|
module.forbidIndentedApplication = [false];
|
|
23645
23486
|
module.forbidBracedApplication = [false];
|
|
23646
23487
|
module.forbidTrailingMemberProperty = [false];
|
|
23647
|
-
module.forbidMultiLineImplicitObjectLiteral = [false];
|
|
23648
23488
|
module.forbidNewlineBinaryOp = [false];
|
|
23649
23489
|
module.JSXTagStack = [];
|
|
23650
23490
|
module.operators = /* @__PURE__ */ new Set();
|
|
@@ -23681,12 +23521,6 @@ ${input.slice(result.pos)}
|
|
|
23681
23521
|
return s[s.length - 1];
|
|
23682
23522
|
}
|
|
23683
23523
|
},
|
|
23684
|
-
multiLineImplicitObjectLiteralForbidden: {
|
|
23685
|
-
get() {
|
|
23686
|
-
const { forbidMultiLineImplicitObjectLiteral: s } = module;
|
|
23687
|
-
return s[s.length - 1];
|
|
23688
|
-
}
|
|
23689
|
-
},
|
|
23690
23524
|
newlineBinaryOpForbidden: {
|
|
23691
23525
|
get() {
|
|
23692
23526
|
const { forbidNewlineBinaryOp: s } = module;
|
|
@@ -23989,19 +23823,11 @@ ${input.slice(result.pos)}
|
|
|
23989
23823
|
return result;
|
|
23990
23824
|
}
|
|
23991
23825
|
}
|
|
23992
|
-
var
|
|
23993
|
-
|
|
23994
|
-
const { level } = indent;
|
|
23995
|
-
const currentIndentLevel = module.currentIndent.level;
|
|
23996
|
-
if (level === currentIndentLevel) {
|
|
23997
|
-
return $0;
|
|
23998
|
-
}
|
|
23999
|
-
return $skip;
|
|
24000
|
-
});
|
|
24001
|
-
function Samedent(state) {
|
|
23826
|
+
var PushIndent$0 = $Y($S(EOS, TrackIndented));
|
|
23827
|
+
function PushIndent(state) {
|
|
24002
23828
|
let eventData;
|
|
24003
23829
|
if (state.events) {
|
|
24004
|
-
const result = state.events.enter?.("
|
|
23830
|
+
const result = state.events.enter?.("PushIndent", state);
|
|
24005
23831
|
if (result) {
|
|
24006
23832
|
if (result.cache)
|
|
24007
23833
|
return result.cache;
|
|
@@ -24009,30 +23835,27 @@ ${input.slice(result.pos)}
|
|
|
24009
23835
|
}
|
|
24010
23836
|
}
|
|
24011
23837
|
if (state.tokenize) {
|
|
24012
|
-
const result = $TOKEN("
|
|
23838
|
+
const result = $TOKEN("PushIndent", state, PushIndent$0(state));
|
|
24013
23839
|
if (state.events)
|
|
24014
|
-
state.events.exit?.("
|
|
23840
|
+
state.events.exit?.("PushIndent", state, result, eventData);
|
|
24015
23841
|
return result;
|
|
24016
23842
|
} else {
|
|
24017
|
-
const result =
|
|
23843
|
+
const result = PushIndent$0(state);
|
|
24018
23844
|
if (state.events)
|
|
24019
|
-
state.events.exit?.("
|
|
23845
|
+
state.events.exit?.("PushIndent", state, result, eventData);
|
|
24020
23846
|
return result;
|
|
24021
23847
|
}
|
|
24022
23848
|
}
|
|
24023
|
-
var
|
|
24024
|
-
|
|
24025
|
-
|
|
24026
|
-
const currentIndentLevel = module.currentIndent.level;
|
|
24027
|
-
if (level > currentIndentLevel) {
|
|
24028
|
-
return $0;
|
|
23849
|
+
var PopIndent$0 = $TV($EXPECT($L0, fail, 'PopIndent ""'), function($skip, $loc, $0, $1) {
|
|
23850
|
+
if (module.config.verbose) {
|
|
23851
|
+
console.log("popping indent", module.indentLevels[module.indentLevels.length - 1], "->", module.indentLevels[module.indentLevels.length - 2]);
|
|
24029
23852
|
}
|
|
24030
|
-
|
|
23853
|
+
module.indentLevels.pop();
|
|
24031
23854
|
});
|
|
24032
|
-
function
|
|
23855
|
+
function PopIndent(state) {
|
|
24033
23856
|
let eventData;
|
|
24034
23857
|
if (state.events) {
|
|
24035
|
-
const result = state.events.enter?.("
|
|
23858
|
+
const result = state.events.enter?.("PopIndent", state);
|
|
24036
23859
|
if (result) {
|
|
24037
23860
|
if (result.cache)
|
|
24038
23861
|
return result.cache;
|
|
@@ -24040,29 +23863,30 @@ ${input.slice(result.pos)}
|
|
|
24040
23863
|
}
|
|
24041
23864
|
}
|
|
24042
23865
|
if (state.tokenize) {
|
|
24043
|
-
const result = $TOKEN("
|
|
23866
|
+
const result = $TOKEN("PopIndent", state, PopIndent$0(state));
|
|
24044
23867
|
if (state.events)
|
|
24045
|
-
state.events.exit?.("
|
|
23868
|
+
state.events.exit?.("PopIndent", state, result, eventData);
|
|
24046
23869
|
return result;
|
|
24047
23870
|
} else {
|
|
24048
|
-
const result =
|
|
23871
|
+
const result = PopIndent$0(state);
|
|
24049
23872
|
if (state.events)
|
|
24050
|
-
state.events.exit?.("
|
|
23873
|
+
state.events.exit?.("PopIndent", state, result, eventData);
|
|
24051
23874
|
return result;
|
|
24052
23875
|
}
|
|
24053
23876
|
}
|
|
24054
|
-
var
|
|
24055
|
-
|
|
24056
|
-
if (
|
|
24057
|
-
|
|
24058
|
-
if (
|
|
24059
|
-
|
|
24060
|
-
|
|
23877
|
+
var Nested$0 = $TS($S(EOS, Indent), function($skip, $loc, $0, $1, $2) {
|
|
23878
|
+
var indent = $2;
|
|
23879
|
+
if (indent.level === module.currentIndent.level)
|
|
23880
|
+
return $0;
|
|
23881
|
+
if (module.config.verbose) {
|
|
23882
|
+
console.log(`failing Nested: ${indent.level} does not match current indent level ${module.currentIndent.level}`);
|
|
23883
|
+
}
|
|
23884
|
+
return $skip;
|
|
24061
23885
|
});
|
|
24062
|
-
function
|
|
23886
|
+
function Nested(state) {
|
|
24063
23887
|
let eventData;
|
|
24064
23888
|
if (state.events) {
|
|
24065
|
-
const result = state.events.enter?.("
|
|
23889
|
+
const result = state.events.enter?.("Nested", state);
|
|
24066
23890
|
if (result) {
|
|
24067
23891
|
if (result.cache)
|
|
24068
23892
|
return result.cache;
|
|
@@ -24070,24 +23894,27 @@ ${input.slice(result.pos)}
|
|
|
24070
23894
|
}
|
|
24071
23895
|
}
|
|
24072
23896
|
if (state.tokenize) {
|
|
24073
|
-
const result = $TOKEN("
|
|
23897
|
+
const result = $TOKEN("Nested", state, Nested$0(state));
|
|
24074
23898
|
if (state.events)
|
|
24075
|
-
state.events.exit?.("
|
|
23899
|
+
state.events.exit?.("Nested", state, result, eventData);
|
|
24076
23900
|
return result;
|
|
24077
23901
|
} else {
|
|
24078
|
-
const result =
|
|
23902
|
+
const result = Nested$0(state);
|
|
24079
23903
|
if (state.events)
|
|
24080
|
-
state.events.exit?.("
|
|
23904
|
+
state.events.exit?.("Nested", state, result, eventData);
|
|
24081
23905
|
return result;
|
|
24082
23906
|
}
|
|
24083
23907
|
}
|
|
24084
|
-
var
|
|
24085
|
-
|
|
23908
|
+
var IndentedFurther$0 = $TS($S(EOS, Indent), function($skip, $loc, $0, $1, $2) {
|
|
23909
|
+
var indent = $2;
|
|
23910
|
+
if (indent.level > module.currentIndent.level)
|
|
23911
|
+
return $0;
|
|
23912
|
+
return $skip;
|
|
24086
23913
|
});
|
|
24087
|
-
function
|
|
23914
|
+
function IndentedFurther(state) {
|
|
24088
23915
|
let eventData;
|
|
24089
23916
|
if (state.events) {
|
|
24090
|
-
const result = state.events.enter?.("
|
|
23917
|
+
const result = state.events.enter?.("IndentedFurther", state);
|
|
24091
23918
|
if (result) {
|
|
24092
23919
|
if (result.cache)
|
|
24093
23920
|
return result.cache;
|
|
@@ -24095,22 +23922,27 @@ ${input.slice(result.pos)}
|
|
|
24095
23922
|
}
|
|
24096
23923
|
}
|
|
24097
23924
|
if (state.tokenize) {
|
|
24098
|
-
const result = $TOKEN("
|
|
23925
|
+
const result = $TOKEN("IndentedFurther", state, IndentedFurther$0(state));
|
|
24099
23926
|
if (state.events)
|
|
24100
|
-
state.events.exit?.("
|
|
23927
|
+
state.events.exit?.("IndentedFurther", state, result, eventData);
|
|
24101
23928
|
return result;
|
|
24102
23929
|
} else {
|
|
24103
|
-
const result =
|
|
23930
|
+
const result = IndentedFurther$0(state);
|
|
24104
23931
|
if (state.events)
|
|
24105
|
-
state.events.exit?.("
|
|
23932
|
+
state.events.exit?.("IndentedFurther", state, result, eventData);
|
|
24106
23933
|
return result;
|
|
24107
23934
|
}
|
|
24108
23935
|
}
|
|
24109
|
-
var
|
|
24110
|
-
|
|
23936
|
+
var IndentedAtLeast$0 = $TS($S(EOS, Indent), function($skip, $loc, $0, $1, $2) {
|
|
23937
|
+
var indent = $2;
|
|
23938
|
+
if (indent.level >= module.currentIndent.level)
|
|
23939
|
+
return $0;
|
|
23940
|
+
return $skip;
|
|
23941
|
+
});
|
|
23942
|
+
function IndentedAtLeast(state) {
|
|
24111
23943
|
let eventData;
|
|
24112
23944
|
if (state.events) {
|
|
24113
|
-
const result = state.events.enter?.("
|
|
23945
|
+
const result = state.events.enter?.("IndentedAtLeast", state);
|
|
24114
23946
|
if (result) {
|
|
24115
23947
|
if (result.cache)
|
|
24116
23948
|
return result.cache;
|
|
@@ -24118,27 +23950,29 @@ ${input.slice(result.pos)}
|
|
|
24118
23950
|
}
|
|
24119
23951
|
}
|
|
24120
23952
|
if (state.tokenize) {
|
|
24121
|
-
const result = $TOKEN("
|
|
23953
|
+
const result = $TOKEN("IndentedAtLeast", state, IndentedAtLeast$0(state));
|
|
24122
23954
|
if (state.events)
|
|
24123
|
-
state.events.exit?.("
|
|
23955
|
+
state.events.exit?.("IndentedAtLeast", state, result, eventData);
|
|
24124
23956
|
return result;
|
|
24125
23957
|
} else {
|
|
24126
|
-
const result =
|
|
23958
|
+
const result = IndentedAtLeast$0(state);
|
|
24127
23959
|
if (state.events)
|
|
24128
|
-
state.events.exit?.("
|
|
23960
|
+
state.events.exit?.("IndentedAtLeast", state, result, eventData);
|
|
24129
23961
|
return result;
|
|
24130
23962
|
}
|
|
24131
23963
|
}
|
|
24132
|
-
var
|
|
24133
|
-
|
|
24134
|
-
|
|
24135
|
-
|
|
24136
|
-
|
|
23964
|
+
var NotDedented$0 = $TS($S($E(IndentedAtLeast), $E(_)), function($skip, $loc, $0, $1, $2) {
|
|
23965
|
+
const ws = [];
|
|
23966
|
+
if ($1)
|
|
23967
|
+
ws.push(...$1);
|
|
23968
|
+
if ($2)
|
|
23969
|
+
ws.push(...$2);
|
|
23970
|
+
return ws.flat(Infinity).filter(Boolean);
|
|
24137
23971
|
});
|
|
24138
|
-
function
|
|
23972
|
+
function NotDedented(state) {
|
|
24139
23973
|
let eventData;
|
|
24140
23974
|
if (state.events) {
|
|
24141
|
-
const result = state.events.enter?.("
|
|
23975
|
+
const result = state.events.enter?.("NotDedented", state);
|
|
24142
23976
|
if (result) {
|
|
24143
23977
|
if (result.cache)
|
|
24144
23978
|
return result.cache;
|
|
@@ -24146,37 +23980,24 @@ ${input.slice(result.pos)}
|
|
|
24146
23980
|
}
|
|
24147
23981
|
}
|
|
24148
23982
|
if (state.tokenize) {
|
|
24149
|
-
const result = $TOKEN("
|
|
23983
|
+
const result = $TOKEN("NotDedented", state, NotDedented$0(state));
|
|
24150
23984
|
if (state.events)
|
|
24151
|
-
state.events.exit?.("
|
|
23985
|
+
state.events.exit?.("NotDedented", state, result, eventData);
|
|
24152
23986
|
return result;
|
|
24153
23987
|
} else {
|
|
24154
|
-
const result =
|
|
23988
|
+
const result = NotDedented$0(state);
|
|
24155
23989
|
if (state.events)
|
|
24156
|
-
state.events.exit?.("
|
|
23990
|
+
state.events.exit?.("NotDedented", state, result, eventData);
|
|
24157
23991
|
return result;
|
|
24158
23992
|
}
|
|
24159
23993
|
}
|
|
24160
|
-
var
|
|
24161
|
-
|
|
24162
|
-
var indent = $2;
|
|
24163
|
-
const { level } = indent;
|
|
24164
|
-
const currentIndent = module.currentIndent;
|
|
24165
|
-
if (module.config.verbose) {
|
|
24166
|
-
console.log("Indented", level, currentIndent);
|
|
24167
|
-
}
|
|
24168
|
-
if (level !== currentIndent.level) {
|
|
24169
|
-
if (module.config.verbose) {
|
|
24170
|
-
console.log("skipped nested");
|
|
24171
|
-
}
|
|
24172
|
-
return $skip;
|
|
24173
|
-
}
|
|
24174
|
-
return $0;
|
|
23994
|
+
var Dedented$0 = $T($S($N(IndentedAtLeast), EOS), function(value) {
|
|
23995
|
+
return value[1];
|
|
24175
23996
|
});
|
|
24176
|
-
function
|
|
23997
|
+
function Dedented(state) {
|
|
24177
23998
|
let eventData;
|
|
24178
23999
|
if (state.events) {
|
|
24179
|
-
const result = state.events.enter?.("
|
|
24000
|
+
const result = state.events.enter?.("Dedented", state);
|
|
24180
24001
|
if (result) {
|
|
24181
24002
|
if (result.cache)
|
|
24182
24003
|
return result.cache;
|
|
@@ -24184,14 +24005,14 @@ ${input.slice(result.pos)}
|
|
|
24184
24005
|
}
|
|
24185
24006
|
}
|
|
24186
24007
|
if (state.tokenize) {
|
|
24187
|
-
const result = $TOKEN("
|
|
24008
|
+
const result = $TOKEN("Dedented", state, Dedented$0(state));
|
|
24188
24009
|
if (state.events)
|
|
24189
|
-
state.events.exit?.("
|
|
24010
|
+
state.events.exit?.("Dedented", state, result, eventData);
|
|
24190
24011
|
return result;
|
|
24191
24012
|
} else {
|
|
24192
|
-
const result =
|
|
24013
|
+
const result = Dedented$0(state);
|
|
24193
24014
|
if (state.events)
|
|
24194
|
-
state.events.exit?.("
|
|
24015
|
+
state.events.exit?.("Dedented", state, result, eventData);
|
|
24195
24016
|
return result;
|
|
24196
24017
|
}
|
|
24197
24018
|
}
|
|
@@ -24224,8 +24045,7 @@ ${input.slice(result.pos)}
|
|
|
24224
24045
|
processBinaryOpExpression,
|
|
24225
24046
|
processCallMemberExpression,
|
|
24226
24047
|
processCoffeeInterpolation,
|
|
24227
|
-
|
|
24228
|
-
processLetAssignmentDeclaration,
|
|
24048
|
+
processAssignmentDeclaration,
|
|
24229
24049
|
processProgram,
|
|
24230
24050
|
processUnaryExpression,
|
|
24231
24051
|
quoteString,
|
|
@@ -24660,7 +24480,7 @@ var parse;
|
|
|
24660
24480
|
var uncacheable;
|
|
24661
24481
|
({ parse } = import_parser.default);
|
|
24662
24482
|
({ SourceMap: SourceMap2 } = util_exports);
|
|
24663
|
-
uncacheable = /* @__PURE__ */ new Set(["ActualAssignment", "AllowAll", "AllowClassImplicitCall", "AllowBracedApplication", "AllowIndentedApplication", "AllowMultiLineImplicitObjectLiteral", "AllowNewlineBinaryOp", "AllowTrailingMemberProperty", "AllowedTrailingMemberExpressions", "ApplicationStart", "Arguments", "ArgumentsWithTrailingMemberExpressions", "ArrowFunction", "ArrowFunctionTail", "AssignmentExpression", "AssignmentExpressionTail", "BinaryOpExpression", "BinaryOpRHS", "BracedApplicationAllowed", "BracedBlock", "BracedObjectLiteralContent", "BracedOrEmptyBlock", "CallExpression", "CallExpressionRest", "ClassImplicitCallForbidden", "CoffeeCommentEnabled", "CommaDelimiter", "ConditionalExpression", "ConditionFragment", "Declaration", "Debugger", "Dedented", "ElementListWithIndentedApplicationForbidden", "ElseClause", "Expression", "ExpressionStatement", "ExpressionWithIndentedApplicationForbidden", "ExpressionWithObjectApplicationForbidden", "ExtendedExpression", "FatArrowBody", "ForbidClassImplicitCall", "ForbidBracedApplication", "ForbidIndentedApplication", "ForbidMultiLineImplicitObjectLiteral", "ForbidNewlineBinaryOp", "ForbidTrailingMemberProperty", "FunctionDeclaration", "FunctionExpression", "HoistableDeclaration", "ImplicitArguments", "ImplicitInlineObjectPropertyDelimiter", "ImplicitNestedBlock", "IndentedApplicationAllowed", "IndentedFurther", "IndentedJSXChildExpression", "InlineObjectLiteral", "InsertIndent", "JSXChild", "JSXChildren", "JSXElement", "JSXFragment", "JSXImplicitFragment", "JSXMixedChildren", "JSXNested", "JSXNestedChildren", "JSXOptionalClosingElement", "JSXOptionalClosingFragment", "JSXTag", "LeftHandSideExpression", "MemberExpression", "MemberExpressionRest", "Nested", "NestedBindingElement", "NestedBindingElements", "NestedBlockExpression", "NestedBlockExpression", "NestedBlockStatement", "NestedBlockStatements", "NestedClassSignatureElement", "NestedClassSignatureElements", "NestedDeclareElement", "NestedDeclareElements", "NestedElement", "NestedElementList", "NestedImplicitObjectLiteral", "NestedImplicitPropertyDefinition", "NestedImplicitPropertyDefinitions", "NestedInterfaceProperty", "NestedJSXChildExpression", "NestedModuleItem", "NestedModuleItems", "NestedNonAssignmentExtendedExpression", "NestedObject", "NestedPropertyDefinitions", "NewlineBinaryOpAllowed", "NonPipelineAssignmentExpression", "NonPipelineExtendedExpression", "NonPipelinePostfixedExpression", "NonSingleBracedBlock", "NotDedented", "ObjectLiteral", "PatternExpressionList", "PopIndent", "PopJSXStack", "PostfixedExpression", "PostfixedStatement", "PrimaryExpression", "PushIndent", "PushJSXOpeningElement", "PushJSXOpeningFragment", "RestoreAll", "RestoreClassImplicitCall", "RestoreMultiLineImplicitObjectLiteral", "RestoreBracedApplication", "RestoreIndentedApplication", "RestoreTrailingMemberProperty", "RestoreNewlineBinaryOp", "RHS", "
|
|
24483
|
+
uncacheable = /* @__PURE__ */ new Set(["ActualAssignment", "AllowAll", "AllowClassImplicitCall", "AllowBracedApplication", "AllowIndentedApplication", "AllowMultiLineImplicitObjectLiteral", "AllowNewlineBinaryOp", "AllowTrailingMemberProperty", "AllowedTrailingMemberExpressions", "ApplicationStart", "Arguments", "ArgumentsWithTrailingMemberExpressions", "ArrowFunction", "ArrowFunctionTail", "AssignmentExpression", "AssignmentExpressionTail", "BinaryOpExpression", "BinaryOpRHS", "BracedApplicationAllowed", "BracedBlock", "BracedObjectLiteralContent", "BracedOrEmptyBlock", "CallExpression", "CallExpressionRest", "ClassImplicitCallForbidden", "CoffeeCommentEnabled", "CommaDelimiter", "ConditionalExpression", "ConditionFragment", "Declaration", "Debugger", "Dedented", "ElementListWithIndentedApplicationForbidden", "ElseClause", "Expression", "ExpressionStatement", "ExpressionWithIndentedApplicationForbidden", "ExpressionWithObjectApplicationForbidden", "ExtendedExpression", "FatArrowBody", "ForbidClassImplicitCall", "ForbidBracedApplication", "ForbidIndentedApplication", "ForbidMultiLineImplicitObjectLiteral", "ForbidNewlineBinaryOp", "ForbidTrailingMemberProperty", "FunctionDeclaration", "FunctionExpression", "HoistableDeclaration", "ImplicitArguments", "ImplicitInlineObjectPropertyDelimiter", "ImplicitNestedBlock", "IndentedApplicationAllowed", "IndentedAtLeast", "IndentedFurther", "IndentedJSXChildExpression", "InlineObjectLiteral", "InsertIndent", "JSXChild", "JSXChildren", "JSXElement", "JSXFragment", "JSXImplicitFragment", "JSXMixedChildren", "JSXNested", "JSXNestedChildren", "JSXOptionalClosingElement", "JSXOptionalClosingFragment", "JSXTag", "LeftHandSideExpression", "MemberExpression", "MemberExpressionRest", "Nested", "NestedBindingElement", "NestedBindingElements", "NestedBlockExpression", "NestedBlockExpression", "NestedBlockStatement", "NestedBlockStatements", "NestedClassSignatureElement", "NestedClassSignatureElements", "NestedDeclareElement", "NestedDeclareElements", "NestedElement", "NestedElementList", "NestedImplicitObjectLiteral", "NestedImplicitPropertyDefinition", "NestedImplicitPropertyDefinitions", "NestedInterfaceProperty", "NestedJSXChildExpression", "NestedModuleItem", "NestedModuleItems", "NestedNonAssignmentExtendedExpression", "NestedObject", "NestedPropertyDefinitions", "NewlineBinaryOpAllowed", "NonPipelineArgumentPart", "NonPipelineArgumentList", "NonPipelineAssignmentExpression", "NonPipelineExtendedExpression", "NonPipelinePostfixedExpression", "NonSingleBracedBlock", "NotDedented", "ObjectLiteral", "PatternExpressionList", "PopIndent", "PopJSXStack", "PostfixedExpression", "PostfixedStatement", "PrimaryExpression", "PushIndent", "PushJSXOpeningElement", "PushJSXOpeningFragment", "RestoreAll", "RestoreClassImplicitCall", "RestoreMultiLineImplicitObjectLiteral", "RestoreBracedApplication", "RestoreIndentedApplication", "RestoreTrailingMemberProperty", "RestoreNewlineBinaryOp", "RHS", "ShortCircuitExpression", "SingleLineAssignmentExpression", "SingleLineBinaryOpRHS", "SingleLineComment", "SingleLineStatements", "SnugNamedProperty", "Statement", "StatementListItem", "SuffixedExpression", "SuffixedStatement", "ThinArrowFunction", "TrackIndented", "TrailingMemberExpressions", "TrailingMemberPropertyAllowed", "TypedJSXElement", "TypedJSXFragment", "UnaryExpression", "UpdateExpression"]);
|
|
24664
24484
|
var compile = function(src, options) {
|
|
24665
24485
|
var ast, code, events, filename, ref, result, sm;
|
|
24666
24486
|
if (!options) {
|