@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/browser.js
CHANGED
|
@@ -34,9 +34,9 @@ var Civet = (() => {
|
|
|
34
34
|
mod
|
|
35
35
|
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
36
36
|
|
|
37
|
-
//
|
|
37
|
+
// node_modules/@danielx/hera/dist/machine.js
|
|
38
38
|
var require_machine = __commonJS({
|
|
39
|
-
"
|
|
39
|
+
"node_modules/@danielx/hera/dist/machine.js"(exports, module) {
|
|
40
40
|
"use strict";
|
|
41
41
|
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
42
42
|
for (var name in all)
|
|
@@ -531,7 +531,7 @@ ${body}`), super(message), this.header = header, this.body = body, this.filename
|
|
|
531
531
|
return;
|
|
532
532
|
}
|
|
533
533
|
if (node = node, parent != null && (node.parent = parent), node.children)
|
|
534
|
-
for (let ref = node.children, i1 = 0,
|
|
534
|
+
for (let ref = node.children, i1 = 0, len12 = ref.length; i1 < len12; i1++) {
|
|
535
535
|
let child = ref[i1];
|
|
536
536
|
addParentPointers(child, node);
|
|
537
537
|
}
|
|
@@ -1257,7 +1257,7 @@ ${body}`), super(message), this.header = header, this.body = body, this.filename
|
|
|
1257
1257
|
return i;
|
|
1258
1258
|
}
|
|
1259
1259
|
function arrayRecurse(array) {
|
|
1260
|
-
for (let i2 = 0,
|
|
1260
|
+
for (let i2 = 0, len12 = array.length; i2 < len12; i2++) {
|
|
1261
1261
|
let c = array[i2];
|
|
1262
1262
|
if (c === child || Array.isArray(c) && arrayRecurse(c))
|
|
1263
1263
|
return !0;
|
|
@@ -1405,7 +1405,7 @@ ${body}`), super(message), this.header = header, this.body = body, this.filename
|
|
|
1405
1405
|
}
|
|
1406
1406
|
function adjustBindingElements(elements) {
|
|
1407
1407
|
let names = elements.flatMap(($2) => $2.names || []), { length } = elements, blockPrefix, restIndex = -1, restCount = 0;
|
|
1408
|
-
for (let i2 = 0,
|
|
1408
|
+
for (let i2 = 0, len12 = elements.length; i2 < len12; i2++) {
|
|
1409
1409
|
let i = i2, { type } = elements[i2];
|
|
1410
1410
|
type === "BindingRestElement" && (restIndex < 0 && (restIndex = i), restCount++);
|
|
1411
1411
|
}
|
|
@@ -2413,7 +2413,7 @@ ${js}`
|
|
|
2413
2413
|
function recurse(pattern2) {
|
|
2414
2414
|
switch (pattern2.type) {
|
|
2415
2415
|
case "ArrayBindingPattern": {
|
|
2416
|
-
for (let ref3 = pattern2.elements, i2 = 0,
|
|
2416
|
+
for (let ref3 = pattern2.elements, i2 = 0, len12 = ref3.length; i2 < len12; i2++) {
|
|
2417
2417
|
let element = ref3[i2];
|
|
2418
2418
|
recurse(element);
|
|
2419
2419
|
}
|
|
@@ -3137,17 +3137,27 @@ ${js}`
|
|
|
3137
3137
|
}
|
|
3138
3138
|
let statements;
|
|
3139
3139
|
if (generator)
|
|
3140
|
-
iterationDefaultBody(statement), assignResults(block, (node) =>
|
|
3141
|
-
|
|
3142
|
-
expression
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
node
|
|
3149
|
-
|
|
3150
|
-
|
|
3140
|
+
iterationDefaultBody(statement), assignResults(block, (node) => {
|
|
3141
|
+
let star;
|
|
3142
|
+
if (node && typeof node == "object" && "type" in node && node.type === "SpreadElement" && "expression" in node) {
|
|
3143
|
+
let { expression } = node;
|
|
3144
|
+
star = "*", node = expression;
|
|
3145
|
+
}
|
|
3146
|
+
return {
|
|
3147
|
+
type: "YieldExpression",
|
|
3148
|
+
expression: node,
|
|
3149
|
+
star,
|
|
3150
|
+
children: [
|
|
3151
|
+
{
|
|
3152
|
+
type: "Yield",
|
|
3153
|
+
children: ["yield"]
|
|
3154
|
+
},
|
|
3155
|
+
star,
|
|
3156
|
+
" ",
|
|
3157
|
+
node
|
|
3158
|
+
]
|
|
3159
|
+
};
|
|
3160
|
+
}), statements = [
|
|
3151
3161
|
["", statement]
|
|
3152
3162
|
];
|
|
3153
3163
|
else {
|
|
@@ -3284,6 +3294,12 @@ ${js}`
|
|
|
3284
3294
|
block.bare = block.implicitlyReturned = !1, implicitlyReturned && processReturn(block.parent, !0);
|
|
3285
3295
|
}
|
|
3286
3296
|
}
|
|
3297
|
+
function unbraceBlock(block) {
|
|
3298
|
+
if (block.bare)
|
|
3299
|
+
return;
|
|
3300
|
+
let ref;
|
|
3301
|
+
block.children[0] === " {" && (ref = block.children)[ref.length - 1] === "}" && (block.children.shift(), block.children.pop(), block.bare = !0);
|
|
3302
|
+
}
|
|
3287
3303
|
function duplicateBlock(block) {
|
|
3288
3304
|
let expressions = [...block.expressions], children;
|
|
3289
3305
|
return block.children === block.expressions ? children = expressions : (children = [...block.children], children.splice(children.indexOf(block.expressions), 1, expressions)), {
|
|
@@ -3352,15 +3368,35 @@ ${js}`
|
|
|
3352
3368
|
}
|
|
3353
3369
|
function processBlocks(statements) {
|
|
3354
3370
|
insertSemicolon(statements);
|
|
3355
|
-
for (let
|
|
3356
|
-
let
|
|
3357
|
-
|
|
3371
|
+
for (let ref1 = gatherRecursive(statements, ($) => $.type === "BlockStatement"), i2 = 0, len12 = ref1.length; i2 < len12; i2++) {
|
|
3372
|
+
let block = ref1[i2], m;
|
|
3373
|
+
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 === !0 && "expression" in m && typeof m.expression == "object" && m.expression != null && "type" in m.expression && m.expression.type === "ObjectExpression")) {
|
|
3374
|
+
let object = block.expressions[0][1].expression;
|
|
3375
|
+
if (!(() => {
|
|
3376
|
+
let results = !0;
|
|
3377
|
+
for (let prop of object.properties)
|
|
3378
|
+
if (!(prop.type === "Property" && prop.implicitName)) {
|
|
3379
|
+
results = !1;
|
|
3380
|
+
break;
|
|
3381
|
+
}
|
|
3382
|
+
return results;
|
|
3383
|
+
})())
|
|
3384
|
+
continue;
|
|
3385
|
+
block.expressions[0][1] = block.expressions[0][1].expression, unbraceBlock(block);
|
|
3386
|
+
for (let ref2 = object.properties, i3 = 0, len22 = ref2.length; i3 < len22; i3++) {
|
|
3387
|
+
let i = i3, prop = ref2[i3], m1;
|
|
3388
|
+
m1 = prop.name, typeof m1 == "object" && m1 != null && "type" in m1 && m1.type === "ComputedPropertyName" && "implicit" in m1 && m1.implicit === !0 && replaceNode(prop.name, prop.name.expression, prop), prop.delim?.implicit && (needsPrecedingSemicolon(object.properties[i + 1]) ? prop.delim.token = ";" : (replaceNode(prop.delim, void 0, prop), prop.delim = void 0));
|
|
3389
|
+
let colon = prop.children.indexOf(": ");
|
|
3390
|
+
colon < 0 || prop.children[colon - 1] === prop.name && prop.children.splice(colon - 1, 2);
|
|
3391
|
+
}
|
|
3392
|
+
}
|
|
3393
|
+
processBlocks(block.expressions);
|
|
3358
3394
|
}
|
|
3359
3395
|
}
|
|
3360
3396
|
function insertSemicolon(statements) {
|
|
3361
3397
|
let l = statements.length;
|
|
3362
|
-
for (let
|
|
3363
|
-
let i =
|
|
3398
|
+
for (let i4 = 0, len3 = statements.length; i4 < len3; i4++) {
|
|
3399
|
+
let i = i4, s = statements[i4];
|
|
3364
3400
|
if (i < l - 1 && needsPrecedingSemicolon(statements[i + 1][1])) {
|
|
3365
3401
|
let delim = s[2];
|
|
3366
3402
|
delim ? typeof delim == "string" && !delim.match(/;/) && (s[2] = `;${delim}`) : s[2] = ";";
|
|
@@ -3371,8 +3407,8 @@ ${js}`
|
|
|
3371
3407
|
if (!exp)
|
|
3372
3408
|
return !1;
|
|
3373
3409
|
if (Array.isArray(exp)) {
|
|
3374
|
-
for (let
|
|
3375
|
-
let child = exp[
|
|
3410
|
+
for (let i5 = 0, len4 = exp.length; i5 < len4; i5++) {
|
|
3411
|
+
let child = exp[i5];
|
|
3376
3412
|
if (child != null)
|
|
3377
3413
|
return needsPrecedingSemicolon(child);
|
|
3378
3414
|
}
|
|
@@ -3401,8 +3437,8 @@ ${js}`
|
|
|
3401
3437
|
}
|
|
3402
3438
|
}
|
|
3403
3439
|
function blockContainingStatement(exp) {
|
|
3404
|
-
let child = exp, parent = exp.parent,
|
|
3405
|
-
for (; parent != null && (
|
|
3440
|
+
let child = exp, parent = exp.parent, m2;
|
|
3441
|
+
for (; parent != null && (m2 = parent.type, m2 === "StatementExpression" || m2 === "PipelineExpression" || m2 === "UnwrappedExpression"); )
|
|
3406
3442
|
child = parent, parent = parent.parent;
|
|
3407
3443
|
if (parent?.type !== "BlockStatement")
|
|
3408
3444
|
return;
|
|
@@ -3447,7 +3483,7 @@ ${js}`
|
|
|
3447
3483
|
], precedenceMap = /* @__PURE__ */ new Map();
|
|
3448
3484
|
for (let i1 = 0, len3 = precedenceOrder.length; i1 < len3; i1++) {
|
|
3449
3485
|
let prec = i1, ops = precedenceOrder[i1];
|
|
3450
|
-
for (let i2 = 0,
|
|
3486
|
+
for (let i2 = 0, len12 = ops.length; i2 < len12; i2++) {
|
|
3451
3487
|
let op = ops[i2];
|
|
3452
3488
|
precedenceMap.set(op, prec);
|
|
3453
3489
|
}
|
|
@@ -3458,6 +3494,12 @@ ${js}`
|
|
|
3458
3494
|
throw new Error(`Unknown operator: ${op}`);
|
|
3459
3495
|
})() : op.type === "PatternTest" ? precedenceRelational : typeof op.prec == "number" ? op.prec : precedenceMap.get(op.prec ?? op.token) ?? (op.relational ? precedenceRelational : precedenceCustomDefault);
|
|
3460
3496
|
}
|
|
3497
|
+
function isShortCircuitOp(op) {
|
|
3498
|
+
if (op && typeof op == "object" && "token" in op) {
|
|
3499
|
+
let { token } = op;
|
|
3500
|
+
return isShortCircuitOp(token);
|
|
3501
|
+
} else return typeof op == "string" ? (op.endsWith("=") && !op.endsWith("==") && (op = op.slice(0, -1)), op === "||" || op === "&&" || op === "??") : !1;
|
|
3502
|
+
}
|
|
3461
3503
|
function processBinaryOpExpression($0) {
|
|
3462
3504
|
return processExpandedBinaryOpExpression(expandChainedComparisons($0));
|
|
3463
3505
|
}
|
|
@@ -3630,7 +3672,7 @@ ${js}`
|
|
|
3630
3672
|
let errors = !1, isPattern = !1;
|
|
3631
3673
|
if (clauses.some(($4) => $4.type === "PatternClause")) {
|
|
3632
3674
|
isPattern = !0;
|
|
3633
|
-
for (let i2 = 0,
|
|
3675
|
+
for (let i2 = 0, len12 = clauses.length; i2 < len12; i2++) {
|
|
3634
3676
|
let c = clauses[i2];
|
|
3635
3677
|
c.type === "PatternClause" || c.type === "DefaultClause" || (errors = !0, c.children.push({
|
|
3636
3678
|
type: "Error",
|
|
@@ -4053,7 +4095,7 @@ ${js}`
|
|
|
4053
4095
|
});
|
|
4054
4096
|
}
|
|
4055
4097
|
function processDeclarations(statements) {
|
|
4056
|
-
for (let ref1 = gatherRecursiveAll(statements, ($) => $.type === "Declaration"), i1 = 0,
|
|
4098
|
+
for (let ref1 = gatherRecursiveAll(statements, ($) => $.type === "Declaration"), i1 = 0, len12 = ref1.length; i1 < len12; i1++) {
|
|
4057
4099
|
let declaration = ref1[i1], { bindings } = declaration;
|
|
4058
4100
|
if (bindings != null) {
|
|
4059
4101
|
for (let i2 = bindings.length + -1; i2 >= 0; --i2) {
|
|
@@ -4108,7 +4150,7 @@ ${js}`
|
|
|
4108
4150
|
let { expression: exp } = initializer, ws;
|
|
4109
4151
|
if (Array.isArray(exp) && (ws = exp[0], exp = exp[1]), !(typeof exp == "object" && exp != null && "type" in exp && exp.type === "StatementExpression" || typeof exp == "object" && exp != null && "type" in exp && exp.type === "SpreadElement" && "expression" in exp && typeof exp.expression == "object" && exp.expression != null && "type" in exp.expression && exp.expression.type === "StatementExpression"))
|
|
4110
4152
|
return;
|
|
4111
|
-
let pre = [], statementExp = exp.statement, blockStatement = ["", statementExp], ref;
|
|
4153
|
+
let pre = [], statementExp = exp.statement, blockStatement = [ws || "", statementExp, ";"], ref;
|
|
4112
4154
|
if (statementExp.type === "IterationExpression") {
|
|
4113
4155
|
if (statementExp.async || statementExp.generator)
|
|
4114
4156
|
return;
|
|
@@ -4123,9 +4165,9 @@ ${js}`
|
|
|
4123
4165
|
}));
|
|
4124
4166
|
let refDec = {
|
|
4125
4167
|
type: "Declaration",
|
|
4126
|
-
children: ["let ", ref
|
|
4168
|
+
children: ["let ", ref]
|
|
4127
4169
|
};
|
|
4128
|
-
pre.unshift(refDec);
|
|
4170
|
+
pre.unshift(["", refDec, ";"]);
|
|
4129
4171
|
} else
|
|
4130
4172
|
wrapIterationReturningResults(statement2, () => {
|
|
4131
4173
|
}), ref = initializer.expression = initializer.children[2] = statement2.resultsRef;
|
|
@@ -4137,11 +4179,11 @@ ${js}`
|
|
|
4137
4179
|
}));
|
|
4138
4180
|
let refDec = {
|
|
4139
4181
|
type: "Declaration",
|
|
4140
|
-
children: ["let ", ref
|
|
4182
|
+
children: ["let ", ref]
|
|
4141
4183
|
};
|
|
4142
|
-
pre.unshift(refDec
|
|
4184
|
+
pre.unshift(["", refDec, ";"]);
|
|
4143
4185
|
}
|
|
4144
|
-
return statement.children.unshift(pre, blockStatement
|
|
4186
|
+
return statement.children.unshift(...pre, blockStatement), updateParentPointers(blockStatement, statement), ref;
|
|
4145
4187
|
}
|
|
4146
4188
|
function processDeclarationCondition(condition, rootCondition, parent) {
|
|
4147
4189
|
if (condition.type !== "DeclarationCondition")
|
|
@@ -4377,24 +4419,55 @@ ${js}`
|
|
|
4377
4419
|
};
|
|
4378
4420
|
}
|
|
4379
4421
|
function dynamizeImportDeclarationExpression($0) {
|
|
4380
|
-
let [imp, ws1,
|
|
4381
|
-
|
|
4382
|
-
type: "CallExpression",
|
|
4422
|
+
let [imp, ws1, imports, ws2, from] = $0, awaitExpression = {
|
|
4423
|
+
type: "AwaitExpression",
|
|
4383
4424
|
children: [
|
|
4384
|
-
{ type: "Await", children: "await" },
|
|
4425
|
+
{ type: "Await", children: ["await"] },
|
|
4385
4426
|
" ",
|
|
4386
4427
|
imp,
|
|
4387
4428
|
trimFirstSpace(ws2),
|
|
4388
|
-
dynamizeFromClause(from)
|
|
4389
|
-
{
|
|
4390
|
-
type: "PropertyGlob",
|
|
4391
|
-
dot,
|
|
4392
|
-
object,
|
|
4393
|
-
children: [ws1, dot, object],
|
|
4394
|
-
reversed: !0
|
|
4395
|
-
}
|
|
4429
|
+
dynamizeFromClause(from)
|
|
4396
4430
|
]
|
|
4397
|
-
}
|
|
4431
|
+
}, dot = {
|
|
4432
|
+
type: "AccessStart",
|
|
4433
|
+
children: ["."],
|
|
4434
|
+
optional: !1
|
|
4435
|
+
};
|
|
4436
|
+
switch (imports?.type) {
|
|
4437
|
+
case "Identifier":
|
|
4438
|
+
return processCallMemberExpression({
|
|
4439
|
+
type: "CallExpression",
|
|
4440
|
+
children: [
|
|
4441
|
+
parenthesizeExpression(awaitExpression),
|
|
4442
|
+
{
|
|
4443
|
+
type: "PropertyAccess",
|
|
4444
|
+
dot,
|
|
4445
|
+
name: "default",
|
|
4446
|
+
children: [ws1, dot, "default"]
|
|
4447
|
+
}
|
|
4448
|
+
]
|
|
4449
|
+
});
|
|
4450
|
+
case "Star":
|
|
4451
|
+
return parenthesizeExpression(awaitExpression);
|
|
4452
|
+
case "Declaration": {
|
|
4453
|
+
let object = convertNamedImportsToObject(imports);
|
|
4454
|
+
return processCallMemberExpression({
|
|
4455
|
+
type: "CallExpression",
|
|
4456
|
+
children: [
|
|
4457
|
+
parenthesizeExpression(awaitExpression),
|
|
4458
|
+
{
|
|
4459
|
+
type: "PropertyGlob",
|
|
4460
|
+
dot,
|
|
4461
|
+
object,
|
|
4462
|
+
children: [ws1, dot, object],
|
|
4463
|
+
reversed: !0
|
|
4464
|
+
}
|
|
4465
|
+
]
|
|
4466
|
+
});
|
|
4467
|
+
}
|
|
4468
|
+
default:
|
|
4469
|
+
throw new Error("Unsupported dynamic import");
|
|
4470
|
+
}
|
|
4398
4471
|
}
|
|
4399
4472
|
function convertWithClause(withClause, extendsClause) {
|
|
4400
4473
|
let extendsToken, extendsTarget, ws;
|
|
@@ -4613,7 +4686,7 @@ ${js}`
|
|
|
4613
4686
|
function processPipelineExpressions(statements) {
|
|
4614
4687
|
for (let ref1 = gatherRecursiveAll(statements, ($1) => $1.type === "PipelineExpression"), i1 = 0, len3 = ref1.length; i1 < len3; i1++) {
|
|
4615
4688
|
let s = ref1[i1], [ws, , body] = s.children, [, arg] = s.children, children = [ws], comma = blockContainingStatement(s) ? ";" : ",", usingRef = null;
|
|
4616
|
-
for (let i2 = 0,
|
|
4689
|
+
for (let i2 = 0, len12 = body.length; i2 < len12; i2++) {
|
|
4617
4690
|
let i = i2, step = body[i2], [leadingComment, pipe, trailingComment, expr] = step, returns = pipe.token === "||>", ref, result, returning = returns ? arg : null;
|
|
4618
4691
|
if (pipe.token === "|>=") {
|
|
4619
4692
|
let initRef;
|
|
@@ -5142,7 +5215,7 @@ ${js}`
|
|
|
5142
5215
|
return $0;
|
|
5143
5216
|
let stringPart = (() => {
|
|
5144
5217
|
let results1 = [];
|
|
5145
|
-
for (let i2 = 0,
|
|
5218
|
+
for (let i2 = 0, len12 = strWithSubstitutions.length; i2 < len12; i2++) {
|
|
5146
5219
|
let part = strWithSubstitutions[i2];
|
|
5147
5220
|
results1.push(part.token ?? "s");
|
|
5148
5221
|
}
|
|
@@ -5211,6 +5284,9 @@ ${js}`
|
|
|
5211
5284
|
|
|
5212
5285
|
// unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\lib.civet.jsx
|
|
5213
5286
|
var xor = (a, b) => a ? !b && a : b;
|
|
5287
|
+
function len1(arr, length) {
|
|
5288
|
+
return arr.length === length;
|
|
5289
|
+
}
|
|
5214
5290
|
function addPostfixStatement(statement, ws, post) {
|
|
5215
5291
|
let expressions = [
|
|
5216
5292
|
...post.blockPrefix || [],
|
|
@@ -5503,7 +5579,7 @@ ${js}`
|
|
|
5503
5579
|
children: call.children.map((x) => x === call.args ? args : x)
|
|
5504
5580
|
}, isComma(args[args.length - 1]) && (args[args.length - 1] = deepCopy(args[args.length - 1]), isComma(args[args.length - 1]).token = "");
|
|
5505
5581
|
let commaCount = 0;
|
|
5506
|
-
for (let i2 = 0,
|
|
5582
|
+
for (let i2 = 0, len22 = args.length; i2 < len22; i2++) {
|
|
5507
5583
|
let i = i2, arg = args[i2];
|
|
5508
5584
|
isComma(arg) && (arg = args[i] = deepCopy(arg), isComma(arg).token = `)${op.token}(`, commaCount++);
|
|
5509
5585
|
}
|
|
@@ -5526,16 +5602,16 @@ ${js}`
|
|
|
5526
5602
|
return children[0];
|
|
5527
5603
|
}
|
|
5528
5604
|
}
|
|
5529
|
-
for (let i3 = 0,
|
|
5605
|
+
for (let i3 = 0, len3 = children.length; i3 < len3; i3++) {
|
|
5530
5606
|
let i = i3, glob = children[i3];
|
|
5531
5607
|
if (glob?.type === "PropertyGlob") {
|
|
5532
5608
|
let prefix = children.slice(0, i), parts = [], ref;
|
|
5533
|
-
if (prefix
|
|
5534
|
-
ref = makeRef();
|
|
5609
|
+
if (needsRef(prefix) && glob.object.properties.length > 1) {
|
|
5610
|
+
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 === !0 && (prefix = [prefix[0].expression]), ref = makeRef();
|
|
5535
5611
|
let { refAssignment } = makeRefAssignment(ref, prefix);
|
|
5536
5612
|
prefix = [makeLeftHandSideExpression(refAssignment)];
|
|
5537
5613
|
}
|
|
5538
|
-
|
|
5614
|
+
let prefixDot = [...prefix, glob.dot];
|
|
5539
5615
|
for (let part of glob.object.properties) {
|
|
5540
5616
|
if (part.type === "Error") {
|
|
5541
5617
|
parts.push(part);
|
|
@@ -5548,7 +5624,7 @@ ${js}`
|
|
|
5548
5624
|
});
|
|
5549
5625
|
continue;
|
|
5550
5626
|
}
|
|
5551
|
-
if (part.value && !["CallExpression", "MemberExpression", "Identifier"].includes(part.value.type)) {
|
|
5627
|
+
if (part.value && !["CallExpression", "MemberExpression", "Identifier", "StringLiteral", "ComputedPropertyName"].includes(part.value.type)) {
|
|
5552
5628
|
parts.push({
|
|
5553
5629
|
type: "Error",
|
|
5554
5630
|
message: `Glob pattern must have call or member expression value, found ${JSON.stringify(part.value)}`
|
|
@@ -5556,7 +5632,19 @@ ${js}`
|
|
|
5556
5632
|
continue;
|
|
5557
5633
|
}
|
|
5558
5634
|
let suppressPrefix = !1, name = part.name, value = part.value ?? name, wValue = getTrimmingSpace(part.value);
|
|
5559
|
-
[value, suppressPrefix] = handleThisPrivateShorthands(value), glob.reversed && ([name, value] = [value, name]), suppressPrefix || (value
|
|
5635
|
+
[value, suppressPrefix] = handleThisPrivateShorthands(value), glob.reversed && ([name, value] = [value, name]), suppressPrefix || (value.type === "StringLiteral" ? value = [
|
|
5636
|
+
...prefix,
|
|
5637
|
+
{
|
|
5638
|
+
type: "Index",
|
|
5639
|
+
children: ["[", trimFirstSpace(value), "]"]
|
|
5640
|
+
}
|
|
5641
|
+
] : value.type === "ComputedPropertyName" ? value = [
|
|
5642
|
+
...prefix,
|
|
5643
|
+
{
|
|
5644
|
+
type: "Index",
|
|
5645
|
+
children: [trimFirstSpace(value)]
|
|
5646
|
+
}
|
|
5647
|
+
] : value = [...prefixDot, trimFirstSpace(value)], ref != null && (prefix = [ref], prefixDot = [...prefix, glob.dot])), wValue && value.unshift(wValue), part.type === "SpreadProperty" ? parts.push({
|
|
5560
5648
|
type: part.type,
|
|
5561
5649
|
value,
|
|
5562
5650
|
dots: part.dots,
|
|
@@ -5865,7 +5953,7 @@ ${js}`
|
|
|
5865
5953
|
);
|
|
5866
5954
|
}
|
|
5867
5955
|
function processAssignments(statements) {
|
|
5868
|
-
for (let ref8 = gatherRecursiveAll(statements, ($4) => $4.type === "AssignmentExpression" || $4.type === "UpdateExpression"), i5 = 0,
|
|
5956
|
+
for (let ref8 = gatherRecursiveAll(statements, ($4) => $4.type === "AssignmentExpression" || $4.type === "UpdateExpression"), i5 = 0, len4 = ref8.length; i5 < len4; i5++) {
|
|
5869
5957
|
let extractAssignment = function(lhs) {
|
|
5870
5958
|
let expr = lhs;
|
|
5871
5959
|
for (; expr.type === "ParenthesizedExpression"; )
|
|
@@ -5880,7 +5968,7 @@ ${js}`
|
|
|
5880
5968
|
case "AssignmentExpression": {
|
|
5881
5969
|
if (!exp.lhs)
|
|
5882
5970
|
continue;
|
|
5883
|
-
for (let ref10 = exp.lhs, i6 = 0,
|
|
5971
|
+
for (let ref10 = exp.lhs, i6 = 0, len5 = ref10.length; i6 < len5; i6++) {
|
|
5884
5972
|
let lhsPart = ref10[i6], ref11;
|
|
5885
5973
|
if (ref11 = extractAssignment(lhsPart[1])) {
|
|
5886
5974
|
let newLhs = ref11;
|
|
@@ -5906,19 +5994,19 @@ ${js}`
|
|
|
5906
5994
|
}), replaceNode(exp, newMemberExp));
|
|
5907
5995
|
}
|
|
5908
5996
|
}
|
|
5909
|
-
for (let ref12 = gatherRecursiveAll(statements, ($6) => $6.type === "AssignmentExpression"), i7 = 0,
|
|
5997
|
+
for (let ref12 = gatherRecursiveAll(statements, ($6) => $6.type === "AssignmentExpression"), i7 = 0, len6 = ref12.length; i7 < len6; i7++) {
|
|
5910
5998
|
let exp = ref12[i7];
|
|
5911
5999
|
if (exp.names !== null)
|
|
5912
6000
|
continue;
|
|
5913
|
-
let { lhs: $1, expression: $2 } = exp, tail = [], len3 = $1.length, block, ref13;
|
|
5914
|
-
if (blockContainingStatement(exp) && !(ref13 = $1[$1.length - 1])?.[ref13.length - 1]?.special) {
|
|
6001
|
+
let { lhs: $1, expression: $2 } = exp, tail = [], len3 = $1.length, block, ref13, ref14;
|
|
6002
|
+
if (blockContainingStatement(exp) && !(ref13 = $1[$1.length - 1])?.[ref13.length - 1]?.special && !isShortCircuitOp((ref14 = $1[$1.length - 1])?.[ref14.length - 1])) {
|
|
5915
6003
|
block = makeBlockFragment();
|
|
5916
|
-
let
|
|
5917
|
-
if (
|
|
6004
|
+
let ref15;
|
|
6005
|
+
if (ref15 = prependStatementExpressionBlock(
|
|
5918
6006
|
{ type: "Initializer", expression: $2, children: [void 0, void 0, $2] },
|
|
5919
6007
|
block
|
|
5920
6008
|
)) {
|
|
5921
|
-
let ref =
|
|
6009
|
+
let ref = ref15;
|
|
5922
6010
|
exp.children = exp.children.map(($7) => $7 === $2 ? ref : $7), $2 = ref;
|
|
5923
6011
|
} else
|
|
5924
6012
|
block = void 0;
|
|
@@ -5953,7 +6041,7 @@ ${js}`
|
|
|
5953
6041
|
let members = lhs.children, lastMember = members[members.length - 1];
|
|
5954
6042
|
if (lastMember.type === "SliceExpression") {
|
|
5955
6043
|
let { start, end, children: c } = lastMember;
|
|
5956
|
-
if (c[0].token = ".splice(", c[1] = start, c[2] = ", ", end ? c[3] = [end, " - ", start] : c[3] = ["1/0"], c[4] = [", ...", $2], c[5] = ")", lastAssignment.pop(), isWhitespaceOrEmpty(lastAssignment[2]) && lastAssignment.pop(), $1.length > 1)
|
|
6044
|
+
if (c[0].token = ".splice(", c[1] = start, c[2] = ", ", end ? c[3] = [makeLeftHandSideExpression(end), " - ", makeLeftHandSideExpression(start)] : c[3] = ["1/0"], c[4] = [", ...", $2], c[5] = ")", lastAssignment.pop(), isWhitespaceOrEmpty(lastAssignment[2]) && lastAssignment.pop(), $1.length > 1)
|
|
5957
6045
|
throw new Error("Not implemented yet! TODO: Handle multiple splice assignments");
|
|
5958
6046
|
exp.children = [$1], exp.names = [];
|
|
5959
6047
|
break;
|
|
@@ -6021,9 +6109,9 @@ ${js}`
|
|
|
6021
6109
|
}
|
|
6022
6110
|
j++;
|
|
6023
6111
|
}
|
|
6024
|
-
let
|
|
6025
|
-
if (
|
|
6026
|
-
let l =
|
|
6112
|
+
let ref16;
|
|
6113
|
+
if (ref16 = conditions.length) {
|
|
6114
|
+
let l = ref16, cs = flatJoin(conditions, " && ");
|
|
6027
6115
|
return {
|
|
6028
6116
|
...exp,
|
|
6029
6117
|
children: [...cs, " ? ", innerExp(children), " : void 0"],
|
|
@@ -6055,8 +6143,8 @@ ${js}`
|
|
|
6055
6143
|
}
|
|
6056
6144
|
function processTypes(node) {
|
|
6057
6145
|
let results1 = [];
|
|
6058
|
-
for (let
|
|
6059
|
-
let unary =
|
|
6146
|
+
for (let ref17 = gatherRecursiveAll(node, ($11) => $11.type === "TypeUnary"), i8 = 0, len7 = ref17.length; i8 < len7; i8++) {
|
|
6147
|
+
let unary = ref17[i8], suffixIndex = unary.suffix.length - 1, results2 = [];
|
|
6060
6148
|
for (; suffixIndex >= 0; ) {
|
|
6061
6149
|
let suffix = unary.suffix[suffixIndex];
|
|
6062
6150
|
if (typeof suffix == "object" && suffix != null && "token" in suffix && suffix.token === "?") {
|
|
@@ -6117,9 +6205,9 @@ ${js}`
|
|
|
6117
6205
|
unary.prefix = [], unary.children = unary.children.filter((a2) => a2 !== prefix);
|
|
6118
6206
|
let outer = unary.suffix.splice(suffixIndex + 1, 1 / 0), space = getTrimmingSpace(unary);
|
|
6119
6207
|
inplaceInsertTrimmingSpace(unary, "");
|
|
6120
|
-
let
|
|
6121
|
-
unary.suffix.length ?
|
|
6122
|
-
let t =
|
|
6208
|
+
let ref18;
|
|
6209
|
+
unary.suffix.length ? ref18 = unary : ref18 = unary.t;
|
|
6210
|
+
let t = ref18, argArray = [makeNode({
|
|
6123
6211
|
type: "TypeArgument",
|
|
6124
6212
|
ts: !0,
|
|
6125
6213
|
t,
|
|
@@ -6155,16 +6243,16 @@ ${js}`
|
|
|
6155
6243
|
return results1;
|
|
6156
6244
|
}
|
|
6157
6245
|
function processStatementExpressions(statements) {
|
|
6158
|
-
for (let
|
|
6159
|
-
let exp =
|
|
6246
|
+
for (let ref19 = gatherRecursiveAll(statements, ($12) => $12.type === "StatementExpression"), i9 = 0, len8 = ref19.length; i9 < len8; i9++) {
|
|
6247
|
+
let exp = ref19[i9], { maybe, statement } = exp;
|
|
6160
6248
|
if ((maybe || statement.type === "ThrowStatement") && blockContainingStatement(exp)) {
|
|
6161
6249
|
replaceNode(exp, statement);
|
|
6162
6250
|
continue;
|
|
6163
6251
|
}
|
|
6164
|
-
let
|
|
6252
|
+
let ref20;
|
|
6165
6253
|
switch (statement.type) {
|
|
6166
6254
|
case "IfStatement": {
|
|
6167
|
-
(
|
|
6255
|
+
(ref20 = expressionizeIfStatement(statement)) ? replaceNode(statement, ref20, exp) : replaceNode(statement, wrapIIFE([["", statement]]), exp);
|
|
6168
6256
|
break;
|
|
6169
6257
|
}
|
|
6170
6258
|
case "IterationExpression": {
|
|
@@ -6205,11 +6293,11 @@ ${js}`
|
|
|
6205
6293
|
});
|
|
6206
6294
|
}
|
|
6207
6295
|
function processFinallyClauses(statements) {
|
|
6208
|
-
for (let
|
|
6209
|
-
let f =
|
|
6210
|
-
if (!((
|
|
6296
|
+
for (let ref21 = gatherRecursiveAll(statements, ($) => $.type === "FinallyClause" && $.parent?.type !== "TryStatement"), i10 = 0, len9 = ref21.length; i10 < len9; i10++) {
|
|
6297
|
+
let f = ref21[i10], ref22;
|
|
6298
|
+
if (!((ref22 = blockContainingStatement(f)) && typeof ref22 == "object" && "block" in ref22 && "index" in ref22))
|
|
6211
6299
|
throw new Error("finally clause must be inside try statement or block");
|
|
6212
|
-
let { block, index } =
|
|
6300
|
+
let { block, index } = ref22, indent = block.expressions[index][0], expressions = block.expressions.slice(index + 1), t = makeNode({
|
|
6213
6301
|
type: "BlockStatement",
|
|
6214
6302
|
expressions,
|
|
6215
6303
|
children: ["{", expressions, "}"],
|
|
@@ -6269,8 +6357,8 @@ ${js}`
|
|
|
6269
6357
|
}
|
|
6270
6358
|
}
|
|
6271
6359
|
function processCoffeeClasses(statements) {
|
|
6272
|
-
for (let
|
|
6273
|
-
let ce =
|
|
6360
|
+
for (let ref23 = gatherRecursiveAll(statements, ($13) => $13.type === "ClassExpression"), i11 = 0, len10 = ref23.length; i11 < len10; i11++) {
|
|
6361
|
+
let ce = ref23[i11], { expressions } = ce.body, indent = expressions[0]?.[0] ?? `
|
|
6274
6362
|
`, autoBinds = expressions.filter(($14) => $14[1]?.autoBind);
|
|
6275
6363
|
if (autoBinds.length) {
|
|
6276
6364
|
let construct;
|
|
@@ -6307,7 +6395,7 @@ ${js}`
|
|
|
6307
6395
|
0,
|
|
6308
6396
|
...(() => {
|
|
6309
6397
|
let results3 = [];
|
|
6310
|
-
for (let i12 = 0,
|
|
6398
|
+
for (let i12 = 0, len11 = autoBinds.length; i12 < len11; i12++) {
|
|
6311
6399
|
let [, a] = autoBinds[i12];
|
|
6312
6400
|
results3.push([indent, ["this.", a.name, " = this.", a.name, ".bind(this)"], ";"]);
|
|
6313
6401
|
}
|
|
@@ -6370,23 +6458,23 @@ ${js}`
|
|
|
6370
6458
|
}
|
|
6371
6459
|
function processRepl(root, rootIIFE) {
|
|
6372
6460
|
let topBlock = gatherRecursive(rootIIFE, ($21) => $21.type === "BlockStatement")[0], i = 0;
|
|
6373
|
-
for (let
|
|
6374
|
-
let decl =
|
|
6461
|
+
for (let ref24 = gatherRecursiveWithinFunction(topBlock, ($22) => $22.type === "Declaration"), i14 = 0, len12 = ref24.length; i14 < len12; i14++) {
|
|
6462
|
+
let decl = ref24[i14];
|
|
6375
6463
|
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(",")}`, ";"]));
|
|
6376
6464
|
}
|
|
6377
|
-
for (let
|
|
6378
|
-
let func =
|
|
6465
|
+
for (let ref25 = gatherRecursive(topBlock, ($23) => $23.type === "FunctionExpression"), i15 = 0, len13 = ref25.length; i15 < len13; i15++) {
|
|
6466
|
+
let func = ref25[i15];
|
|
6379
6467
|
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}`, ";"])));
|
|
6380
6468
|
}
|
|
6381
|
-
for (let
|
|
6382
|
-
let classExp =
|
|
6469
|
+
for (let ref26 = gatherRecursiveWithinFunction(topBlock, ($24) => $24.type === "ClassExpression"), i16 = 0, len14 = ref26.length; i16 < len14; i16++) {
|
|
6470
|
+
let classExp = ref26[i16], m8;
|
|
6383
6471
|
(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}`, ";"]));
|
|
6384
6472
|
}
|
|
6385
6473
|
}
|
|
6386
6474
|
function processPlaceholders(statements) {
|
|
6387
6475
|
let placeholderMap = /* @__PURE__ */ new Map(), liftedIfs = /* @__PURE__ */ new Set();
|
|
6388
|
-
for (let
|
|
6389
|
-
let exp =
|
|
6476
|
+
for (let ref27 = gatherRecursiveAll(statements, ($25) => $25.type === "Placeholder"), i17 = 0, len15 = ref27.length; i17 < len15; i17++) {
|
|
6477
|
+
let exp = ref27[i17], ancestor;
|
|
6390
6478
|
if (exp.subtype === ".") {
|
|
6391
6479
|
({ ancestor } = findAncestor(
|
|
6392
6480
|
exp,
|
|
@@ -6455,11 +6543,11 @@ ${js}`
|
|
|
6455
6543
|
}
|
|
6456
6544
|
for (let [ancestor, placeholders] of placeholderMap) {
|
|
6457
6545
|
let ref = makeRef("$"), typeSuffix;
|
|
6458
|
-
for (let i18 = 0,
|
|
6546
|
+
for (let i18 = 0, len16 = placeholders.length; i18 < len16; i18++) {
|
|
6459
6547
|
let placeholder = placeholders[i18];
|
|
6460
6548
|
typeSuffix ??= placeholder.typeSuffix;
|
|
6461
|
-
let
|
|
6462
|
-
(
|
|
6549
|
+
let ref28;
|
|
6550
|
+
(ref28 = placeholder.children)[ref28.length - 1] = ref;
|
|
6463
6551
|
}
|
|
6464
6552
|
let { parent } = ancestor, body = maybeUnwrap(ancestor), fnExp = makeAmpersandFunction({ ref, typeSuffix, body }), outer;
|
|
6465
6553
|
switch (parent?.type) {
|
|
@@ -6476,8 +6564,8 @@ ${js}`
|
|
|
6476
6564
|
break;
|
|
6477
6565
|
}
|
|
6478
6566
|
case "PipelineExpression": {
|
|
6479
|
-
let i = findChildIndex(parent, ancestor),
|
|
6480
|
-
i === 1 ?
|
|
6567
|
+
let i = findChildIndex(parent, ancestor), ref29;
|
|
6568
|
+
i === 1 ? ref29 = ancestor === parent.children[i] : i === 2 ? ref29 = ancestor === parent.children[i][findChildIndex(parent.children[i], ancestor)][3] : ref29 = void 0, outer = ref29;
|
|
6481
6569
|
break;
|
|
6482
6570
|
}
|
|
6483
6571
|
case "AssignmentExpression":
|
|
@@ -6489,9 +6577,9 @@ ${js}`
|
|
|
6489
6577
|
}
|
|
6490
6578
|
}
|
|
6491
6579
|
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);
|
|
6492
|
-
let
|
|
6493
|
-
if (
|
|
6494
|
-
let ws =
|
|
6580
|
+
let ref30;
|
|
6581
|
+
if (ref30 = getTrimmingSpace(body)) {
|
|
6582
|
+
let ws = ref30;
|
|
6495
6583
|
inplaceInsertTrimmingSpace(body, ""), inplacePrepend(ws, fnExp);
|
|
6496
6584
|
}
|
|
6497
6585
|
}
|
|
@@ -6522,8 +6610,8 @@ ${js}`
|
|
|
6522
6610
|
}
|
|
6523
6611
|
];
|
|
6524
6612
|
}
|
|
6525
|
-
let
|
|
6526
|
-
Array.isArray(rest.delim) && (
|
|
6613
|
+
let ref31;
|
|
6614
|
+
Array.isArray(rest.delim) && (ref31 = rest.delim)[ref31.length - 1]?.token === "," && (rest.delim = rest.delim.slice(0, -1), rest.children = [...rest.children.slice(0, -1), rest.delim]);
|
|
6527
6615
|
let children = [...props, ...after, rest];
|
|
6528
6616
|
return restCount > 1 && children.push({
|
|
6529
6617
|
type: "Error",
|
|
@@ -6551,24 +6639,28 @@ ${js}`
|
|
|
6551
6639
|
let type = [], lastType;
|
|
6552
6640
|
for (let child of node.jsxChildren) {
|
|
6553
6641
|
switch (child.type) {
|
|
6554
|
-
case "JSXText":
|
|
6642
|
+
case "JSXText": {
|
|
6555
6643
|
lastType !== "JSXText" && type.push("string");
|
|
6556
6644
|
break;
|
|
6557
|
-
|
|
6645
|
+
}
|
|
6646
|
+
case "JSXElement": {
|
|
6558
6647
|
type.push(typeOfJSXElement(child, config2));
|
|
6559
6648
|
break;
|
|
6560
|
-
|
|
6649
|
+
}
|
|
6650
|
+
case "JSXFragment": {
|
|
6561
6651
|
type.push(...typeOfJSXFragment(child, config2));
|
|
6562
6652
|
break;
|
|
6563
|
-
|
|
6653
|
+
}
|
|
6654
|
+
case "JSXChildExpression": {
|
|
6564
6655
|
child.expression && type.push(["typeof ", child.expression]);
|
|
6565
6656
|
break;
|
|
6657
|
+
}
|
|
6566
6658
|
default:
|
|
6567
6659
|
throw new Error(`unknown child in JSXFragment: ${JSON.stringify(child)}`);
|
|
6568
6660
|
}
|
|
6569
6661
|
lastType = child.type;
|
|
6570
6662
|
}
|
|
6571
|
-
return type.length === 1 ? type[0] : (type = type.flatMap((
|
|
6663
|
+
return type.length === 1 ? type[0] : (type = type.flatMap(($26) => [$26, ", "]), type.pop(), ["[", type, "]"]);
|
|
6572
6664
|
}
|
|
6573
6665
|
}
|
|
6574
6666
|
|
|
@@ -6788,6 +6880,8 @@ ${js}`
|
|
|
6788
6880
|
NonSingleBracedBlock,
|
|
6789
6881
|
DeclarationOrStatement,
|
|
6790
6882
|
SingleLineStatements,
|
|
6883
|
+
ObjectSingleLineStatements,
|
|
6884
|
+
BracedObjectSingleLineStatements,
|
|
6791
6885
|
PostfixedSingleLineStatements,
|
|
6792
6886
|
PostfixedSingleLineNoCommaStatements,
|
|
6793
6887
|
NestedBlockStatements,
|
|
@@ -6968,6 +7062,10 @@ ${js}`
|
|
|
6968
7062
|
ForbidNewlineBinaryOp,
|
|
6969
7063
|
RestoreNewlineBinaryOp,
|
|
6970
7064
|
NewlineBinaryOpAllowed,
|
|
7065
|
+
AllowImplicitFragment,
|
|
7066
|
+
ForbidImplicitFragment,
|
|
7067
|
+
RestoreImplicitFragment,
|
|
7068
|
+
ImplicitFragmentAllowed,
|
|
6971
7069
|
AllowPipeline,
|
|
6972
7070
|
ForbidPipeline,
|
|
6973
7071
|
RestorePipeline,
|
|
@@ -6993,11 +7091,15 @@ ${js}`
|
|
|
6993
7091
|
NameSpaceImport,
|
|
6994
7092
|
NamedImports,
|
|
6995
7093
|
OperatorNamedImports,
|
|
7094
|
+
DynamicNamedImports,
|
|
7095
|
+
DynamicImportContents,
|
|
6996
7096
|
FromClause,
|
|
6997
7097
|
ImportAssertion,
|
|
6998
7098
|
TypeAndImportSpecifier,
|
|
6999
7099
|
ImportSpecifier,
|
|
7000
7100
|
OperatorImportSpecifier,
|
|
7101
|
+
DynamicImportSpecifier,
|
|
7102
|
+
DynamicModuleExportName,
|
|
7001
7103
|
ImportAsToken,
|
|
7002
7104
|
ModuleExportName,
|
|
7003
7105
|
ModuleSpecifier,
|
|
@@ -7796,7 +7898,10 @@ ${js}`
|
|
|
7796
7898
|
function SingleLineBinaryOpRHS(ctx, state2) {
|
|
7797
7899
|
return (0, import_lib2.$EVENT)(ctx, state2, "SingleLineBinaryOpRHS", SingleLineBinaryOpRHS$0);
|
|
7798
7900
|
}
|
|
7799
|
-
var RHS$0 = ExpressionizedStatementWithTrailingCallExpressions, RHS$1 = UnaryExpression,
|
|
7901
|
+
var RHS$0 = ExpressionizedStatementWithTrailingCallExpressions, RHS$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(ForbidImplicitFragment, (0, import_lib2.$E)(UnaryExpression), RestoreImplicitFragment), function($skip, $loc, $0, $1, $2, $3) {
|
|
7902
|
+
var exp = $2;
|
|
7903
|
+
return exp || $skip;
|
|
7904
|
+
}), RHS$$ = [RHS$0, RHS$1];
|
|
7800
7905
|
function RHS(ctx, state2) {
|
|
7801
7906
|
return (0, import_lib2.$EVENT_C)(ctx, state2, "RHS", RHS$$);
|
|
7802
7907
|
}
|
|
@@ -8049,7 +8154,7 @@ ${js}`
|
|
|
8049
8154
|
children: [expressions],
|
|
8050
8155
|
implicitlyReturned: !0
|
|
8051
8156
|
};
|
|
8052
|
-
}), FatArrowBody$1 = NoCommaBracedOrEmptyBlock, FatArrowBody$$ = [FatArrowBody$0, FatArrowBody$1];
|
|
8157
|
+
}), FatArrowBody$1 = BracedObjectSingleLineStatements, FatArrowBody$2 = NoCommaBracedOrEmptyBlock, FatArrowBody$$ = [FatArrowBody$0, FatArrowBody$1, FatArrowBody$2];
|
|
8053
8158
|
function FatArrowBody(ctx, state2) {
|
|
8054
8159
|
return (0, import_lib2.$EVENT_C)(ctx, state2, "FatArrowBody", FatArrowBody$$);
|
|
8055
8160
|
}
|
|
@@ -8602,9 +8707,9 @@ ${js}`
|
|
|
8602
8707
|
type: "CallExpression",
|
|
8603
8708
|
children: [$1, ...$2, ...rest.flat()]
|
|
8604
8709
|
});
|
|
8605
|
-
}), CallExpression$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(Import, _,
|
|
8710
|
+
}), CallExpression$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(Import, _, DynamicImportContents, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
8606
8711
|
return dynamizeImportDeclarationExpression($0);
|
|
8607
|
-
}), CallExpression$2 = (0, import_lib2.$TS)((0, import_lib2.$S)(FromClause, __, Import, _,
|
|
8712
|
+
}), CallExpression$2 = (0, import_lib2.$TS)((0, import_lib2.$S)(FromClause, __, Import, _, DynamicImportContents), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
8608
8713
|
var from = $1, fws = $2, i = $3, iws = $4, imports = $5;
|
|
8609
8714
|
return dynamizeImportDeclarationExpression([i, iws, imports, fws, from]);
|
|
8610
8715
|
}), CallExpression$3 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$EXPECT)($L15, 'CallExpression "import"'), ArgumentsWithTrailingCallExpressions, (0, import_lib2.$Q)(CallExpressionRest)), function($skip, $loc, $0, $1, $2, $3) {
|
|
@@ -9664,7 +9769,7 @@ ${js}`
|
|
|
9664
9769
|
function OperatorAssociativity(ctx, state2) {
|
|
9665
9770
|
return (0, import_lib2.$EVENT)(ctx, state2, "OperatorAssociativity", OperatorAssociativity$0);
|
|
9666
9771
|
}
|
|
9667
|
-
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) {
|
|
9772
|
+
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) {
|
|
9668
9773
|
var async = $1, parameters = $2, returnType = $3, arrow = $5, block = $6;
|
|
9669
9774
|
async || (async = []);
|
|
9670
9775
|
let generator = [];
|
|
@@ -9788,7 +9893,7 @@ ${js}`
|
|
|
9788
9893
|
}
|
|
9789
9894
|
var ThenBlock$0 = (0, import_lib2.$T)((0, import_lib2.$S)(NoBlock, EmptyBlock), function(value) {
|
|
9790
9895
|
return value[1];
|
|
9791
|
-
}), ThenBlock$1 = ImplicitNestedBlock, ThenBlock$2 = SingleLineStatements, ThenBlock$$ = [ThenBlock$0, ThenBlock$1, ThenBlock$2];
|
|
9896
|
+
}), ThenBlock$1 = ImplicitNestedBlock, ThenBlock$2 = ObjectSingleLineStatements, ThenBlock$3 = SingleLineStatements, ThenBlock$$ = [ThenBlock$0, ThenBlock$1, ThenBlock$2, ThenBlock$3];
|
|
9792
9897
|
function ThenBlock(ctx, state2) {
|
|
9793
9898
|
return (0, import_lib2.$EVENT_C)(ctx, state2, "ThenBlock", ThenBlock$$);
|
|
9794
9899
|
}
|
|
@@ -9837,9 +9942,9 @@ ${js}`
|
|
|
9837
9942
|
function BlockOrEmptyStatement(ctx, state2) {
|
|
9838
9943
|
return (0, import_lib2.$EVENT_C)(ctx, state2, "BlockOrEmptyStatement", BlockOrEmptyStatement$$);
|
|
9839
9944
|
}
|
|
9840
|
-
var BlockOrEmpty$0 =
|
|
9945
|
+
var BlockOrEmpty$0 = ObjectSingleLineStatements, BlockOrEmpty$1 = Block, BlockOrEmpty$2 = (0, import_lib2.$T)((0, import_lib2.$S)(NoBlock, EmptyBlock), function(value) {
|
|
9841
9946
|
return value[1];
|
|
9842
|
-
}), BlockOrEmpty$$ = [BlockOrEmpty$0, BlockOrEmpty$1];
|
|
9947
|
+
}), BlockOrEmpty$$ = [BlockOrEmpty$0, BlockOrEmpty$1, BlockOrEmpty$2];
|
|
9843
9948
|
function BlockOrEmpty(ctx, state2) {
|
|
9844
9949
|
return (0, import_lib2.$EVENT_C)(ctx, state2, "BlockOrEmpty", BlockOrEmpty$$);
|
|
9845
9950
|
}
|
|
@@ -9947,6 +10052,24 @@ ${js}`
|
|
|
9947
10052
|
function SingleLineStatements(ctx, state2) {
|
|
9948
10053
|
return (0, import_lib2.$EVENT)(ctx, state2, "SingleLineStatements", SingleLineStatements$0);
|
|
9949
10054
|
}
|
|
10055
|
+
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) {
|
|
10056
|
+
var block = $2;
|
|
10057
|
+
if (block.bare && block.expressions.length === 1) {
|
|
10058
|
+
let expression = block.expressions[0][1];
|
|
10059
|
+
expression.type === "ParenthesizedExpression" && expression.implicit && expression.expression.type === "ObjectExpression" && (block = { ...block, unwrapObject: !0 });
|
|
10060
|
+
}
|
|
10061
|
+
return block;
|
|
10062
|
+
});
|
|
10063
|
+
function ObjectSingleLineStatements(ctx, state2) {
|
|
10064
|
+
return (0, import_lib2.$EVENT)(ctx, state2, "ObjectSingleLineStatements", ObjectSingleLineStatements$0);
|
|
10065
|
+
}
|
|
10066
|
+
var BracedObjectSingleLineStatements$0 = (0, import_lib2.$TV)(ObjectSingleLineStatements, function($skip, $loc, $0, $1) {
|
|
10067
|
+
var block = $0;
|
|
10068
|
+
return bracedBlock(block);
|
|
10069
|
+
});
|
|
10070
|
+
function BracedObjectSingleLineStatements(ctx, state2) {
|
|
10071
|
+
return (0, import_lib2.$EVENT)(ctx, state2, "BracedObjectSingleLineStatements", BracedObjectSingleLineStatements$0);
|
|
10072
|
+
}
|
|
9950
10073
|
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) {
|
|
9951
10074
|
var stmts = $1, last = $2;
|
|
9952
10075
|
let children = [...stmts];
|
|
@@ -10610,7 +10733,8 @@ ${js}`
|
|
|
10610
10733
|
children: [ws, id],
|
|
10611
10734
|
name: id,
|
|
10612
10735
|
names: id.names,
|
|
10613
|
-
value: id
|
|
10736
|
+
value: id,
|
|
10737
|
+
implicitName: !0
|
|
10614
10738
|
};
|
|
10615
10739
|
}), PropertyDefinition$3 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), MethodDefinition), function($skip, $loc, $0, $1, $2) {
|
|
10616
10740
|
var ws = $1, def = $2;
|
|
@@ -10649,7 +10773,8 @@ ${js}`
|
|
|
10649
10773
|
if (type === "Index")
|
|
10650
10774
|
({ ref, refAssignment } = maybeRefAssignment(expression)), refAssignment ? (name = {
|
|
10651
10775
|
type: "ComputedPropertyName",
|
|
10652
|
-
children: [last.children[0], "(", refAssignment, ",", ref, ")", ...last.children.slice(-2)]
|
|
10776
|
+
children: [last.children[0], "(", refAssignment, ",", ref, ")", ...last.children.slice(-2)],
|
|
10777
|
+
implicit: !0
|
|
10653
10778
|
}, value = {
|
|
10654
10779
|
...value,
|
|
10655
10780
|
children: value.children.map((c) => c === last ? {
|
|
@@ -10658,7 +10783,8 @@ ${js}`
|
|
|
10658
10783
|
} : c)
|
|
10659
10784
|
}) : name = {
|
|
10660
10785
|
type: "ComputedPropertyName",
|
|
10661
|
-
children: last.children
|
|
10786
|
+
children: last.children,
|
|
10787
|
+
implicit: !0
|
|
10662
10788
|
};
|
|
10663
10789
|
else if ({ name } = last, !name) return $skip;
|
|
10664
10790
|
return name[0] === "#" && (name = name.slice(1)), {
|
|
@@ -10666,7 +10792,8 @@ ${js}`
|
|
|
10666
10792
|
children: [ws, name, ": ", processUnaryExpression(pre, value, post)],
|
|
10667
10793
|
name,
|
|
10668
10794
|
names: [],
|
|
10669
|
-
value
|
|
10795
|
+
value,
|
|
10796
|
+
implicitName: !0
|
|
10670
10797
|
};
|
|
10671
10798
|
}), PropertyDefinition$$ = [PropertyDefinition$0, PropertyDefinition$1, PropertyDefinition$2, PropertyDefinition$3, PropertyDefinition$4, PropertyDefinition$5];
|
|
10672
10799
|
function PropertyDefinition(ctx, state2) {
|
|
@@ -10830,7 +10957,7 @@ ${js}`
|
|
|
10830
10957
|
}
|
|
10831
10958
|
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) {
|
|
10832
10959
|
var kind = $1, ws = $2;
|
|
10833
|
-
return {
|
|
10960
|
+
return ws || (ws = " "), {
|
|
10834
10961
|
// no async or generator, because getters and setters can't be
|
|
10835
10962
|
modifier: {
|
|
10836
10963
|
async: !1,
|
|
@@ -11342,7 +11469,7 @@ ${js}`
|
|
|
11342
11469
|
function ShouldExpressionize(ctx, state2) {
|
|
11343
11470
|
return (0, import_lib2.$EVENT_C)(ctx, state2, "ShouldExpressionize", ShouldExpressionize$$);
|
|
11344
11471
|
}
|
|
11345
|
-
var NoCommaStatement$0 = KeywordStatement, NoCommaStatement$1 = VariableStatement, NoCommaStatement$2 = IfStatement, NoCommaStatement$3 =
|
|
11472
|
+
var NoCommaStatement$0 = KeywordStatement, NoCommaStatement$1 = VariableStatement, NoCommaStatement$2 = IfStatement, NoCommaStatement$3 = IterationActualStatement, NoCommaStatement$4 = SwitchStatement, NoCommaStatement$5 = TryStatement, NoCommaStatement$6 = EmptyStatement, NoCommaStatement$7 = LabelledStatement, NoCommaStatement$8 = ExpressionStatement, NoCommaStatement$9 = BlockStatement, NoCommaStatement$$ = [NoCommaStatement$0, NoCommaStatement$1, NoCommaStatement$2, NoCommaStatement$3, NoCommaStatement$4, NoCommaStatement$5, NoCommaStatement$6, NoCommaStatement$7, NoCommaStatement$8, NoCommaStatement$9];
|
|
11346
11473
|
function NoCommaStatement(ctx, state2) {
|
|
11347
11474
|
return (0, import_lib2.$EVENT_C)(ctx, state2, "NoCommaStatement", NoCommaStatement$$);
|
|
11348
11475
|
}
|
|
@@ -12148,8 +12275,8 @@ ${js}`
|
|
|
12148
12275
|
function SingleLineExpressionWithIndentedApplicationForbidden(ctx, state2) {
|
|
12149
12276
|
return (0, import_lib2.$EVENT)(ctx, state2, "SingleLineExpressionWithIndentedApplicationForbidden", SingleLineExpressionWithIndentedApplicationForbidden$0);
|
|
12150
12277
|
}
|
|
12151
|
-
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) {
|
|
12152
|
-
var exp = $
|
|
12278
|
+
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) {
|
|
12279
|
+
var exp = $4;
|
|
12153
12280
|
return exp || $skip;
|
|
12154
12281
|
});
|
|
12155
12282
|
function ExpressionWithObjectApplicationForbidden(ctx, state2) {
|
|
@@ -12306,6 +12433,30 @@ ${js}`
|
|
|
12306
12433
|
function NewlineBinaryOpAllowed(ctx, state2) {
|
|
12307
12434
|
return (0, import_lib2.$EVENT)(ctx, state2, "NewlineBinaryOpAllowed", NewlineBinaryOpAllowed$0);
|
|
12308
12435
|
}
|
|
12436
|
+
var AllowImplicitFragment$0 = (0, import_lib2.$TV)((0, import_lib2.$EXPECT)($L0, 'AllowImplicitFragment ""'), function($skip, $loc, $0, $1) {
|
|
12437
|
+
state.forbidImplicitFragment.push(!1);
|
|
12438
|
+
});
|
|
12439
|
+
function AllowImplicitFragment(ctx, state2) {
|
|
12440
|
+
return (0, import_lib2.$EVENT)(ctx, state2, "AllowImplicitFragment", AllowImplicitFragment$0);
|
|
12441
|
+
}
|
|
12442
|
+
var ForbidImplicitFragment$0 = (0, import_lib2.$TV)((0, import_lib2.$EXPECT)($L0, 'ForbidImplicitFragment ""'), function($skip, $loc, $0, $1) {
|
|
12443
|
+
state.forbidImplicitFragment.push(!0);
|
|
12444
|
+
});
|
|
12445
|
+
function ForbidImplicitFragment(ctx, state2) {
|
|
12446
|
+
return (0, import_lib2.$EVENT)(ctx, state2, "ForbidImplicitFragment", ForbidImplicitFragment$0);
|
|
12447
|
+
}
|
|
12448
|
+
var RestoreImplicitFragment$0 = (0, import_lib2.$TV)((0, import_lib2.$EXPECT)($L0, 'RestoreImplicitFragment ""'), function($skip, $loc, $0, $1) {
|
|
12449
|
+
state.forbidImplicitFragment.pop();
|
|
12450
|
+
});
|
|
12451
|
+
function RestoreImplicitFragment(ctx, state2) {
|
|
12452
|
+
return (0, import_lib2.$EVENT)(ctx, state2, "RestoreImplicitFragment", RestoreImplicitFragment$0);
|
|
12453
|
+
}
|
|
12454
|
+
var ImplicitFragmentAllowed$0 = (0, import_lib2.$TV)((0, import_lib2.$EXPECT)($L0, 'ImplicitFragmentAllowed ""'), function($skip, $loc, $0, $1) {
|
|
12455
|
+
if (config.verbose && console.log("forbidImplicitFragment:", state.forbidImplicitFragment), state.implicitFragmentForbidden) return $skip;
|
|
12456
|
+
});
|
|
12457
|
+
function ImplicitFragmentAllowed(ctx, state2) {
|
|
12458
|
+
return (0, import_lib2.$EVENT)(ctx, state2, "ImplicitFragmentAllowed", ImplicitFragmentAllowed$0);
|
|
12459
|
+
}
|
|
12309
12460
|
var AllowPipeline$0 = (0, import_lib2.$TV)((0, import_lib2.$EXPECT)($L0, 'AllowPipeline ""'), function($skip, $loc, $0, $1) {
|
|
12310
12461
|
state.forbidPipeline.push(!1);
|
|
12311
12462
|
});
|
|
@@ -12330,11 +12481,11 @@ ${js}`
|
|
|
12330
12481
|
function PipelineAllowed(ctx, state2) {
|
|
12331
12482
|
return (0, import_lib2.$EVENT)(ctx, state2, "PipelineAllowed", PipelineAllowed$0);
|
|
12332
12483
|
}
|
|
12333
|
-
var AllowAll$0 = (0, import_lib2.$S)(AllowTrailingMemberProperty, AllowBracedApplication, AllowIndentedApplication, AllowClassImplicitCall, AllowNestedBinaryOp, AllowNewlineBinaryOp, AllowPipeline);
|
|
12484
|
+
var AllowAll$0 = (0, import_lib2.$S)(AllowTrailingMemberProperty, AllowBracedApplication, AllowIndentedApplication, AllowClassImplicitCall, AllowNestedBinaryOp, AllowNewlineBinaryOp, AllowImplicitFragment, AllowPipeline);
|
|
12334
12485
|
function AllowAll(ctx, state2) {
|
|
12335
12486
|
return (0, import_lib2.$EVENT)(ctx, state2, "AllowAll", AllowAll$0);
|
|
12336
12487
|
}
|
|
12337
|
-
var RestoreAll$0 = (0, import_lib2.$S)(RestoreTrailingMemberProperty, RestoreBracedApplication, RestoreIndentedApplication, RestoreClassImplicitCall, RestoreNestedBinaryOp, RestoreNewlineBinaryOp, RestorePipeline);
|
|
12488
|
+
var RestoreAll$0 = (0, import_lib2.$S)(RestoreTrailingMemberProperty, RestoreBracedApplication, RestoreIndentedApplication, RestoreClassImplicitCall, RestoreNestedBinaryOp, RestoreNewlineBinaryOp, RestoreImplicitFragment, RestorePipeline);
|
|
12338
12489
|
function RestoreAll(ctx, state2) {
|
|
12339
12490
|
return (0, import_lib2.$EVENT)(ctx, state2, "RestoreAll", RestoreAll$0);
|
|
12340
12491
|
}
|
|
@@ -12420,14 +12571,20 @@ ${js}`
|
|
|
12420
12571
|
var MaybeNestedNonPipelineExpression$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$N)(NestedBulletedArray), (0, import_lib2.$N)(NestedImplicitObjectLiteral), PushIndent, (0, import_lib2.$E)((0, import_lib2.$S)(Nested, NonPipelineExpression)), PopIndent, (0, import_lib2.$E)(AllowedTrailingCallExpressions)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
12421
12572
|
var expression = $4, trailing = $6;
|
|
12422
12573
|
return expression ? trailing ? [expression, trailing] : expression : $skip;
|
|
12423
|
-
}), MaybeNestedNonPipelineExpression$1 = NonPipelineExpression,
|
|
12574
|
+
}), MaybeNestedNonPipelineExpression$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(ForbidImplicitFragment, (0, import_lib2.$E)(NonPipelineExpression), RestoreImplicitFragment), function($skip, $loc, $0, $1, $2, $3) {
|
|
12575
|
+
var expression = $2;
|
|
12576
|
+
return expression || $skip;
|
|
12577
|
+
}), MaybeNestedNonPipelineExpression$$ = [MaybeNestedNonPipelineExpression$0, MaybeNestedNonPipelineExpression$1];
|
|
12424
12578
|
function MaybeNestedNonPipelineExpression(ctx, state2) {
|
|
12425
12579
|
return (0, import_lib2.$EVENT_C)(ctx, state2, "MaybeNestedNonPipelineExpression", MaybeNestedNonPipelineExpression$$);
|
|
12426
12580
|
}
|
|
12427
12581
|
var MaybeNestedPostfixedExpression$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$N)(NestedBulletedArray), (0, import_lib2.$N)(NestedImplicitObjectLiteral), PushIndent, (0, import_lib2.$E)((0, import_lib2.$S)(Nested, PostfixedExpression)), PopIndent, (0, import_lib2.$E)(AllowedTrailingCallExpressions)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
12428
12582
|
var expression = $4, trailing = $6;
|
|
12429
12583
|
return expression ? trailing ? [expression, trailing] : expression : $skip;
|
|
12430
|
-
}), MaybeNestedPostfixedExpression$1 = PostfixedExpression,
|
|
12584
|
+
}), MaybeNestedPostfixedExpression$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(ForbidImplicitFragment, (0, import_lib2.$E)(PostfixedExpression), RestoreImplicitFragment), function($skip, $loc, $0, $1, $2, $3) {
|
|
12585
|
+
var expression = $2;
|
|
12586
|
+
return expression || $skip;
|
|
12587
|
+
}), MaybeNestedPostfixedExpression$$ = [MaybeNestedPostfixedExpression$0, MaybeNestedPostfixedExpression$1];
|
|
12431
12588
|
function MaybeNestedPostfixedExpression(ctx, state2) {
|
|
12432
12589
|
return (0, import_lib2.$EVENT_C)(ctx, state2, "MaybeNestedPostfixedExpression", MaybeNestedPostfixedExpression$$);
|
|
12433
12590
|
}
|
|
@@ -12441,7 +12598,10 @@ ${js}`
|
|
|
12441
12598
|
var MaybeNestedExpression$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$N)(NestedBulletedArray), (0, import_lib2.$N)(NestedImplicitObjectLiteral), PushIndent, (0, import_lib2.$E)((0, import_lib2.$S)(Nested, Expression)), PopIndent, (0, import_lib2.$E)(AllowedTrailingCallExpressions)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
12442
12599
|
var expression = $4, trailing = $6;
|
|
12443
12600
|
return expression ? trailing ? [expression, trailing] : expression : $skip;
|
|
12444
|
-
}), MaybeNestedExpression$1 = Expression,
|
|
12601
|
+
}), MaybeNestedExpression$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(ForbidImplicitFragment, (0, import_lib2.$E)(Expression), RestoreImplicitFragment), function($skip, $loc, $0, $1, $2, $3) {
|
|
12602
|
+
var expression = $2;
|
|
12603
|
+
return expression || $skip;
|
|
12604
|
+
}), MaybeNestedExpression$$ = [MaybeNestedExpression$0, MaybeNestedExpression$1];
|
|
12445
12605
|
function MaybeNestedExpression(ctx, state2) {
|
|
12446
12606
|
return (0, import_lib2.$EVENT_C)(ctx, state2, "MaybeNestedExpression", MaybeNestedExpression$$);
|
|
12447
12607
|
}
|
|
@@ -12584,6 +12744,21 @@ ${js}`
|
|
|
12584
12744
|
function OperatorNamedImports(ctx, state2) {
|
|
12585
12745
|
return (0, import_lib2.$EVENT)(ctx, state2, "OperatorNamedImports", OperatorNamedImports$0);
|
|
12586
12746
|
}
|
|
12747
|
+
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) {
|
|
12748
|
+
var specifiers = $2;
|
|
12749
|
+
return {
|
|
12750
|
+
type: "Declaration",
|
|
12751
|
+
children: $0,
|
|
12752
|
+
specifiers
|
|
12753
|
+
};
|
|
12754
|
+
});
|
|
12755
|
+
function DynamicNamedImports(ctx, state2) {
|
|
12756
|
+
return (0, import_lib2.$EVENT)(ctx, state2, "DynamicNamedImports", DynamicNamedImports$0);
|
|
12757
|
+
}
|
|
12758
|
+
var DynamicImportContents$0 = DynamicNamedImports, DynamicImportContents$1 = IdentifierName, DynamicImportContents$2 = Star, DynamicImportContents$$ = [DynamicImportContents$0, DynamicImportContents$1, DynamicImportContents$2];
|
|
12759
|
+
function DynamicImportContents(ctx, state2) {
|
|
12760
|
+
return (0, import_lib2.$EVENT_C)(ctx, state2, "DynamicImportContents", DynamicImportContents$$);
|
|
12761
|
+
}
|
|
12587
12762
|
var FromClause$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(From, __, ModuleSpecifier), function($skip, $loc, $0, $1, $2, $3) {
|
|
12588
12763
|
var module = $3;
|
|
12589
12764
|
return Array.isArray(module) ? [$1, $2, ...module] : $0;
|
|
@@ -12603,9 +12778,9 @@ ${js}`
|
|
|
12603
12778
|
function ImportAssertion(ctx, state2) {
|
|
12604
12779
|
return (0, import_lib2.$EVENT)(ctx, state2, "ImportAssertion", ImportAssertion$0);
|
|
12605
12780
|
}
|
|
12606
|
-
var TypeAndImportSpecifier$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(
|
|
12607
|
-
return
|
|
12608
|
-
}), TypeAndImportSpecifier$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(__, Operator, OperatorImportSpecifier), function($skip, $loc, $0, $1, $2, $3) {
|
|
12781
|
+
var TypeAndImportSpecifier$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(__, TypeKeyword, ImportSpecifier), function($skip, $loc, $0, $1, $2, $3) {
|
|
12782
|
+
return { ts: !0, children: $0, binding: $3.binding };
|
|
12783
|
+
}), TypeAndImportSpecifier$1 = ImportSpecifier, TypeAndImportSpecifier$2 = (0, import_lib2.$TS)((0, import_lib2.$S)(__, Operator, OperatorImportSpecifier), function($skip, $loc, $0, $1, $2, $3) {
|
|
12609
12784
|
var ws = $1, spec = $3;
|
|
12610
12785
|
if (spec.binding.type !== "Identifier")
|
|
12611
12786
|
throw new Error("Expected identifier after `operator`");
|
|
@@ -12617,7 +12792,7 @@ ${js}`
|
|
|
12617
12792
|
spec.children.slice(1)
|
|
12618
12793
|
]
|
|
12619
12794
|
};
|
|
12620
|
-
}), TypeAndImportSpecifier$$ = [TypeAndImportSpecifier$0, TypeAndImportSpecifier$1];
|
|
12795
|
+
}), TypeAndImportSpecifier$$ = [TypeAndImportSpecifier$0, TypeAndImportSpecifier$1, TypeAndImportSpecifier$2];
|
|
12621
12796
|
function TypeAndImportSpecifier(ctx, state2) {
|
|
12622
12797
|
return (0, import_lib2.$EVENT_C)(ctx, state2, "TypeAndImportSpecifier", TypeAndImportSpecifier$$);
|
|
12623
12798
|
}
|
|
@@ -12657,6 +12832,23 @@ ${js}`
|
|
|
12657
12832
|
function OperatorImportSpecifier(ctx, state2) {
|
|
12658
12833
|
return (0, import_lib2.$EVENT_C)(ctx, state2, "OperatorImportSpecifier", OperatorImportSpecifier$$);
|
|
12659
12834
|
}
|
|
12835
|
+
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) {
|
|
12836
|
+
var ts2 = $2, source = $3, binding = $4;
|
|
12837
|
+
return {
|
|
12838
|
+
source,
|
|
12839
|
+
binding: binding?.[2],
|
|
12840
|
+
ts: !!ts2,
|
|
12841
|
+
// true causes an error later
|
|
12842
|
+
children: $0
|
|
12843
|
+
};
|
|
12844
|
+
});
|
|
12845
|
+
function DynamicImportSpecifier(ctx, state2) {
|
|
12846
|
+
return (0, import_lib2.$EVENT)(ctx, state2, "DynamicImportSpecifier", DynamicImportSpecifier$0);
|
|
12847
|
+
}
|
|
12848
|
+
var DynamicModuleExportName$0 = ModuleExportName, DynamicModuleExportName$1 = ComputedPropertyName, DynamicModuleExportName$$ = [DynamicModuleExportName$0, DynamicModuleExportName$1];
|
|
12849
|
+
function DynamicModuleExportName(ctx, state2) {
|
|
12850
|
+
return (0, import_lib2.$EVENT_C)(ctx, state2, "DynamicModuleExportName", DynamicModuleExportName$$);
|
|
12851
|
+
}
|
|
12660
12852
|
var ImportAsToken$0 = (0, import_lib2.$S)(__, As), 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) {
|
|
12661
12853
|
var l = $1, ws = $2, c = $3;
|
|
12662
12854
|
let children = [
|
|
@@ -13796,7 +13988,7 @@ ${js}`
|
|
|
13796
13988
|
return (0, import_lib2.$EVENT)(ctx, state2, "SingleQuote", SingleQuote$0);
|
|
13797
13989
|
}
|
|
13798
13990
|
var Star$0 = (0, import_lib2.$TV)((0, import_lib2.$EXPECT)($L75, 'Star "*"'), function($skip, $loc, $0, $1) {
|
|
13799
|
-
return { $loc, token: $1 };
|
|
13991
|
+
return { $loc, token: $1, type: "Star" };
|
|
13800
13992
|
});
|
|
13801
13993
|
function Star(ctx, state2) {
|
|
13802
13994
|
return (0, import_lib2.$EVENT)(ctx, state2, "Star", Star$0);
|
|
@@ -13947,20 +14139,23 @@ ${js}`
|
|
|
13947
14139
|
function Yield(ctx, state2) {
|
|
13948
14140
|
return (0, import_lib2.$EVENT)(ctx, state2, "Yield", Yield$0);
|
|
13949
14141
|
}
|
|
13950
|
-
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) {
|
|
13951
|
-
|
|
14142
|
+
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) {
|
|
14143
|
+
var first = $1, rest = $2;
|
|
14144
|
+
rest = rest ? rest[3] : [];
|
|
14145
|
+
let jsx = rest.length === 0 ? first : {
|
|
13952
14146
|
type: "JSXFragment",
|
|
13953
14147
|
children: [
|
|
13954
14148
|
`<>
|
|
13955
14149
|
`,
|
|
13956
14150
|
state.currentIndent.token,
|
|
13957
|
-
|
|
14151
|
+
first,
|
|
14152
|
+
...rest,
|
|
13958
14153
|
`
|
|
13959
14154
|
`,
|
|
13960
14155
|
state.currentIndent.token,
|
|
13961
14156
|
"</>"
|
|
13962
14157
|
],
|
|
13963
|
-
jsxChildren: [
|
|
14158
|
+
jsxChildren: [first, ...rest.map(([, tag]) => tag)]
|
|
13964
14159
|
}, type = typeOfJSX(jsx, config);
|
|
13965
14160
|
return type ? [
|
|
13966
14161
|
{ ts: !0, children: ["("] },
|
|
@@ -14468,10 +14663,7 @@ ${js}`
|
|
|
14468
14663
|
function JSXAngleChild(ctx, state2) {
|
|
14469
14664
|
return (0, import_lib2.$EVENT)(ctx, state2, "JSXAngleChild", JSXAngleChild$0);
|
|
14470
14665
|
}
|
|
14471
|
-
var JSXCodeChild$0 = (0, import_lib2.$
|
|
14472
|
-
var open = $1, expression = $2, close = $3;
|
|
14473
|
-
return expression ? [open, expression, close] : $skip;
|
|
14474
|
-
});
|
|
14666
|
+
var JSXCodeChild$0 = (0, import_lib2.$S)(InsertInlineOpenBrace, JSXCodeChildExpression, InsertCloseBrace);
|
|
14475
14667
|
function JSXCodeChild(ctx, state2) {
|
|
14476
14668
|
return (0, import_lib2.$EVENT)(ctx, state2, "JSXCodeChild", JSXCodeChild$0);
|
|
14477
14669
|
}
|
|
@@ -15859,7 +16051,7 @@ ${js}`
|
|
|
15859
16051
|
state.indentLevels = [{
|
|
15860
16052
|
level: 0,
|
|
15861
16053
|
token: ""
|
|
15862
|
-
}], state.forbidClassImplicitCall = [!1], state.forbidIndentedApplication = [!1], state.forbidBracedApplication = [!1], state.forbidTrailingMemberProperty = [!1], state.forbidNestedBinaryOp = [!1], state.forbidNewlineBinaryOp = [!1], state.forbidPipeline = [!1], state.JSXTagStack = [void 0], state.operators = /* @__PURE__ */ new Map(), state.helperRefs = {}, state.prelude = [], config = {
|
|
16054
|
+
}], state.forbidClassImplicitCall = [!1], state.forbidIndentedApplication = [!1], state.forbidBracedApplication = [!1], state.forbidTrailingMemberProperty = [!1], state.forbidNestedBinaryOp = [!1], state.forbidNewlineBinaryOp = [!1], state.forbidImplicitFragment = [!1], state.forbidPipeline = [!1], state.JSXTagStack = [void 0], state.operators = /* @__PURE__ */ new Map(), state.helperRefs = {}, state.prelude = [], config = {
|
|
15863
16055
|
autoConst: !1,
|
|
15864
16056
|
autoVar: !1,
|
|
15865
16057
|
autoLet: !1,
|
|
@@ -16084,6 +16276,7 @@ ${js}`
|
|
|
16084
16276
|
forbidTrailingMemberProperty: [!1],
|
|
16085
16277
|
forbidNestedBinaryOp: [!1],
|
|
16086
16278
|
forbidNewlineBinaryOp: [!1],
|
|
16279
|
+
forbidImplicitFragment: [!1],
|
|
16087
16280
|
forbidPipeline: [!1],
|
|
16088
16281
|
JSXTagStack: [void 0]
|
|
16089
16282
|
}, getState = () => state, getConfig = () => config, getInitialConfig = () => initialConfig, getFilename = () => filename, getSync = () => sync;
|
|
@@ -16130,6 +16323,12 @@ ${js}`
|
|
|
16130
16323
|
return s[s.length - 1];
|
|
16131
16324
|
}
|
|
16132
16325
|
},
|
|
16326
|
+
implicitFragmentForbidden: {
|
|
16327
|
+
get() {
|
|
16328
|
+
let { forbidImplicitFragment: s } = state;
|
|
16329
|
+
return s[s.length - 1];
|
|
16330
|
+
}
|
|
16331
|
+
},
|
|
16133
16332
|
pipelineForbidden: {
|
|
16134
16333
|
get() {
|
|
16135
16334
|
let { forbidPipeline: s } = state;
|
|
@@ -16148,7 +16347,7 @@ ${js}`
|
|
|
16148
16347
|
existing && behavior ? state.operators.set(name, { ...existing, ...behavior }) : state.operators.set(name, behavior || existing);
|
|
16149
16348
|
}
|
|
16150
16349
|
function getStateKey() {
|
|
16151
|
-
return [state.currentIndent.level % 256 <<
|
|
16350
|
+
return [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,
|
|
16152
16351
|
// since it is affected by the directive prologue and may be hit
|
|
16153
16352
|
// by the EOL rule early in the parse. Later if we wanted to
|
|
16154
16353
|
// allow block scoping of the compat directives we would need to
|
|
@@ -16217,7 +16416,7 @@ ${js}`
|
|
|
16217
16416
|
let line = ref1[i1];
|
|
16218
16417
|
results.push((() => {
|
|
16219
16418
|
let results1 = [];
|
|
16220
|
-
for (let i2 = 0,
|
|
16419
|
+
for (let i2 = 0, len12 = line.length; i2 < len12; i2++) {
|
|
16221
16420
|
let entry = line[i2];
|
|
16222
16421
|
if (entry.length === 4) {
|
|
16223
16422
|
let [colDelta, sourceFileIndex, srcLine, srcCol] = entry, lineDelta = srcLine - lastSourceLine;
|
|
@@ -16575,7 +16774,7 @@ ${options.sourceMap.comment(filename2, filename2 + ".tsx")}` : {
|
|
|
16575
16774
|
}
|
|
16576
16775
|
function autoRunScripts(roots, options = {}) {
|
|
16577
16776
|
let observer = new MutationObserver(async (mutations) => {
|
|
16578
|
-
for (let i2 = 0,
|
|
16777
|
+
for (let i2 = 0, len12 = mutations.length; i2 < len12; i2++) {
|
|
16579
16778
|
let mutation = mutations[i2];
|
|
16580
16779
|
if (mutation.type === "childList")
|
|
16581
16780
|
for (let ref1 = mutation.addedNodes, i3 = 0, len22 = ref1.length; i3 < len22; i3++) {
|