@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/browser.js
CHANGED
|
@@ -157,15 +157,8 @@ var Civet = (() => {
|
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
function arrayElementHasTrailingComma(elementNode) {
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
if (lastChild) {
|
|
163
|
-
const l2 = lastChild.length;
|
|
164
|
-
if (lastChild[l2 - 1]?.token === ",") {
|
|
165
|
-
return true;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
return false;
|
|
160
|
+
const lastChild = elementNode.children.at(-1);
|
|
161
|
+
return lastChild && lastChild[lastChild.length - 1]?.token === ",";
|
|
169
162
|
}
|
|
170
163
|
var assert = {
|
|
171
164
|
equal(a, b, msg) {
|
|
@@ -592,7 +585,15 @@ var Civet = (() => {
|
|
|
592
585
|
case "EmptyStatement":
|
|
593
586
|
case "ReturnStatement":
|
|
594
587
|
case "ThrowStatement":
|
|
588
|
+
return;
|
|
595
589
|
case "Declaration":
|
|
590
|
+
exp.children.push(["", [
|
|
591
|
+
";",
|
|
592
|
+
ref,
|
|
593
|
+
".push(",
|
|
594
|
+
patternAsValue(exp.bindings.at(-1).pattern),
|
|
595
|
+
")"
|
|
596
|
+
]]);
|
|
596
597
|
return;
|
|
597
598
|
case "ForStatement":
|
|
598
599
|
case "IterationStatement":
|
|
@@ -845,6 +846,39 @@ var Civet = (() => {
|
|
|
845
846
|
const indent = expressions[index][0];
|
|
846
847
|
expressions.splice(index, 0, [indent, dec, ";"]);
|
|
847
848
|
}
|
|
849
|
+
function patternAsValue(pattern) {
|
|
850
|
+
switch (pattern.type) {
|
|
851
|
+
case "ArrayBindingPattern": {
|
|
852
|
+
const children = [...pattern.children];
|
|
853
|
+
const index = children.indexOf(pattern.elements);
|
|
854
|
+
if (index < 0)
|
|
855
|
+
throw new Error("failed to find elements in ArrayBindingPattern");
|
|
856
|
+
children[index] = pattern.elements.map((el) => {
|
|
857
|
+
const [ws, e, delim] = el.children;
|
|
858
|
+
return { ...el, children: [ws, patternAsValue(e), delim] };
|
|
859
|
+
});
|
|
860
|
+
return { ...pattern, children };
|
|
861
|
+
}
|
|
862
|
+
case "ObjectBindingPattern": {
|
|
863
|
+
const children = [...pattern.children];
|
|
864
|
+
const index = children.indexOf(pattern.properties);
|
|
865
|
+
if (index < 0)
|
|
866
|
+
throw new Error("failed to find properties in ArrayBindingPattern");
|
|
867
|
+
children[index] = pattern.properties.map(patternAsValue);
|
|
868
|
+
return { ...pattern, children };
|
|
869
|
+
}
|
|
870
|
+
case "Identifier":
|
|
871
|
+
case "BindingProperty": {
|
|
872
|
+
const children = [pattern.name, pattern.delim];
|
|
873
|
+
if (isWhitespaceOrEmpty(pattern.children[0])) {
|
|
874
|
+
children.unshift(pattern.children[0]);
|
|
875
|
+
}
|
|
876
|
+
return { ...pattern, children };
|
|
877
|
+
}
|
|
878
|
+
default:
|
|
879
|
+
return pattern;
|
|
880
|
+
}
|
|
881
|
+
}
|
|
848
882
|
function insertReturn(node) {
|
|
849
883
|
if (!node)
|
|
850
884
|
return;
|
|
@@ -886,7 +920,12 @@ var Civet = (() => {
|
|
|
886
920
|
case "EmptyStatement":
|
|
887
921
|
case "ReturnStatement":
|
|
888
922
|
case "ThrowStatement":
|
|
923
|
+
return;
|
|
889
924
|
case "Declaration":
|
|
925
|
+
exp.children.push(["", {
|
|
926
|
+
type: "ReturnStatement",
|
|
927
|
+
children: [";return ", patternAsValue(exp.bindings.at(-1).pattern)]
|
|
928
|
+
}]);
|
|
890
929
|
return;
|
|
891
930
|
case "ForStatement":
|
|
892
931
|
case "IterationStatement":
|
|
@@ -1301,72 +1340,59 @@ var Civet = (() => {
|
|
|
1301
1340
|
children: [s, parts, e]
|
|
1302
1341
|
};
|
|
1303
1342
|
}
|
|
1304
|
-
function
|
|
1305
|
-
|
|
1306
|
-
...
|
|
1343
|
+
function processAssignmentDeclaration(decl, id, suffix, ws, assign, e) {
|
|
1344
|
+
decl = {
|
|
1345
|
+
...decl,
|
|
1307
1346
|
$loc: {
|
|
1308
|
-
pos:
|
|
1309
|
-
length:
|
|
1347
|
+
pos: assign.$loc.pos - 1,
|
|
1348
|
+
length: assign.$loc.length + 1
|
|
1310
1349
|
}
|
|
1311
1350
|
};
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
exp
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1351
|
+
if (decl.token.startsWith("const")) {
|
|
1352
|
+
let exp;
|
|
1353
|
+
if (e.type === "FunctionExpression") {
|
|
1354
|
+
exp = e;
|
|
1355
|
+
} else {
|
|
1356
|
+
exp = e[1];
|
|
1357
|
+
}
|
|
1358
|
+
if (exp?.children?.[0]?.token?.match(/^\s+$/))
|
|
1359
|
+
exp.children.shift();
|
|
1360
|
+
if (id.type === "Identifier" && exp?.type === "FunctionExpression" && !exp.id) {
|
|
1361
|
+
const i = exp.children.findIndex((c) => c?.token === "function") + 1;
|
|
1362
|
+
exp = {
|
|
1363
|
+
...exp,
|
|
1364
|
+
children: [...exp.children.slice(0, i), " ", id, suffix, ws, ...exp.children.slice(i)]
|
|
1365
|
+
};
|
|
1366
|
+
return {
|
|
1367
|
+
type: "Declaration",
|
|
1368
|
+
decl,
|
|
1369
|
+
children: [exp],
|
|
1370
|
+
names: id.names
|
|
1371
|
+
};
|
|
1372
|
+
}
|
|
1331
1373
|
}
|
|
1332
1374
|
let [splices, thisAssignments] = gatherBindingCode(id);
|
|
1333
1375
|
splices = splices.map((s) => [", ", s]);
|
|
1334
1376
|
thisAssignments = thisAssignments.map((a) => ["", a, ";"]);
|
|
1335
|
-
const
|
|
1336
|
-
const
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
type: "Declaration",
|
|
1340
|
-
names: id.names,
|
|
1341
|
-
children,
|
|
1342
|
-
binding,
|
|
1377
|
+
const initializer = [ws, assign, e];
|
|
1378
|
+
const binding = {
|
|
1379
|
+
type: "Binding",
|
|
1380
|
+
pattern: id,
|
|
1343
1381
|
initializer,
|
|
1344
1382
|
splices,
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
function processLetAssignmentDeclaration(l, id, suffix, ws, la, e) {
|
|
1349
|
-
l = {
|
|
1350
|
-
...l,
|
|
1351
|
-
$loc: {
|
|
1352
|
-
pos: la.$loc.pos - 1,
|
|
1353
|
-
length: la.$loc.length + 1
|
|
1354
|
-
}
|
|
1383
|
+
suffix,
|
|
1384
|
+
thisAssignments,
|
|
1385
|
+
children: [id, suffix, initializer]
|
|
1355
1386
|
};
|
|
1356
|
-
|
|
1357
|
-
splices = splices.map((s) => [", ", s]);
|
|
1358
|
-
thisAssignments = thisAssignments.map((a) => ["", a, ";"]);
|
|
1359
|
-
const binding = [l, id, suffix, ...ws];
|
|
1360
|
-
const initializer = [la, e];
|
|
1361
|
-
const children = [binding, initializer];
|
|
1387
|
+
const children = [decl, binding];
|
|
1362
1388
|
return {
|
|
1363
1389
|
type: "Declaration",
|
|
1364
1390
|
names: id.names,
|
|
1365
|
-
|
|
1366
|
-
binding,
|
|
1367
|
-
initializer,
|
|
1391
|
+
decl,
|
|
1392
|
+
bindings: [binding],
|
|
1368
1393
|
splices,
|
|
1369
|
-
thisAssignments
|
|
1394
|
+
thisAssignments,
|
|
1395
|
+
children
|
|
1370
1396
|
};
|
|
1371
1397
|
}
|
|
1372
1398
|
function implicitFunctionBlock(f) {
|
|
@@ -1577,9 +1603,9 @@ var Civet = (() => {
|
|
|
1577
1603
|
const subRef = [ref, "[", i.toString(), "]"];
|
|
1578
1604
|
getPatternConditions(e, subRef, conditions);
|
|
1579
1605
|
});
|
|
1580
|
-
const
|
|
1581
|
-
if (
|
|
1582
|
-
const postElements =
|
|
1606
|
+
const { blockPrefix } = pattern;
|
|
1607
|
+
if (blockPrefix) {
|
|
1608
|
+
const postElements = blockPrefix.children[1], { length: postLength } = postElements;
|
|
1583
1609
|
postElements.forEach(({ children: [, e] }, i) => {
|
|
1584
1610
|
const subRef = [ref, "[", ref, ".length - ", (postLength + i).toString(), "]"];
|
|
1585
1611
|
getPatternConditions(e, subRef, conditions);
|
|
@@ -1666,15 +1692,15 @@ var Civet = (() => {
|
|
|
1666
1692
|
if (el.type === "BindingRestElement") {
|
|
1667
1693
|
return ["", el, void 0];
|
|
1668
1694
|
}
|
|
1669
|
-
const { children: [ws, e,
|
|
1695
|
+
const { children: [ws, e, delim] } = el;
|
|
1670
1696
|
switch (e.type) {
|
|
1671
1697
|
case "Literal":
|
|
1672
1698
|
case "RegularExpressionLiteral":
|
|
1673
1699
|
case "StringLiteral":
|
|
1674
1700
|
case "PinPattern":
|
|
1675
|
-
return
|
|
1701
|
+
return delim;
|
|
1676
1702
|
default:
|
|
1677
|
-
return [ws, nonMatcherBindings(e),
|
|
1703
|
+
return [ws, nonMatcherBindings(e), delim];
|
|
1678
1704
|
}
|
|
1679
1705
|
});
|
|
1680
1706
|
}
|
|
@@ -1684,13 +1710,12 @@ var Civet = (() => {
|
|
|
1684
1710
|
case "BindingProperty": {
|
|
1685
1711
|
const { children, name, value } = p;
|
|
1686
1712
|
const [ws] = children;
|
|
1687
|
-
const sep = children[children.length - 1];
|
|
1688
1713
|
switch (value && value.type) {
|
|
1689
1714
|
case "ArrayBindingPattern":
|
|
1690
1715
|
case "ObjectBindingPattern":
|
|
1691
1716
|
return {
|
|
1692
1717
|
...p,
|
|
1693
|
-
children: [ws, name, ": ", nonMatcherBindings(value)]
|
|
1718
|
+
children: [ws, name, ": ", nonMatcherBindings(value), p.delim]
|
|
1694
1719
|
};
|
|
1695
1720
|
case "Identifier":
|
|
1696
1721
|
return p;
|
|
@@ -1700,7 +1725,7 @@ var Civet = (() => {
|
|
|
1700
1725
|
default:
|
|
1701
1726
|
return {
|
|
1702
1727
|
...p,
|
|
1703
|
-
children: [ws, name,
|
|
1728
|
+
children: [ws, name, p.delim]
|
|
1704
1729
|
};
|
|
1705
1730
|
}
|
|
1706
1731
|
}
|
|
@@ -2040,10 +2065,11 @@ var Civet = (() => {
|
|
|
2040
2065
|
});
|
|
2041
2066
|
}
|
|
2042
2067
|
function processProgram(root, config, m, ReservedWord) {
|
|
2068
|
+
assert.equal(m.forbidBracedApplication.length, 1, "forbidBracedApplication");
|
|
2043
2069
|
assert.equal(m.forbidClassImplicitCall.length, 1, "forbidClassImplicitCall");
|
|
2044
2070
|
assert.equal(m.forbidIndentedApplication.length, 1, "forbidIndentedApplication");
|
|
2071
|
+
assert.equal(m.forbidNewlineBinaryOp.length, 1, "forbidNewlineBinaryOp");
|
|
2045
2072
|
assert.equal(m.forbidTrailingMemberProperty.length, 1, "forbidTrailingMemberProperty");
|
|
2046
|
-
assert.equal(m.forbidMultiLineImplicitObjectLiteral.length, 1, "forbidMultiLineImplicitObjectLiteral");
|
|
2047
2073
|
assert.equal(m.JSXTagStack.length, 0, "JSXTagStack should be empty");
|
|
2048
2074
|
addParentPointers(root);
|
|
2049
2075
|
const { expressions: statements } = root;
|
|
@@ -2370,9 +2396,20 @@ var Civet = (() => {
|
|
|
2370
2396
|
let rest = props[restIndex];
|
|
2371
2397
|
props = props.slice(0, restIndex);
|
|
2372
2398
|
if (after.length) {
|
|
2373
|
-
const
|
|
2374
|
-
rest = {
|
|
2375
|
-
|
|
2399
|
+
const { delim: restDelim } = rest, lastAfterProp = after[after.length - 1], { delim: lastDelim, children: lastAfterChildren } = lastAfterProp;
|
|
2400
|
+
rest = {
|
|
2401
|
+
...rest,
|
|
2402
|
+
delim: lastDelim,
|
|
2403
|
+
children: [...rest.children.slice(0, -1), lastDelim]
|
|
2404
|
+
};
|
|
2405
|
+
after = [
|
|
2406
|
+
...after.slice(0, -1),
|
|
2407
|
+
{
|
|
2408
|
+
...lastAfterProp,
|
|
2409
|
+
delim: restDelim,
|
|
2410
|
+
children: [...lastAfterChildren.slice(0, -1), restDelim]
|
|
2411
|
+
}
|
|
2412
|
+
];
|
|
2376
2413
|
}
|
|
2377
2414
|
const children = [...props, ...after, rest];
|
|
2378
2415
|
return {
|
|
@@ -2552,8 +2589,7 @@ var Civet = (() => {
|
|
|
2552
2589
|
processBinaryOpExpression,
|
|
2553
2590
|
processCallMemberExpression,
|
|
2554
2591
|
processCoffeeInterpolation,
|
|
2555
|
-
|
|
2556
|
-
processLetAssignmentDeclaration,
|
|
2592
|
+
processAssignmentDeclaration,
|
|
2557
2593
|
processParams,
|
|
2558
2594
|
processProgram,
|
|
2559
2595
|
processReturnValue,
|
|
@@ -3094,7 +3130,6 @@ ${input.slice(result.pos)}
|
|
|
3094
3130
|
BindingProperty,
|
|
3095
3131
|
BindingRestProperty,
|
|
3096
3132
|
NestedBindingElements,
|
|
3097
|
-
NestedBindingElement,
|
|
3098
3133
|
BindingElement,
|
|
3099
3134
|
BindingRestElement,
|
|
3100
3135
|
EmptyBindingPattern,
|
|
@@ -3158,10 +3193,8 @@ ${input.slice(result.pos)}
|
|
|
3158
3193
|
InlineObjectLiteral,
|
|
3159
3194
|
ImplicitInlineObjectPropertyDelimiter,
|
|
3160
3195
|
ObjectPropertyDelimiter,
|
|
3161
|
-
PropertyDefinitionList,
|
|
3162
3196
|
PropertyDefinition,
|
|
3163
3197
|
NamedProperty,
|
|
3164
|
-
ImplicitNamedProperty,
|
|
3165
3198
|
SnugNamedProperty,
|
|
3166
3199
|
PropertyName,
|
|
3167
3200
|
ComputedPropertyName,
|
|
@@ -3267,10 +3300,6 @@ ${input.slice(result.pos)}
|
|
|
3267
3300
|
AllowTrailingMemberProperty,
|
|
3268
3301
|
RestoreTrailingMemberProperty,
|
|
3269
3302
|
TrailingMemberPropertyAllowed,
|
|
3270
|
-
ForbidMultiLineImplicitObjectLiteral,
|
|
3271
|
-
AllowMultiLineImplicitObjectLiteral,
|
|
3272
|
-
RestoreMultiLineImplicitObjectLiteral,
|
|
3273
|
-
MultiLineImplicitObjectLiteralAllowed,
|
|
3274
3303
|
AllowNewlineBinaryOp,
|
|
3275
3304
|
ForbidNewlineBinaryOp,
|
|
3276
3305
|
RestoreNewlineBinaryOp,
|
|
@@ -3316,7 +3345,6 @@ ${input.slice(result.pos)}
|
|
|
3316
3345
|
Initializer,
|
|
3317
3346
|
VariableStatement,
|
|
3318
3347
|
VariableDeclarationList,
|
|
3319
|
-
VariableDeclaration,
|
|
3320
3348
|
NumericLiteral,
|
|
3321
3349
|
NumericLiteralKind,
|
|
3322
3350
|
DecimalBigIntegerLiteral,
|
|
@@ -3505,6 +3533,7 @@ ${input.slice(result.pos)}
|
|
|
3505
3533
|
NestedJSXChildExpression,
|
|
3506
3534
|
TypeDeclaration,
|
|
3507
3535
|
TypeDeclarationRest,
|
|
3536
|
+
OptionalEquals,
|
|
3508
3537
|
TypeLexicalDeclaration,
|
|
3509
3538
|
TypeDeclarationBinding,
|
|
3510
3539
|
InterfaceExtendsClause,
|
|
@@ -3593,6 +3622,7 @@ ${input.slice(result.pos)}
|
|
|
3593
3622
|
InsertOpenBracket,
|
|
3594
3623
|
InsertCloseBracket,
|
|
3595
3624
|
InsertComma,
|
|
3625
|
+
InsertSpaceEquals,
|
|
3596
3626
|
InsertConst,
|
|
3597
3627
|
InsertLet,
|
|
3598
3628
|
InsertReadonly,
|
|
@@ -3620,13 +3650,13 @@ ${input.slice(result.pos)}
|
|
|
3620
3650
|
Init,
|
|
3621
3651
|
Indent,
|
|
3622
3652
|
TrackIndented,
|
|
3623
|
-
Samedent,
|
|
3624
|
-
IndentedFurther,
|
|
3625
|
-
NotDedented,
|
|
3626
|
-
Dedented,
|
|
3627
3653
|
PushIndent,
|
|
3628
3654
|
PopIndent,
|
|
3629
|
-
Nested
|
|
3655
|
+
Nested,
|
|
3656
|
+
IndentedFurther,
|
|
3657
|
+
IndentedAtLeast,
|
|
3658
|
+
NotDedented,
|
|
3659
|
+
Dedented
|
|
3630
3660
|
});
|
|
3631
3661
|
var $L0 = $L("");
|
|
3632
3662
|
var $L1 = $L("{");
|
|
@@ -4470,7 +4500,7 @@ ${input.slice(result.pos)}
|
|
|
4470
4500
|
return result;
|
|
4471
4501
|
}
|
|
4472
4502
|
}
|
|
4473
|
-
var TrailingMemberExpressions$0 = $TS($S($Q(MemberExpressionRest), $Q($S(
|
|
4503
|
+
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) {
|
|
4474
4504
|
return $1.concat($2);
|
|
4475
4505
|
});
|
|
4476
4506
|
function TrailingMemberExpressions(state) {
|
|
@@ -4521,7 +4551,7 @@ ${input.slice(result.pos)}
|
|
|
4521
4551
|
return result;
|
|
4522
4552
|
}
|
|
4523
4553
|
}
|
|
4524
|
-
var TrailingCallExpressions$0 = $P($S(
|
|
4554
|
+
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)));
|
|
4525
4555
|
function TrailingCallExpressions(state) {
|
|
4526
4556
|
let eventData;
|
|
4527
4557
|
if (state.events) {
|
|
@@ -4569,7 +4599,7 @@ ${input.slice(result.pos)}
|
|
|
4569
4599
|
return result;
|
|
4570
4600
|
}
|
|
4571
4601
|
}
|
|
4572
|
-
var CommaDelimiter$0 = $S(
|
|
4602
|
+
var CommaDelimiter$0 = $S(NotDedented, Comma);
|
|
4573
4603
|
function CommaDelimiter(state) {
|
|
4574
4604
|
let eventData;
|
|
4575
4605
|
if (state.events) {
|
|
@@ -7342,7 +7372,7 @@ ${input.slice(result.pos)}
|
|
|
7342
7372
|
var c = $3;
|
|
7343
7373
|
return {
|
|
7344
7374
|
type: "ObjectBindingPattern",
|
|
7345
|
-
children: $
|
|
7375
|
+
children: [$1, $2, c.children, $4, $5],
|
|
7346
7376
|
names: c.names,
|
|
7347
7377
|
properties: c.children
|
|
7348
7378
|
};
|
|
@@ -7403,6 +7433,7 @@ ${input.slice(result.pos)}
|
|
|
7403
7433
|
return props.map(([prop, delim]) => {
|
|
7404
7434
|
return {
|
|
7405
7435
|
...prop,
|
|
7436
|
+
delim,
|
|
7406
7437
|
children: [...prop.children, delim]
|
|
7407
7438
|
};
|
|
7408
7439
|
});
|
|
@@ -7432,11 +7463,10 @@ ${input.slice(result.pos)}
|
|
|
7432
7463
|
var ArrayBindingPattern$0 = $TS($S($E(_), OpenBracket, ArrayBindingPatternContent, __, CloseBracket), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
7433
7464
|
var c = $3;
|
|
7434
7465
|
return {
|
|
7466
|
+
...c,
|
|
7435
7467
|
type: "ArrayBindingPattern",
|
|
7436
|
-
children: $0,
|
|
7437
|
-
names: c.names,
|
|
7438
7468
|
elements: c.children,
|
|
7439
|
-
|
|
7469
|
+
children: [$1, $2, c.children, $4, $5]
|
|
7440
7470
|
};
|
|
7441
7471
|
});
|
|
7442
7472
|
function ArrayBindingPattern(state) {
|
|
@@ -7522,14 +7552,14 @@ ${input.slice(result.pos)}
|
|
|
7522
7552
|
}
|
|
7523
7553
|
}
|
|
7524
7554
|
var NestedBindingElementList$0 = $TS($S(Nested, BindingElementList), function($skip, $loc, $0, $1, $2) {
|
|
7525
|
-
var
|
|
7555
|
+
var indent = $1;
|
|
7526
7556
|
var elements = $2;
|
|
7527
7557
|
return elements.map((element, i) => {
|
|
7528
7558
|
if (i > 0)
|
|
7529
7559
|
return element;
|
|
7530
7560
|
return {
|
|
7531
7561
|
...element,
|
|
7532
|
-
children: [
|
|
7562
|
+
children: [indent, ...element.children.slice(1)]
|
|
7533
7563
|
};
|
|
7534
7564
|
});
|
|
7535
7565
|
});
|
|
@@ -7644,13 +7674,13 @@ ${input.slice(result.pos)}
|
|
|
7644
7674
|
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) {
|
|
7645
7675
|
var name = $2;
|
|
7646
7676
|
var value = $6;
|
|
7647
|
-
var
|
|
7677
|
+
var initializer = $7;
|
|
7648
7678
|
return {
|
|
7649
7679
|
type: "BindingProperty",
|
|
7650
7680
|
children: $0,
|
|
7651
7681
|
name,
|
|
7652
7682
|
value,
|
|
7653
|
-
|
|
7683
|
+
initializer,
|
|
7654
7684
|
names: value.names
|
|
7655
7685
|
};
|
|
7656
7686
|
});
|
|
@@ -7658,14 +7688,14 @@ ${input.slice(result.pos)}
|
|
|
7658
7688
|
var ws = $1;
|
|
7659
7689
|
var pin = $2;
|
|
7660
7690
|
var binding = $3;
|
|
7661
|
-
var
|
|
7691
|
+
var initializer = $4;
|
|
7662
7692
|
if (binding.type === "AtBinding") {
|
|
7663
7693
|
return {
|
|
7664
7694
|
type: "AtBindingProperty",
|
|
7665
7695
|
children: $0,
|
|
7666
7696
|
binding,
|
|
7667
7697
|
ref: binding.ref,
|
|
7668
|
-
|
|
7698
|
+
initializer,
|
|
7669
7699
|
names: []
|
|
7670
7700
|
};
|
|
7671
7701
|
}
|
|
@@ -7685,7 +7715,7 @@ ${input.slice(result.pos)}
|
|
|
7685
7715
|
children: $0,
|
|
7686
7716
|
name: binding,
|
|
7687
7717
|
value: void 0,
|
|
7688
|
-
|
|
7718
|
+
initializer,
|
|
7689
7719
|
names: binding.names,
|
|
7690
7720
|
identifier: binding
|
|
7691
7721
|
};
|
|
@@ -7782,36 +7812,6 @@ ${input.slice(result.pos)}
|
|
|
7782
7812
|
return result;
|
|
7783
7813
|
}
|
|
7784
7814
|
}
|
|
7785
|
-
var NestedBindingElement$0 = $TS($S(Nested, BindingElement), function($skip, $loc, $0, $1, $2) {
|
|
7786
|
-
var indent = $1;
|
|
7787
|
-
var element = $2;
|
|
7788
|
-
return {
|
|
7789
|
-
...element,
|
|
7790
|
-
children: [indent, ...element.children]
|
|
7791
|
-
};
|
|
7792
|
-
});
|
|
7793
|
-
function NestedBindingElement(state) {
|
|
7794
|
-
let eventData;
|
|
7795
|
-
if (state.events) {
|
|
7796
|
-
const result = state.events.enter?.("NestedBindingElement", state);
|
|
7797
|
-
if (result) {
|
|
7798
|
-
if (result.cache)
|
|
7799
|
-
return result.cache;
|
|
7800
|
-
eventData = result.data;
|
|
7801
|
-
}
|
|
7802
|
-
}
|
|
7803
|
-
if (state.tokenize) {
|
|
7804
|
-
const result = $TOKEN("NestedBindingElement", state, NestedBindingElement$0(state));
|
|
7805
|
-
if (state.events)
|
|
7806
|
-
state.events.exit?.("NestedBindingElement", state, result, eventData);
|
|
7807
|
-
return result;
|
|
7808
|
-
} else {
|
|
7809
|
-
const result = NestedBindingElement$0(state);
|
|
7810
|
-
if (state.events)
|
|
7811
|
-
state.events.exit?.("NestedBindingElement", state, result, eventData);
|
|
7812
|
-
return result;
|
|
7813
|
-
}
|
|
7814
|
-
}
|
|
7815
7815
|
var BindingElement$0 = BindingRestElement;
|
|
7816
7816
|
var BindingElement$1 = $TS($S($E(_), $C(BindingIdentifier, BindingPattern), $E(Initializer)), function($skip, $loc, $0, $1, $2, $3) {
|
|
7817
7817
|
var ws = $1;
|
|
@@ -7820,6 +7820,7 @@ ${input.slice(result.pos)}
|
|
|
7820
7820
|
if (binding.children) {
|
|
7821
7821
|
binding = {
|
|
7822
7822
|
...binding,
|
|
7823
|
+
initializer,
|
|
7823
7824
|
children: [...binding.children, initializer]
|
|
7824
7825
|
};
|
|
7825
7826
|
}
|
|
@@ -7865,7 +7866,7 @@ ${input.slice(result.pos)}
|
|
|
7865
7866
|
var binding = $3;
|
|
7866
7867
|
return {
|
|
7867
7868
|
type: "BindingRestElement",
|
|
7868
|
-
children: [
|
|
7869
|
+
children: [ws, [dots, binding]],
|
|
7869
7870
|
binding,
|
|
7870
7871
|
name: binding.name,
|
|
7871
7872
|
names: binding.names,
|
|
@@ -8754,7 +8755,7 @@ ${input.slice(result.pos)}
|
|
|
8754
8755
|
var s = $3;
|
|
8755
8756
|
var ws = $4;
|
|
8756
8757
|
var c = $5;
|
|
8757
|
-
if (!s.
|
|
8758
|
+
if (!s.expressions.length)
|
|
8758
8759
|
return $skip;
|
|
8759
8760
|
return {
|
|
8760
8761
|
type: "BlockStatement",
|
|
@@ -8829,16 +8830,16 @@ ${input.slice(result.pos)}
|
|
|
8829
8830
|
return result;
|
|
8830
8831
|
}
|
|
8831
8832
|
}
|
|
8832
|
-
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) {
|
|
8833
|
-
var stmts = $
|
|
8834
|
-
var last = $
|
|
8835
|
-
const
|
|
8833
|
+
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) {
|
|
8834
|
+
var stmts = $2;
|
|
8835
|
+
var last = $3;
|
|
8836
|
+
const expressions = [...stmts];
|
|
8836
8837
|
if (last)
|
|
8837
|
-
|
|
8838
|
+
expressions.push(last);
|
|
8838
8839
|
return {
|
|
8839
8840
|
type: "BlockStatement",
|
|
8840
|
-
expressions
|
|
8841
|
-
children,
|
|
8841
|
+
expressions,
|
|
8842
|
+
children: [expressions],
|
|
8842
8843
|
bare: true
|
|
8843
8844
|
};
|
|
8844
8845
|
});
|
|
@@ -9294,9 +9295,7 @@ ${input.slice(result.pos)}
|
|
|
9294
9295
|
} else {
|
|
9295
9296
|
children = [open, content, ...ws, close];
|
|
9296
9297
|
}
|
|
9297
|
-
const names = children.flatMap((c) =>
|
|
9298
|
-
return c.names || [];
|
|
9299
|
-
});
|
|
9298
|
+
const names = children.flatMap((c) => c?.names || []);
|
|
9300
9299
|
return {
|
|
9301
9300
|
type: "ArrayExpression",
|
|
9302
9301
|
children,
|
|
@@ -9412,17 +9411,17 @@ ${input.slice(result.pos)}
|
|
|
9412
9411
|
}
|
|
9413
9412
|
}
|
|
9414
9413
|
var ArrayLiteralContent$0 = RangeExpression;
|
|
9415
|
-
var ArrayLiteralContent$1 = $S(
|
|
9416
|
-
var ArrayLiteralContent$2 = NestedElementList
|
|
9417
|
-
var ArrayLiteralContent$3 = $TS($S(ElementListWithIndentedApplicationForbidden, InsertComma, $E(NestedElementList)), function($skip, $loc, $0, $1, $2, $3) {
|
|
9414
|
+
var ArrayLiteralContent$1 = $S(NestedElementList, $Y($S(__, CloseBracket)));
|
|
9415
|
+
var ArrayLiteralContent$2 = $TS($S(ElementListWithIndentedApplicationForbidden, ArrayElementDelimiter, $E(NestedElementList), $Y($S(__, CloseBracket))), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
9418
9416
|
var list = $1;
|
|
9419
|
-
var
|
|
9417
|
+
var delimiter = $2;
|
|
9420
9418
|
var nested = $3;
|
|
9421
|
-
if (nested)
|
|
9422
|
-
return [...list, comma, ...nested];
|
|
9423
|
-
} else {
|
|
9419
|
+
if (!nested)
|
|
9424
9420
|
return list;
|
|
9425
|
-
|
|
9421
|
+
return [...list, delimiter, ...nested];
|
|
9422
|
+
});
|
|
9423
|
+
var ArrayLiteralContent$3 = $TV($Q($S(__, ElementListWithIndentedApplicationForbidden, ArrayElementDelimiter)), function($skip, $loc, $0, $1) {
|
|
9424
|
+
return $1.flat();
|
|
9426
9425
|
});
|
|
9427
9426
|
function ArrayLiteralContent(state) {
|
|
9428
9427
|
let eventData;
|
|
@@ -9570,9 +9569,9 @@ ${input.slice(result.pos)}
|
|
|
9570
9569
|
return result;
|
|
9571
9570
|
}
|
|
9572
9571
|
}
|
|
9573
|
-
var ElementList$0 = $TS($S(ArrayElementExpression, $Q(ElementListRest)), function($skip, $loc, $0, $1, $2) {
|
|
9574
|
-
var first = $
|
|
9575
|
-
var rest = $
|
|
9572
|
+
var ElementList$0 = $TS($S($N(EOS), ArrayElementExpression, $Q(ElementListRest)), function($skip, $loc, $0, $1, $2, $3) {
|
|
9573
|
+
var first = $2;
|
|
9574
|
+
var rest = $3;
|
|
9576
9575
|
if (rest.length) {
|
|
9577
9576
|
return [{
|
|
9578
9577
|
...first,
|
|
@@ -9609,7 +9608,7 @@ ${input.slice(result.pos)}
|
|
|
9609
9608
|
return result;
|
|
9610
9609
|
}
|
|
9611
9610
|
}
|
|
9612
|
-
var ElementListRest$0 = $S($S(
|
|
9611
|
+
var ElementListRest$0 = $S($S($E(_), Comma, $N(EOS)), ArrayElementExpression);
|
|
9613
9612
|
function ElementListRest(state) {
|
|
9614
9613
|
let eventData;
|
|
9615
9614
|
if (state.events) {
|
|
@@ -9724,26 +9723,16 @@ ${input.slice(result.pos)}
|
|
|
9724
9723
|
return result;
|
|
9725
9724
|
}
|
|
9726
9725
|
}
|
|
9727
|
-
var BracedObjectLiteral$0 = $TS($S(OpenBrace, AllowAll, $E($S(
|
|
9726
|
+
var BracedObjectLiteral$0 = $TS($S(OpenBrace, AllowAll, $E($S(BracedObjectLiteralContent, __, CloseBrace)), RestoreAll), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
9728
9727
|
var open = $1;
|
|
9729
9728
|
if (!$3)
|
|
9730
9729
|
return $skip;
|
|
9731
9730
|
const [properties, ...close] = $3;
|
|
9732
|
-
if (properties) {
|
|
9733
|
-
const children = [open, ...properties, close];
|
|
9734
|
-
return {
|
|
9735
|
-
type: "ObjectExpression",
|
|
9736
|
-
children,
|
|
9737
|
-
names: children.flatMap((c) => {
|
|
9738
|
-
return c.names || [];
|
|
9739
|
-
}),
|
|
9740
|
-
properties
|
|
9741
|
-
};
|
|
9742
|
-
}
|
|
9743
9731
|
return {
|
|
9744
9732
|
type: "ObjectExpression",
|
|
9745
|
-
children: [open, close],
|
|
9746
|
-
names: []
|
|
9733
|
+
children: [open, properties, close],
|
|
9734
|
+
names: properties.flatMap((c) => c.names || []),
|
|
9735
|
+
properties
|
|
9747
9736
|
};
|
|
9748
9737
|
});
|
|
9749
9738
|
function BracedObjectLiteral(state) {
|
|
@@ -9768,8 +9757,33 @@ ${input.slice(result.pos)}
|
|
|
9768
9757
|
return result;
|
|
9769
9758
|
}
|
|
9770
9759
|
}
|
|
9771
|
-
var BracedObjectLiteralContent$0 = NestedPropertyDefinitions
|
|
9772
|
-
|
|
9760
|
+
var BracedObjectLiteralContent$0 = $TS($S($Q($S(PropertyDefinition, ObjectPropertyDelimiter)), $E(NestedPropertyDefinitions)), function($skip, $loc, $0, $1, $2) {
|
|
9761
|
+
var line = $1;
|
|
9762
|
+
var nested = $2;
|
|
9763
|
+
line = line.flatMap(([prop, delim]) => {
|
|
9764
|
+
prop = Array.isArray(prop) ? prop : [prop];
|
|
9765
|
+
let last = prop[prop.length - 1];
|
|
9766
|
+
last = {
|
|
9767
|
+
...last,
|
|
9768
|
+
delim,
|
|
9769
|
+
children: [...last.children, delim]
|
|
9770
|
+
};
|
|
9771
|
+
return [...prop.slice(0, prop.length - 1), last];
|
|
9772
|
+
});
|
|
9773
|
+
return line.concat(nested || []);
|
|
9774
|
+
});
|
|
9775
|
+
var BracedObjectLiteralContent$1 = $TV($P($S(__, PropertyDefinition, ObjectPropertyDelimiter)), function($skip, $loc, $0, $1) {
|
|
9776
|
+
return $0.flatMap(([ws, prop, delim]) => {
|
|
9777
|
+
prop = Array.isArray(prop) ? prop : [prop];
|
|
9778
|
+
let last = prop[prop.length - 1];
|
|
9779
|
+
last = {
|
|
9780
|
+
...last,
|
|
9781
|
+
delim,
|
|
9782
|
+
children: [ws, ...last.children.slice(1), delim]
|
|
9783
|
+
};
|
|
9784
|
+
return [...prop.slice(0, prop.length - 1), last];
|
|
9785
|
+
});
|
|
9786
|
+
});
|
|
9773
9787
|
function BracedObjectLiteralContent(state) {
|
|
9774
9788
|
let eventData;
|
|
9775
9789
|
if (state.events) {
|
|
@@ -9793,9 +9807,11 @@ ${input.slice(result.pos)}
|
|
|
9793
9807
|
}
|
|
9794
9808
|
}
|
|
9795
9809
|
var NestedImplicitObjectLiteral$0 = $TS($S(InsertOpenBrace, NestedImplicitPropertyDefinitions, InsertNewline, InsertIndent, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
9810
|
+
var properties = $2;
|
|
9796
9811
|
return {
|
|
9797
9812
|
type: "ObjectExpression",
|
|
9798
|
-
|
|
9813
|
+
properties,
|
|
9814
|
+
children: $0
|
|
9799
9815
|
};
|
|
9800
9816
|
});
|
|
9801
9817
|
function NestedImplicitObjectLiteral(state) {
|
|
@@ -9848,7 +9864,7 @@ ${input.slice(result.pos)}
|
|
|
9848
9864
|
return result;
|
|
9849
9865
|
}
|
|
9850
9866
|
}
|
|
9851
|
-
var NestedImplicitPropertyDefinition$0 = $TS($S(Nested,
|
|
9867
|
+
var NestedImplicitPropertyDefinition$0 = $TS($S(Nested, NamedProperty, ObjectPropertyDelimiter), function($skip, $loc, $0, $1, $2, $3) {
|
|
9852
9868
|
var ws = $1;
|
|
9853
9869
|
var prop = $2;
|
|
9854
9870
|
var delimiter = $3;
|
|
@@ -9951,7 +9967,7 @@ ${input.slice(result.pos)}
|
|
|
9951
9967
|
return result;
|
|
9952
9968
|
}
|
|
9953
9969
|
}
|
|
9954
|
-
var InlineObjectLiteral$0 = $TS($S(InsertInlineOpenBrace, SnugNamedProperty, $Q($S(ImplicitInlineObjectPropertyDelimiter,
|
|
9970
|
+
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) {
|
|
9955
9971
|
var open = $1;
|
|
9956
9972
|
var first = $2;
|
|
9957
9973
|
var rest = $3;
|
|
@@ -9985,7 +10001,7 @@ ${input.slice(result.pos)}
|
|
|
9985
10001
|
}
|
|
9986
10002
|
}
|
|
9987
10003
|
var ImplicitInlineObjectPropertyDelimiter$0 = $S($E(_), Comma, $C(NotDedented, $E(_)));
|
|
9988
|
-
var ImplicitInlineObjectPropertyDelimiter$1 = $T($S($Y($S(
|
|
10004
|
+
var ImplicitInlineObjectPropertyDelimiter$1 = $T($S($Y($S(Nested, NamedProperty)), InsertComma, $C(Nested, $E(_))), function(value) {
|
|
9989
10005
|
return [value[1], value[2]];
|
|
9990
10006
|
});
|
|
9991
10007
|
function ImplicitInlineObjectPropertyDelimiter(state) {
|
|
@@ -10037,41 +10053,7 @@ ${input.slice(result.pos)}
|
|
|
10037
10053
|
return result;
|
|
10038
10054
|
}
|
|
10039
10055
|
}
|
|
10040
|
-
var
|
|
10041
|
-
return $0.flatMap(([prop, delim]) => {
|
|
10042
|
-
prop = Array.isArray(prop) ? prop : [prop];
|
|
10043
|
-
let last = prop[prop.length - 1];
|
|
10044
|
-
last = {
|
|
10045
|
-
...last,
|
|
10046
|
-
delim,
|
|
10047
|
-
children: [...last.children, delim]
|
|
10048
|
-
};
|
|
10049
|
-
return [...prop.slice(0, prop.length - 1), last];
|
|
10050
|
-
});
|
|
10051
|
-
});
|
|
10052
|
-
function PropertyDefinitionList(state) {
|
|
10053
|
-
let eventData;
|
|
10054
|
-
if (state.events) {
|
|
10055
|
-
const result = state.events.enter?.("PropertyDefinitionList", state);
|
|
10056
|
-
if (result) {
|
|
10057
|
-
if (result.cache)
|
|
10058
|
-
return result.cache;
|
|
10059
|
-
eventData = result.data;
|
|
10060
|
-
}
|
|
10061
|
-
}
|
|
10062
|
-
if (state.tokenize) {
|
|
10063
|
-
const result = $TOKEN("PropertyDefinitionList", state, PropertyDefinitionList$0(state));
|
|
10064
|
-
if (state.events)
|
|
10065
|
-
state.events.exit?.("PropertyDefinitionList", state, result, eventData);
|
|
10066
|
-
return result;
|
|
10067
|
-
} else {
|
|
10068
|
-
const result = PropertyDefinitionList$0(state);
|
|
10069
|
-
if (state.events)
|
|
10070
|
-
state.events.exit?.("PropertyDefinitionList", state, result, eventData);
|
|
10071
|
-
return result;
|
|
10072
|
-
}
|
|
10073
|
-
}
|
|
10074
|
-
var PropertyDefinition$0 = $TS($S(__, AtThis, IdentifierReference), function($skip, $loc, $0, $1, $2, $3) {
|
|
10056
|
+
var PropertyDefinition$0 = $TS($S($E(_), AtThis, IdentifierReference), function($skip, $loc, $0, $1, $2, $3) {
|
|
10075
10057
|
var ws = $1;
|
|
10076
10058
|
var at = $2;
|
|
10077
10059
|
var id = $3;
|
|
@@ -10084,7 +10066,7 @@ ${input.slice(result.pos)}
|
|
|
10084
10066
|
value
|
|
10085
10067
|
};
|
|
10086
10068
|
});
|
|
10087
|
-
var PropertyDefinition$1 = $TS($S(
|
|
10069
|
+
var PropertyDefinition$1 = $TS($S($E(_), NamedProperty), function($skip, $loc, $0, $1, $2) {
|
|
10088
10070
|
var ws = $1;
|
|
10089
10071
|
var prop = $2;
|
|
10090
10072
|
return {
|
|
@@ -10092,7 +10074,7 @@ ${input.slice(result.pos)}
|
|
|
10092
10074
|
children: [ws, ...prop.children]
|
|
10093
10075
|
};
|
|
10094
10076
|
});
|
|
10095
|
-
var PropertyDefinition$2 = $TS($S(
|
|
10077
|
+
var PropertyDefinition$2 = $TS($S($E(_), $TEXT($EXPECT($R6, fail, "PropertyDefinition /[!+-]/")), PropertyName), function($skip, $loc, $0, $1, $2, $3) {
|
|
10096
10078
|
var ws = $1;
|
|
10097
10079
|
var toggle = $2;
|
|
10098
10080
|
var id = $3;
|
|
@@ -10105,7 +10087,7 @@ ${input.slice(result.pos)}
|
|
|
10105
10087
|
value
|
|
10106
10088
|
};
|
|
10107
10089
|
});
|
|
10108
|
-
var PropertyDefinition$3 = $TS($S(
|
|
10090
|
+
var PropertyDefinition$3 = $TS($S($E(_), MethodDefinition), function($skip, $loc, $0, $1, $2) {
|
|
10109
10091
|
var ws = $1;
|
|
10110
10092
|
var def = $2;
|
|
10111
10093
|
if (!def.block || def.block.empty)
|
|
@@ -10115,7 +10097,7 @@ ${input.slice(result.pos)}
|
|
|
10115
10097
|
children: [ws, ...def.children]
|
|
10116
10098
|
};
|
|
10117
10099
|
});
|
|
10118
|
-
var PropertyDefinition$4 = $TS($S(
|
|
10100
|
+
var PropertyDefinition$4 = $TS($S($E(_), DotDotDot, ExtendedExpression), function($skip, $loc, $0, $1, $2, $3) {
|
|
10119
10101
|
var ws = $1;
|
|
10120
10102
|
var dots = $2;
|
|
10121
10103
|
var exp = $3;
|
|
@@ -10127,9 +10109,9 @@ ${input.slice(result.pos)}
|
|
|
10127
10109
|
value: exp
|
|
10128
10110
|
};
|
|
10129
10111
|
});
|
|
10130
|
-
var PropertyDefinition$5 = $TS($S(
|
|
10112
|
+
var PropertyDefinition$5 = $TS($S($E(_), $N(EOS), CallExpression), function($skip, $loc, $0, $1, $2, $3) {
|
|
10131
10113
|
var ws = $1;
|
|
10132
|
-
var value = $
|
|
10114
|
+
var value = $3;
|
|
10133
10115
|
switch (value.type) {
|
|
10134
10116
|
case "Identifier":
|
|
10135
10117
|
return { ...value, children: [ws, ...value.children] };
|
|
@@ -10250,41 +10232,8 @@ ${input.slice(result.pos)}
|
|
|
10250
10232
|
return result;
|
|
10251
10233
|
}
|
|
10252
10234
|
}
|
|
10253
|
-
var
|
|
10254
|
-
var
|
|
10255
|
-
var exp = $5;
|
|
10256
|
-
return {
|
|
10257
|
-
type: "Property",
|
|
10258
|
-
children: $0,
|
|
10259
|
-
name,
|
|
10260
|
-
names: exp.names || [],
|
|
10261
|
-
value: exp
|
|
10262
|
-
};
|
|
10263
|
-
});
|
|
10264
|
-
function ImplicitNamedProperty(state) {
|
|
10265
|
-
let eventData;
|
|
10266
|
-
if (state.events) {
|
|
10267
|
-
const result = state.events.enter?.("ImplicitNamedProperty", state);
|
|
10268
|
-
if (result) {
|
|
10269
|
-
if (result.cache)
|
|
10270
|
-
return result.cache;
|
|
10271
|
-
eventData = result.data;
|
|
10272
|
-
}
|
|
10273
|
-
}
|
|
10274
|
-
if (state.tokenize) {
|
|
10275
|
-
const result = $TOKEN("ImplicitNamedProperty", state, ImplicitNamedProperty$0(state));
|
|
10276
|
-
if (state.events)
|
|
10277
|
-
state.events.exit?.("ImplicitNamedProperty", state, result, eventData);
|
|
10278
|
-
return result;
|
|
10279
|
-
} else {
|
|
10280
|
-
const result = ImplicitNamedProperty$0(state);
|
|
10281
|
-
if (state.events)
|
|
10282
|
-
state.events.exit?.("ImplicitNamedProperty", state, result, eventData);
|
|
10283
|
-
return result;
|
|
10284
|
-
}
|
|
10285
|
-
}
|
|
10286
|
-
var SnugNamedProperty$0 = $TS($S(PropertyName, Colon, $C(MultiLineImplicitObjectLiteralAllowed, $N(EOS)), ExtendedExpression), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
10287
|
-
var exp = $4;
|
|
10235
|
+
var SnugNamedProperty$0 = $TS($S(PropertyName, Colon, ExtendedExpression), function($skip, $loc, $0, $1, $2, $3) {
|
|
10236
|
+
var exp = $3;
|
|
10288
10237
|
return {
|
|
10289
10238
|
type: "Property",
|
|
10290
10239
|
children: $0,
|
|
@@ -10860,7 +10809,7 @@ ${input.slice(result.pos)}
|
|
|
10860
10809
|
ws.push(...$2);
|
|
10861
10810
|
return [ws, $3];
|
|
10862
10811
|
});
|
|
10863
|
-
var NotDedentedBinaryOp$1 = $TS($S(
|
|
10812
|
+
var NotDedentedBinaryOp$1 = $TS($S(Nested, $E(_), $N(Identifier), BinaryOp), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
10864
10813
|
const ws = [...$1];
|
|
10865
10814
|
if ($2)
|
|
10866
10815
|
ws.push(...$2);
|
|
@@ -11648,7 +11597,7 @@ ${input.slice(result.pos)}
|
|
|
11648
11597
|
return result;
|
|
11649
11598
|
}
|
|
11650
11599
|
}
|
|
11651
|
-
var ElseClause$0 = $S(
|
|
11600
|
+
var ElseClause$0 = $S(Nested, Else, Block);
|
|
11652
11601
|
var ElseClause$1 = $S($E(_), Else, Block);
|
|
11653
11602
|
function ElseClause(state) {
|
|
11654
11603
|
let eventData;
|
|
@@ -11792,7 +11741,7 @@ ${input.slice(result.pos)}
|
|
|
11792
11741
|
return result;
|
|
11793
11742
|
}
|
|
11794
11743
|
}
|
|
11795
|
-
var ElseExpressionClause$0 = $TS($S($C($S(
|
|
11744
|
+
var ElseExpressionClause$0 = $TS($S($C($S(Nested, Else), $S($E(_), Else)), ElseExpressionBlock), function($skip, $loc, $0, $1, $2) {
|
|
11796
11745
|
return [...$1, $2];
|
|
11797
11746
|
});
|
|
11798
11747
|
function ElseExpressionClause(state) {
|
|
@@ -12896,7 +12845,7 @@ ${input.slice(result.pos)}
|
|
|
12896
12845
|
return result;
|
|
12897
12846
|
}
|
|
12898
12847
|
}
|
|
12899
|
-
var CaseBlock$0 = $TS($S($E($C(
|
|
12848
|
+
var CaseBlock$0 = $TS($S($E($C(Nested, _)), OpenBrace, NestedCaseClauses, __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
12900
12849
|
var clauses = $3;
|
|
12901
12850
|
return {
|
|
12902
12851
|
type: "CaseBlock",
|
|
@@ -13113,11 +13062,9 @@ ${input.slice(result.pos)}
|
|
|
13113
13062
|
return result;
|
|
13114
13063
|
}
|
|
13115
13064
|
}
|
|
13116
|
-
var CaseExpressionList$0 = $TS($S(
|
|
13117
|
-
var first = $
|
|
13118
|
-
var rest = $
|
|
13119
|
-
if (!first)
|
|
13120
|
-
return $skip;
|
|
13065
|
+
var CaseExpressionList$0 = $TS($S($S($E(_), CaseExpression, InsertColon), $Q($S(__, Comma, CaseExpression, InsertColon))), function($skip, $loc, $0, $1, $2) {
|
|
13066
|
+
var first = $1;
|
|
13067
|
+
var rest = $2;
|
|
13121
13068
|
const result = rest.map(([ws, _comma, exp, col]) => {
|
|
13122
13069
|
exp = insertTrimmingSpace(exp, "");
|
|
13123
13070
|
if (ws.length)
|
|
@@ -13310,7 +13257,7 @@ ${input.slice(result.pos)}
|
|
|
13310
13257
|
return result;
|
|
13311
13258
|
}
|
|
13312
13259
|
}
|
|
13313
|
-
var CatchClause$0 = $TS($S($C(
|
|
13260
|
+
var CatchClause$0 = $TS($S($C(Nested, _), Catch, $E(CatchBind), $C(ThenClause, BracedOrEmptyBlock)), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
13314
13261
|
var block = $4;
|
|
13315
13262
|
return {
|
|
13316
13263
|
type: "CatchClause",
|
|
@@ -13364,7 +13311,7 @@ ${input.slice(result.pos)}
|
|
|
13364
13311
|
return result;
|
|
13365
13312
|
}
|
|
13366
13313
|
}
|
|
13367
|
-
var FinallyClause$0 = $S($C(
|
|
13314
|
+
var FinallyClause$0 = $S($C(Nested, _), Finally, $C(ThenClause, BracedOrEmptyBlock));
|
|
13368
13315
|
function FinallyClause(state) {
|
|
13369
13316
|
let eventData;
|
|
13370
13317
|
if (state.events) {
|
|
@@ -13476,17 +13423,19 @@ ${input.slice(result.pos)}
|
|
|
13476
13423
|
type: "Ref",
|
|
13477
13424
|
base: "ref"
|
|
13478
13425
|
};
|
|
13479
|
-
const {
|
|
13426
|
+
const { decl, bindings } = dec;
|
|
13427
|
+
const binding = bindings[0];
|
|
13428
|
+
const { pattern, suffix, initializer, splices, thisAssignments } = binding;
|
|
13480
13429
|
const initCondition = {
|
|
13481
13430
|
type: "AssignmentExpression",
|
|
13482
|
-
children: [ref,
|
|
13431
|
+
children: [ref, initializer],
|
|
13483
13432
|
hoistDec: {
|
|
13484
13433
|
type: "Declaration",
|
|
13485
|
-
children: ["let ", ref],
|
|
13434
|
+
children: ["let ", ref, suffix],
|
|
13486
13435
|
names: []
|
|
13487
13436
|
},
|
|
13488
13437
|
blockPrefix: [
|
|
13489
|
-
["", [
|
|
13438
|
+
["", [decl, pattern, suffix, " = ", ref, ...splices], ";"],
|
|
13490
13439
|
...thisAssignments
|
|
13491
13440
|
]
|
|
13492
13441
|
};
|
|
@@ -13986,110 +13935,6 @@ ${input.slice(result.pos)}
|
|
|
13986
13935
|
return result;
|
|
13987
13936
|
}
|
|
13988
13937
|
}
|
|
13989
|
-
var ForbidMultiLineImplicitObjectLiteral$0 = $TV($EXPECT($L0, fail, 'ForbidMultiLineImplicitObjectLiteral ""'), function($skip, $loc, $0, $1) {
|
|
13990
|
-
module.forbidMultiLineImplicitObjectLiteral.push(true);
|
|
13991
|
-
});
|
|
13992
|
-
function ForbidMultiLineImplicitObjectLiteral(state) {
|
|
13993
|
-
let eventData;
|
|
13994
|
-
if (state.events) {
|
|
13995
|
-
const result = state.events.enter?.("ForbidMultiLineImplicitObjectLiteral", state);
|
|
13996
|
-
if (result) {
|
|
13997
|
-
if (result.cache)
|
|
13998
|
-
return result.cache;
|
|
13999
|
-
eventData = result.data;
|
|
14000
|
-
}
|
|
14001
|
-
}
|
|
14002
|
-
if (state.tokenize) {
|
|
14003
|
-
const result = $TOKEN("ForbidMultiLineImplicitObjectLiteral", state, ForbidMultiLineImplicitObjectLiteral$0(state));
|
|
14004
|
-
if (state.events)
|
|
14005
|
-
state.events.exit?.("ForbidMultiLineImplicitObjectLiteral", state, result, eventData);
|
|
14006
|
-
return result;
|
|
14007
|
-
} else {
|
|
14008
|
-
const result = ForbidMultiLineImplicitObjectLiteral$0(state);
|
|
14009
|
-
if (state.events)
|
|
14010
|
-
state.events.exit?.("ForbidMultiLineImplicitObjectLiteral", state, result, eventData);
|
|
14011
|
-
return result;
|
|
14012
|
-
}
|
|
14013
|
-
}
|
|
14014
|
-
var AllowMultiLineImplicitObjectLiteral$0 = $TV($EXPECT($L0, fail, 'AllowMultiLineImplicitObjectLiteral ""'), function($skip, $loc, $0, $1) {
|
|
14015
|
-
module.forbidMultiLineImplicitObjectLiteral.push(false);
|
|
14016
|
-
});
|
|
14017
|
-
function AllowMultiLineImplicitObjectLiteral(state) {
|
|
14018
|
-
let eventData;
|
|
14019
|
-
if (state.events) {
|
|
14020
|
-
const result = state.events.enter?.("AllowMultiLineImplicitObjectLiteral", state);
|
|
14021
|
-
if (result) {
|
|
14022
|
-
if (result.cache)
|
|
14023
|
-
return result.cache;
|
|
14024
|
-
eventData = result.data;
|
|
14025
|
-
}
|
|
14026
|
-
}
|
|
14027
|
-
if (state.tokenize) {
|
|
14028
|
-
const result = $TOKEN("AllowMultiLineImplicitObjectLiteral", state, AllowMultiLineImplicitObjectLiteral$0(state));
|
|
14029
|
-
if (state.events)
|
|
14030
|
-
state.events.exit?.("AllowMultiLineImplicitObjectLiteral", state, result, eventData);
|
|
14031
|
-
return result;
|
|
14032
|
-
} else {
|
|
14033
|
-
const result = AllowMultiLineImplicitObjectLiteral$0(state);
|
|
14034
|
-
if (state.events)
|
|
14035
|
-
state.events.exit?.("AllowMultiLineImplicitObjectLiteral", state, result, eventData);
|
|
14036
|
-
return result;
|
|
14037
|
-
}
|
|
14038
|
-
}
|
|
14039
|
-
var RestoreMultiLineImplicitObjectLiteral$0 = $TV($EXPECT($L0, fail, 'RestoreMultiLineImplicitObjectLiteral ""'), function($skip, $loc, $0, $1) {
|
|
14040
|
-
module.forbidMultiLineImplicitObjectLiteral.pop();
|
|
14041
|
-
});
|
|
14042
|
-
function RestoreMultiLineImplicitObjectLiteral(state) {
|
|
14043
|
-
let eventData;
|
|
14044
|
-
if (state.events) {
|
|
14045
|
-
const result = state.events.enter?.("RestoreMultiLineImplicitObjectLiteral", state);
|
|
14046
|
-
if (result) {
|
|
14047
|
-
if (result.cache)
|
|
14048
|
-
return result.cache;
|
|
14049
|
-
eventData = result.data;
|
|
14050
|
-
}
|
|
14051
|
-
}
|
|
14052
|
-
if (state.tokenize) {
|
|
14053
|
-
const result = $TOKEN("RestoreMultiLineImplicitObjectLiteral", state, RestoreMultiLineImplicitObjectLiteral$0(state));
|
|
14054
|
-
if (state.events)
|
|
14055
|
-
state.events.exit?.("RestoreMultiLineImplicitObjectLiteral", state, result, eventData);
|
|
14056
|
-
return result;
|
|
14057
|
-
} else {
|
|
14058
|
-
const result = RestoreMultiLineImplicitObjectLiteral$0(state);
|
|
14059
|
-
if (state.events)
|
|
14060
|
-
state.events.exit?.("RestoreMultiLineImplicitObjectLiteral", state, result, eventData);
|
|
14061
|
-
return result;
|
|
14062
|
-
}
|
|
14063
|
-
}
|
|
14064
|
-
var MultiLineImplicitObjectLiteralAllowed$0 = $TV($EXPECT($L0, fail, 'MultiLineImplicitObjectLiteralAllowed ""'), function($skip, $loc, $0, $1) {
|
|
14065
|
-
if (module.config.verbose) {
|
|
14066
|
-
console.log("forbidMultiLineImplicitObjectLiteral:", module.forbidMultiLineImplicitObjectLiteral);
|
|
14067
|
-
}
|
|
14068
|
-
if (module.multiLineImplicitObjectLiteralForbidden)
|
|
14069
|
-
return $skip;
|
|
14070
|
-
});
|
|
14071
|
-
function MultiLineImplicitObjectLiteralAllowed(state) {
|
|
14072
|
-
let eventData;
|
|
14073
|
-
if (state.events) {
|
|
14074
|
-
const result = state.events.enter?.("MultiLineImplicitObjectLiteralAllowed", state);
|
|
14075
|
-
if (result) {
|
|
14076
|
-
if (result.cache)
|
|
14077
|
-
return result.cache;
|
|
14078
|
-
eventData = result.data;
|
|
14079
|
-
}
|
|
14080
|
-
}
|
|
14081
|
-
if (state.tokenize) {
|
|
14082
|
-
const result = $TOKEN("MultiLineImplicitObjectLiteralAllowed", state, MultiLineImplicitObjectLiteralAllowed$0(state));
|
|
14083
|
-
if (state.events)
|
|
14084
|
-
state.events.exit?.("MultiLineImplicitObjectLiteralAllowed", state, result, eventData);
|
|
14085
|
-
return result;
|
|
14086
|
-
} else {
|
|
14087
|
-
const result = MultiLineImplicitObjectLiteralAllowed$0(state);
|
|
14088
|
-
if (state.events)
|
|
14089
|
-
state.events.exit?.("MultiLineImplicitObjectLiteralAllowed", state, result, eventData);
|
|
14090
|
-
return result;
|
|
14091
|
-
}
|
|
14092
|
-
}
|
|
14093
13938
|
var AllowNewlineBinaryOp$0 = $TV($EXPECT($L0, fail, 'AllowNewlineBinaryOp ""'), function($skip, $loc, $0, $1) {
|
|
14094
13939
|
module.forbidNewlineBinaryOp.push(false);
|
|
14095
13940
|
});
|
|
@@ -14194,7 +14039,7 @@ ${input.slice(result.pos)}
|
|
|
14194
14039
|
return result;
|
|
14195
14040
|
}
|
|
14196
14041
|
}
|
|
14197
|
-
var AllowAll$0 = $S(AllowTrailingMemberProperty, AllowBracedApplication, AllowIndentedApplication,
|
|
14042
|
+
var AllowAll$0 = $S(AllowTrailingMemberProperty, AllowBracedApplication, AllowIndentedApplication, AllowClassImplicitCall, AllowNewlineBinaryOp);
|
|
14198
14043
|
function AllowAll(state) {
|
|
14199
14044
|
let eventData;
|
|
14200
14045
|
if (state.events) {
|
|
@@ -14217,7 +14062,7 @@ ${input.slice(result.pos)}
|
|
|
14217
14062
|
return result;
|
|
14218
14063
|
}
|
|
14219
14064
|
}
|
|
14220
|
-
var RestoreAll$0 = $S(RestoreTrailingMemberProperty, RestoreBracedApplication, RestoreIndentedApplication,
|
|
14065
|
+
var RestoreAll$0 = $S(RestoreTrailingMemberProperty, RestoreBracedApplication, RestoreIndentedApplication, RestoreClassImplicitCall, RestoreNewlineBinaryOp);
|
|
14221
14066
|
function RestoreAll(state) {
|
|
14222
14067
|
let eventData;
|
|
14223
14068
|
if (state.events) {
|
|
@@ -15185,26 +15030,23 @@ ${input.slice(result.pos)}
|
|
|
15185
15030
|
return result;
|
|
15186
15031
|
}
|
|
15187
15032
|
}
|
|
15188
|
-
var LexicalDeclaration$0 = $TS($S(LetOrConst, LexicalBinding, $Q($S(__, Comma, LexicalBinding))), function($skip, $loc, $0, $1, $2, $3) {
|
|
15189
|
-
var
|
|
15033
|
+
var LexicalDeclaration$0 = $TS($S(LetOrConst, LexicalBinding, $Q($S(__, Comma, __, LexicalBinding))), function($skip, $loc, $0, $1, $2, $3) {
|
|
15034
|
+
var decl = $1;
|
|
15190
15035
|
var binding = $2;
|
|
15191
15036
|
var tail = $3;
|
|
15192
|
-
const
|
|
15037
|
+
const bindings = [binding].concat(tail.map(([, , , b]) => b));
|
|
15193
15038
|
return {
|
|
15194
15039
|
type: "Declaration",
|
|
15195
15040
|
children: $0,
|
|
15196
|
-
names:
|
|
15197
|
-
|
|
15198
|
-
|
|
15199
|
-
|
|
15200
|
-
|
|
15201
|
-
initializer: binding.initializer,
|
|
15202
|
-
splices,
|
|
15203
|
-
thisAssignments
|
|
15041
|
+
names: bindings.flatMap((b) => b.names),
|
|
15042
|
+
bindings,
|
|
15043
|
+
decl,
|
|
15044
|
+
splices: bindings.flatMap((b) => b.splices),
|
|
15045
|
+
thisAssignments: bindings.flatMap((b) => b.thisAssignments)
|
|
15204
15046
|
};
|
|
15205
15047
|
});
|
|
15206
15048
|
var LexicalDeclaration$1 = $TS($S(InsertConst, $C(BindingPattern, BindingIdentifier), $E(TypeSuffix), __, ConstAssignment, ExtendedExpression), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
15207
|
-
return
|
|
15049
|
+
return processAssignmentDeclaration(...$0);
|
|
15208
15050
|
});
|
|
15209
15051
|
var LexicalDeclaration$2 = $TS($S(InsertLet, $C(BindingPattern, BindingIdentifier), $E(TypeSuffix), __, LetAssignment, ExtendedExpression), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
15210
15052
|
var l = $1;
|
|
@@ -15213,7 +15055,7 @@ ${input.slice(result.pos)}
|
|
|
15213
15055
|
var ws = $4;
|
|
15214
15056
|
var la = $5;
|
|
15215
15057
|
var e = $6;
|
|
15216
|
-
return
|
|
15058
|
+
return processAssignmentDeclaration(...$0);
|
|
15217
15059
|
});
|
|
15218
15060
|
function LexicalDeclaration(state) {
|
|
15219
15061
|
let eventData;
|
|
@@ -15287,48 +15129,32 @@ ${input.slice(result.pos)}
|
|
|
15287
15129
|
return result;
|
|
15288
15130
|
}
|
|
15289
15131
|
}
|
|
15290
|
-
var LexicalBinding$0 = $TS($S(BindingPattern, $E(TypeSuffix),
|
|
15291
|
-
var
|
|
15132
|
+
var LexicalBinding$0 = $TS($S(BindingPattern, $E(TypeSuffix), Initializer), function($skip, $loc, $0, $1, $2, $3) {
|
|
15133
|
+
var pattern = $1;
|
|
15292
15134
|
var suffix = $2;
|
|
15293
|
-
var
|
|
15294
|
-
|
|
15295
|
-
const bindingChildren = [...binding.children];
|
|
15296
|
-
if (suffix)
|
|
15297
|
-
bindingChildren.push(suffix);
|
|
15298
|
-
if (ws)
|
|
15299
|
-
bindingChildren.push(...ws);
|
|
15300
|
-
binding = {
|
|
15301
|
-
...binding,
|
|
15302
|
-
children: bindingChildren
|
|
15303
|
-
};
|
|
15304
|
-
const [splices, thisAssignments] = gatherBindingCode(binding.children);
|
|
15135
|
+
var initializer = $3;
|
|
15136
|
+
const [splices, thisAssignments] = gatherBindingCode(pattern);
|
|
15305
15137
|
return {
|
|
15306
|
-
|
|
15307
|
-
|
|
15308
|
-
|
|
15138
|
+
type: "Binding",
|
|
15139
|
+
children: $0,
|
|
15140
|
+
names: pattern.names,
|
|
15141
|
+
pattern,
|
|
15142
|
+
suffix,
|
|
15309
15143
|
initializer,
|
|
15310
15144
|
splices: splices.map((s) => [",", s]),
|
|
15311
15145
|
thisAssignments: thisAssignments.map((s) => ["", s, ";"])
|
|
15312
15146
|
};
|
|
15313
15147
|
});
|
|
15314
|
-
var LexicalBinding$1 = $TS($S(BindingIdentifier, $E(TypeSuffix), $E(
|
|
15315
|
-
var
|
|
15148
|
+
var LexicalBinding$1 = $TS($S(BindingIdentifier, $E(TypeSuffix), $E(Initializer)), function($skip, $loc, $0, $1, $2, $3) {
|
|
15149
|
+
var pattern = $1;
|
|
15316
15150
|
var suffix = $2;
|
|
15317
|
-
var
|
|
15318
|
-
var initializer = $4;
|
|
15319
|
-
const bindingChildren = [...binding.children];
|
|
15320
|
-
if (suffix)
|
|
15321
|
-
bindingChildren.push(suffix);
|
|
15322
|
-
if (ws)
|
|
15323
|
-
bindingChildren.push(...ws);
|
|
15324
|
-
binding = {
|
|
15325
|
-
...binding,
|
|
15326
|
-
children: bindingChildren
|
|
15327
|
-
};
|
|
15151
|
+
var initializer = $3;
|
|
15328
15152
|
return {
|
|
15329
|
-
|
|
15330
|
-
|
|
15331
|
-
|
|
15153
|
+
type: "Binding",
|
|
15154
|
+
children: $0,
|
|
15155
|
+
names: pattern.names,
|
|
15156
|
+
pattern,
|
|
15157
|
+
suffix,
|
|
15332
15158
|
initializer,
|
|
15333
15159
|
splices: [],
|
|
15334
15160
|
thisAssignments: []
|
|
@@ -15380,9 +15206,10 @@ ${input.slice(result.pos)}
|
|
|
15380
15206
|
}
|
|
15381
15207
|
}
|
|
15382
15208
|
var VariableStatement$0 = $TS($S(Var, __, VariableDeclarationList), function($skip, $loc, $0, $1, $2, $3) {
|
|
15383
|
-
return
|
|
15209
|
+
return {
|
|
15210
|
+
...$3,
|
|
15384
15211
|
children: [$1, ...$2, ...$3.children]
|
|
15385
|
-
}
|
|
15212
|
+
};
|
|
15386
15213
|
});
|
|
15387
15214
|
function VariableStatement(state) {
|
|
15388
15215
|
let eventData;
|
|
@@ -15406,18 +15233,15 @@ ${input.slice(result.pos)}
|
|
|
15406
15233
|
return result;
|
|
15407
15234
|
}
|
|
15408
15235
|
}
|
|
15409
|
-
var VariableDeclarationList$0 = $TS($S(
|
|
15410
|
-
|
|
15411
|
-
|
|
15412
|
-
|
|
15413
|
-
} else {
|
|
15414
|
-
children = [$1];
|
|
15415
|
-
}
|
|
15416
|
-
const names = children.flatMap((c) => c.names || []);
|
|
15236
|
+
var VariableDeclarationList$0 = $TS($S(LexicalBinding, $Q($S(__, Comma, __, LexicalBinding))), function($skip, $loc, $0, $1, $2) {
|
|
15237
|
+
var binding = $1;
|
|
15238
|
+
var tail = $2;
|
|
15239
|
+
const bindings = [binding].concat(tail.map(([, , , b]) => b));
|
|
15417
15240
|
return {
|
|
15418
15241
|
type: "Declaration",
|
|
15419
|
-
children,
|
|
15420
|
-
|
|
15242
|
+
children: [binding, ...tail],
|
|
15243
|
+
bindings,
|
|
15244
|
+
names: bindings.flatMap((b) => b.names)
|
|
15421
15245
|
};
|
|
15422
15246
|
});
|
|
15423
15247
|
function VariableDeclarationList(state) {
|
|
@@ -15442,49 +15266,6 @@ ${input.slice(result.pos)}
|
|
|
15442
15266
|
return result;
|
|
15443
15267
|
}
|
|
15444
15268
|
}
|
|
15445
|
-
var VariableDeclaration$0 = $TS($S(BindingPattern, $E(TypeSuffix), Initializer), function($skip, $loc, $0, $1, $2, $3) {
|
|
15446
|
-
const children = [...$1.children];
|
|
15447
|
-
if ($2)
|
|
15448
|
-
children.push($2);
|
|
15449
|
-
children.push($3);
|
|
15450
|
-
return {
|
|
15451
|
-
children,
|
|
15452
|
-
names: $1.names
|
|
15453
|
-
};
|
|
15454
|
-
});
|
|
15455
|
-
var VariableDeclaration$1 = $TS($S(BindingIdentifier, $E(TypeSuffix), $E(Initializer)), function($skip, $loc, $0, $1, $2, $3) {
|
|
15456
|
-
const children = [...$1.children];
|
|
15457
|
-
if ($2)
|
|
15458
|
-
children.push($2);
|
|
15459
|
-
if ($3)
|
|
15460
|
-
children.push($3);
|
|
15461
|
-
return {
|
|
15462
|
-
children,
|
|
15463
|
-
names: $1.names
|
|
15464
|
-
};
|
|
15465
|
-
});
|
|
15466
|
-
function VariableDeclaration(state) {
|
|
15467
|
-
let eventData;
|
|
15468
|
-
if (state.events) {
|
|
15469
|
-
const result = state.events.enter?.("VariableDeclaration", state);
|
|
15470
|
-
if (result) {
|
|
15471
|
-
if (result.cache)
|
|
15472
|
-
return result.cache;
|
|
15473
|
-
eventData = result.data;
|
|
15474
|
-
}
|
|
15475
|
-
}
|
|
15476
|
-
if (state.tokenize) {
|
|
15477
|
-
const result = $TOKEN("VariableDeclaration", state, VariableDeclaration$0(state) || VariableDeclaration$1(state));
|
|
15478
|
-
if (state.events)
|
|
15479
|
-
state.events.exit?.("VariableDeclaration", state, result, eventData);
|
|
15480
|
-
return result;
|
|
15481
|
-
} else {
|
|
15482
|
-
const result = VariableDeclaration$0(state) || VariableDeclaration$1(state);
|
|
15483
|
-
if (state.events)
|
|
15484
|
-
state.events.exit?.("VariableDeclaration", state, result, eventData);
|
|
15485
|
-
return result;
|
|
15486
|
-
}
|
|
15487
|
-
}
|
|
15488
15269
|
var NumericLiteral$0 = $TS($S(NumericLiteralKind), function($skip, $loc, $0, $1) {
|
|
15489
15270
|
return { type: "NumericLiteral", $loc, token: $1 };
|
|
15490
15271
|
});
|
|
@@ -16884,7 +16665,7 @@ ${input.slice(result.pos)}
|
|
|
16884
16665
|
}
|
|
16885
16666
|
}
|
|
16886
16667
|
var StatementDelimiter$0 = SemicolonDelimiter;
|
|
16887
|
-
var StatementDelimiter$1 = $S($Y($S(
|
|
16668
|
+
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);
|
|
16888
16669
|
var StatementDelimiter$2 = $Y(EOS);
|
|
16889
16670
|
function StatementDelimiter(state) {
|
|
16890
16671
|
let eventData;
|
|
@@ -19105,7 +18886,7 @@ ${input.slice(result.pos)}
|
|
|
19105
18886
|
return result;
|
|
19106
18887
|
}
|
|
19107
18888
|
}
|
|
19108
|
-
var JSXImplicitFragment$0 = $TS($S(JSXTag, $Q($S(
|
|
18889
|
+
var JSXImplicitFragment$0 = $TS($S(JSXTag, $Q($S(Nested, JSXTag))), function($skip, $loc, $0, $1, $2) {
|
|
19109
18890
|
const jsx = $2.length === 0 ? $1 : {
|
|
19110
18891
|
type: "JSXFragment",
|
|
19111
18892
|
children: [
|
|
@@ -20625,7 +20406,7 @@ ${input.slice(result.pos)}
|
|
|
20625
20406
|
return result;
|
|
20626
20407
|
}
|
|
20627
20408
|
}
|
|
20628
|
-
var TypeDeclarationRest$0 = $S(TypeKeyword, $E(_), IdentifierName, $E(TypeParameters),
|
|
20409
|
+
var TypeDeclarationRest$0 = $S(TypeKeyword, $E(_), IdentifierName, $E(TypeParameters), OptionalEquals, $C($S($E(_), Type), $S(__, Type)));
|
|
20629
20410
|
var TypeDeclarationRest$1 = $S(Interface, $E(_), IdentifierName, $E(TypeParameters), $E(InterfaceExtendsClause), InterfaceBlock);
|
|
20630
20411
|
var TypeDeclarationRest$2 = $S(Namespace, $E(_), IdentifierName, ModuleBlock);
|
|
20631
20412
|
var TypeDeclarationRest$3 = FunctionSignature;
|
|
@@ -20651,6 +20432,32 @@ ${input.slice(result.pos)}
|
|
|
20651
20432
|
return result;
|
|
20652
20433
|
}
|
|
20653
20434
|
}
|
|
20435
|
+
var OptionalEquals$0 = $S(__, Equals);
|
|
20436
|
+
var OptionalEquals$1 = $T($S($Y(IndentedFurther), InsertSpaceEquals), function(value) {
|
|
20437
|
+
return value[1];
|
|
20438
|
+
});
|
|
20439
|
+
function OptionalEquals(state) {
|
|
20440
|
+
let eventData;
|
|
20441
|
+
if (state.events) {
|
|
20442
|
+
const result = state.events.enter?.("OptionalEquals", state);
|
|
20443
|
+
if (result) {
|
|
20444
|
+
if (result.cache)
|
|
20445
|
+
return result.cache;
|
|
20446
|
+
eventData = result.data;
|
|
20447
|
+
}
|
|
20448
|
+
}
|
|
20449
|
+
if (state.tokenize) {
|
|
20450
|
+
const result = $TOKEN("OptionalEquals", state, OptionalEquals$0(state) || OptionalEquals$1(state));
|
|
20451
|
+
if (state.events)
|
|
20452
|
+
state.events.exit?.("OptionalEquals", state, result, eventData);
|
|
20453
|
+
return result;
|
|
20454
|
+
} else {
|
|
20455
|
+
const result = OptionalEquals$0(state) || OptionalEquals$1(state);
|
|
20456
|
+
if (state.events)
|
|
20457
|
+
state.events.exit?.("OptionalEquals", state, result, eventData);
|
|
20458
|
+
return result;
|
|
20459
|
+
}
|
|
20460
|
+
}
|
|
20654
20461
|
var TypeLexicalDeclaration$0 = $S(__, LetOrConstOrVar, TypeDeclarationBinding, $Q($S(CommaDelimiter, __, TypeDeclarationBinding)));
|
|
20655
20462
|
var TypeLexicalDeclaration$1 = $S(__, EnumDeclaration);
|
|
20656
20463
|
var TypeLexicalDeclaration$2 = ClassSignature;
|
|
@@ -21245,9 +21052,9 @@ ${input.slice(result.pos)}
|
|
|
21245
21052
|
["let ", id, " = {};\n"],
|
|
21246
21053
|
...block.properties.map((property, i) => {
|
|
21247
21054
|
let init, isString;
|
|
21248
|
-
if (property.
|
|
21055
|
+
if (property.initializer) {
|
|
21249
21056
|
init = replaceNodes(
|
|
21250
|
-
deepCopy(property.
|
|
21057
|
+
deepCopy(property.initializer),
|
|
21251
21058
|
(n) => n.type === "Identifier" && names.has(n.name),
|
|
21252
21059
|
(n) => [id, '["', n.name, '"]']
|
|
21253
21060
|
);
|
|
@@ -21410,11 +21217,11 @@ ${input.slice(result.pos)}
|
|
|
21410
21217
|
}
|
|
21411
21218
|
var EnumProperty$0 = $TS($S(Identifier, $E($S(__, Equals, ExtendedExpression)), ObjectPropertyDelimiter), function($skip, $loc, $0, $1, $2, $3) {
|
|
21412
21219
|
var name = $1;
|
|
21413
|
-
var
|
|
21220
|
+
var initializer = $2;
|
|
21414
21221
|
return {
|
|
21415
21222
|
type: "EnumProperty",
|
|
21416
21223
|
name,
|
|
21417
|
-
|
|
21224
|
+
initializer,
|
|
21418
21225
|
children: $0
|
|
21419
21226
|
};
|
|
21420
21227
|
});
|
|
@@ -21798,10 +21605,10 @@ ${input.slice(result.pos)}
|
|
|
21798
21605
|
return result;
|
|
21799
21606
|
}
|
|
21800
21607
|
}
|
|
21801
|
-
var TypePrimary$0 =
|
|
21802
|
-
var TypePrimary$1 =
|
|
21803
|
-
var TypePrimary$2 = $S($E(_),
|
|
21804
|
-
var TypePrimary$3 = $S($E(_),
|
|
21608
|
+
var TypePrimary$0 = $S($E(_), TypeTuple);
|
|
21609
|
+
var TypePrimary$1 = InterfaceBlock;
|
|
21610
|
+
var TypePrimary$2 = $S($E(_), FunctionType);
|
|
21611
|
+
var TypePrimary$3 = $S($E(_), InlineInterfaceLiteral);
|
|
21805
21612
|
var TypePrimary$4 = $S($E(_), ImportType);
|
|
21806
21613
|
var TypePrimary$5 = $TS($S($E(_), TypeLiteral), function($skip, $loc, $0, $1, $2) {
|
|
21807
21614
|
var t = $2;
|
|
@@ -21914,25 +21721,34 @@ ${input.slice(result.pos)}
|
|
|
21914
21721
|
return result;
|
|
21915
21722
|
}
|
|
21916
21723
|
}
|
|
21917
|
-
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) {
|
|
21724
|
+
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) {
|
|
21918
21725
|
var ws = $1;
|
|
21919
|
-
var
|
|
21920
|
-
var
|
|
21921
|
-
var
|
|
21726
|
+
var dots1 = $2;
|
|
21727
|
+
var name = $3;
|
|
21728
|
+
var dots2 = $4;
|
|
21922
21729
|
var colon = $5;
|
|
21923
21730
|
var type = $6;
|
|
21924
|
-
|
|
21731
|
+
let dots = dots1 || dots2 && [dots2[1], dots2[0]];
|
|
21732
|
+
if (dots1 && dots2) {
|
|
21733
|
+
dots = [dots, {
|
|
21734
|
+
type: "Error",
|
|
21735
|
+
message: "... both before and after identifier"
|
|
21736
|
+
}];
|
|
21737
|
+
}
|
|
21738
|
+
return [ws, dots, name, colon, type];
|
|
21925
21739
|
});
|
|
21926
|
-
var TypeElement$1 = $
|
|
21740
|
+
var TypeElement$1 = $S(__, DotDotDot, __, Type);
|
|
21741
|
+
var TypeElement$2 = $TS($S(Type, $E($S($E(_), DotDotDot))), function($skip, $loc, $0, $1, $2) {
|
|
21927
21742
|
var type = $1;
|
|
21928
|
-
var
|
|
21929
|
-
|
|
21743
|
+
var spaceDots = $2;
|
|
21744
|
+
if (!spaceDots)
|
|
21745
|
+
return type;
|
|
21746
|
+
const [space, dots] = spaceDots;
|
|
21930
21747
|
const ws = getTrimmingSpace(type);
|
|
21931
21748
|
if (!ws)
|
|
21932
21749
|
return [dots, space, type];
|
|
21933
21750
|
return [ws, dots, space, insertTrimmingSpace(type, "")];
|
|
21934
21751
|
});
|
|
21935
|
-
var TypeElement$2 = $S($E($S(__, DotDotDot)), $E($S(__, IdentifierName, __, $E($S(QuestionMark, $E(_))), Colon, __)), Type);
|
|
21936
21752
|
function TypeElement(state) {
|
|
21937
21753
|
let eventData;
|
|
21938
21754
|
if (state.events) {
|
|
@@ -23035,6 +22851,31 @@ ${input.slice(result.pos)}
|
|
|
23035
22851
|
return result;
|
|
23036
22852
|
}
|
|
23037
22853
|
}
|
|
22854
|
+
var InsertSpaceEquals$0 = $TV($EXPECT($L0, fail, 'InsertSpaceEquals ""'), function($skip, $loc, $0, $1) {
|
|
22855
|
+
return { $loc, token: " =" };
|
|
22856
|
+
});
|
|
22857
|
+
function InsertSpaceEquals(state) {
|
|
22858
|
+
let eventData;
|
|
22859
|
+
if (state.events) {
|
|
22860
|
+
const result = state.events.enter?.("InsertSpaceEquals", state);
|
|
22861
|
+
if (result) {
|
|
22862
|
+
if (result.cache)
|
|
22863
|
+
return result.cache;
|
|
22864
|
+
eventData = result.data;
|
|
22865
|
+
}
|
|
22866
|
+
}
|
|
22867
|
+
if (state.tokenize) {
|
|
22868
|
+
const result = $TOKEN("InsertSpaceEquals", state, InsertSpaceEquals$0(state));
|
|
22869
|
+
if (state.events)
|
|
22870
|
+
state.events.exit?.("InsertSpaceEquals", state, result, eventData);
|
|
22871
|
+
return result;
|
|
22872
|
+
} else {
|
|
22873
|
+
const result = InsertSpaceEquals$0(state);
|
|
22874
|
+
if (state.events)
|
|
22875
|
+
state.events.exit?.("InsertSpaceEquals", state, result, eventData);
|
|
22876
|
+
return result;
|
|
22877
|
+
}
|
|
22878
|
+
}
|
|
23038
22879
|
var InsertConst$0 = $TV($EXPECT($L0, fail, 'InsertConst ""'), function($skip, $loc, $0, $1) {
|
|
23039
22880
|
return { $loc, token: "const " };
|
|
23040
22881
|
});
|
|
@@ -23647,7 +23488,6 @@ ${input.slice(result.pos)}
|
|
|
23647
23488
|
module.forbidIndentedApplication = [false];
|
|
23648
23489
|
module.forbidBracedApplication = [false];
|
|
23649
23490
|
module.forbidTrailingMemberProperty = [false];
|
|
23650
|
-
module.forbidMultiLineImplicitObjectLiteral = [false];
|
|
23651
23491
|
module.forbidNewlineBinaryOp = [false];
|
|
23652
23492
|
module.JSXTagStack = [];
|
|
23653
23493
|
module.operators = /* @__PURE__ */ new Set();
|
|
@@ -23684,12 +23524,6 @@ ${input.slice(result.pos)}
|
|
|
23684
23524
|
return s[s.length - 1];
|
|
23685
23525
|
}
|
|
23686
23526
|
},
|
|
23687
|
-
multiLineImplicitObjectLiteralForbidden: {
|
|
23688
|
-
get() {
|
|
23689
|
-
const { forbidMultiLineImplicitObjectLiteral: s } = module;
|
|
23690
|
-
return s[s.length - 1];
|
|
23691
|
-
}
|
|
23692
|
-
},
|
|
23693
23527
|
newlineBinaryOpForbidden: {
|
|
23694
23528
|
get() {
|
|
23695
23529
|
const { forbidNewlineBinaryOp: s } = module;
|
|
@@ -23992,19 +23826,11 @@ ${input.slice(result.pos)}
|
|
|
23992
23826
|
return result;
|
|
23993
23827
|
}
|
|
23994
23828
|
}
|
|
23995
|
-
var
|
|
23996
|
-
|
|
23997
|
-
const { level } = indent;
|
|
23998
|
-
const currentIndentLevel = module.currentIndent.level;
|
|
23999
|
-
if (level === currentIndentLevel) {
|
|
24000
|
-
return $0;
|
|
24001
|
-
}
|
|
24002
|
-
return $skip;
|
|
24003
|
-
});
|
|
24004
|
-
function Samedent(state) {
|
|
23829
|
+
var PushIndent$0 = $Y($S(EOS, TrackIndented));
|
|
23830
|
+
function PushIndent(state) {
|
|
24005
23831
|
let eventData;
|
|
24006
23832
|
if (state.events) {
|
|
24007
|
-
const result = state.events.enter?.("
|
|
23833
|
+
const result = state.events.enter?.("PushIndent", state);
|
|
24008
23834
|
if (result) {
|
|
24009
23835
|
if (result.cache)
|
|
24010
23836
|
return result.cache;
|
|
@@ -24012,30 +23838,27 @@ ${input.slice(result.pos)}
|
|
|
24012
23838
|
}
|
|
24013
23839
|
}
|
|
24014
23840
|
if (state.tokenize) {
|
|
24015
|
-
const result = $TOKEN("
|
|
23841
|
+
const result = $TOKEN("PushIndent", state, PushIndent$0(state));
|
|
24016
23842
|
if (state.events)
|
|
24017
|
-
state.events.exit?.("
|
|
23843
|
+
state.events.exit?.("PushIndent", state, result, eventData);
|
|
24018
23844
|
return result;
|
|
24019
23845
|
} else {
|
|
24020
|
-
const result =
|
|
23846
|
+
const result = PushIndent$0(state);
|
|
24021
23847
|
if (state.events)
|
|
24022
|
-
state.events.exit?.("
|
|
23848
|
+
state.events.exit?.("PushIndent", state, result, eventData);
|
|
24023
23849
|
return result;
|
|
24024
23850
|
}
|
|
24025
23851
|
}
|
|
24026
|
-
var
|
|
24027
|
-
|
|
24028
|
-
|
|
24029
|
-
const currentIndentLevel = module.currentIndent.level;
|
|
24030
|
-
if (level > currentIndentLevel) {
|
|
24031
|
-
return $0;
|
|
23852
|
+
var PopIndent$0 = $TV($EXPECT($L0, fail, 'PopIndent ""'), function($skip, $loc, $0, $1) {
|
|
23853
|
+
if (module.config.verbose) {
|
|
23854
|
+
console.log("popping indent", module.indentLevels[module.indentLevels.length - 1], "->", module.indentLevels[module.indentLevels.length - 2]);
|
|
24032
23855
|
}
|
|
24033
|
-
|
|
23856
|
+
module.indentLevels.pop();
|
|
24034
23857
|
});
|
|
24035
|
-
function
|
|
23858
|
+
function PopIndent(state) {
|
|
24036
23859
|
let eventData;
|
|
24037
23860
|
if (state.events) {
|
|
24038
|
-
const result = state.events.enter?.("
|
|
23861
|
+
const result = state.events.enter?.("PopIndent", state);
|
|
24039
23862
|
if (result) {
|
|
24040
23863
|
if (result.cache)
|
|
24041
23864
|
return result.cache;
|
|
@@ -24043,29 +23866,30 @@ ${input.slice(result.pos)}
|
|
|
24043
23866
|
}
|
|
24044
23867
|
}
|
|
24045
23868
|
if (state.tokenize) {
|
|
24046
|
-
const result = $TOKEN("
|
|
23869
|
+
const result = $TOKEN("PopIndent", state, PopIndent$0(state));
|
|
24047
23870
|
if (state.events)
|
|
24048
|
-
state.events.exit?.("
|
|
23871
|
+
state.events.exit?.("PopIndent", state, result, eventData);
|
|
24049
23872
|
return result;
|
|
24050
23873
|
} else {
|
|
24051
|
-
const result =
|
|
23874
|
+
const result = PopIndent$0(state);
|
|
24052
23875
|
if (state.events)
|
|
24053
|
-
state.events.exit?.("
|
|
23876
|
+
state.events.exit?.("PopIndent", state, result, eventData);
|
|
24054
23877
|
return result;
|
|
24055
23878
|
}
|
|
24056
23879
|
}
|
|
24057
|
-
var
|
|
24058
|
-
|
|
24059
|
-
if (
|
|
24060
|
-
|
|
24061
|
-
if (
|
|
24062
|
-
|
|
24063
|
-
|
|
23880
|
+
var Nested$0 = $TS($S(EOS, Indent), function($skip, $loc, $0, $1, $2) {
|
|
23881
|
+
var indent = $2;
|
|
23882
|
+
if (indent.level === module.currentIndent.level)
|
|
23883
|
+
return $0;
|
|
23884
|
+
if (module.config.verbose) {
|
|
23885
|
+
console.log(`failing Nested: ${indent.level} does not match current indent level ${module.currentIndent.level}`);
|
|
23886
|
+
}
|
|
23887
|
+
return $skip;
|
|
24064
23888
|
});
|
|
24065
|
-
function
|
|
23889
|
+
function Nested(state) {
|
|
24066
23890
|
let eventData;
|
|
24067
23891
|
if (state.events) {
|
|
24068
|
-
const result = state.events.enter?.("
|
|
23892
|
+
const result = state.events.enter?.("Nested", state);
|
|
24069
23893
|
if (result) {
|
|
24070
23894
|
if (result.cache)
|
|
24071
23895
|
return result.cache;
|
|
@@ -24073,24 +23897,27 @@ ${input.slice(result.pos)}
|
|
|
24073
23897
|
}
|
|
24074
23898
|
}
|
|
24075
23899
|
if (state.tokenize) {
|
|
24076
|
-
const result = $TOKEN("
|
|
23900
|
+
const result = $TOKEN("Nested", state, Nested$0(state));
|
|
24077
23901
|
if (state.events)
|
|
24078
|
-
state.events.exit?.("
|
|
23902
|
+
state.events.exit?.("Nested", state, result, eventData);
|
|
24079
23903
|
return result;
|
|
24080
23904
|
} else {
|
|
24081
|
-
const result =
|
|
23905
|
+
const result = Nested$0(state);
|
|
24082
23906
|
if (state.events)
|
|
24083
|
-
state.events.exit?.("
|
|
23907
|
+
state.events.exit?.("Nested", state, result, eventData);
|
|
24084
23908
|
return result;
|
|
24085
23909
|
}
|
|
24086
23910
|
}
|
|
24087
|
-
var
|
|
24088
|
-
|
|
23911
|
+
var IndentedFurther$0 = $TS($S(EOS, Indent), function($skip, $loc, $0, $1, $2) {
|
|
23912
|
+
var indent = $2;
|
|
23913
|
+
if (indent.level > module.currentIndent.level)
|
|
23914
|
+
return $0;
|
|
23915
|
+
return $skip;
|
|
24089
23916
|
});
|
|
24090
|
-
function
|
|
23917
|
+
function IndentedFurther(state) {
|
|
24091
23918
|
let eventData;
|
|
24092
23919
|
if (state.events) {
|
|
24093
|
-
const result = state.events.enter?.("
|
|
23920
|
+
const result = state.events.enter?.("IndentedFurther", state);
|
|
24094
23921
|
if (result) {
|
|
24095
23922
|
if (result.cache)
|
|
24096
23923
|
return result.cache;
|
|
@@ -24098,22 +23925,27 @@ ${input.slice(result.pos)}
|
|
|
24098
23925
|
}
|
|
24099
23926
|
}
|
|
24100
23927
|
if (state.tokenize) {
|
|
24101
|
-
const result = $TOKEN("
|
|
23928
|
+
const result = $TOKEN("IndentedFurther", state, IndentedFurther$0(state));
|
|
24102
23929
|
if (state.events)
|
|
24103
|
-
state.events.exit?.("
|
|
23930
|
+
state.events.exit?.("IndentedFurther", state, result, eventData);
|
|
24104
23931
|
return result;
|
|
24105
23932
|
} else {
|
|
24106
|
-
const result =
|
|
23933
|
+
const result = IndentedFurther$0(state);
|
|
24107
23934
|
if (state.events)
|
|
24108
|
-
state.events.exit?.("
|
|
23935
|
+
state.events.exit?.("IndentedFurther", state, result, eventData);
|
|
24109
23936
|
return result;
|
|
24110
23937
|
}
|
|
24111
23938
|
}
|
|
24112
|
-
var
|
|
24113
|
-
|
|
23939
|
+
var IndentedAtLeast$0 = $TS($S(EOS, Indent), function($skip, $loc, $0, $1, $2) {
|
|
23940
|
+
var indent = $2;
|
|
23941
|
+
if (indent.level >= module.currentIndent.level)
|
|
23942
|
+
return $0;
|
|
23943
|
+
return $skip;
|
|
23944
|
+
});
|
|
23945
|
+
function IndentedAtLeast(state) {
|
|
24114
23946
|
let eventData;
|
|
24115
23947
|
if (state.events) {
|
|
24116
|
-
const result = state.events.enter?.("
|
|
23948
|
+
const result = state.events.enter?.("IndentedAtLeast", state);
|
|
24117
23949
|
if (result) {
|
|
24118
23950
|
if (result.cache)
|
|
24119
23951
|
return result.cache;
|
|
@@ -24121,27 +23953,29 @@ ${input.slice(result.pos)}
|
|
|
24121
23953
|
}
|
|
24122
23954
|
}
|
|
24123
23955
|
if (state.tokenize) {
|
|
24124
|
-
const result = $TOKEN("
|
|
23956
|
+
const result = $TOKEN("IndentedAtLeast", state, IndentedAtLeast$0(state));
|
|
24125
23957
|
if (state.events)
|
|
24126
|
-
state.events.exit?.("
|
|
23958
|
+
state.events.exit?.("IndentedAtLeast", state, result, eventData);
|
|
24127
23959
|
return result;
|
|
24128
23960
|
} else {
|
|
24129
|
-
const result =
|
|
23961
|
+
const result = IndentedAtLeast$0(state);
|
|
24130
23962
|
if (state.events)
|
|
24131
|
-
state.events.exit?.("
|
|
23963
|
+
state.events.exit?.("IndentedAtLeast", state, result, eventData);
|
|
24132
23964
|
return result;
|
|
24133
23965
|
}
|
|
24134
23966
|
}
|
|
24135
|
-
var
|
|
24136
|
-
|
|
24137
|
-
|
|
24138
|
-
|
|
24139
|
-
|
|
23967
|
+
var NotDedented$0 = $TS($S($E(IndentedAtLeast), $E(_)), function($skip, $loc, $0, $1, $2) {
|
|
23968
|
+
const ws = [];
|
|
23969
|
+
if ($1)
|
|
23970
|
+
ws.push(...$1);
|
|
23971
|
+
if ($2)
|
|
23972
|
+
ws.push(...$2);
|
|
23973
|
+
return ws.flat(Infinity).filter(Boolean);
|
|
24140
23974
|
});
|
|
24141
|
-
function
|
|
23975
|
+
function NotDedented(state) {
|
|
24142
23976
|
let eventData;
|
|
24143
23977
|
if (state.events) {
|
|
24144
|
-
const result = state.events.enter?.("
|
|
23978
|
+
const result = state.events.enter?.("NotDedented", state);
|
|
24145
23979
|
if (result) {
|
|
24146
23980
|
if (result.cache)
|
|
24147
23981
|
return result.cache;
|
|
@@ -24149,37 +23983,24 @@ ${input.slice(result.pos)}
|
|
|
24149
23983
|
}
|
|
24150
23984
|
}
|
|
24151
23985
|
if (state.tokenize) {
|
|
24152
|
-
const result = $TOKEN("
|
|
23986
|
+
const result = $TOKEN("NotDedented", state, NotDedented$0(state));
|
|
24153
23987
|
if (state.events)
|
|
24154
|
-
state.events.exit?.("
|
|
23988
|
+
state.events.exit?.("NotDedented", state, result, eventData);
|
|
24155
23989
|
return result;
|
|
24156
23990
|
} else {
|
|
24157
|
-
const result =
|
|
23991
|
+
const result = NotDedented$0(state);
|
|
24158
23992
|
if (state.events)
|
|
24159
|
-
state.events.exit?.("
|
|
23993
|
+
state.events.exit?.("NotDedented", state, result, eventData);
|
|
24160
23994
|
return result;
|
|
24161
23995
|
}
|
|
24162
23996
|
}
|
|
24163
|
-
var
|
|
24164
|
-
|
|
24165
|
-
var indent = $2;
|
|
24166
|
-
const { level } = indent;
|
|
24167
|
-
const currentIndent = module.currentIndent;
|
|
24168
|
-
if (module.config.verbose) {
|
|
24169
|
-
console.log("Indented", level, currentIndent);
|
|
24170
|
-
}
|
|
24171
|
-
if (level !== currentIndent.level) {
|
|
24172
|
-
if (module.config.verbose) {
|
|
24173
|
-
console.log("skipped nested");
|
|
24174
|
-
}
|
|
24175
|
-
return $skip;
|
|
24176
|
-
}
|
|
24177
|
-
return $0;
|
|
23997
|
+
var Dedented$0 = $T($S($N(IndentedAtLeast), EOS), function(value) {
|
|
23998
|
+
return value[1];
|
|
24178
23999
|
});
|
|
24179
|
-
function
|
|
24000
|
+
function Dedented(state) {
|
|
24180
24001
|
let eventData;
|
|
24181
24002
|
if (state.events) {
|
|
24182
|
-
const result = state.events.enter?.("
|
|
24003
|
+
const result = state.events.enter?.("Dedented", state);
|
|
24183
24004
|
if (result) {
|
|
24184
24005
|
if (result.cache)
|
|
24185
24006
|
return result.cache;
|
|
@@ -24187,14 +24008,14 @@ ${input.slice(result.pos)}
|
|
|
24187
24008
|
}
|
|
24188
24009
|
}
|
|
24189
24010
|
if (state.tokenize) {
|
|
24190
|
-
const result = $TOKEN("
|
|
24011
|
+
const result = $TOKEN("Dedented", state, Dedented$0(state));
|
|
24191
24012
|
if (state.events)
|
|
24192
|
-
state.events.exit?.("
|
|
24013
|
+
state.events.exit?.("Dedented", state, result, eventData);
|
|
24193
24014
|
return result;
|
|
24194
24015
|
} else {
|
|
24195
|
-
const result =
|
|
24016
|
+
const result = Dedented$0(state);
|
|
24196
24017
|
if (state.events)
|
|
24197
|
-
state.events.exit?.("
|
|
24018
|
+
state.events.exit?.("Dedented", state, result, eventData);
|
|
24198
24019
|
return result;
|
|
24199
24020
|
}
|
|
24200
24021
|
}
|
|
@@ -24227,8 +24048,7 @@ ${input.slice(result.pos)}
|
|
|
24227
24048
|
processBinaryOpExpression,
|
|
24228
24049
|
processCallMemberExpression,
|
|
24229
24050
|
processCoffeeInterpolation,
|
|
24230
|
-
|
|
24231
|
-
processLetAssignmentDeclaration,
|
|
24051
|
+
processAssignmentDeclaration,
|
|
24232
24052
|
processProgram,
|
|
24233
24053
|
processUnaryExpression,
|
|
24234
24054
|
quoteString,
|
|
@@ -24672,7 +24492,7 @@ ${input.slice(result.pos)}
|
|
|
24672
24492
|
var uncacheable;
|
|
24673
24493
|
({ parse } = import_parser.default);
|
|
24674
24494
|
({ SourceMap: SourceMap2 } = util_exports);
|
|
24675
|
-
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", "
|
|
24495
|
+
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"]);
|
|
24676
24496
|
var compile = function(src, options) {
|
|
24677
24497
|
var ast, code, events, filename, ref, result, sm;
|
|
24678
24498
|
if (!options) {
|