@danielx/civet 0.10.7 → 0.11.1
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 +14 -0
- package/dist/browser.js +345 -146
- package/dist/main.js +426 -158
- package/dist/main.mjs +426 -158
- package/dist/node-worker.mjs +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
package/dist/main.mjs
CHANGED
|
@@ -28,9 +28,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
mod
|
|
29
29
|
));
|
|
30
30
|
|
|
31
|
-
//
|
|
31
|
+
// node_modules/@danielx/hera/dist/machine.js
|
|
32
32
|
var require_machine = __commonJS({
|
|
33
|
-
"
|
|
33
|
+
"node_modules/@danielx/hera/dist/machine.js"(exports, module) {
|
|
34
34
|
"use strict";
|
|
35
35
|
var __defProp2 = Object.defineProperty;
|
|
36
36
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -604,7 +604,7 @@ function addParentPointers(node, parent) {
|
|
|
604
604
|
node.parent = parent;
|
|
605
605
|
}
|
|
606
606
|
if (node.children) {
|
|
607
|
-
for (let ref = node.children, i1 = 0,
|
|
607
|
+
for (let ref = node.children, i1 = 0, len12 = ref.length; i1 < len12; i1++) {
|
|
608
608
|
const child = ref[i1];
|
|
609
609
|
addParentPointers(child, node);
|
|
610
610
|
}
|
|
@@ -1588,7 +1588,7 @@ function findChildIndex(parent, child) {
|
|
|
1588
1588
|
}
|
|
1589
1589
|
}
|
|
1590
1590
|
function arrayRecurse(array) {
|
|
1591
|
-
for (let i2 = 0,
|
|
1591
|
+
for (let i2 = 0, len12 = array.length; i2 < len12; i2++) {
|
|
1592
1592
|
const c = array[i2];
|
|
1593
1593
|
if (c === child || Array.isArray(c) && arrayRecurse(c)) {
|
|
1594
1594
|
return true;
|
|
@@ -1795,7 +1795,7 @@ function adjustBindingElements(elements) {
|
|
|
1795
1795
|
const names = elements.flatMap(($2) => $2.names || []);
|
|
1796
1796
|
const { length } = elements;
|
|
1797
1797
|
let blockPrefix, restIndex = -1, restCount = 0;
|
|
1798
|
-
for (let i2 = 0,
|
|
1798
|
+
for (let i2 = 0, len12 = elements.length; i2 < len12; i2++) {
|
|
1799
1799
|
const i = i2;
|
|
1800
1800
|
const { type } = elements[i2];
|
|
1801
1801
|
if (type === "BindingRestElement") {
|
|
@@ -3054,7 +3054,7 @@ function patternBindings(pattern) {
|
|
|
3054
3054
|
function recurse(pattern2) {
|
|
3055
3055
|
switch (pattern2.type) {
|
|
3056
3056
|
case "ArrayBindingPattern": {
|
|
3057
|
-
for (let ref3 = pattern2.elements, i2 = 0,
|
|
3057
|
+
for (let ref3 = pattern2.elements, i2 = 0, len12 = ref3.length; i2 < len12; i2++) {
|
|
3058
3058
|
const element = ref3[i2];
|
|
3059
3059
|
recurse(element);
|
|
3060
3060
|
}
|
|
@@ -4057,14 +4057,23 @@ function expressionizeIteration(exp) {
|
|
|
4057
4057
|
if (generator) {
|
|
4058
4058
|
iterationDefaultBody(statement);
|
|
4059
4059
|
assignResults(block, (node) => {
|
|
4060
|
+
let star;
|
|
4061
|
+
if (node && typeof node === "object" && "type" in node && node.type === "SpreadElement" && "expression" in node) {
|
|
4062
|
+
const { expression } = node;
|
|
4063
|
+
star = "*";
|
|
4064
|
+
node = expression;
|
|
4065
|
+
}
|
|
4060
4066
|
return {
|
|
4061
4067
|
type: "YieldExpression",
|
|
4062
4068
|
expression: node,
|
|
4069
|
+
star,
|
|
4063
4070
|
children: [
|
|
4064
4071
|
{
|
|
4065
4072
|
type: "Yield",
|
|
4066
|
-
|
|
4073
|
+
children: ["yield"]
|
|
4067
4074
|
},
|
|
4075
|
+
star,
|
|
4076
|
+
" ",
|
|
4068
4077
|
node
|
|
4069
4078
|
]
|
|
4070
4079
|
};
|
|
@@ -4258,6 +4267,17 @@ function braceBlock(block) {
|
|
|
4258
4267
|
}
|
|
4259
4268
|
}
|
|
4260
4269
|
}
|
|
4270
|
+
function unbraceBlock(block) {
|
|
4271
|
+
if (block.bare) {
|
|
4272
|
+
return;
|
|
4273
|
+
}
|
|
4274
|
+
let ref;
|
|
4275
|
+
if (block.children[0] === " {" && (ref = block.children)[ref.length - 1] === "}") {
|
|
4276
|
+
block.children.shift();
|
|
4277
|
+
block.children.pop();
|
|
4278
|
+
block.bare = true;
|
|
4279
|
+
}
|
|
4280
|
+
}
|
|
4261
4281
|
function duplicateBlock(block) {
|
|
4262
4282
|
const expressions = [...block.expressions];
|
|
4263
4283
|
let children;
|
|
@@ -4356,16 +4376,58 @@ function insertHoistDec(block, node, dec) {
|
|
|
4356
4376
|
}
|
|
4357
4377
|
function processBlocks(statements) {
|
|
4358
4378
|
insertSemicolon(statements);
|
|
4359
|
-
for (let
|
|
4360
|
-
const
|
|
4361
|
-
|
|
4379
|
+
for (let ref1 = gatherRecursive(statements, ($) => $.type === "BlockStatement"), i2 = 0, len12 = ref1.length; i2 < len12; i2++) {
|
|
4380
|
+
const block = ref1[i2];
|
|
4381
|
+
let m;
|
|
4382
|
+
if (block.unwrapObject && block.expressions.length === 1 && (m = block.expressions[0][1], typeof m === "object" && m != null && "type" in m && m.type === "ParenthesizedExpression" && "implicit" in m && m.implicit === true && "expression" in m && typeof m.expression === "object" && m.expression != null && "type" in m.expression && m.expression.type === "ObjectExpression")) {
|
|
4383
|
+
const object = block.expressions[0][1].expression;
|
|
4384
|
+
if (!(() => {
|
|
4385
|
+
let results = true;
|
|
4386
|
+
for (const prop of object.properties) {
|
|
4387
|
+
if (!(prop.type === "Property" && prop.implicitName)) {
|
|
4388
|
+
results = false;
|
|
4389
|
+
break;
|
|
4390
|
+
}
|
|
4391
|
+
}
|
|
4392
|
+
return results;
|
|
4393
|
+
})()) {
|
|
4394
|
+
continue;
|
|
4395
|
+
}
|
|
4396
|
+
block.expressions[0][1] = block.expressions[0][1].expression;
|
|
4397
|
+
unbraceBlock(block);
|
|
4398
|
+
for (let ref2 = object.properties, i3 = 0, len22 = ref2.length; i3 < len22; i3++) {
|
|
4399
|
+
const i = i3;
|
|
4400
|
+
const prop = ref2[i3];
|
|
4401
|
+
let m1;
|
|
4402
|
+
if (m1 = prop.name, typeof m1 === "object" && m1 != null && "type" in m1 && m1.type === "ComputedPropertyName" && "implicit" in m1 && m1.implicit === true) {
|
|
4403
|
+
replaceNode(prop.name, prop.name.expression, prop);
|
|
4404
|
+
}
|
|
4405
|
+
if (prop.delim?.implicit) {
|
|
4406
|
+
if (needsPrecedingSemicolon(object.properties[i + 1])) {
|
|
4407
|
+
prop.delim.token = ";";
|
|
4408
|
+
} else {
|
|
4409
|
+
replaceNode(prop.delim, void 0, prop);
|
|
4410
|
+
prop.delim = void 0;
|
|
4411
|
+
}
|
|
4412
|
+
}
|
|
4413
|
+
const colon = prop.children.indexOf(": ");
|
|
4414
|
+
if (colon < 0) {
|
|
4415
|
+
continue;
|
|
4416
|
+
}
|
|
4417
|
+
if (!(prop.children[colon - 1] === prop.name)) {
|
|
4418
|
+
continue;
|
|
4419
|
+
}
|
|
4420
|
+
prop.children.splice(colon - 1, 2);
|
|
4421
|
+
}
|
|
4422
|
+
}
|
|
4423
|
+
processBlocks(block.expressions);
|
|
4362
4424
|
}
|
|
4363
4425
|
}
|
|
4364
4426
|
function insertSemicolon(statements) {
|
|
4365
4427
|
const l = statements.length;
|
|
4366
|
-
for (let
|
|
4367
|
-
const i =
|
|
4368
|
-
const s = statements[
|
|
4428
|
+
for (let i4 = 0, len3 = statements.length; i4 < len3; i4++) {
|
|
4429
|
+
const i = i4;
|
|
4430
|
+
const s = statements[i4];
|
|
4369
4431
|
if (i < l - 1) {
|
|
4370
4432
|
if (needsPrecedingSemicolon(statements[i + 1][1])) {
|
|
4371
4433
|
const delim = s[2];
|
|
@@ -4383,8 +4445,8 @@ function needsPrecedingSemicolon(exp) {
|
|
|
4383
4445
|
return false;
|
|
4384
4446
|
}
|
|
4385
4447
|
if (Array.isArray(exp)) {
|
|
4386
|
-
for (let
|
|
4387
|
-
const child = exp[
|
|
4448
|
+
for (let i5 = 0, len4 = exp.length; i5 < len4; i5++) {
|
|
4449
|
+
const child = exp[i5];
|
|
4388
4450
|
if (!(child != null)) {
|
|
4389
4451
|
continue;
|
|
4390
4452
|
}
|
|
@@ -4430,8 +4492,8 @@ function needsPrecedingSemicolon(exp) {
|
|
|
4430
4492
|
function blockContainingStatement(exp) {
|
|
4431
4493
|
let child = exp;
|
|
4432
4494
|
let parent = exp.parent;
|
|
4433
|
-
let
|
|
4434
|
-
while (parent != null && (
|
|
4495
|
+
let m2;
|
|
4496
|
+
while (parent != null && (m2 = parent.type, m2 === "StatementExpression" || m2 === "PipelineExpression" || m2 === "UnwrappedExpression")) {
|
|
4435
4497
|
child = parent;
|
|
4436
4498
|
parent = parent.parent;
|
|
4437
4499
|
}
|
|
@@ -4484,7 +4546,7 @@ var precedenceMap = /* @__PURE__ */ new Map();
|
|
|
4484
4546
|
for (let i1 = 0, len3 = precedenceOrder.length; i1 < len3; i1++) {
|
|
4485
4547
|
const prec = i1;
|
|
4486
4548
|
const ops = precedenceOrder[i1];
|
|
4487
|
-
for (let i2 = 0,
|
|
4549
|
+
for (let i2 = 0, len12 = ops.length; i2 < len12; i2++) {
|
|
4488
4550
|
const op = ops[i2];
|
|
4489
4551
|
precedenceMap.set(op, prec);
|
|
4490
4552
|
}
|
|
@@ -4506,6 +4568,19 @@ function getPrecedence(op) {
|
|
|
4506
4568
|
return precedenceMap.get(op.prec ?? op.token) ?? (op.relational ? precedenceRelational : precedenceCustomDefault);
|
|
4507
4569
|
}
|
|
4508
4570
|
}
|
|
4571
|
+
function isShortCircuitOp(op) {
|
|
4572
|
+
if (op && typeof op === "object" && "token" in op) {
|
|
4573
|
+
const { token } = op;
|
|
4574
|
+
return isShortCircuitOp(token);
|
|
4575
|
+
} else if (typeof op === "string") {
|
|
4576
|
+
if (op.endsWith("=") && !op.endsWith("==")) {
|
|
4577
|
+
op = op.slice(0, -1);
|
|
4578
|
+
}
|
|
4579
|
+
return op === "||" || op === "&&" || op === "??";
|
|
4580
|
+
} else {
|
|
4581
|
+
return false;
|
|
4582
|
+
}
|
|
4583
|
+
}
|
|
4509
4584
|
function processBinaryOpExpression($0) {
|
|
4510
4585
|
return processExpandedBinaryOpExpression(expandChainedComparisons($0));
|
|
4511
4586
|
}
|
|
@@ -4815,7 +4890,7 @@ function processPatternMatching(statements) {
|
|
|
4815
4890
|
let isPattern = false;
|
|
4816
4891
|
if (clauses.some(($4) => $4.type === "PatternClause")) {
|
|
4817
4892
|
isPattern = true;
|
|
4818
|
-
for (let i2 = 0,
|
|
4893
|
+
for (let i2 = 0, len12 = clauses.length; i2 < len12; i2++) {
|
|
4819
4894
|
const c = clauses[i2];
|
|
4820
4895
|
if (!(c.type === "PatternClause" || c.type === "DefaultClause")) {
|
|
4821
4896
|
errors = true;
|
|
@@ -5349,7 +5424,7 @@ function processAssignmentDeclaration(decl, pattern, typeSuffix, ws, assign, e)
|
|
|
5349
5424
|
});
|
|
5350
5425
|
}
|
|
5351
5426
|
function processDeclarations(statements) {
|
|
5352
|
-
for (let ref1 = gatherRecursiveAll(statements, ($) => $.type === "Declaration"), i1 = 0,
|
|
5427
|
+
for (let ref1 = gatherRecursiveAll(statements, ($) => $.type === "Declaration"), i1 = 0, len12 = ref1.length; i1 < len12; i1++) {
|
|
5353
5428
|
const declaration = ref1[i1];
|
|
5354
5429
|
const { bindings } = declaration;
|
|
5355
5430
|
if (!(bindings != null)) {
|
|
@@ -5436,7 +5511,7 @@ function prependStatementExpressionBlock(initializer, statement) {
|
|
|
5436
5511
|
}
|
|
5437
5512
|
const pre = [];
|
|
5438
5513
|
const statementExp = exp.statement;
|
|
5439
|
-
const blockStatement = ["", statementExp];
|
|
5514
|
+
const blockStatement = [ws || "", statementExp, ";"];
|
|
5440
5515
|
let ref;
|
|
5441
5516
|
if (statementExp.type === "IterationExpression") {
|
|
5442
5517
|
if (statementExp.async || statementExp.generator) {
|
|
@@ -5458,9 +5533,9 @@ function prependStatementExpressionBlock(initializer, statement) {
|
|
|
5458
5533
|
});
|
|
5459
5534
|
const refDec = {
|
|
5460
5535
|
type: "Declaration",
|
|
5461
|
-
children: ["let ", ref
|
|
5536
|
+
children: ["let ", ref]
|
|
5462
5537
|
};
|
|
5463
|
-
pre.unshift(refDec);
|
|
5538
|
+
pre.unshift(["", refDec, ";"]);
|
|
5464
5539
|
} else {
|
|
5465
5540
|
wrapIterationReturningResults(statement2, () => void 0);
|
|
5466
5541
|
ref = initializer.expression = initializer.children[2] = statement2.resultsRef;
|
|
@@ -5476,14 +5551,11 @@ function prependStatementExpressionBlock(initializer, statement) {
|
|
|
5476
5551
|
});
|
|
5477
5552
|
const refDec = {
|
|
5478
5553
|
type: "Declaration",
|
|
5479
|
-
children: ["let ", ref
|
|
5554
|
+
children: ["let ", ref]
|
|
5480
5555
|
};
|
|
5481
|
-
pre.unshift(refDec);
|
|
5482
|
-
if (ws) {
|
|
5483
|
-
pre.push(ws);
|
|
5484
|
-
}
|
|
5556
|
+
pre.unshift(["", refDec, ";"]);
|
|
5485
5557
|
}
|
|
5486
|
-
statement.children.unshift(pre, blockStatement
|
|
5558
|
+
statement.children.unshift(...pre, blockStatement);
|
|
5487
5559
|
updateParentPointers(blockStatement, statement);
|
|
5488
5560
|
return ref;
|
|
5489
5561
|
}
|
|
@@ -5804,26 +5876,60 @@ function dynamizeImportDeclaration(decl) {
|
|
|
5804
5876
|
};
|
|
5805
5877
|
}
|
|
5806
5878
|
function dynamizeImportDeclarationExpression($0) {
|
|
5807
|
-
const [imp, ws1,
|
|
5808
|
-
const
|
|
5809
|
-
|
|
5810
|
-
return processCallMemberExpression({
|
|
5811
|
-
type: "CallExpression",
|
|
5879
|
+
const [imp, ws1, imports, ws2, from] = $0;
|
|
5880
|
+
const awaitExpression = {
|
|
5881
|
+
type: "AwaitExpression",
|
|
5812
5882
|
children: [
|
|
5813
|
-
{ type: "Await", children: "await" },
|
|
5883
|
+
{ type: "Await", children: ["await"] },
|
|
5814
5884
|
" ",
|
|
5815
5885
|
imp,
|
|
5816
5886
|
trimFirstSpace(ws2),
|
|
5817
|
-
dynamizeFromClause(from)
|
|
5818
|
-
{
|
|
5819
|
-
type: "PropertyGlob",
|
|
5820
|
-
dot,
|
|
5821
|
-
object,
|
|
5822
|
-
children: [ws1, dot, object],
|
|
5823
|
-
reversed: true
|
|
5824
|
-
}
|
|
5887
|
+
dynamizeFromClause(from)
|
|
5825
5888
|
]
|
|
5826
|
-
}
|
|
5889
|
+
};
|
|
5890
|
+
const dot = {
|
|
5891
|
+
type: "AccessStart",
|
|
5892
|
+
children: ["."],
|
|
5893
|
+
optional: false
|
|
5894
|
+
};
|
|
5895
|
+
switch (imports?.type) {
|
|
5896
|
+
case "Identifier": {
|
|
5897
|
+
return processCallMemberExpression({
|
|
5898
|
+
type: "CallExpression",
|
|
5899
|
+
children: [
|
|
5900
|
+
parenthesizeExpression(awaitExpression),
|
|
5901
|
+
{
|
|
5902
|
+
type: "PropertyAccess",
|
|
5903
|
+
dot,
|
|
5904
|
+
name: "default",
|
|
5905
|
+
children: [ws1, dot, "default"]
|
|
5906
|
+
}
|
|
5907
|
+
]
|
|
5908
|
+
});
|
|
5909
|
+
}
|
|
5910
|
+
case "Star": {
|
|
5911
|
+
return parenthesizeExpression(awaitExpression);
|
|
5912
|
+
}
|
|
5913
|
+
case "Declaration": {
|
|
5914
|
+
const object = convertNamedImportsToObject(imports);
|
|
5915
|
+
return processCallMemberExpression({
|
|
5916
|
+
type: "CallExpression",
|
|
5917
|
+
children: [
|
|
5918
|
+
parenthesizeExpression(awaitExpression),
|
|
5919
|
+
{
|
|
5920
|
+
type: "PropertyGlob",
|
|
5921
|
+
dot,
|
|
5922
|
+
object,
|
|
5923
|
+
children: [ws1, dot, object],
|
|
5924
|
+
reversed: true
|
|
5925
|
+
}
|
|
5926
|
+
]
|
|
5927
|
+
});
|
|
5928
|
+
}
|
|
5929
|
+
default: {
|
|
5930
|
+
throw new Error("Unsupported dynamic import");
|
|
5931
|
+
}
|
|
5932
|
+
}
|
|
5827
5933
|
}
|
|
5828
5934
|
function convertWithClause(withClause, extendsClause) {
|
|
5829
5935
|
let extendsToken, extendsTarget, ws;
|
|
@@ -6123,7 +6229,7 @@ function processPipelineExpressions(statements) {
|
|
|
6123
6229
|
const children = [ws];
|
|
6124
6230
|
const comma = blockContainingStatement(s) ? ";" : ",";
|
|
6125
6231
|
let usingRef = null;
|
|
6126
|
-
for (let i2 = 0,
|
|
6232
|
+
for (let i2 = 0, len12 = body.length; i2 < len12; i2++) {
|
|
6127
6233
|
const i = i2;
|
|
6128
6234
|
const step = body[i2];
|
|
6129
6235
|
const [leadingComment, pipe, trailingComment, expr] = step;
|
|
@@ -6915,7 +7021,7 @@ function dedentBlockSubstitutions($0, tab) {
|
|
|
6915
7021
|
}
|
|
6916
7022
|
const stringPart = (() => {
|
|
6917
7023
|
const results1 = [];
|
|
6918
|
-
for (let i2 = 0,
|
|
7024
|
+
for (let i2 = 0, len12 = strWithSubstitutions.length; i2 < len12; i2++) {
|
|
6919
7025
|
const part = strWithSubstitutions[i2];
|
|
6920
7026
|
results1.push(part.token ?? "s");
|
|
6921
7027
|
}
|
|
@@ -7005,6 +7111,9 @@ function quoteString(str) {
|
|
|
7005
7111
|
|
|
7006
7112
|
// unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\lib.civet.jsx
|
|
7007
7113
|
var xor = (a, b) => a ? !b && a : b;
|
|
7114
|
+
function len1(arr, length) {
|
|
7115
|
+
return arr.length === length;
|
|
7116
|
+
}
|
|
7008
7117
|
function addPostfixStatement(statement, ws, post) {
|
|
7009
7118
|
const expressions = [
|
|
7010
7119
|
...post.blockPrefix || [],
|
|
@@ -7382,7 +7491,7 @@ function processCallMemberExpression(node) {
|
|
|
7382
7491
|
isComma(args[args.length - 1]).token = "";
|
|
7383
7492
|
}
|
|
7384
7493
|
let commaCount = 0;
|
|
7385
|
-
for (let i2 = 0,
|
|
7494
|
+
for (let i2 = 0, len22 = args.length; i2 < len22; i2++) {
|
|
7386
7495
|
const i = i2;
|
|
7387
7496
|
let arg = args[i2];
|
|
7388
7497
|
if (isComma(arg)) {
|
|
@@ -7412,19 +7521,22 @@ function processCallMemberExpression(node) {
|
|
|
7412
7521
|
}
|
|
7413
7522
|
}
|
|
7414
7523
|
}
|
|
7415
|
-
for (let i3 = 0,
|
|
7524
|
+
for (let i3 = 0, len3 = children.length; i3 < len3; i3++) {
|
|
7416
7525
|
const i = i3;
|
|
7417
7526
|
const glob = children[i3];
|
|
7418
7527
|
if (glob?.type === "PropertyGlob") {
|
|
7419
7528
|
let prefix = children.slice(0, i);
|
|
7420
7529
|
const parts = [];
|
|
7421
7530
|
let ref;
|
|
7422
|
-
if (prefix
|
|
7531
|
+
if (needsRef(prefix) && glob.object.properties.length > 1) {
|
|
7532
|
+
if (Array.isArray(prefix) && len1(prefix, 1) && typeof prefix[0] === "object" && prefix[0] != null && "type" in prefix[0] && prefix[0].type === "ParenthesizedExpression" && "implicit" in prefix[0] && prefix[0].implicit === true) {
|
|
7533
|
+
prefix = [prefix[0].expression];
|
|
7534
|
+
}
|
|
7423
7535
|
ref = makeRef();
|
|
7424
7536
|
const { refAssignment } = makeRefAssignment(ref, prefix);
|
|
7425
7537
|
prefix = [makeLeftHandSideExpression(refAssignment)];
|
|
7426
7538
|
}
|
|
7427
|
-
|
|
7539
|
+
let prefixDot = [...prefix, glob.dot];
|
|
7428
7540
|
for (const part of glob.object.properties) {
|
|
7429
7541
|
if (part.type === "Error") {
|
|
7430
7542
|
parts.push(part);
|
|
@@ -7437,7 +7549,7 @@ function processCallMemberExpression(node) {
|
|
|
7437
7549
|
});
|
|
7438
7550
|
continue;
|
|
7439
7551
|
}
|
|
7440
|
-
if (part.value && !["CallExpression", "MemberExpression", "Identifier"].includes(part.value.type)) {
|
|
7552
|
+
if (part.value && !["CallExpression", "MemberExpression", "Identifier", "StringLiteral", "ComputedPropertyName"].includes(part.value.type)) {
|
|
7441
7553
|
parts.push({
|
|
7442
7554
|
type: "Error",
|
|
7443
7555
|
message: `Glob pattern must have call or member expression value, found ${JSON.stringify(part.value)}`
|
|
@@ -7453,9 +7565,28 @@ function processCallMemberExpression(node) {
|
|
|
7453
7565
|
[name, value] = [value, name];
|
|
7454
7566
|
}
|
|
7455
7567
|
if (!suppressPrefix) {
|
|
7456
|
-
value
|
|
7568
|
+
if (value.type === "StringLiteral") {
|
|
7569
|
+
value = [
|
|
7570
|
+
...prefix,
|
|
7571
|
+
{
|
|
7572
|
+
type: "Index",
|
|
7573
|
+
children: ["[", trimFirstSpace(value), "]"]
|
|
7574
|
+
}
|
|
7575
|
+
];
|
|
7576
|
+
} else if (value.type === "ComputedPropertyName") {
|
|
7577
|
+
value = [
|
|
7578
|
+
...prefix,
|
|
7579
|
+
{
|
|
7580
|
+
type: "Index",
|
|
7581
|
+
children: [trimFirstSpace(value)]
|
|
7582
|
+
}
|
|
7583
|
+
];
|
|
7584
|
+
} else {
|
|
7585
|
+
value = [...prefixDot, trimFirstSpace(value)];
|
|
7586
|
+
}
|
|
7457
7587
|
if (ref != null) {
|
|
7458
|
-
prefix = [ref]
|
|
7588
|
+
prefix = [ref];
|
|
7589
|
+
prefixDot = [...prefix, glob.dot];
|
|
7459
7590
|
}
|
|
7460
7591
|
}
|
|
7461
7592
|
if (wValue) value.unshift(wValue);
|
|
@@ -7858,7 +7989,7 @@ function processBindingPatternLHS(lhs, tail) {
|
|
|
7858
7989
|
);
|
|
7859
7990
|
}
|
|
7860
7991
|
function processAssignments(statements) {
|
|
7861
|
-
for (let ref8 = gatherRecursiveAll(statements, ($4) => $4.type === "AssignmentExpression" || $4.type === "UpdateExpression"), i5 = 0,
|
|
7992
|
+
for (let ref8 = gatherRecursiveAll(statements, ($4) => $4.type === "AssignmentExpression" || $4.type === "UpdateExpression"), i5 = 0, len4 = ref8.length; i5 < len4; i5++) {
|
|
7862
7993
|
let extractAssignment = function(lhs) {
|
|
7863
7994
|
let expr = lhs;
|
|
7864
7995
|
while (expr.type === "ParenthesizedExpression") {
|
|
@@ -7887,7 +8018,7 @@ function processAssignments(statements) {
|
|
|
7887
8018
|
if (!exp.lhs) {
|
|
7888
8019
|
continue;
|
|
7889
8020
|
}
|
|
7890
|
-
for (let ref10 = exp.lhs, i6 = 0,
|
|
8021
|
+
for (let ref10 = exp.lhs, i6 = 0, len5 = ref10.length; i6 < len5; i6++) {
|
|
7891
8022
|
const lhsPart = ref10[i6];
|
|
7892
8023
|
let ref11;
|
|
7893
8024
|
if (ref11 = extractAssignment(lhsPart[1])) {
|
|
@@ -7932,7 +8063,7 @@ function processAssignments(statements) {
|
|
|
7932
8063
|
}
|
|
7933
8064
|
}
|
|
7934
8065
|
}
|
|
7935
|
-
for (let ref12 = gatherRecursiveAll(statements, ($6) => $6.type === "AssignmentExpression"), i7 = 0,
|
|
8066
|
+
for (let ref12 = gatherRecursiveAll(statements, ($6) => $6.type === "AssignmentExpression"), i7 = 0, len6 = ref12.length; i7 < len6; i7++) {
|
|
7936
8067
|
const exp = ref12[i7];
|
|
7937
8068
|
if (!(exp.names === null)) {
|
|
7938
8069
|
continue;
|
|
@@ -7940,14 +8071,15 @@ function processAssignments(statements) {
|
|
|
7940
8071
|
let { lhs: $1, expression: $2 } = exp, tail = [], len3 = $1.length;
|
|
7941
8072
|
let block;
|
|
7942
8073
|
let ref13;
|
|
7943
|
-
|
|
8074
|
+
let ref14;
|
|
8075
|
+
if (blockContainingStatement(exp) && !(ref13 = $1[$1.length - 1])?.[ref13.length - 1]?.special && !isShortCircuitOp((ref14 = $1[$1.length - 1])?.[ref14.length - 1])) {
|
|
7944
8076
|
block = makeBlockFragment();
|
|
7945
|
-
let
|
|
7946
|
-
if (
|
|
8077
|
+
let ref15;
|
|
8078
|
+
if (ref15 = prependStatementExpressionBlock(
|
|
7947
8079
|
{ type: "Initializer", expression: $2, children: [void 0, void 0, $2] },
|
|
7948
8080
|
block
|
|
7949
8081
|
)) {
|
|
7950
|
-
const ref =
|
|
8082
|
+
const ref = ref15;
|
|
7951
8083
|
exp.children = exp.children.map(($7) => $7 === $2 ? ref : $7);
|
|
7952
8084
|
$2 = ref;
|
|
7953
8085
|
} else {
|
|
@@ -8003,7 +8135,7 @@ function processAssignments(statements) {
|
|
|
8003
8135
|
c[1] = start;
|
|
8004
8136
|
c[2] = ", ";
|
|
8005
8137
|
if (end) {
|
|
8006
|
-
c[3] = [end, " - ", start];
|
|
8138
|
+
c[3] = [makeLeftHandSideExpression(end), " - ", makeLeftHandSideExpression(start)];
|
|
8007
8139
|
} else {
|
|
8008
8140
|
c[3] = ["1/0"];
|
|
8009
8141
|
}
|
|
@@ -8128,9 +8260,9 @@ function unchainOptionalMemberExpression(exp, ref, innerExp) {
|
|
|
8128
8260
|
}
|
|
8129
8261
|
j++;
|
|
8130
8262
|
}
|
|
8131
|
-
let
|
|
8132
|
-
if (
|
|
8133
|
-
const l =
|
|
8263
|
+
let ref16;
|
|
8264
|
+
if (ref16 = conditions.length) {
|
|
8265
|
+
const l = ref16;
|
|
8134
8266
|
const cs = flatJoin(conditions, " && ");
|
|
8135
8267
|
return {
|
|
8136
8268
|
...exp,
|
|
@@ -8166,8 +8298,8 @@ function attachPostfixStatementAsExpression(exp, post) {
|
|
|
8166
8298
|
}
|
|
8167
8299
|
function processTypes(node) {
|
|
8168
8300
|
const results1 = [];
|
|
8169
|
-
for (let
|
|
8170
|
-
const unary =
|
|
8301
|
+
for (let ref17 = gatherRecursiveAll(node, ($11) => $11.type === "TypeUnary"), i8 = 0, len7 = ref17.length; i8 < len7; i8++) {
|
|
8302
|
+
const unary = ref17[i8];
|
|
8171
8303
|
let suffixIndex = unary.suffix.length - 1;
|
|
8172
8304
|
const results2 = [];
|
|
8173
8305
|
while (suffixIndex >= 0) {
|
|
@@ -8246,10 +8378,10 @@ function processTypes(node) {
|
|
|
8246
8378
|
const outer = unary.suffix.splice(suffixIndex + 1, Infinity);
|
|
8247
8379
|
const space = getTrimmingSpace(unary);
|
|
8248
8380
|
inplaceInsertTrimmingSpace(unary, "");
|
|
8249
|
-
let
|
|
8250
|
-
if (unary.suffix.length)
|
|
8251
|
-
else
|
|
8252
|
-
const t =
|
|
8381
|
+
let ref18;
|
|
8382
|
+
if (unary.suffix.length) ref18 = unary;
|
|
8383
|
+
else ref18 = unary.t;
|
|
8384
|
+
const t = ref18;
|
|
8253
8385
|
const arg = makeNode({
|
|
8254
8386
|
type: "TypeArgument",
|
|
8255
8387
|
ts: true,
|
|
@@ -8294,18 +8426,18 @@ function processTypes(node) {
|
|
|
8294
8426
|
return results1;
|
|
8295
8427
|
}
|
|
8296
8428
|
function processStatementExpressions(statements) {
|
|
8297
|
-
for (let
|
|
8298
|
-
const exp =
|
|
8429
|
+
for (let ref19 = gatherRecursiveAll(statements, ($12) => $12.type === "StatementExpression"), i9 = 0, len8 = ref19.length; i9 < len8; i9++) {
|
|
8430
|
+
const exp = ref19[i9];
|
|
8299
8431
|
const { maybe, statement } = exp;
|
|
8300
8432
|
if ((maybe || statement.type === "ThrowStatement") && blockContainingStatement(exp)) {
|
|
8301
8433
|
replaceNode(exp, statement);
|
|
8302
8434
|
continue;
|
|
8303
8435
|
}
|
|
8304
|
-
let
|
|
8436
|
+
let ref20;
|
|
8305
8437
|
switch (statement.type) {
|
|
8306
8438
|
case "IfStatement": {
|
|
8307
|
-
if (
|
|
8308
|
-
const expression =
|
|
8439
|
+
if (ref20 = expressionizeIfStatement(statement)) {
|
|
8440
|
+
const expression = ref20;
|
|
8309
8441
|
replaceNode(statement, expression, exp);
|
|
8310
8442
|
} else {
|
|
8311
8443
|
replaceNode(statement, wrapIIFE([["", statement]]), exp);
|
|
@@ -8364,13 +8496,13 @@ function processNegativeIndexAccess(statements) {
|
|
|
8364
8496
|
});
|
|
8365
8497
|
}
|
|
8366
8498
|
function processFinallyClauses(statements) {
|
|
8367
|
-
for (let
|
|
8368
|
-
let f =
|
|
8369
|
-
let
|
|
8370
|
-
if (!((
|
|
8499
|
+
for (let ref21 = gatherRecursiveAll(statements, ($) => $.type === "FinallyClause" && $.parent?.type !== "TryStatement"), i10 = 0, len9 = ref21.length; i10 < len9; i10++) {
|
|
8500
|
+
let f = ref21[i10];
|
|
8501
|
+
let ref22;
|
|
8502
|
+
if (!((ref22 = blockContainingStatement(f)) && typeof ref22 === "object" && "block" in ref22 && "index" in ref22)) {
|
|
8371
8503
|
throw new Error("finally clause must be inside try statement or block");
|
|
8372
8504
|
}
|
|
8373
|
-
const { block, index } =
|
|
8505
|
+
const { block, index } = ref22;
|
|
8374
8506
|
const indent = block.expressions[index][0];
|
|
8375
8507
|
const expressions = block.expressions.slice(index + 1);
|
|
8376
8508
|
const t = makeNode({
|
|
@@ -8442,8 +8574,8 @@ function processBreaksContinues(statements) {
|
|
|
8442
8574
|
}
|
|
8443
8575
|
}
|
|
8444
8576
|
function processCoffeeClasses(statements) {
|
|
8445
|
-
for (let
|
|
8446
|
-
const ce =
|
|
8577
|
+
for (let ref23 = gatherRecursiveAll(statements, ($13) => $13.type === "ClassExpression"), i11 = 0, len10 = ref23.length; i11 < len10; i11++) {
|
|
8578
|
+
const ce = ref23[i11];
|
|
8447
8579
|
const { expressions } = ce.body;
|
|
8448
8580
|
const indent = expressions[0]?.[0] ?? "\n";
|
|
8449
8581
|
const autoBinds = expressions.filter(($14) => $14[1]?.autoBind);
|
|
@@ -8487,7 +8619,7 @@ function processCoffeeClasses(statements) {
|
|
|
8487
8619
|
0,
|
|
8488
8620
|
...(() => {
|
|
8489
8621
|
const results3 = [];
|
|
8490
|
-
for (let i12 = 0,
|
|
8622
|
+
for (let i12 = 0, len11 = autoBinds.length; i12 < len11; i12++) {
|
|
8491
8623
|
const [, a] = autoBinds[i12];
|
|
8492
8624
|
results3.push([indent, ["this.", a.name, " = this.", a.name, ".bind(this)"], ";"]);
|
|
8493
8625
|
}
|
|
@@ -8603,8 +8735,8 @@ async function processProgramAsync(root) {
|
|
|
8603
8735
|
function processRepl(root, rootIIFE) {
|
|
8604
8736
|
const topBlock = gatherRecursive(rootIIFE, ($21) => $21.type === "BlockStatement")[0];
|
|
8605
8737
|
let i = 0;
|
|
8606
|
-
for (let
|
|
8607
|
-
const decl =
|
|
8738
|
+
for (let ref24 = gatherRecursiveWithinFunction(topBlock, ($22) => $22.type === "Declaration"), i14 = 0, len12 = ref24.length; i14 < len12; i14++) {
|
|
8739
|
+
const decl = ref24[i14];
|
|
8608
8740
|
if (!decl.names?.length) {
|
|
8609
8741
|
continue;
|
|
8610
8742
|
}
|
|
@@ -8617,8 +8749,8 @@ function processRepl(root, rootIIFE) {
|
|
|
8617
8749
|
root.expressions.splice(i++, 0, ["", `var ${decl.names.join(",")}`, ";"]);
|
|
8618
8750
|
}
|
|
8619
8751
|
}
|
|
8620
|
-
for (let
|
|
8621
|
-
const func =
|
|
8752
|
+
for (let ref25 = gatherRecursive(topBlock, ($23) => $23.type === "FunctionExpression"), i15 = 0, len13 = ref25.length; i15 < len13; i15++) {
|
|
8753
|
+
const func = ref25[i15];
|
|
8622
8754
|
if (func.name && func.parent?.type === "BlockStatement") {
|
|
8623
8755
|
if (func.parent === topBlock) {
|
|
8624
8756
|
replaceNode(func, void 0);
|
|
@@ -8630,8 +8762,8 @@ function processRepl(root, rootIIFE) {
|
|
|
8630
8762
|
}
|
|
8631
8763
|
}
|
|
8632
8764
|
}
|
|
8633
|
-
for (let
|
|
8634
|
-
const classExp =
|
|
8765
|
+
for (let ref26 = gatherRecursiveWithinFunction(topBlock, ($24) => $24.type === "ClassExpression"), i16 = 0, len14 = ref26.length; i16 < len14; i16++) {
|
|
8766
|
+
const classExp = ref26[i16];
|
|
8635
8767
|
let m8;
|
|
8636
8768
|
if (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)) {
|
|
8637
8769
|
classExp.children.unshift(classExp.name, "=");
|
|
@@ -8642,8 +8774,8 @@ function processRepl(root, rootIIFE) {
|
|
|
8642
8774
|
function processPlaceholders(statements) {
|
|
8643
8775
|
const placeholderMap = /* @__PURE__ */ new Map();
|
|
8644
8776
|
const liftedIfs = /* @__PURE__ */ new Set();
|
|
8645
|
-
for (let
|
|
8646
|
-
const exp =
|
|
8777
|
+
for (let ref27 = gatherRecursiveAll(statements, ($25) => $25.type === "Placeholder"), i17 = 0, len15 = ref27.length; i17 < len15; i17++) {
|
|
8778
|
+
const exp = ref27[i17];
|
|
8647
8779
|
let ancestor;
|
|
8648
8780
|
if (exp.subtype === ".") {
|
|
8649
8781
|
({ ancestor } = findAncestor(
|
|
@@ -8752,11 +8884,11 @@ function processPlaceholders(statements) {
|
|
|
8752
8884
|
for (const [ancestor, placeholders] of placeholderMap) {
|
|
8753
8885
|
let ref = makeRef("$");
|
|
8754
8886
|
let typeSuffix;
|
|
8755
|
-
for (let i18 = 0,
|
|
8887
|
+
for (let i18 = 0, len16 = placeholders.length; i18 < len16; i18++) {
|
|
8756
8888
|
const placeholder = placeholders[i18];
|
|
8757
8889
|
typeSuffix ??= placeholder.typeSuffix;
|
|
8758
|
-
let
|
|
8759
|
-
(
|
|
8890
|
+
let ref28;
|
|
8891
|
+
(ref28 = placeholder.children)[ref28.length - 1] = ref;
|
|
8760
8892
|
}
|
|
8761
8893
|
const { parent } = ancestor;
|
|
8762
8894
|
const body = maybeUnwrap(ancestor);
|
|
@@ -8777,16 +8909,16 @@ function processPlaceholders(statements) {
|
|
|
8777
8909
|
}
|
|
8778
8910
|
case "PipelineExpression": {
|
|
8779
8911
|
const i = findChildIndex(parent, ancestor);
|
|
8780
|
-
let
|
|
8912
|
+
let ref29;
|
|
8781
8913
|
if (i === 1) {
|
|
8782
|
-
|
|
8914
|
+
ref29 = ancestor === parent.children[i];
|
|
8783
8915
|
} else if (i === 2) {
|
|
8784
|
-
|
|
8916
|
+
ref29 = ancestor === parent.children[i][findChildIndex(parent.children[i], ancestor)][3];
|
|
8785
8917
|
} else {
|
|
8786
|
-
|
|
8918
|
+
ref29 = void 0;
|
|
8787
8919
|
}
|
|
8788
8920
|
;
|
|
8789
|
-
outer =
|
|
8921
|
+
outer = ref29;
|
|
8790
8922
|
break;
|
|
8791
8923
|
}
|
|
8792
8924
|
case "AssignmentExpression":
|
|
@@ -8804,9 +8936,9 @@ function processPlaceholders(statements) {
|
|
|
8804
8936
|
if (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 === true && "body" in parent.parent && parent.parent.body === body) {
|
|
8805
8937
|
parent.parent.body = fnExp;
|
|
8806
8938
|
}
|
|
8807
|
-
let
|
|
8808
|
-
if (
|
|
8809
|
-
const ws =
|
|
8939
|
+
let ref30;
|
|
8940
|
+
if (ref30 = getTrimmingSpace(body)) {
|
|
8941
|
+
const ws = ref30;
|
|
8810
8942
|
inplaceInsertTrimmingSpace(body, "");
|
|
8811
8943
|
inplacePrepend(ws, fnExp);
|
|
8812
8944
|
}
|
|
@@ -8850,8 +8982,8 @@ function reorderBindingRestProperty(props) {
|
|
|
8850
8982
|
}
|
|
8851
8983
|
];
|
|
8852
8984
|
}
|
|
8853
|
-
let
|
|
8854
|
-
if (Array.isArray(rest.delim) && (
|
|
8985
|
+
let ref31;
|
|
8986
|
+
if (Array.isArray(rest.delim) && (ref31 = rest.delim)[ref31.length - 1]?.token === ",") {
|
|
8855
8987
|
rest.delim = rest.delim.slice(0, -1);
|
|
8856
8988
|
rest.children = [...rest.children.slice(0, -1), rest.delim];
|
|
8857
8989
|
}
|
|
@@ -8866,10 +8998,12 @@ function reorderBindingRestProperty(props) {
|
|
|
8866
8998
|
}
|
|
8867
8999
|
function typeOfJSX(node, config2) {
|
|
8868
9000
|
switch (node.type) {
|
|
8869
|
-
case "JSXElement":
|
|
9001
|
+
case "JSXElement": {
|
|
8870
9002
|
return typeOfJSXElement(node, config2);
|
|
8871
|
-
|
|
9003
|
+
}
|
|
9004
|
+
case "JSXFragment": {
|
|
8872
9005
|
return typeOfJSXFragment(node, config2);
|
|
9006
|
+
}
|
|
8873
9007
|
}
|
|
8874
9008
|
}
|
|
8875
9009
|
function typeOfJSXElement(node, config2) {
|
|
@@ -8877,7 +9011,7 @@ function typeOfJSXElement(node, config2) {
|
|
|
8877
9011
|
if (config2.server && !config2.client) {
|
|
8878
9012
|
return ["string"];
|
|
8879
9013
|
}
|
|
8880
|
-
|
|
9014
|
+
const { tag } = node;
|
|
8881
9015
|
const clientType = tag[0] === tag[0].toLowerCase() ? [getHelperRef("IntrinsicElements"), '<"', tag, '">'] : ["ReturnType<typeof ", tag, ">"];
|
|
8882
9016
|
if (config2.server) {
|
|
8883
9017
|
return ["string", " | ", clientType];
|
|
@@ -8892,33 +9026,40 @@ function typeOfJSXFragment(node, config2) {
|
|
|
8892
9026
|
if (config2.solid) {
|
|
8893
9027
|
let type = [];
|
|
8894
9028
|
let lastType;
|
|
8895
|
-
for (
|
|
9029
|
+
for (const child of node.jsxChildren) {
|
|
8896
9030
|
switch (child.type) {
|
|
8897
|
-
case "JSXText":
|
|
8898
|
-
if (lastType
|
|
9031
|
+
case "JSXText": {
|
|
9032
|
+
if (!(lastType === "JSXText")) {
|
|
8899
9033
|
type.push("string");
|
|
8900
9034
|
}
|
|
9035
|
+
;
|
|
8901
9036
|
break;
|
|
8902
|
-
|
|
9037
|
+
}
|
|
9038
|
+
case "JSXElement": {
|
|
8903
9039
|
type.push(typeOfJSXElement(child, config2));
|
|
8904
9040
|
break;
|
|
8905
|
-
|
|
9041
|
+
}
|
|
9042
|
+
case "JSXFragment": {
|
|
8906
9043
|
type.push(...typeOfJSXFragment(child, config2));
|
|
8907
9044
|
break;
|
|
8908
|
-
|
|
9045
|
+
}
|
|
9046
|
+
case "JSXChildExpression": {
|
|
8909
9047
|
if (child.expression) {
|
|
8910
9048
|
type.push(["typeof ", child.expression]);
|
|
8911
9049
|
}
|
|
9050
|
+
;
|
|
8912
9051
|
break;
|
|
8913
|
-
|
|
9052
|
+
}
|
|
9053
|
+
default: {
|
|
8914
9054
|
throw new Error(`unknown child in JSXFragment: ${JSON.stringify(child)}`);
|
|
9055
|
+
}
|
|
8915
9056
|
}
|
|
8916
9057
|
lastType = child.type;
|
|
8917
9058
|
}
|
|
8918
9059
|
if (type.length === 1) {
|
|
8919
9060
|
return type[0];
|
|
8920
9061
|
} else {
|
|
8921
|
-
type = type.flatMap((
|
|
9062
|
+
type = type.flatMap(($26) => [$26, ", "]);
|
|
8922
9063
|
type.pop();
|
|
8923
9064
|
return ["[", type, "]"];
|
|
8924
9065
|
}
|
|
@@ -9143,6 +9284,8 @@ var grammar = {
|
|
|
9143
9284
|
NonSingleBracedBlock,
|
|
9144
9285
|
DeclarationOrStatement,
|
|
9145
9286
|
SingleLineStatements,
|
|
9287
|
+
ObjectSingleLineStatements,
|
|
9288
|
+
BracedObjectSingleLineStatements,
|
|
9146
9289
|
PostfixedSingleLineStatements,
|
|
9147
9290
|
PostfixedSingleLineNoCommaStatements,
|
|
9148
9291
|
NestedBlockStatements,
|
|
@@ -9323,6 +9466,10 @@ var grammar = {
|
|
|
9323
9466
|
ForbidNewlineBinaryOp,
|
|
9324
9467
|
RestoreNewlineBinaryOp,
|
|
9325
9468
|
NewlineBinaryOpAllowed,
|
|
9469
|
+
AllowImplicitFragment,
|
|
9470
|
+
ForbidImplicitFragment,
|
|
9471
|
+
RestoreImplicitFragment,
|
|
9472
|
+
ImplicitFragmentAllowed,
|
|
9326
9473
|
AllowPipeline,
|
|
9327
9474
|
ForbidPipeline,
|
|
9328
9475
|
RestorePipeline,
|
|
@@ -9348,11 +9495,15 @@ var grammar = {
|
|
|
9348
9495
|
NameSpaceImport,
|
|
9349
9496
|
NamedImports,
|
|
9350
9497
|
OperatorNamedImports,
|
|
9498
|
+
DynamicNamedImports,
|
|
9499
|
+
DynamicImportContents,
|
|
9351
9500
|
FromClause,
|
|
9352
9501
|
ImportAssertion,
|
|
9353
9502
|
TypeAndImportSpecifier,
|
|
9354
9503
|
ImportSpecifier,
|
|
9355
9504
|
OperatorImportSpecifier,
|
|
9505
|
+
DynamicImportSpecifier,
|
|
9506
|
+
DynamicModuleExportName,
|
|
9356
9507
|
ImportAsToken,
|
|
9357
9508
|
ModuleExportName,
|
|
9358
9509
|
ModuleSpecifier,
|
|
@@ -10630,7 +10781,11 @@ function SingleLineBinaryOpRHS(ctx, state2) {
|
|
|
10630
10781
|
return (0, import_lib2.$EVENT)(ctx, state2, "SingleLineBinaryOpRHS", SingleLineBinaryOpRHS$0);
|
|
10631
10782
|
}
|
|
10632
10783
|
var RHS$0 = ExpressionizedStatementWithTrailingCallExpressions;
|
|
10633
|
-
var RHS$1 = UnaryExpression
|
|
10784
|
+
var RHS$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(ForbidImplicitFragment, (0, import_lib2.$E)(UnaryExpression), RestoreImplicitFragment), function($skip, $loc, $0, $1, $2, $3) {
|
|
10785
|
+
var exp = $2;
|
|
10786
|
+
if (!exp) return $skip;
|
|
10787
|
+
return exp;
|
|
10788
|
+
});
|
|
10634
10789
|
var RHS$$ = [RHS$0, RHS$1];
|
|
10635
10790
|
function RHS(ctx, state2) {
|
|
10636
10791
|
return (0, import_lib2.$EVENT_C)(ctx, state2, "RHS", RHS$$);
|
|
@@ -10964,8 +11119,9 @@ var FatArrowBody$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$N
|
|
|
10964
11119
|
implicitlyReturned: true
|
|
10965
11120
|
};
|
|
10966
11121
|
});
|
|
10967
|
-
var FatArrowBody$1 =
|
|
10968
|
-
var FatArrowBody
|
|
11122
|
+
var FatArrowBody$1 = BracedObjectSingleLineStatements;
|
|
11123
|
+
var FatArrowBody$2 = NoCommaBracedOrEmptyBlock;
|
|
11124
|
+
var FatArrowBody$$ = [FatArrowBody$0, FatArrowBody$1, FatArrowBody$2];
|
|
10969
11125
|
function FatArrowBody(ctx, state2) {
|
|
10970
11126
|
return (0, import_lib2.$EVENT_C)(ctx, state2, "FatArrowBody", FatArrowBody$$);
|
|
10971
11127
|
}
|
|
@@ -11676,10 +11832,10 @@ var CallExpression$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(Super, Arguments
|
|
|
11676
11832
|
children: [$1, ...$2, ...rest.flat()]
|
|
11677
11833
|
});
|
|
11678
11834
|
});
|
|
11679
|
-
var CallExpression$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(Import, _,
|
|
11835
|
+
var CallExpression$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(Import, _, DynamicImportContents, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
11680
11836
|
return dynamizeImportDeclarationExpression($0);
|
|
11681
11837
|
});
|
|
11682
|
-
var CallExpression$2 = (0, import_lib2.$TS)((0, import_lib2.$S)(FromClause, __, Import, _,
|
|
11838
|
+
var CallExpression$2 = (0, import_lib2.$TS)((0, import_lib2.$S)(FromClause, __, Import, _, DynamicImportContents), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
11683
11839
|
var from = $1;
|
|
11684
11840
|
var fws = $2;
|
|
11685
11841
|
var i = $3;
|
|
@@ -13120,7 +13276,7 @@ var OperatorAssociativity$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, impor
|
|
|
13120
13276
|
function OperatorAssociativity(ctx, state2) {
|
|
13121
13277
|
return (0, import_lib2.$EVENT)(ctx, state2, "OperatorAssociativity", OperatorAssociativity$0);
|
|
13122
13278
|
}
|
|
13123
|
-
var ThinArrowFunction$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)((0, import_lib2.$S)(Async, _)), ArrowParameters, (0, import_lib2.$E)(ReturnTypeSuffix), (0, import_lib2.$E)(_), Arrow, NoCommaBracedOrEmptyBlock), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
13279
|
+
var ThinArrowFunction$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)((0, import_lib2.$S)(Async, _)), ArrowParameters, (0, import_lib2.$E)(ReturnTypeSuffix), (0, import_lib2.$E)(_), Arrow, (0, import_lib2.$C)(BracedObjectSingleLineStatements, NoCommaBracedOrEmptyBlock)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
13124
13280
|
var async = $1;
|
|
13125
13281
|
var parameters = $2;
|
|
13126
13282
|
var returnType = $3;
|
|
@@ -13274,8 +13430,9 @@ var ThenBlock$0 = (0, import_lib2.$T)((0, import_lib2.$S)(NoBlock, EmptyBlock),
|
|
|
13274
13430
|
return value[1];
|
|
13275
13431
|
});
|
|
13276
13432
|
var ThenBlock$1 = ImplicitNestedBlock;
|
|
13277
|
-
var ThenBlock$2 =
|
|
13278
|
-
var ThenBlock
|
|
13433
|
+
var ThenBlock$2 = ObjectSingleLineStatements;
|
|
13434
|
+
var ThenBlock$3 = SingleLineStatements;
|
|
13435
|
+
var ThenBlock$$ = [ThenBlock$0, ThenBlock$1, ThenBlock$2, ThenBlock$3];
|
|
13279
13436
|
function ThenBlock(ctx, state2) {
|
|
13280
13437
|
return (0, import_lib2.$EVENT_C)(ctx, state2, "ThenBlock", ThenBlock$$);
|
|
13281
13438
|
}
|
|
@@ -13334,11 +13491,12 @@ var BlockOrEmptyStatement$$ = [BlockOrEmptyStatement$0, BlockOrEmptyStatement$1]
|
|
|
13334
13491
|
function BlockOrEmptyStatement(ctx, state2) {
|
|
13335
13492
|
return (0, import_lib2.$EVENT_C)(ctx, state2, "BlockOrEmptyStatement", BlockOrEmptyStatement$$);
|
|
13336
13493
|
}
|
|
13337
|
-
var BlockOrEmpty$0 =
|
|
13338
|
-
var BlockOrEmpty$1 =
|
|
13494
|
+
var BlockOrEmpty$0 = ObjectSingleLineStatements;
|
|
13495
|
+
var BlockOrEmpty$1 = Block;
|
|
13496
|
+
var BlockOrEmpty$2 = (0, import_lib2.$T)((0, import_lib2.$S)(NoBlock, EmptyBlock), function(value) {
|
|
13339
13497
|
return value[1];
|
|
13340
13498
|
});
|
|
13341
|
-
var BlockOrEmpty$$ = [BlockOrEmpty$0, BlockOrEmpty$1];
|
|
13499
|
+
var BlockOrEmpty$$ = [BlockOrEmpty$0, BlockOrEmpty$1, BlockOrEmpty$2];
|
|
13342
13500
|
function BlockOrEmpty(ctx, state2) {
|
|
13343
13501
|
return (0, import_lib2.$EVENT_C)(ctx, state2, "BlockOrEmpty", BlockOrEmpty$$);
|
|
13344
13502
|
}
|
|
@@ -13474,6 +13632,26 @@ var SingleLineStatements$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(ForbidNewl
|
|
|
13474
13632
|
function SingleLineStatements(ctx, state2) {
|
|
13475
13633
|
return (0, import_lib2.$EVENT)(ctx, state2, "SingleLineStatements", SingleLineStatements$0);
|
|
13476
13634
|
}
|
|
13635
|
+
var ObjectSingleLineStatements$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$Y)((0, import_lib2.$S)((0, import_lib2.$E)(_), BracedObjectLiteral)), SingleLineStatements), function($skip, $loc, $0, $1, $2) {
|
|
13636
|
+
var block = $2;
|
|
13637
|
+
if (block.bare && block.expressions.length === 1) {
|
|
13638
|
+
const expression = block.expressions[0][1];
|
|
13639
|
+
if (expression.type === "ParenthesizedExpression" && expression.implicit && expression.expression.type === "ObjectExpression") {
|
|
13640
|
+
block = { ...block, unwrapObject: true };
|
|
13641
|
+
}
|
|
13642
|
+
}
|
|
13643
|
+
return block;
|
|
13644
|
+
});
|
|
13645
|
+
function ObjectSingleLineStatements(ctx, state2) {
|
|
13646
|
+
return (0, import_lib2.$EVENT)(ctx, state2, "ObjectSingleLineStatements", ObjectSingleLineStatements$0);
|
|
13647
|
+
}
|
|
13648
|
+
var BracedObjectSingleLineStatements$0 = (0, import_lib2.$TV)(ObjectSingleLineStatements, function($skip, $loc, $0, $1) {
|
|
13649
|
+
var block = $0;
|
|
13650
|
+
return bracedBlock(block);
|
|
13651
|
+
});
|
|
13652
|
+
function BracedObjectSingleLineStatements(ctx, state2) {
|
|
13653
|
+
return (0, import_lib2.$EVENT)(ctx, state2, "BracedObjectSingleLineStatements", BracedObjectSingleLineStatements$0);
|
|
13654
|
+
}
|
|
13477
13655
|
var PostfixedSingleLineStatements$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$Q)((0, import_lib2.$S)((0, import_lib2.$S)((0, import_lib2.$E)(_), (0, import_lib2.$N)(EOS)), StatementListItem, SemicolonDelimiter)), (0, import_lib2.$E)((0, import_lib2.$S)((0, import_lib2.$S)((0, import_lib2.$E)(_), (0, import_lib2.$N)(EOS)), StatementListItem, (0, import_lib2.$E)(SemicolonDelimiter)))), function($skip, $loc, $0, $1, $2) {
|
|
13478
13656
|
var stmts = $1;
|
|
13479
13657
|
var last = $2;
|
|
@@ -14324,7 +14502,8 @@ var PropertyDefinition$2 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_l
|
|
|
14324
14502
|
children: [ws, id],
|
|
14325
14503
|
name: id,
|
|
14326
14504
|
names: id.names,
|
|
14327
|
-
value: id
|
|
14505
|
+
value: id,
|
|
14506
|
+
implicitName: true
|
|
14328
14507
|
};
|
|
14329
14508
|
});
|
|
14330
14509
|
var PropertyDefinition$3 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), MethodDefinition), function($skip, $loc, $0, $1, $2) {
|
|
@@ -14383,7 +14562,8 @@ var PropertyDefinition$5 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_l
|
|
|
14383
14562
|
if (refAssignment) {
|
|
14384
14563
|
name = {
|
|
14385
14564
|
type: "ComputedPropertyName",
|
|
14386
|
-
children: [last.children[0], "(", refAssignment, ",", ref, ")", ...last.children.slice(-2)]
|
|
14565
|
+
children: [last.children[0], "(", refAssignment, ",", ref, ")", ...last.children.slice(-2)],
|
|
14566
|
+
implicit: true
|
|
14387
14567
|
};
|
|
14388
14568
|
value = {
|
|
14389
14569
|
...value,
|
|
@@ -14398,7 +14578,8 @@ var PropertyDefinition$5 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_l
|
|
|
14398
14578
|
} else {
|
|
14399
14579
|
name = {
|
|
14400
14580
|
type: "ComputedPropertyName",
|
|
14401
|
-
children: last.children
|
|
14581
|
+
children: last.children,
|
|
14582
|
+
implicit: true
|
|
14402
14583
|
};
|
|
14403
14584
|
}
|
|
14404
14585
|
} else {
|
|
@@ -14411,7 +14592,8 @@ var PropertyDefinition$5 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_l
|
|
|
14411
14592
|
children: [ws, name, ": ", processUnaryExpression(pre, value, post)],
|
|
14412
14593
|
name,
|
|
14413
14594
|
names: [],
|
|
14414
|
-
value
|
|
14595
|
+
value,
|
|
14596
|
+
implicitName: true
|
|
14415
14597
|
};
|
|
14416
14598
|
});
|
|
14417
14599
|
var PropertyDefinition$$ = [PropertyDefinition$0, PropertyDefinition$1, PropertyDefinition$2, PropertyDefinition$3, PropertyDefinition$4, PropertyDefinition$5];
|
|
@@ -14614,6 +14796,7 @@ function MethodDefinition(ctx, state2) {
|
|
|
14614
14796
|
var MethodModifier$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(GetOrSet, (0, import_lib2.$E)(_), (0, import_lib2.$Y)(ClassElementName)), function($skip, $loc, $0, $1, $2, $3) {
|
|
14615
14797
|
var kind = $1;
|
|
14616
14798
|
var ws = $2;
|
|
14799
|
+
if (!ws) ws = " ";
|
|
14617
14800
|
return {
|
|
14618
14801
|
// no async or generator, because getters and setters can't be
|
|
14619
14802
|
modifier: {
|
|
@@ -15331,7 +15514,7 @@ function ShouldExpressionize(ctx, state2) {
|
|
|
15331
15514
|
var NoCommaStatement$0 = KeywordStatement;
|
|
15332
15515
|
var NoCommaStatement$1 = VariableStatement;
|
|
15333
15516
|
var NoCommaStatement$2 = IfStatement;
|
|
15334
|
-
var NoCommaStatement$3 =
|
|
15517
|
+
var NoCommaStatement$3 = IterationActualStatement;
|
|
15335
15518
|
var NoCommaStatement$4 = SwitchStatement;
|
|
15336
15519
|
var NoCommaStatement$5 = TryStatement;
|
|
15337
15520
|
var NoCommaStatement$6 = EmptyStatement;
|
|
@@ -16363,8 +16546,8 @@ var SingleLineExpressionWithIndentedApplicationForbidden$0 = (0, import_lib2.$TS
|
|
|
16363
16546
|
function SingleLineExpressionWithIndentedApplicationForbidden(ctx, state2) {
|
|
16364
16547
|
return (0, import_lib2.$EVENT)(ctx, state2, "SingleLineExpressionWithIndentedApplicationForbidden", SingleLineExpressionWithIndentedApplicationForbidden$0);
|
|
16365
16548
|
}
|
|
16366
|
-
var ExpressionWithObjectApplicationForbidden$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(ForbidBracedApplication, ForbidIndentedApplication, (0, import_lib2.$E)(Expression), RestoreBracedApplication, RestoreIndentedApplication), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
16367
|
-
var exp = $
|
|
16549
|
+
var ExpressionWithObjectApplicationForbidden$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(ForbidBracedApplication, ForbidIndentedApplication, ForbidImplicitFragment, (0, import_lib2.$E)(Expression), RestoreBracedApplication, RestoreIndentedApplication, RestoreImplicitFragment), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
|
|
16550
|
+
var exp = $4;
|
|
16368
16551
|
if (exp) return exp;
|
|
16369
16552
|
return $skip;
|
|
16370
16553
|
});
|
|
@@ -16541,6 +16724,33 @@ var NewlineBinaryOpAllowed$0 = (0, import_lib2.$TV)((0, import_lib2.$EXPECT)($L0
|
|
|
16541
16724
|
function NewlineBinaryOpAllowed(ctx, state2) {
|
|
16542
16725
|
return (0, import_lib2.$EVENT)(ctx, state2, "NewlineBinaryOpAllowed", NewlineBinaryOpAllowed$0);
|
|
16543
16726
|
}
|
|
16727
|
+
var AllowImplicitFragment$0 = (0, import_lib2.$TV)((0, import_lib2.$EXPECT)($L0, 'AllowImplicitFragment ""'), function($skip, $loc, $0, $1) {
|
|
16728
|
+
state.forbidImplicitFragment.push(false);
|
|
16729
|
+
});
|
|
16730
|
+
function AllowImplicitFragment(ctx, state2) {
|
|
16731
|
+
return (0, import_lib2.$EVENT)(ctx, state2, "AllowImplicitFragment", AllowImplicitFragment$0);
|
|
16732
|
+
}
|
|
16733
|
+
var ForbidImplicitFragment$0 = (0, import_lib2.$TV)((0, import_lib2.$EXPECT)($L0, 'ForbidImplicitFragment ""'), function($skip, $loc, $0, $1) {
|
|
16734
|
+
state.forbidImplicitFragment.push(true);
|
|
16735
|
+
});
|
|
16736
|
+
function ForbidImplicitFragment(ctx, state2) {
|
|
16737
|
+
return (0, import_lib2.$EVENT)(ctx, state2, "ForbidImplicitFragment", ForbidImplicitFragment$0);
|
|
16738
|
+
}
|
|
16739
|
+
var RestoreImplicitFragment$0 = (0, import_lib2.$TV)((0, import_lib2.$EXPECT)($L0, 'RestoreImplicitFragment ""'), function($skip, $loc, $0, $1) {
|
|
16740
|
+
state.forbidImplicitFragment.pop();
|
|
16741
|
+
});
|
|
16742
|
+
function RestoreImplicitFragment(ctx, state2) {
|
|
16743
|
+
return (0, import_lib2.$EVENT)(ctx, state2, "RestoreImplicitFragment", RestoreImplicitFragment$0);
|
|
16744
|
+
}
|
|
16745
|
+
var ImplicitFragmentAllowed$0 = (0, import_lib2.$TV)((0, import_lib2.$EXPECT)($L0, 'ImplicitFragmentAllowed ""'), function($skip, $loc, $0, $1) {
|
|
16746
|
+
if (config.verbose) {
|
|
16747
|
+
console.log("forbidImplicitFragment:", state.forbidImplicitFragment);
|
|
16748
|
+
}
|
|
16749
|
+
if (state.implicitFragmentForbidden) return $skip;
|
|
16750
|
+
});
|
|
16751
|
+
function ImplicitFragmentAllowed(ctx, state2) {
|
|
16752
|
+
return (0, import_lib2.$EVENT)(ctx, state2, "ImplicitFragmentAllowed", ImplicitFragmentAllowed$0);
|
|
16753
|
+
}
|
|
16544
16754
|
var AllowPipeline$0 = (0, import_lib2.$TV)((0, import_lib2.$EXPECT)($L0, 'AllowPipeline ""'), function($skip, $loc, $0, $1) {
|
|
16545
16755
|
state.forbidPipeline.push(false);
|
|
16546
16756
|
});
|
|
@@ -16568,11 +16778,11 @@ var PipelineAllowed$0 = (0, import_lib2.$TV)((0, import_lib2.$EXPECT)($L0, 'Pipe
|
|
|
16568
16778
|
function PipelineAllowed(ctx, state2) {
|
|
16569
16779
|
return (0, import_lib2.$EVENT)(ctx, state2, "PipelineAllowed", PipelineAllowed$0);
|
|
16570
16780
|
}
|
|
16571
|
-
var AllowAll$0 = (0, import_lib2.$S)(AllowTrailingMemberProperty, AllowBracedApplication, AllowIndentedApplication, AllowClassImplicitCall, AllowNestedBinaryOp, AllowNewlineBinaryOp, AllowPipeline);
|
|
16781
|
+
var AllowAll$0 = (0, import_lib2.$S)(AllowTrailingMemberProperty, AllowBracedApplication, AllowIndentedApplication, AllowClassImplicitCall, AllowNestedBinaryOp, AllowNewlineBinaryOp, AllowImplicitFragment, AllowPipeline);
|
|
16572
16782
|
function AllowAll(ctx, state2) {
|
|
16573
16783
|
return (0, import_lib2.$EVENT)(ctx, state2, "AllowAll", AllowAll$0);
|
|
16574
16784
|
}
|
|
16575
|
-
var RestoreAll$0 = (0, import_lib2.$S)(RestoreTrailingMemberProperty, RestoreBracedApplication, RestoreIndentedApplication, RestoreClassImplicitCall, RestoreNestedBinaryOp, RestoreNewlineBinaryOp, RestorePipeline);
|
|
16785
|
+
var RestoreAll$0 = (0, import_lib2.$S)(RestoreTrailingMemberProperty, RestoreBracedApplication, RestoreIndentedApplication, RestoreClassImplicitCall, RestoreNestedBinaryOp, RestoreNewlineBinaryOp, RestoreImplicitFragment, RestorePipeline);
|
|
16576
16786
|
function RestoreAll(ctx, state2) {
|
|
16577
16787
|
return (0, import_lib2.$EVENT)(ctx, state2, "RestoreAll", RestoreAll$0);
|
|
16578
16788
|
}
|
|
@@ -16675,7 +16885,11 @@ var MaybeNestedNonPipelineExpression$0 = (0, import_lib2.$TS)((0, import_lib2.$S
|
|
|
16675
16885
|
if (!trailing) return expression;
|
|
16676
16886
|
return [expression, trailing];
|
|
16677
16887
|
});
|
|
16678
|
-
var MaybeNestedNonPipelineExpression$1 = NonPipelineExpression
|
|
16888
|
+
var MaybeNestedNonPipelineExpression$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(ForbidImplicitFragment, (0, import_lib2.$E)(NonPipelineExpression), RestoreImplicitFragment), function($skip, $loc, $0, $1, $2, $3) {
|
|
16889
|
+
var expression = $2;
|
|
16890
|
+
if (!expression) return $skip;
|
|
16891
|
+
return expression;
|
|
16892
|
+
});
|
|
16679
16893
|
var MaybeNestedNonPipelineExpression$$ = [MaybeNestedNonPipelineExpression$0, MaybeNestedNonPipelineExpression$1];
|
|
16680
16894
|
function MaybeNestedNonPipelineExpression(ctx, state2) {
|
|
16681
16895
|
return (0, import_lib2.$EVENT_C)(ctx, state2, "MaybeNestedNonPipelineExpression", MaybeNestedNonPipelineExpression$$);
|
|
@@ -16687,7 +16901,11 @@ var MaybeNestedPostfixedExpression$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(
|
|
|
16687
16901
|
if (!trailing) return expression;
|
|
16688
16902
|
return [expression, trailing];
|
|
16689
16903
|
});
|
|
16690
|
-
var MaybeNestedPostfixedExpression$1 = PostfixedExpression
|
|
16904
|
+
var MaybeNestedPostfixedExpression$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(ForbidImplicitFragment, (0, import_lib2.$E)(PostfixedExpression), RestoreImplicitFragment), function($skip, $loc, $0, $1, $2, $3) {
|
|
16905
|
+
var expression = $2;
|
|
16906
|
+
if (!expression) return $skip;
|
|
16907
|
+
return expression;
|
|
16908
|
+
});
|
|
16691
16909
|
var MaybeNestedPostfixedExpression$$ = [MaybeNestedPostfixedExpression$0, MaybeNestedPostfixedExpression$1];
|
|
16692
16910
|
function MaybeNestedPostfixedExpression(ctx, state2) {
|
|
16693
16911
|
return (0, import_lib2.$EVENT_C)(ctx, state2, "MaybeNestedPostfixedExpression", MaybeNestedPostfixedExpression$$);
|
|
@@ -16710,7 +16928,11 @@ var MaybeNestedExpression$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, impor
|
|
|
16710
16928
|
if (!trailing) return expression;
|
|
16711
16929
|
return [expression, trailing];
|
|
16712
16930
|
});
|
|
16713
|
-
var MaybeNestedExpression$1 = Expression
|
|
16931
|
+
var MaybeNestedExpression$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(ForbidImplicitFragment, (0, import_lib2.$E)(Expression), RestoreImplicitFragment), function($skip, $loc, $0, $1, $2, $3) {
|
|
16932
|
+
var expression = $2;
|
|
16933
|
+
if (!expression) return $skip;
|
|
16934
|
+
return expression;
|
|
16935
|
+
});
|
|
16714
16936
|
var MaybeNestedExpression$$ = [MaybeNestedExpression$0, MaybeNestedExpression$1];
|
|
16715
16937
|
function MaybeNestedExpression(ctx, state2) {
|
|
16716
16938
|
return (0, import_lib2.$EVENT_C)(ctx, state2, "MaybeNestedExpression", MaybeNestedExpression$$);
|
|
@@ -16905,6 +17127,24 @@ var OperatorNamedImports$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(OpenBrace,
|
|
|
16905
17127
|
function OperatorNamedImports(ctx, state2) {
|
|
16906
17128
|
return (0, import_lib2.$EVENT)(ctx, state2, "OperatorNamedImports", OperatorNamedImports$0);
|
|
16907
17129
|
}
|
|
17130
|
+
var DynamicNamedImports$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(OpenBrace, (0, import_lib2.$Q)(DynamicImportSpecifier), (0, import_lib2.$E)((0, import_lib2.$S)(__, Comma)), __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
17131
|
+
var specifiers = $2;
|
|
17132
|
+
return {
|
|
17133
|
+
type: "Declaration",
|
|
17134
|
+
children: $0,
|
|
17135
|
+
specifiers
|
|
17136
|
+
};
|
|
17137
|
+
});
|
|
17138
|
+
function DynamicNamedImports(ctx, state2) {
|
|
17139
|
+
return (0, import_lib2.$EVENT)(ctx, state2, "DynamicNamedImports", DynamicNamedImports$0);
|
|
17140
|
+
}
|
|
17141
|
+
var DynamicImportContents$0 = DynamicNamedImports;
|
|
17142
|
+
var DynamicImportContents$1 = IdentifierName;
|
|
17143
|
+
var DynamicImportContents$2 = Star;
|
|
17144
|
+
var DynamicImportContents$$ = [DynamicImportContents$0, DynamicImportContents$1, DynamicImportContents$2];
|
|
17145
|
+
function DynamicImportContents(ctx, state2) {
|
|
17146
|
+
return (0, import_lib2.$EVENT_C)(ctx, state2, "DynamicImportContents", DynamicImportContents$$);
|
|
17147
|
+
}
|
|
16908
17148
|
var FromClause$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(From, __, ModuleSpecifier), function($skip, $loc, $0, $1, $2, $3) {
|
|
16909
17149
|
var module = $3;
|
|
16910
17150
|
if (!Array.isArray(module)) return $0;
|
|
@@ -16926,11 +17166,11 @@ var ImportAssertion$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2
|
|
|
16926
17166
|
function ImportAssertion(ctx, state2) {
|
|
16927
17167
|
return (0, import_lib2.$EVENT)(ctx, state2, "ImportAssertion", ImportAssertion$0);
|
|
16928
17168
|
}
|
|
16929
|
-
var TypeAndImportSpecifier$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(
|
|
16930
|
-
|
|
16931
|
-
return { ts: true, children: $0, binding: $2.binding };
|
|
17169
|
+
var TypeAndImportSpecifier$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(__, TypeKeyword, ImportSpecifier), function($skip, $loc, $0, $1, $2, $3) {
|
|
17170
|
+
return { ts: true, children: $0, binding: $3.binding };
|
|
16932
17171
|
});
|
|
16933
|
-
var TypeAndImportSpecifier$1 =
|
|
17172
|
+
var TypeAndImportSpecifier$1 = ImportSpecifier;
|
|
17173
|
+
var TypeAndImportSpecifier$2 = (0, import_lib2.$TS)((0, import_lib2.$S)(__, Operator, OperatorImportSpecifier), function($skip, $loc, $0, $1, $2, $3) {
|
|
16934
17174
|
var ws = $1;
|
|
16935
17175
|
var spec = $3;
|
|
16936
17176
|
if (spec.binding.type !== "Identifier") {
|
|
@@ -16946,7 +17186,7 @@ var TypeAndImportSpecifier$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(__, Oper
|
|
|
16946
17186
|
]
|
|
16947
17187
|
};
|
|
16948
17188
|
});
|
|
16949
|
-
var TypeAndImportSpecifier$$ = [TypeAndImportSpecifier$0, TypeAndImportSpecifier$1];
|
|
17189
|
+
var TypeAndImportSpecifier$$ = [TypeAndImportSpecifier$0, TypeAndImportSpecifier$1, TypeAndImportSpecifier$2];
|
|
16950
17190
|
function TypeAndImportSpecifier(ctx, state2) {
|
|
16951
17191
|
return (0, import_lib2.$EVENT_C)(ctx, state2, "TypeAndImportSpecifier", TypeAndImportSpecifier$$);
|
|
16952
17192
|
}
|
|
@@ -16993,6 +17233,27 @@ var OperatorImportSpecifier$$ = [OperatorImportSpecifier$0, OperatorImportSpecif
|
|
|
16993
17233
|
function OperatorImportSpecifier(ctx, state2) {
|
|
16994
17234
|
return (0, import_lib2.$EVENT_C)(ctx, state2, "OperatorImportSpecifier", OperatorImportSpecifier$$);
|
|
16995
17235
|
}
|
|
17236
|
+
var DynamicImportSpecifier$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(__, (0, import_lib2.$E)((0, import_lib2.$S)(TypeKeyword, __, (0, import_lib2.$Y)(DynamicModuleExportName))), DynamicModuleExportName, (0, import_lib2.$E)((0, import_lib2.$S)(ImportAsToken, __, DynamicModuleExportName)), ObjectPropertyDelimiter), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
17237
|
+
var ts2 = $2;
|
|
17238
|
+
var source = $3;
|
|
17239
|
+
var binding = $4;
|
|
17240
|
+
return {
|
|
17241
|
+
source,
|
|
17242
|
+
binding: binding?.[2],
|
|
17243
|
+
ts: !!ts2,
|
|
17244
|
+
// true causes an error later
|
|
17245
|
+
children: $0
|
|
17246
|
+
};
|
|
17247
|
+
});
|
|
17248
|
+
function DynamicImportSpecifier(ctx, state2) {
|
|
17249
|
+
return (0, import_lib2.$EVENT)(ctx, state2, "DynamicImportSpecifier", DynamicImportSpecifier$0);
|
|
17250
|
+
}
|
|
17251
|
+
var DynamicModuleExportName$0 = ModuleExportName;
|
|
17252
|
+
var DynamicModuleExportName$1 = ComputedPropertyName;
|
|
17253
|
+
var DynamicModuleExportName$$ = [DynamicModuleExportName$0, DynamicModuleExportName$1];
|
|
17254
|
+
function DynamicModuleExportName(ctx, state2) {
|
|
17255
|
+
return (0, import_lib2.$EVENT_C)(ctx, state2, "DynamicModuleExportName", DynamicModuleExportName$$);
|
|
17256
|
+
}
|
|
16996
17257
|
var ImportAsToken$0 = (0, import_lib2.$S)(__, As);
|
|
16997
17258
|
var ImportAsToken$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(Loc, __, Colon, (0, import_lib2.$E)((0, import_lib2.$EXPECT)($L17, 'ImportAsToken " "'))), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
16998
17259
|
var l = $1;
|
|
@@ -18284,7 +18545,7 @@ function SingleQuote(ctx, state2) {
|
|
|
18284
18545
|
return (0, import_lib2.$EVENT)(ctx, state2, "SingleQuote", SingleQuote$0);
|
|
18285
18546
|
}
|
|
18286
18547
|
var Star$0 = (0, import_lib2.$TV)((0, import_lib2.$EXPECT)($L75, 'Star "*"'), function($skip, $loc, $0, $1) {
|
|
18287
|
-
return { $loc, token: $1 };
|
|
18548
|
+
return { $loc, token: $1, type: "Star" };
|
|
18288
18549
|
});
|
|
18289
18550
|
function Star(ctx, state2) {
|
|
18290
18551
|
return (0, import_lib2.$EVENT)(ctx, state2, "Star", Star$0);
|
|
@@ -18437,18 +18698,22 @@ var Yield$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$EXPECT)(
|
|
|
18437
18698
|
function Yield(ctx, state2) {
|
|
18438
18699
|
return (0, import_lib2.$EVENT)(ctx, state2, "Yield", Yield$0);
|
|
18439
18700
|
}
|
|
18440
|
-
var JSXImplicitFragment$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(JSXTag, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, (0, import_lib2.$C)(JSXTag, JSXAngleChild)))), function($skip, $loc, $0, $1, $2) {
|
|
18441
|
-
|
|
18701
|
+
var JSXImplicitFragment$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(JSXTag, (0, import_lib2.$E)((0, import_lib2.$S)(ImplicitFragmentAllowed, NestedBinaryOpAllowed, NewlineBinaryOpAllowed, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, (0, import_lib2.$C)(JSXTag, JSXAngleChild)))))), function($skip, $loc, $0, $1, $2) {
|
|
18702
|
+
var first = $1;
|
|
18703
|
+
var rest = $2;
|
|
18704
|
+
rest = rest ? rest[3] : [];
|
|
18705
|
+
const jsx = rest.length === 0 ? first : {
|
|
18442
18706
|
type: "JSXFragment",
|
|
18443
18707
|
children: [
|
|
18444
18708
|
"<>\n",
|
|
18445
18709
|
state.currentIndent.token,
|
|
18446
|
-
|
|
18710
|
+
first,
|
|
18711
|
+
...rest,
|
|
18447
18712
|
"\n",
|
|
18448
18713
|
state.currentIndent.token,
|
|
18449
18714
|
"</>"
|
|
18450
18715
|
],
|
|
18451
|
-
jsxChildren: [
|
|
18716
|
+
jsxChildren: [first, ...rest.map(([, tag]) => tag)]
|
|
18452
18717
|
};
|
|
18453
18718
|
const type = typeOfJSX(jsx, config);
|
|
18454
18719
|
return type ? [
|
|
@@ -19183,13 +19448,7 @@ var JSXAngleChild$0 = (0, import_lib2.$T)((0, import_lib2.$S)(CloseAngleBracket,
|
|
|
19183
19448
|
function JSXAngleChild(ctx, state2) {
|
|
19184
19449
|
return (0, import_lib2.$EVENT)(ctx, state2, "JSXAngleChild", JSXAngleChild$0);
|
|
19185
19450
|
}
|
|
19186
|
-
var JSXCodeChild$0 = (0, import_lib2.$
|
|
19187
|
-
var open = $1;
|
|
19188
|
-
var expression = $2;
|
|
19189
|
-
var close = $3;
|
|
19190
|
-
if (!expression) return $skip;
|
|
19191
|
-
return [open, expression, close];
|
|
19192
|
-
});
|
|
19451
|
+
var JSXCodeChild$0 = (0, import_lib2.$S)(InsertInlineOpenBrace, JSXCodeChildExpression, InsertCloseBrace);
|
|
19193
19452
|
function JSXCodeChild(ctx, state2) {
|
|
19194
19453
|
return (0, import_lib2.$EVENT)(ctx, state2, "JSXCodeChild", JSXCodeChild$0);
|
|
19195
19454
|
}
|
|
@@ -20853,6 +21112,7 @@ var Reset$0 = (0, import_lib2.$TV)((0, import_lib2.$EXPECT)($L0, 'Reset ""'), fu
|
|
|
20853
21112
|
state.forbidTrailingMemberProperty = [false];
|
|
20854
21113
|
state.forbidNestedBinaryOp = [false];
|
|
20855
21114
|
state.forbidNewlineBinaryOp = [false];
|
|
21115
|
+
state.forbidImplicitFragment = [false];
|
|
20856
21116
|
state.forbidPipeline = [false];
|
|
20857
21117
|
state.JSXTagStack = [void 0];
|
|
20858
21118
|
state.operators = /* @__PURE__ */ new Map();
|
|
@@ -21134,6 +21394,7 @@ var state = {
|
|
|
21134
21394
|
forbidTrailingMemberProperty: [false],
|
|
21135
21395
|
forbidNestedBinaryOp: [false],
|
|
21136
21396
|
forbidNewlineBinaryOp: [false],
|
|
21397
|
+
forbidImplicitFragment: [false],
|
|
21137
21398
|
forbidPipeline: [false],
|
|
21138
21399
|
JSXTagStack: [void 0]
|
|
21139
21400
|
};
|
|
@@ -21185,6 +21446,12 @@ Object.defineProperties(state, {
|
|
|
21185
21446
|
return s[s.length - 1];
|
|
21186
21447
|
}
|
|
21187
21448
|
},
|
|
21449
|
+
implicitFragmentForbidden: {
|
|
21450
|
+
get() {
|
|
21451
|
+
const { forbidImplicitFragment: s } = state;
|
|
21452
|
+
return s[s.length - 1];
|
|
21453
|
+
}
|
|
21454
|
+
},
|
|
21188
21455
|
pipelineForbidden: {
|
|
21189
21456
|
get() {
|
|
21190
21457
|
const { forbidPipeline: s } = state;
|
|
@@ -21207,7 +21474,7 @@ function setOperatorBehavior(name, behavior) {
|
|
|
21207
21474
|
}
|
|
21208
21475
|
}
|
|
21209
21476
|
function getStateKey() {
|
|
21210
|
-
const stateInt = state.currentIndent.level % 256 <<
|
|
21477
|
+
const stateInt = state.currentIndent.level % 256 << 9 | state.classImplicitCallForbidden << 8 | state.indentedApplicationForbidden << 7 | state.bracedApplicationForbidden << 6 | state.trailingMemberPropertyForbidden << 5 | state.nestedBinaryOpForbidden << 4 | state.newlineBinaryOpForbidden << 3 | state.implicitFragmentForbidden << 2 | state.pipelineForbidden << 1 | // This is slightly different than the rest of the state,
|
|
21211
21478
|
// since it is affected by the directive prologue and may be hit
|
|
21212
21479
|
// by the EOL rule early in the parse. Later if we wanted to
|
|
21213
21480
|
// allow block scoping of the compat directives we would need to
|
|
@@ -21307,7 +21574,7 @@ var SourceMap = class {
|
|
|
21307
21574
|
const line = ref1[i1];
|
|
21308
21575
|
results.push((() => {
|
|
21309
21576
|
const results1 = [];
|
|
21310
|
-
for (let i2 = 0,
|
|
21577
|
+
for (let i2 = 0, len12 = line.length; i2 < len12; i2++) {
|
|
21311
21578
|
const entry = line[i2];
|
|
21312
21579
|
if (entry.length === 4) {
|
|
21313
21580
|
let [colDelta, sourceFileIndex, srcLine, srcCol] = entry;
|
|
@@ -21653,10 +21920,11 @@ var WorkerPool = class {
|
|
|
21653
21920
|
}
|
|
21654
21921
|
})();
|
|
21655
21922
|
const worker = new Worker(path.join(__dirname, "node-worker.mjs"));
|
|
21656
|
-
worker.on("message", (response) => {
|
|
21923
|
+
worker.on("message", async (response) => {
|
|
21657
21924
|
const callback = this.callbacks.get(response.id);
|
|
21658
21925
|
this.callbacks.delete(response.id);
|
|
21659
21926
|
if (response.error) {
|
|
21927
|
+
await new Promise((done) => setTimeout(done, 0));
|
|
21660
21928
|
const message = `${response.error.name}: ${response.error.message}`;
|
|
21661
21929
|
let ref;
|
|
21662
21930
|
if (response.error.type in globalThis) {
|