@danielx/civet 0.9.5 → 0.9.6
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/CHANGELOG.md +10 -0
- package/dist/browser.js +152 -123
- package/dist/main.js +181 -124
- package/dist/main.mjs +181 -124
- package/package.json +1 -1
package/dist/browser.js
CHANGED
|
@@ -473,6 +473,7 @@ ${body}`), super(message), this.header = header, this.body = body, this.filename
|
|
|
473
473
|
maybeRefAssignment: () => maybeRefAssignment,
|
|
474
474
|
modifyString: () => modifyString,
|
|
475
475
|
negateCondition: () => negateCondition,
|
|
476
|
+
precedenceCustomDefault: () => precedenceCustomDefault,
|
|
476
477
|
precedenceStep: () => precedenceStep,
|
|
477
478
|
prepend: () => prepend,
|
|
478
479
|
processAssignmentDeclaration: () => processAssignmentDeclaration,
|
|
@@ -2429,7 +2430,7 @@ ${js}`
|
|
|
2429
2430
|
exp = exp;
|
|
2430
2431
|
let outer = exp;
|
|
2431
2432
|
exp.type === "LabelledStatement" && (exp = exp.statement);
|
|
2432
|
-
let ref6;
|
|
2433
|
+
let ref6, m1;
|
|
2433
2434
|
switch (exp.type) {
|
|
2434
2435
|
case "BreakStatement":
|
|
2435
2436
|
case "ContinueStatement":
|
|
@@ -2494,6 +2495,8 @@ ${js}`
|
|
|
2494
2495
|
return;
|
|
2495
2496
|
}
|
|
2496
2497
|
case "PipelineExpression": {
|
|
2498
|
+
if (m1 = exp.children[1]?.type, m1 === "ReturnStatement" || m1 === "ThrowStatement")
|
|
2499
|
+
return;
|
|
2497
2500
|
let semi2 = exp.children.lastIndexOf(";");
|
|
2498
2501
|
if (0 <= semi2 && semi2 < exp.children.length - 1) {
|
|
2499
2502
|
exp.children.splice(semi2 + 1, 1 / 0, collect(exp.children.slice(semi2 + 1)));
|
|
@@ -2514,8 +2517,8 @@ ${js}`
|
|
|
2514
2517
|
let last = node.expressions[node.expressions.length - 1];
|
|
2515
2518
|
insertReturn(last);
|
|
2516
2519
|
} else {
|
|
2517
|
-
let
|
|
2518
|
-
|
|
2520
|
+
let m2;
|
|
2521
|
+
m2 = node.parent?.type, (m2 === "CatchClause" || m2 === "WhenClause") && node.expressions.push(["", wrapWithReturn(void 0, node)]);
|
|
2519
2522
|
}
|
|
2520
2523
|
return;
|
|
2521
2524
|
}
|
|
@@ -2546,7 +2549,7 @@ ${js}`
|
|
|
2546
2549
|
return;
|
|
2547
2550
|
let outer = exp;
|
|
2548
2551
|
exp.type === "LabelledStatement" && (exp = exp.statement);
|
|
2549
|
-
let ref11;
|
|
2552
|
+
let ref11, m3;
|
|
2550
2553
|
switch (exp.type) {
|
|
2551
2554
|
case "BreakStatement":
|
|
2552
2555
|
case "ContinueStatement":
|
|
@@ -2623,6 +2626,8 @@ ${js}`
|
|
|
2623
2626
|
return;
|
|
2624
2627
|
}
|
|
2625
2628
|
case "PipelineExpression": {
|
|
2629
|
+
if (m3 = exp.children[1]?.type, m3 === "ReturnStatement" || m3 === "ThrowStatement")
|
|
2630
|
+
return;
|
|
2626
2631
|
let semi2 = exp.children.lastIndexOf(";");
|
|
2627
2632
|
if (0 <= semi2 && semi2 < exp.children.length - 1) {
|
|
2628
2633
|
exp.children.splice(semi2 + 1, 1 / 0, wrapWithReturn(exp.children.slice(semi2 + 1)));
|
|
@@ -2641,8 +2646,8 @@ ${js}`
|
|
|
2641
2646
|
))
|
|
2642
2647
|
if (control.with) {
|
|
2643
2648
|
if (control.label) {
|
|
2644
|
-
let
|
|
2645
|
-
if (
|
|
2649
|
+
let m4;
|
|
2650
|
+
if (m4 = statement.parent, !(typeof m4 == "object" && m4 != null && "type" in m4 && m4.type === "LabelledStatement" && "label" in m4 && typeof m4.label == "object" && m4.label != null && "name" in m4.label && m4.label.name === control.label.name))
|
|
2646
2651
|
continue;
|
|
2647
2652
|
} else {
|
|
2648
2653
|
let { ancestor } = findAncestor(
|
|
@@ -2793,8 +2798,8 @@ ${js}`
|
|
|
2793
2798
|
return !1;
|
|
2794
2799
|
let reduction = statement.type === "ForStatement" && statement.reduction;
|
|
2795
2800
|
function fillBlock(expression) {
|
|
2796
|
-
let ref15,
|
|
2797
|
-
return
|
|
2801
|
+
let ref15, m5;
|
|
2802
|
+
return m5 = (ref15 = block.expressions)[ref15.length - 1], Array.isArray(m5) && m5.length >= 2 && typeof m5[1] == "object" && m5[1] != null && "type" in m5[1] && m5[1].type === "EmptyStatement" && "implicit" in m5[1] && m5[1].implicit === !0 && block.expressions.pop(), block.expressions.push(expression), block.empty = !1, braceBlock(block);
|
|
2798
2803
|
}
|
|
2799
2804
|
if (reduction)
|
|
2800
2805
|
switch (reduction.subtype) {
|
|
@@ -2872,8 +2877,8 @@ ${js}`
|
|
|
2872
2877
|
if (parameters.names = before.flatMap(($7) => $7.names), parameters.parameters.splice(0, 1 / 0), tt && parameters.parameters.push(tt), parameters.parameters.push(...before), rest) {
|
|
2873
2878
|
let restIdentifier = rest.binding.ref || rest.binding;
|
|
2874
2879
|
if (parameters.names.push(...rest.names || []), rest.children.pop(), after.length) {
|
|
2875
|
-
let
|
|
2876
|
-
|
|
2880
|
+
let m6;
|
|
2881
|
+
m6 = rest.binding.type, (m6 === "ArrayBindingPattern" || m6 === "ObjectBindingPattern" || m6 === "NamedBindingPattern") && parameters.parameters.push({
|
|
2877
2882
|
type: "Error",
|
|
2878
2883
|
message: "Non-end rest parameter cannot be binding pattern"
|
|
2879
2884
|
}), after = trimFirstSpace(after);
|
|
@@ -2975,8 +2980,8 @@ ${js}`
|
|
|
2975
2980
|
if (ancestor != null) {
|
|
2976
2981
|
let fields = new Set(gatherRecursiveWithinFunction(ancestor, ($11) => $11.type === "FieldDefinition").map(($12) => $12.id).filter((a3) => typeof a3 == "object" && a3 != null && "type" in a3 && a3.type === "Identifier").map(($13) => $13.name)), classExpressions = ancestor.body.expressions, index2 = findChildIndex(classExpressions, f);
|
|
2977
2982
|
assert.notEqual(index2, -1, "Could not find constructor in class");
|
|
2978
|
-
let
|
|
2979
|
-
for (;
|
|
2983
|
+
let m7;
|
|
2984
|
+
for (; m7 = classExpressions[index2 - 1]?.[1], typeof m7 == "object" && m7 != null && "type" in m7 && m7.type === "MethodDefinition" && "name" in m7 && m7.name === "constructor"; )
|
|
2980
2985
|
index2--;
|
|
2981
2986
|
let fStatement = classExpressions[index2];
|
|
2982
2987
|
for (let ref18 = gatherRecursive(parameters, ($14) => $14.type === "Parameter"), i9 = 0, len8 = ref18.length; i9 < len8; i9++) {
|
|
@@ -4508,9 +4513,8 @@ ${js}`
|
|
|
4508
4513
|
if (lhs.type === "NewExpression") {
|
|
4509
4514
|
let { expression } = lhs;
|
|
4510
4515
|
return expression = {
|
|
4511
|
-
...expression,
|
|
4512
4516
|
type: "CallExpression",
|
|
4513
|
-
children: [
|
|
4517
|
+
children: [expression, call]
|
|
4514
4518
|
}, {
|
|
4515
4519
|
...lhs,
|
|
4516
4520
|
expression,
|
|
@@ -4556,13 +4560,13 @@ ${js}`
|
|
|
4556
4560
|
];
|
|
4557
4561
|
}
|
|
4558
4562
|
function processPipelineExpressions(statements) {
|
|
4559
|
-
gatherRecursiveAll(statements, (
|
|
4560
|
-
let [ws, , body] = s.children, [, arg] = s.children,
|
|
4561
|
-
for (let
|
|
4562
|
-
let
|
|
4563
|
+
for (let ref1 = gatherRecursiveAll(statements, ($1) => $1.type === "PipelineExpression"), i1 = 0, len3 = ref1.length; i1 < len3; i1++) {
|
|
4564
|
+
let s = ref1[i1], [ws, , body] = s.children, [, arg] = s.children, children = [ws], comma = blockContainingStatement(s) ? ";" : ",", usingRef = null;
|
|
4565
|
+
for (let i2 = 0, len1 = body.length; i2 < len1; i2++) {
|
|
4566
|
+
let i = i2, step = body[i2], [leadingComment, pipe, trailingComment, expr] = step, returns = pipe.token === "||>", ref, result, returning = returns ? arg : null;
|
|
4563
4567
|
if (pipe.token === "|>=") {
|
|
4564
4568
|
let initRef;
|
|
4565
|
-
if (
|
|
4569
|
+
if (i === 0) {
|
|
4566
4570
|
switch (checkValidLHS(arg), arg.type) {
|
|
4567
4571
|
case "MemberExpression":
|
|
4568
4572
|
if (arg.children.length <= 2)
|
|
@@ -4600,7 +4604,7 @@ ${js}`
|
|
|
4600
4604
|
message: "Can't use |>= in the middle of a pipeline"
|
|
4601
4605
|
});
|
|
4602
4606
|
} else
|
|
4603
|
-
|
|
4607
|
+
i === 0 && (s.children = children);
|
|
4604
4608
|
if (returns && (ref = needsRef(arg)) && (usingRef = usingRef || ref, arg = {
|
|
4605
4609
|
type: "ParenthesizedExpression",
|
|
4606
4610
|
children: ["(", {
|
|
@@ -4616,7 +4620,7 @@ ${js}`
|
|
|
4616
4620
|
arg,
|
|
4617
4621
|
returning
|
|
4618
4622
|
), result.type === "ReturnStatement") {
|
|
4619
|
-
|
|
4623
|
+
i < body.length - 1 && result.children.push({
|
|
4620
4624
|
type: "Error",
|
|
4621
4625
|
message: "Can't continue a pipeline after returning"
|
|
4622
4626
|
}), arg = result, children[children.length - 1] === "," && (children.pop(), children.push(";"));
|
|
@@ -4628,15 +4632,15 @@ ${js}`
|
|
|
4628
4632
|
type: "Declaration",
|
|
4629
4633
|
children: ["let ", usingRef],
|
|
4630
4634
|
names: []
|
|
4631
|
-
}), children.push(arg), !children.some(($
|
|
4635
|
+
}), children.push(arg), !children.some(($2) => $2?.type === "ReturnStatement") && children.some(($3) => $3 === ",")) {
|
|
4632
4636
|
let { parent } = s, parenthesizedExpression = makeLeftHandSideExpression({ ...s });
|
|
4633
4637
|
Object.assign(s, parenthesizedExpression, {
|
|
4634
4638
|
parent,
|
|
4635
4639
|
hoistDec: void 0
|
|
4636
4640
|
});
|
|
4637
4641
|
}
|
|
4638
|
-
|
|
4639
|
-
}
|
|
4642
|
+
addParentPointers(s, s.parent);
|
|
4643
|
+
}
|
|
4640
4644
|
}
|
|
4641
4645
|
|
|
4642
4646
|
// unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\for.civet.jsx
|
|
@@ -5452,15 +5456,24 @@ ${js}`
|
|
|
5452
5456
|
let i = i2, arg = args[i2];
|
|
5453
5457
|
isComma(arg) && (arg = args[i] = deepCopy(arg), isComma(arg).token = `)${op.token}(`, commaCount++);
|
|
5454
5458
|
}
|
|
5455
|
-
if (args.length
|
|
5456
|
-
|
|
5457
|
-
|
|
5458
|
-
|
|
5459
|
-
|
|
5460
|
-
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
|
|
5459
|
+
if (args.length) {
|
|
5460
|
+
if (commaCount)
|
|
5461
|
+
children.splice(0, 2, {
|
|
5462
|
+
type: "ParenthesizedExpression",
|
|
5463
|
+
children: ["(", call.children, ")"],
|
|
5464
|
+
expression: call.children
|
|
5465
|
+
});
|
|
5466
|
+
else {
|
|
5467
|
+
let middle = call.children.slice(1, -1), ref2;
|
|
5468
|
+
children.splice(0, 2, {
|
|
5469
|
+
type: "ParenthesizedExpression",
|
|
5470
|
+
expression: middle,
|
|
5471
|
+
children: [call.children[0], middle, (ref2 = call.children)[ref2.length - 1]]
|
|
5472
|
+
});
|
|
5473
|
+
}
|
|
5474
|
+
if (children.length === 1)
|
|
5475
|
+
return children[0];
|
|
5476
|
+
}
|
|
5464
5477
|
}
|
|
5465
5478
|
for (let i3 = 0, len22 = children.length; i3 < len22; i3++) {
|
|
5466
5479
|
let i = i3, glob = children[i3];
|
|
@@ -5518,13 +5531,13 @@ ${js}`
|
|
|
5518
5531
|
usesRef: !!ref
|
|
5519
5532
|
});
|
|
5520
5533
|
}
|
|
5521
|
-
let
|
|
5534
|
+
let ref3, object = {
|
|
5522
5535
|
type: "ObjectExpression",
|
|
5523
5536
|
children: [
|
|
5524
5537
|
glob.object.children[0],
|
|
5525
5538
|
// {
|
|
5526
5539
|
...parts,
|
|
5527
|
-
(
|
|
5540
|
+
(ref3 = glob.object.children)[ref3.length - 1]
|
|
5528
5541
|
// whitespace and }
|
|
5529
5542
|
],
|
|
5530
5543
|
properties: parts
|
|
@@ -5579,7 +5592,7 @@ ${js}`
|
|
|
5579
5592
|
]
|
|
5580
5593
|
})
|
|
5581
5594
|
]
|
|
5582
|
-
}),
|
|
5595
|
+
}), ref4;
|
|
5583
5596
|
return processCallMemberExpression({
|
|
5584
5597
|
// in case there are more
|
|
5585
5598
|
...node,
|
|
@@ -5593,7 +5606,7 @@ ${js}`
|
|
|
5593
5606
|
glob.children[0],
|
|
5594
5607
|
// "[" token
|
|
5595
5608
|
call,
|
|
5596
|
-
(
|
|
5609
|
+
(ref4 = glob.children)[ref4.length - 1]
|
|
5597
5610
|
// "]" token
|
|
5598
5611
|
]
|
|
5599
5612
|
}),
|
|
@@ -5605,7 +5618,7 @@ ${js}`
|
|
|
5605
5618
|
{ ...node, children: node.children.slice(0, i) },
|
|
5606
5619
|
{ ...glob.children[0], token: ", " },
|
|
5607
5620
|
...glob.children.slice(1, -1)
|
|
5608
|
-
],
|
|
5621
|
+
], ref5, rsliceCall = makeNode({
|
|
5609
5622
|
type: "CallExpression",
|
|
5610
5623
|
implicit: !0,
|
|
5611
5624
|
children: [
|
|
@@ -5616,7 +5629,7 @@ ${js}`
|
|
|
5616
5629
|
children: [
|
|
5617
5630
|
"(",
|
|
5618
5631
|
args,
|
|
5619
|
-
(
|
|
5632
|
+
(ref5 = glob.children)[ref5.length - 1]
|
|
5620
5633
|
]
|
|
5621
5634
|
})
|
|
5622
5635
|
]
|
|
@@ -5673,7 +5686,7 @@ ${js}`
|
|
|
5673
5686
|
if (specifier.ts)
|
|
5674
5687
|
return { type: "Error", message: "cannot use `type` in dynamic import" };
|
|
5675
5688
|
{
|
|
5676
|
-
let { source, binding } = specifier,
|
|
5689
|
+
let { source, binding } = specifier, ref6, delim = (ref6 = specifier.children)[ref6.length - 1];
|
|
5677
5690
|
return {
|
|
5678
5691
|
type: pattern ? "BindingProperty" : "Property",
|
|
5679
5692
|
name: source,
|
|
@@ -5682,7 +5695,7 @@ ${js}`
|
|
|
5682
5695
|
children: source === binding ? [source, delim] : [source, ":", binding, delim]
|
|
5683
5696
|
};
|
|
5684
5697
|
}
|
|
5685
|
-
}),
|
|
5698
|
+
}), ref7;
|
|
5686
5699
|
return {
|
|
5687
5700
|
type: pattern ? "ObjectBindingPattern" : "ObjectExpression",
|
|
5688
5701
|
names: node.names,
|
|
@@ -5691,7 +5704,7 @@ ${js}`
|
|
|
5691
5704
|
node.children[0],
|
|
5692
5705
|
// {
|
|
5693
5706
|
properties,
|
|
5694
|
-
(
|
|
5707
|
+
(ref7 = node.children)[ref7.length - 1]
|
|
5695
5708
|
// }
|
|
5696
5709
|
]
|
|
5697
5710
|
};
|
|
@@ -5775,7 +5788,7 @@ ${js}`
|
|
|
5775
5788
|
);
|
|
5776
5789
|
}
|
|
5777
5790
|
function processAssignments(statements) {
|
|
5778
|
-
for (let
|
|
5791
|
+
for (let ref8 = gatherRecursiveAll(statements, ($4) => $4.type === "AssignmentExpression" || $4.type === "UpdateExpression"), i5 = 0, len3 = ref8.length; i5 < len3; i5++) {
|
|
5779
5792
|
let extractAssignment = function(lhs) {
|
|
5780
5793
|
let expr = lhs;
|
|
5781
5794
|
for (; expr.type === "ParenthesizedExpression"; )
|
|
@@ -5783,25 +5796,25 @@ ${js}`
|
|
|
5783
5796
|
let m1;
|
|
5784
5797
|
if (m1 = expr.type, m1 === "AssignmentExpression" || m1 === "UpdateExpression")
|
|
5785
5798
|
return expr.type === "UpdateExpression" && expr.children[0] === expr.assigned ? (pre.push("("), post.push([", ", lhs, ")"])) : (pre.push(["(", lhs, ", "]), post.push(")")), expr.assigned;
|
|
5786
|
-
}, exp =
|
|
5799
|
+
}, exp = ref8[i5];
|
|
5787
5800
|
checkValidLHS(exp.assigned);
|
|
5788
|
-
let pre = [], post = [],
|
|
5801
|
+
let pre = [], post = [], ref9;
|
|
5789
5802
|
switch (exp.type) {
|
|
5790
5803
|
case "AssignmentExpression": {
|
|
5791
5804
|
if (!exp.lhs)
|
|
5792
5805
|
continue;
|
|
5793
|
-
for (let
|
|
5794
|
-
let lhsPart =
|
|
5795
|
-
if (
|
|
5796
|
-
let newLhs =
|
|
5806
|
+
for (let ref10 = exp.lhs, i6 = 0, len4 = ref10.length; i6 < len4; i6++) {
|
|
5807
|
+
let lhsPart = ref10[i6], ref11;
|
|
5808
|
+
if (ref11 = extractAssignment(lhsPart[1])) {
|
|
5809
|
+
let newLhs = ref11;
|
|
5797
5810
|
lhsPart[1] = newLhs;
|
|
5798
5811
|
}
|
|
5799
5812
|
}
|
|
5800
5813
|
break;
|
|
5801
5814
|
}
|
|
5802
5815
|
case "UpdateExpression": {
|
|
5803
|
-
if (
|
|
5804
|
-
let newLhs =
|
|
5816
|
+
if (ref9 = extractAssignment(exp.assigned)) {
|
|
5817
|
+
let newLhs = ref9, i = exp.children.indexOf(exp.assigned);
|
|
5805
5818
|
exp.assigned = exp.children[i] = newLhs;
|
|
5806
5819
|
}
|
|
5807
5820
|
break;
|
|
@@ -5816,19 +5829,19 @@ ${js}`
|
|
|
5816
5829
|
}), replaceNode(exp, newMemberExp));
|
|
5817
5830
|
}
|
|
5818
5831
|
}
|
|
5819
|
-
for (let
|
|
5820
|
-
let exp =
|
|
5832
|
+
for (let ref12 = gatherRecursiveAll(statements, ($6) => $6.type === "AssignmentExpression"), i7 = 0, len5 = ref12.length; i7 < len5; i7++) {
|
|
5833
|
+
let exp = ref12[i7];
|
|
5821
5834
|
if (exp.names !== null)
|
|
5822
5835
|
continue;
|
|
5823
|
-
let { lhs: $1, expression: $2 } = exp, tail = [], len3 = $1.length, block,
|
|
5824
|
-
if (blockContainingStatement(exp) && !(
|
|
5836
|
+
let { lhs: $1, expression: $2 } = exp, tail = [], len3 = $1.length, block, ref13;
|
|
5837
|
+
if (blockContainingStatement(exp) && !(ref13 = $1[$1.length - 1])?.[ref13.length - 1]?.special) {
|
|
5825
5838
|
block = makeBlockFragment();
|
|
5826
|
-
let
|
|
5827
|
-
if (
|
|
5839
|
+
let ref14;
|
|
5840
|
+
if (ref14 = prependStatementExpressionBlock(
|
|
5828
5841
|
{ type: "Initializer", expression: $2, children: [void 0, void 0, $2] },
|
|
5829
5842
|
block
|
|
5830
5843
|
)) {
|
|
5831
|
-
let ref =
|
|
5844
|
+
let ref = ref14;
|
|
5832
5845
|
exp.children = exp.children.map(($7) => $7 === $2 ? ref : $7), $2 = ref;
|
|
5833
5846
|
} else
|
|
5834
5847
|
block = void 0;
|
|
@@ -5931,9 +5944,9 @@ ${js}`
|
|
|
5931
5944
|
}
|
|
5932
5945
|
j++;
|
|
5933
5946
|
}
|
|
5934
|
-
let
|
|
5935
|
-
if (
|
|
5936
|
-
let l =
|
|
5947
|
+
let ref15;
|
|
5948
|
+
if (ref15 = conditions.length) {
|
|
5949
|
+
let l = ref15, cs = flatJoin(conditions, " && ");
|
|
5937
5950
|
return {
|
|
5938
5951
|
...exp,
|
|
5939
5952
|
children: [...cs, " ? ", innerExp(children), " : void 0"],
|
|
@@ -5965,8 +5978,8 @@ ${js}`
|
|
|
5965
5978
|
}
|
|
5966
5979
|
function processTypes(node) {
|
|
5967
5980
|
let results1 = [];
|
|
5968
|
-
for (let
|
|
5969
|
-
let unary =
|
|
5981
|
+
for (let ref16 = gatherRecursiveAll(node, ($11) => $11.type === "TypeUnary"), i8 = 0, len6 = ref16.length; i8 < len6; i8++) {
|
|
5982
|
+
let unary = ref16[i8], suffixIndex = unary.suffix.length - 1, results2 = [];
|
|
5970
5983
|
for (; suffixIndex >= 0; ) {
|
|
5971
5984
|
let suffix = unary.suffix[suffixIndex];
|
|
5972
5985
|
if (typeof suffix == "object" && suffix != null && "token" in suffix && suffix.token === "?") {
|
|
@@ -6027,9 +6040,9 @@ ${js}`
|
|
|
6027
6040
|
unary.prefix = [], unary.children = unary.children.filter((a2) => a2 !== prefix);
|
|
6028
6041
|
let outer = unary.suffix.splice(suffixIndex + 1, 1 / 0), space = getTrimmingSpace(unary);
|
|
6029
6042
|
inplaceInsertTrimmingSpace(unary, "");
|
|
6030
|
-
let
|
|
6031
|
-
unary.suffix.length ?
|
|
6032
|
-
let t =
|
|
6043
|
+
let ref17;
|
|
6044
|
+
unary.suffix.length ? ref17 = unary : ref17 = unary.t;
|
|
6045
|
+
let t = ref17, argArray = [makeNode({
|
|
6033
6046
|
type: "TypeArgument",
|
|
6034
6047
|
ts: !0,
|
|
6035
6048
|
t,
|
|
@@ -6065,16 +6078,16 @@ ${js}`
|
|
|
6065
6078
|
return results1;
|
|
6066
6079
|
}
|
|
6067
6080
|
function processStatementExpressions(statements) {
|
|
6068
|
-
for (let
|
|
6069
|
-
let exp =
|
|
6081
|
+
for (let ref18 = gatherRecursiveAll(statements, ($12) => $12.type === "StatementExpression"), i9 = 0, len7 = ref18.length; i9 < len7; i9++) {
|
|
6082
|
+
let exp = ref18[i9], { maybe, statement } = exp;
|
|
6070
6083
|
if ((maybe || statement.type === "ThrowStatement") && blockContainingStatement(exp)) {
|
|
6071
6084
|
replaceNode(exp, statement);
|
|
6072
6085
|
continue;
|
|
6073
6086
|
}
|
|
6074
|
-
let
|
|
6087
|
+
let ref19;
|
|
6075
6088
|
switch (statement.type) {
|
|
6076
6089
|
case "IfStatement": {
|
|
6077
|
-
(
|
|
6090
|
+
(ref19 = expressionizeIfStatement(statement)) ? replaceNode(statement, ref19, exp) : replaceNode(statement, wrapIIFE([["", statement]]), exp);
|
|
6078
6091
|
break;
|
|
6079
6092
|
}
|
|
6080
6093
|
case "IterationExpression": {
|
|
@@ -6115,11 +6128,11 @@ ${js}`
|
|
|
6115
6128
|
});
|
|
6116
6129
|
}
|
|
6117
6130
|
function processFinallyClauses(statements) {
|
|
6118
|
-
for (let
|
|
6119
|
-
let f =
|
|
6120
|
-
if (!((
|
|
6131
|
+
for (let ref20 = gatherRecursiveAll(statements, ($) => $.type === "FinallyClause" && $.parent?.type !== "TryStatement"), i10 = 0, len8 = ref20.length; i10 < len8; i10++) {
|
|
6132
|
+
let f = ref20[i10], ref21;
|
|
6133
|
+
if (!((ref21 = blockContainingStatement(f)) && typeof ref21 == "object" && "block" in ref21 && "index" in ref21))
|
|
6121
6134
|
throw new Error("finally clause must be inside try statement or block");
|
|
6122
|
-
let { block, index } =
|
|
6135
|
+
let { block, index } = ref21, indent = block.expressions[index][0], expressions = block.expressions.slice(index + 1), t = makeNode({
|
|
6123
6136
|
type: "BlockStatement",
|
|
6124
6137
|
expressions,
|
|
6125
6138
|
children: ["{", expressions, "}"],
|
|
@@ -6179,8 +6192,8 @@ ${js}`
|
|
|
6179
6192
|
}
|
|
6180
6193
|
}
|
|
6181
6194
|
function processCoffeeClasses(statements) {
|
|
6182
|
-
for (let
|
|
6183
|
-
let ce =
|
|
6195
|
+
for (let ref22 = gatherRecursiveAll(statements, ($13) => $13.type === "ClassExpression"), i11 = 0, len9 = ref22.length; i11 < len9; i11++) {
|
|
6196
|
+
let ce = ref22[i11], { expressions } = ce.body, indent = expressions[0]?.[0] ?? `
|
|
6184
6197
|
`, autoBinds = expressions.filter(($14) => $14[1]?.autoBind);
|
|
6185
6198
|
if (autoBinds.length) {
|
|
6186
6199
|
let construct;
|
|
@@ -6270,23 +6283,23 @@ ${js}`
|
|
|
6270
6283
|
}
|
|
6271
6284
|
function processRepl(root, rootIIFE) {
|
|
6272
6285
|
let topBlock = gatherRecursive(rootIIFE, ($17) => $17.type === "BlockStatement")[0], i = 0;
|
|
6273
|
-
for (let
|
|
6274
|
-
let decl =
|
|
6286
|
+
for (let ref23 = gatherRecursiveWithinFunction(topBlock, ($18) => $18.type === "Declaration"), i14 = 0, len11 = ref23.length; i14 < len11; i14++) {
|
|
6287
|
+
let decl = ref23[i14];
|
|
6275
6288
|
decl.names?.length && (decl.parent === topBlock || decl.decl === "var") && (decl.children.shift(), decl.bindings[0]?.pattern?.type === "ObjectBindingPattern" && (decl.children.unshift("("), decl.children.push(")")), root.expressions.splice(i++, 0, ["", `var ${decl.names.join(",")}`, ";"]));
|
|
6276
6289
|
}
|
|
6277
|
-
for (let
|
|
6278
|
-
let func =
|
|
6290
|
+
for (let ref24 = gatherRecursive(topBlock, ($19) => $19.type === "FunctionExpression"), i15 = 0, len12 = ref24.length; i15 < len12; i15++) {
|
|
6291
|
+
let func = ref24[i15];
|
|
6279
6292
|
func.name && func.parent?.type === "BlockStatement" && (func.parent === topBlock ? (replaceNode(func, void 0), root.expressions.splice(i++, 0, ["", func]), func.parent = root) : (func.children.unshift(func.name, "="), root.expressions.splice(i++, 0, ["", `var ${func.name}`, ";"])));
|
|
6280
6293
|
}
|
|
6281
|
-
for (let
|
|
6282
|
-
let classExp =
|
|
6294
|
+
for (let ref25 = gatherRecursiveWithinFunction(topBlock, ($20) => $20.type === "ClassExpression"), i16 = 0, len13 = ref25.length; i16 < len13; i16++) {
|
|
6295
|
+
let classExp = ref25[i16], m8;
|
|
6283
6296
|
(classExp.name && classExp.parent === topBlock || (m8 = classExp.parent, typeof m8 == "object" && m8 != null && "type" in m8 && m8.type === "ReturnStatement" && "parent" in m8 && m8.parent === topBlock)) && (classExp.children.unshift(classExp.name, "="), root.expressions.splice(i++, 0, ["", `var ${classExp.name}`, ";"]));
|
|
6284
6297
|
}
|
|
6285
6298
|
}
|
|
6286
6299
|
function processPlaceholders(statements) {
|
|
6287
6300
|
let placeholderMap = /* @__PURE__ */ new Map(), liftedIfs = /* @__PURE__ */ new Set();
|
|
6288
|
-
for (let
|
|
6289
|
-
let exp =
|
|
6301
|
+
for (let ref26 = gatherRecursiveAll(statements, ($21) => $21.type === "Placeholder"), i17 = 0, len14 = ref26.length; i17 < len14; i17++) {
|
|
6302
|
+
let exp = ref26[i17], ancestor;
|
|
6290
6303
|
if (exp.subtype === ".") {
|
|
6291
6304
|
({ ancestor } = findAncestor(
|
|
6292
6305
|
exp,
|
|
@@ -6358,8 +6371,8 @@ ${js}`
|
|
|
6358
6371
|
for (let i18 = 0, len15 = placeholders.length; i18 < len15; i18++) {
|
|
6359
6372
|
let placeholder = placeholders[i18];
|
|
6360
6373
|
typeSuffix ??= placeholder.typeSuffix;
|
|
6361
|
-
let
|
|
6362
|
-
(
|
|
6374
|
+
let ref27;
|
|
6375
|
+
(ref27 = placeholder.children)[ref27.length - 1] = ref;
|
|
6363
6376
|
}
|
|
6364
6377
|
let { parent } = ancestor, body = maybeUnwrap(ancestor), fnExp = makeAmpersandFunction({ ref, typeSuffix, body }), outer;
|
|
6365
6378
|
switch (parent?.type) {
|
|
@@ -6376,8 +6389,8 @@ ${js}`
|
|
|
6376
6389
|
break;
|
|
6377
6390
|
}
|
|
6378
6391
|
case "PipelineExpression": {
|
|
6379
|
-
let i = findChildIndex(parent, ancestor),
|
|
6380
|
-
i === 1 ?
|
|
6392
|
+
let i = findChildIndex(parent, ancestor), ref28;
|
|
6393
|
+
i === 1 ? ref28 = ancestor === parent.children[i] : i === 2 ? ref28 = ancestor === parent.children[i][findChildIndex(parent.children[i], ancestor)][3] : ref28 = void 0, outer = ref28;
|
|
6381
6394
|
break;
|
|
6382
6395
|
}
|
|
6383
6396
|
case "AssignmentExpression":
|
|
@@ -6388,10 +6401,10 @@ ${js}`
|
|
|
6388
6401
|
break;
|
|
6389
6402
|
}
|
|
6390
6403
|
}
|
|
6391
|
-
outer || (fnExp = makeLeftHandSideExpression(fnExp)), replaceNode(ancestor, fnExp, parent);
|
|
6392
|
-
let
|
|
6393
|
-
if (
|
|
6394
|
-
let ws =
|
|
6404
|
+
outer || (fnExp = makeLeftHandSideExpression(fnExp)), replaceNode(ancestor, fnExp, parent), typeof parent == "object" && parent != null && "type" in parent && parent.type === "BlockStatement" && "parent" in parent && typeof parent.parent == "object" && parent.parent != null && "type" in parent.parent && parent.parent.type === "ArrowFunction" && "ampersandBlock" in parent.parent && parent.parent.ampersandBlock === !0 && "body" in parent.parent && parent.parent.body === body && (parent.parent.body = fnExp);
|
|
6405
|
+
let ref29;
|
|
6406
|
+
if (ref29 = getTrimmingSpace(body)) {
|
|
6407
|
+
let ws = ref29;
|
|
6395
6408
|
inplaceInsertTrimmingSpace(body, ""), inplacePrepend(ws, fnExp);
|
|
6396
6409
|
}
|
|
6397
6410
|
}
|
|
@@ -6422,8 +6435,8 @@ ${js}`
|
|
|
6422
6435
|
}
|
|
6423
6436
|
];
|
|
6424
6437
|
}
|
|
6425
|
-
let
|
|
6426
|
-
Array.isArray(rest.delim) && (
|
|
6438
|
+
let ref30;
|
|
6439
|
+
Array.isArray(rest.delim) && (ref30 = rest.delim)[ref30.length - 1]?.token === "," && (rest.delim = rest.delim.slice(0, -1), rest.children = [...rest.children.slice(0, -1), rest.delim]);
|
|
6427
6440
|
let children = [...props, ...after, rest];
|
|
6428
6441
|
return restCount > 1 && children.push({
|
|
6429
6442
|
type: "Error",
|
|
@@ -8008,20 +8021,22 @@ ${js}`
|
|
|
8008
8021
|
function PipelineHeadItem(ctx, state2) {
|
|
8009
8022
|
return (0, import_lib2.$EVENT_C)(ctx, state2, "PipelineHeadItem", PipelineHeadItem$$);
|
|
8010
8023
|
}
|
|
8011
|
-
var PipelineTailItem$0 = (0, import_lib2.$T)((0, import_lib2.$S)((0, import_lib2.$C)(AwaitOp,
|
|
8024
|
+
var PipelineTailItem$0 = (0, import_lib2.$T)((0, import_lib2.$S)((0, import_lib2.$C)(AwaitOp, Return, Throw), (0, import_lib2.$N)(AccessStart), (0, import_lib2.$N)(MaybeParenNestedExpression)), function(value) {
|
|
8012
8025
|
return value[0];
|
|
8013
|
-
}), PipelineTailItem$1 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$
|
|
8026
|
+
}), PipelineTailItem$1 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$TEXT)((0, import_lib2.$S)(Yield, (0, import_lib2.$E)((0, import_lib2.$S)((0, import_lib2.$E)(_), Star)))), (0, import_lib2.$N)(AccessStart), (0, import_lib2.$N)(MaybeParenNestedExpression)), function($skip, $loc, $0, $1, $2, $3) {
|
|
8027
|
+
return { $loc, token: $1, type: "Yield" };
|
|
8028
|
+
}), PipelineTailItem$2 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$EXPECT)($L15, 'PipelineTailItem "import"'), (0, import_lib2.$N)(AccessStart)), function($skip, $loc, $0, $1, $2) {
|
|
8014
8029
|
return {
|
|
8015
8030
|
type: "Identifier",
|
|
8016
8031
|
children: [$1]
|
|
8017
8032
|
};
|
|
8018
|
-
}), PipelineTailItem$
|
|
8033
|
+
}), PipelineTailItem$3 = (0, import_lib2.$TS)((0, import_lib2.$S)(NWTypePostfix, (0, import_lib2.$Q)(TypePostfix)), function($skip, $loc, $0, $1, $2) {
|
|
8019
8034
|
return makeAmpersandFunction({
|
|
8020
8035
|
body: [" ", $1, ...$2]
|
|
8021
8036
|
});
|
|
8022
|
-
}), PipelineTailItem$
|
|
8037
|
+
}), PipelineTailItem$4 = (0, import_lib2.$T)((0, import_lib2.$S)(PipelineHeadItem), function(value) {
|
|
8023
8038
|
return value[0];
|
|
8024
|
-
}), PipelineTailItem$$ = [PipelineTailItem$0, PipelineTailItem$1, PipelineTailItem$2, PipelineTailItem$3];
|
|
8039
|
+
}), PipelineTailItem$$ = [PipelineTailItem$0, PipelineTailItem$1, PipelineTailItem$2, PipelineTailItem$3, PipelineTailItem$4];
|
|
8025
8040
|
function PipelineTailItem(ctx, state2) {
|
|
8026
8041
|
return (0, import_lib2.$EVENT_C)(ctx, state2, "PipelineTailItem", PipelineTailItem$$);
|
|
8027
8042
|
}
|
|
@@ -9355,11 +9370,12 @@ ${js}`
|
|
|
9355
9370
|
signature,
|
|
9356
9371
|
ts: !0
|
|
9357
9372
|
};
|
|
9358
|
-
}), FunctionExpression$1 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$N)(ArrowFunction), OpenParen, BinaryOp, CloseParen), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
9359
|
-
var open = $2,
|
|
9373
|
+
}), FunctionExpression$1 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$N)(ArrowFunction), OpenParen, __, BinaryOp, __, CloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
9374
|
+
var open = $2, ws1 = $3, op = $4, ws2 = $5, close = $6;
|
|
9360
9375
|
if (op.special && op.call && !op.negated) return op.call;
|
|
9376
|
+
ws1 || (ws1 = op.spaced ? [" "] : []), ws2 || (ws2 = op.spaced ? [" "] : []);
|
|
9361
9377
|
let refA = makeRef("a"), refB = makeRef("b"), body = processBinaryOpExpression([refA, [
|
|
9362
|
-
[
|
|
9378
|
+
[ws1, op, ws2, refB]
|
|
9363
9379
|
// BinaryOpRHS
|
|
9364
9380
|
]]), parameterList = [[refA, ","], refB], parameters = {
|
|
9365
9381
|
type: "Parameters",
|
|
@@ -9382,6 +9398,7 @@ ${js}`
|
|
|
9382
9398
|
};
|
|
9383
9399
|
}), FunctionExpression$2 = (0, import_lib2.$TS)((0, import_lib2.$S)(OpenParen, NonPipelineAssignmentExpression, __, BinaryOp, __, CloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
9384
9400
|
var open = $1, lhs = $2, ws1 = $3, op = $4, ws2 = $5, close = $6;
|
|
9401
|
+
ws1 || (ws1 = op.spaced ? [" "] : []), ws2 || (ws2 = op.spaced ? [" "] : []);
|
|
9385
9402
|
let refB = makeRef("b"), fn = makeAmpersandFunction({
|
|
9386
9403
|
ref: refB,
|
|
9387
9404
|
body: processBinaryOpExpression([lhs, [
|
|
@@ -9429,6 +9446,7 @@ ${js}`
|
|
|
9429
9446
|
};
|
|
9430
9447
|
}), FunctionExpression$5 = (0, import_lib2.$TS)((0, import_lib2.$S)(OpenParen, __, (0, import_lib2.$N)((0, import_lib2.$EXPECT)($R15, "FunctionExpression /\\+\\+|--|\u29FA|\u2014|[\\+\\-&]\\S/")), (0, import_lib2.$N)((0, import_lib2.$S)(Placeholder, (0, import_lib2.$C)(TypePostfix, BinaryOpRHS))), BinaryOp, __, NonPipelineAssignmentExpression, CloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8) {
|
|
9431
9448
|
var open = $1, ws1 = $2, op = $5, ws2 = $6, rhs = $7, close = $8;
|
|
9449
|
+
ws1 || (ws1 = op.spaced ? [" "] : []), ws2 || (ws2 = op.spaced ? [" "] : []);
|
|
9432
9450
|
let refA = makeRef("a"), fn = makeAmpersandFunction({
|
|
9433
9451
|
ref: refA,
|
|
9434
9452
|
body: processBinaryOpExpression([refA, [
|
|
@@ -9447,10 +9465,7 @@ ${js}`
|
|
|
9447
9465
|
}
|
|
9448
9466
|
var OperatorDeclaration$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(Operator, (0, import_lib2.$E)(OperatorBehavior), _, LexicalDeclaration), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
9449
9467
|
var op = $1, behavior = $2, w = $3, decl = $4;
|
|
9450
|
-
return decl.names.forEach((name) => state.operators.set(name, behavior)),
|
|
9451
|
-
...decl,
|
|
9452
|
-
children: [trimFirstSpace(w), ...decl.children]
|
|
9453
|
-
};
|
|
9468
|
+
return decl.names.forEach((name) => state.operators.set(name, behavior)), behavior?.error && (decl = prepend(behavior.error, decl)), decl = prepend(trimFirstSpace(w), decl), decl;
|
|
9454
9469
|
}), OperatorDeclaration$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(OperatorSignature, BracedBlock), function($skip, $loc, $0, $1, $2) {
|
|
9455
9470
|
var signature = $1, block = $2;
|
|
9456
9471
|
return state.operators.set(signature.id.name, signature.behavior), {
|
|
@@ -9463,9 +9478,12 @@ ${js}`
|
|
|
9463
9478
|
};
|
|
9464
9479
|
}), OperatorDeclaration$2 = (0, import_lib2.$TS)((0, import_lib2.$S)(Operator, _, Identifier, (0, import_lib2.$E)(OperatorBehavior), (0, import_lib2.$Q)((0, import_lib2.$S)(CommaDelimiter, (0, import_lib2.$E)(_), Identifier, (0, import_lib2.$E)(OperatorBehavior)))), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
9465
9480
|
var op = $1, w1 = $2, id = $3, behavior = $4, ids = $5;
|
|
9466
|
-
|
|
9481
|
+
let children = [];
|
|
9482
|
+
return state.operators.set(id.name, behavior), behavior?.error && children.push(behavior.error), ids.forEach(([, , id2, behavior2]) => {
|
|
9483
|
+
state.operators.set(id2.name, behavior2), behavior2?.error && children.push(behavior2.error);
|
|
9484
|
+
}), {
|
|
9467
9485
|
id,
|
|
9468
|
-
children
|
|
9486
|
+
children
|
|
9469
9487
|
};
|
|
9470
9488
|
}), OperatorDeclaration$$ = [OperatorDeclaration$0, OperatorDeclaration$1, OperatorDeclaration$2];
|
|
9471
9489
|
function OperatorDeclaration(ctx, state2) {
|
|
@@ -9486,7 +9504,7 @@ ${js}`
|
|
|
9486
9504
|
generator: !!generator.length
|
|
9487
9505
|
},
|
|
9488
9506
|
block: null,
|
|
9489
|
-
children: [async, func, generator, w1, id, w2, parameters, returnType],
|
|
9507
|
+
children: [async, func, generator, w1, id, behavior?.error, w2, parameters, returnType],
|
|
9490
9508
|
behavior
|
|
9491
9509
|
};
|
|
9492
9510
|
});
|
|
@@ -9503,16 +9521,19 @@ ${js}`
|
|
|
9503
9521
|
}
|
|
9504
9522
|
var OperatorPrecedence$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), (0, import_lib2.$C)((0, import_lib2.$EXPECT)($L27, 'OperatorPrecedence "tighter"'), (0, import_lib2.$EXPECT)($L28, 'OperatorPrecedence "looser"'), (0, import_lib2.$EXPECT)($L29, 'OperatorPrecedence "same"')), NonIdContinue, (0, import_lib2.$E)(_), (0, import_lib2.$C)(Identifier, (0, import_lib2.$S)(OpenParen, BinaryOp, CloseParen))), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
9505
9523
|
var mod = $2, op = $5;
|
|
9506
|
-
let prec
|
|
9507
|
-
switch (
|
|
9524
|
+
let prec, error;
|
|
9525
|
+
switch (op.type === "Identifier" ? state.operators.has(op.name) ? prec = state.operators.get(op.name).prec : (prec = precedenceCustomDefault, error = {
|
|
9526
|
+
type: "Error",
|
|
9527
|
+
message: `Precedence refers to unknown operator ${op.name}`
|
|
9528
|
+
}) : prec = getPrecedence(op[1]), mod) {
|
|
9508
9529
|
case "tighter":
|
|
9509
|
-
prec +=
|
|
9530
|
+
prec += precedenceStep;
|
|
9510
9531
|
break;
|
|
9511
9532
|
case "looser":
|
|
9512
|
-
prec -=
|
|
9533
|
+
prec -= precedenceStep;
|
|
9513
9534
|
break;
|
|
9514
9535
|
}
|
|
9515
|
-
return { prec };
|
|
9536
|
+
return { prec, error };
|
|
9516
9537
|
});
|
|
9517
9538
|
function OperatorPrecedence(ctx, state2) {
|
|
9518
9539
|
return (0, import_lib2.$EVENT)(ctx, state2, "OperatorPrecedence", OperatorPrecedence$0);
|
|
@@ -10926,6 +10947,7 @@ ${js}`
|
|
|
10926
10947
|
return {
|
|
10927
10948
|
$loc,
|
|
10928
10949
|
token: "instanceof",
|
|
10950
|
+
spaced: !0,
|
|
10929
10951
|
relational: !0,
|
|
10930
10952
|
special: !0
|
|
10931
10953
|
};
|
|
@@ -10933,6 +10955,7 @@ ${js}`
|
|
|
10933
10955
|
return {
|
|
10934
10956
|
$loc,
|
|
10935
10957
|
token: "instanceof",
|
|
10958
|
+
spaced: !0,
|
|
10936
10959
|
relational: !0,
|
|
10937
10960
|
special: !0,
|
|
10938
10961
|
negated: !0
|
|
@@ -10979,6 +11002,7 @@ ${js}`
|
|
|
10979
11002
|
return {
|
|
10980
11003
|
$loc,
|
|
10981
11004
|
token: $1,
|
|
11005
|
+
spaced: !0,
|
|
10982
11006
|
relational: !0,
|
|
10983
11007
|
special: !0
|
|
10984
11008
|
// for typeof shorthand
|
|
@@ -11058,6 +11082,7 @@ ${js}`
|
|
|
11058
11082
|
return {
|
|
11059
11083
|
$loc,
|
|
11060
11084
|
token: "in",
|
|
11085
|
+
spaced: !0,
|
|
11061
11086
|
special: !0,
|
|
11062
11087
|
negated: !0
|
|
11063
11088
|
};
|
|
@@ -11077,6 +11102,7 @@ ${js}`
|
|
|
11077
11102
|
return {
|
|
11078
11103
|
$loc,
|
|
11079
11104
|
token: "instanceof",
|
|
11105
|
+
spaced: !0,
|
|
11080
11106
|
relational: !0,
|
|
11081
11107
|
special: !0,
|
|
11082
11108
|
negated: !0
|
|
@@ -11085,6 +11111,7 @@ ${js}`
|
|
|
11085
11111
|
return {
|
|
11086
11112
|
$loc,
|
|
11087
11113
|
token: "in",
|
|
11114
|
+
spaced: !0,
|
|
11088
11115
|
special: !0,
|
|
11089
11116
|
negated: !0
|
|
11090
11117
|
};
|
|
@@ -12334,11 +12361,12 @@ ${js}`
|
|
|
12334
12361
|
};
|
|
12335
12362
|
}), ImportDeclaration$1 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$C)((0, import_lib2.$S)(Import, __), ImpliedImport), Operator, (0, import_lib2.$E)(OperatorBehavior), __, OperatorNamedImports, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
|
|
12336
12363
|
var i = $1, behavior = $3, ws1 = $4, imports = $5, ws2 = $6, from = $7;
|
|
12337
|
-
|
|
12338
|
-
|
|
12364
|
+
let errors = [];
|
|
12365
|
+
return behavior?.error && errors.push(behavior.error), imports.specifiers.forEach((spec) => {
|
|
12366
|
+
state.operators.set(spec.binding.name, spec.behavior ?? behavior), spec.behavior?.error && errors.push(spec.behavior.error);
|
|
12339
12367
|
}), {
|
|
12340
12368
|
type: "ImportDeclaration",
|
|
12341
|
-
children: [i, trimFirstSpace(ws1), imports, ws2, from],
|
|
12369
|
+
children: [i, ...errors, trimFirstSpace(ws1), imports, ws2, from],
|
|
12342
12370
|
// omit $2 = Operator and $3 = OperatorBehavior
|
|
12343
12371
|
imports,
|
|
12344
12372
|
from
|
|
@@ -12363,11 +12391,12 @@ ${js}`
|
|
|
12363
12391
|
}, { type: "ImportDeclaration", ts: !!t, children: [i, t, imports, w, from], imports, from };
|
|
12364
12392
|
}), ImportDeclaration$5 = (0, import_lib2.$TS)((0, import_lib2.$S)(ImpliedFromClause, __, Import, __, Operator, (0, import_lib2.$E)(OperatorBehavior), __, OperatorNamedImports), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8) {
|
|
12365
12393
|
var from = $1, fws = $2, i = $3, iws = $4, behavior = $6, ows = $7, imports = $8;
|
|
12366
|
-
|
|
12367
|
-
|
|
12394
|
+
let errors = [];
|
|
12395
|
+
return behavior?.error && errors.push(behavior.error), imports.specifiers.forEach((spec) => {
|
|
12396
|
+
state.operators.set(spec.binding.name, spec.behavior ?? behavior), spec.behavior?.error && errors.push(spec.behavior.error);
|
|
12368
12397
|
}), {
|
|
12369
12398
|
type: "ImportDeclaration",
|
|
12370
|
-
children: [i, iws, trimFirstSpace(ows), imports, fws, from],
|
|
12399
|
+
children: [i, iws, ...errors, trimFirstSpace(ows), imports, fws, from],
|
|
12371
12400
|
// omit Operator and OperatorBehavior
|
|
12372
12401
|
imports,
|
|
12373
12402
|
from
|
|
@@ -12521,14 +12550,14 @@ ${js}`
|
|
|
12521
12550
|
return {
|
|
12522
12551
|
binding,
|
|
12523
12552
|
behavior,
|
|
12524
|
-
children: [$1, $2, $4, $5, $6, $7]
|
|
12553
|
+
children: [$1, $2, $3?.error, $4, $5, $6, $7]
|
|
12525
12554
|
};
|
|
12526
12555
|
}), OperatorImportSpecifier$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(__, ImportedBinding, (0, import_lib2.$E)(OperatorBehavior), ObjectPropertyDelimiter), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
12527
12556
|
var binding = $2, behavior = $3;
|
|
12528
12557
|
return {
|
|
12529
12558
|
binding,
|
|
12530
12559
|
behavior,
|
|
12531
|
-
children: [$1, $2, $4]
|
|
12560
|
+
children: [$1, $2, $3?.error, $4]
|
|
12532
12561
|
};
|
|
12533
12562
|
}), OperatorImportSpecifier$$ = [OperatorImportSpecifier$0, OperatorImportSpecifier$1];
|
|
12534
12563
|
function OperatorImportSpecifier(ctx, state2) {
|
|
@@ -13501,7 +13530,7 @@ ${js}`
|
|
|
13501
13530
|
return (0, import_lib2.$EVENT)(ctx, state2, "Import", Import$0);
|
|
13502
13531
|
}
|
|
13503
13532
|
var In$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$EXPECT)($L180, 'In "in"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
13504
|
-
return { $loc, token: $1 };
|
|
13533
|
+
return { $loc, token: $1, spaced: !0 };
|
|
13505
13534
|
});
|
|
13506
13535
|
function In(ctx, state2) {
|
|
13507
13536
|
return (0, import_lib2.$EVENT)(ctx, state2, "In", In$0);
|