@danielx/civet 0.11.12 → 0.11.13
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 +15 -0
- package/dist/browser.js +248 -84
- package/dist/browser.min.js +1 -1
- package/dist/main.js +331 -71
- package/dist/main.mjs +331 -71
- package/dist/ts-service/index.js.map +2 -2
- package/dist/ts-service/index.mjs.map +2 -2
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,21 @@ This changelog is generated automatically by [`build/changelog.civet`](build/cha
|
|
|
4
4
|
For each version of Civet, it lists and links to all incorporated PRs,
|
|
5
5
|
as well as a full diff and commit list.
|
|
6
6
|
|
|
7
|
+
## 0.11.13 (2026-06-04, [diff](https://github.com/DanielXMoore/Civet/compare/v0.11.12...v0.11.13), [commits](https://github.com/DanielXMoore/Civet/commits/v0.11.13))
|
|
8
|
+
* LSP: Don't indent after keyword property inside Object [[#2129](https://github.com/DanielXMoore/Civet/pull/2129)]
|
|
9
|
+
* Move ts-service unit tests to root; gate coverage from single compile path [[#2130](https://github.com/DanielXMoore/Civet/pull/2130)]
|
|
10
|
+
* Drop type-only named imports entirely in JS mode [[#2126](https://github.com/DanielXMoore/Civet/pull/2126)]
|
|
11
|
+
* Fix postfix if/unless followed by ; emitting invalid JS [[#2132](https://github.com/DanielXMoore/Civet/pull/2132)]
|
|
12
|
+
* docs: coverage mechanics guide for agents [[#2135](https://github.com/DanielXMoore/Civet/pull/2135)]
|
|
13
|
+
* coverage: exclude sibling git worktrees from the gate [[#2136](https://github.com/DanielXMoore/Civet/pull/2136)]
|
|
14
|
+
* LSP: pull-model diagnostics (`textDocument/diagnostic`) [[#2133](https://github.com/DanielXMoore/Civet/pull/2133)]
|
|
15
|
+
* LSP: Hera-aware grammar-level features for `.hera` [[#2127](https://github.com/DanielXMoore/Civet/pull/2127)]
|
|
16
|
+
* LSP: grammar-level folding and selection ranges for `.hera` [[#2138](https://github.com/DanielXMoore/Civet/pull/2138)]
|
|
17
|
+
* feat: infer @-param types from class field declarations [[#2139](https://github.com/DanielXMoore/Civet/pull/2139)]
|
|
18
|
+
* feat: allow yield in fat-arrow functions (#2140) [[#2143](https://github.com/DanielXMoore/Civet/pull/2143)]
|
|
19
|
+
* esCompat: full ES-superset for statement-position braces and `=> expr;` [[#2142](https://github.com/DanielXMoore/Civet/pull/2142)]
|
|
20
|
+
* Keep trailing comments inside indented blocks [[#2120](https://github.com/DanielXMoore/Civet/pull/2120)]
|
|
21
|
+
|
|
7
22
|
## 0.11.12 (2026-05-26, [diff](https://github.com/DanielXMoore/Civet/compare/v0.11.11...v0.11.12), [commits](https://github.com/DanielXMoore/Civet/commits/v0.11.12))
|
|
8
23
|
* Fix Sublime support via JSON to XML conversion [[#2111](https://github.com/DanielXMoore/Civet/pull/2111)]
|
|
9
24
|
* Fix crash on optional-chain LHS with custom `oper=` (#2109) [[#2113](https://github.com/DanielXMoore/Civet/pull/2113)]
|
package/dist/browser.js
CHANGED
|
@@ -2725,9 +2725,9 @@ ${js}`
|
|
|
2725
2725
|
assert.notEqual(breakIndex, -1, "Could not find break in when clause"), node.children.splice(breakIndex, 1), node.break = void 0;
|
|
2726
2726
|
}
|
|
2727
2727
|
if (insertReturn(node.block), !isExit(node.block)) {
|
|
2728
|
-
let comment = hasTrailingComment(node.block.expressions), ref12;
|
|
2728
|
+
let comment = node.block.trailing?.length || hasTrailingComment(node.block.expressions), ref12;
|
|
2729
2729
|
node.block.expressions.push([
|
|
2730
|
-
comment ? (ref12 = node.block.expressions)[ref12.length - 1][0] || `
|
|
2730
|
+
comment ? (ref12 = node.block.expressions)[ref12.length - 1]?.[0] || `
|
|
2731
2731
|
` : "",
|
|
2732
2732
|
wrapWithReturn(void 0, node, !comment)
|
|
2733
2733
|
]);
|
|
@@ -3188,33 +3188,62 @@ ${js}`
|
|
|
3188
3188
|
assert(expressions, "block is missing expressions");
|
|
3189
3189
|
let indent;
|
|
3190
3190
|
expressions.length ? indent = expressions[0][0] : indent = "";
|
|
3191
|
+
let { ancestor: enclosingClass } = findAncestor(f, ($10) => $10.type === "ClassExpression");
|
|
3192
|
+
if (enclosingClass != null) {
|
|
3193
|
+
let fieldTypes = /* @__PURE__ */ new Map();
|
|
3194
|
+
for (let ref20 = gatherRecursiveWithinFunction(enclosingClass.body, ($11) => $11.type === "FieldDefinition"), i9 = 0, len8 = ref20.length; i9 < len8; i9++) {
|
|
3195
|
+
let { id, typeSuffix } = ref20[i9];
|
|
3196
|
+
typeSuffix != null && id?.type === "Identifier" && fieldTypes.set(id.name, typeSuffix);
|
|
3197
|
+
}
|
|
3198
|
+
if (fieldTypes.size)
|
|
3199
|
+
for (let ref21 = gatherRecursive(parameters, ($12) => $12.type === "Parameter"), i10 = 0, len9 = ref21.length; i10 < len9; i10++) {
|
|
3200
|
+
let parameter = ref21[i10];
|
|
3201
|
+
if (parameter.typeSuffix != null)
|
|
3202
|
+
continue;
|
|
3203
|
+
let inferredInPattern = !1;
|
|
3204
|
+
for (let ref22 = gatherRecursive(parameter, ($13) => $13.type === "AtBinding"), i11 = 0, len10 = ref22.length; i11 < len10; i11++) {
|
|
3205
|
+
let binding = ref22[i11], owner = binding.parent;
|
|
3206
|
+
assert(owner, "@-binding has no parent");
|
|
3207
|
+
let fieldType = fieldTypes.get(binding.ref.id);
|
|
3208
|
+
if (fieldType != null)
|
|
3209
|
+
if (owner.typeSuffix = deepCopy(fieldType), updateParentPointers(owner), owner === parameter) {
|
|
3210
|
+
let i = owner.children.indexOf(binding);
|
|
3211
|
+
assert.notEqual(i, -1, "@-binding missing from parameter children"), owner.children[i + 1] = owner.typeSuffix;
|
|
3212
|
+
} else
|
|
3213
|
+
inferredInPattern = !0;
|
|
3214
|
+
}
|
|
3215
|
+
if (inferredInPattern) {
|
|
3216
|
+
let pattern = parameter.binding;
|
|
3217
|
+
pattern.typeSuffix = void 0, gatherBindingPatternTypeSuffix(pattern), assert(pattern.typeSuffix, "expected aggregated binding pattern type"), parameter.typeSuffix = pattern.typeSuffix;
|
|
3218
|
+
let i = parameter.children.indexOf(pattern);
|
|
3219
|
+
assert.notEqual(i, -1, "binding pattern missing from parameter children"), parameter.children[i + 1] = parameter.typeSuffix;
|
|
3220
|
+
}
|
|
3221
|
+
}
|
|
3222
|
+
}
|
|
3191
3223
|
let [splices, thisAssignments] = gatherBindingCode(parameters, {
|
|
3192
3224
|
injectParamProps: isConstructor,
|
|
3193
3225
|
assignPins: !0
|
|
3194
3226
|
}), subbindings = gatherSubbindings(parameters.parameters);
|
|
3195
|
-
if (simplifyBindingProperties(parameters.parameters), simplifyBindingProperties(subbindings), isConstructor) {
|
|
3196
|
-
let
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
let
|
|
3201
|
-
|
|
3202
|
-
let
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
}, ";"]), fStatement[0] = "");
|
|
3216
|
-
}
|
|
3217
|
-
}
|
|
3227
|
+
if (simplifyBindingProperties(parameters.parameters), simplifyBindingProperties(subbindings), isConstructor && enclosingClass != null) {
|
|
3228
|
+
let fields = new Set(gatherRecursiveWithinFunction(enclosingClass, ($14) => $14.type === "FieldDefinition").map(($15) => $15.id).filter(((a3) => typeof a3 == "object" && a3 != null && "type" in a3 && a3.type === "Identifier")).map(($16) => $16.name)), classExpressions = enclosingClass.body.expressions, index2 = findChildIndex(classExpressions, f);
|
|
3229
|
+
assert.notEqual(index2, -1, "Could not find constructor in class"), index2 -= precedingOverloads(f).length;
|
|
3230
|
+
let fStatement = classExpressions[index2];
|
|
3231
|
+
for (let ref23 = gatherRecursive(parameters, ($17) => $17.type === "Parameter"), i12 = 0, len11 = ref23.length; i12 < len11; i12++) {
|
|
3232
|
+
let parameter = ref23[i12], { accessModifier } = parameter;
|
|
3233
|
+
if (accessModifier || parameter.typeSuffix)
|
|
3234
|
+
for (let ref24 = gatherRecursive(parameter, ($18) => $18.type === "AtBinding"), i13 = 0, len12 = ref24.length; i13 < len12; i13++) {
|
|
3235
|
+
let binding = ref24[i13], typeSuffix = binding.parent?.typeSuffix;
|
|
3236
|
+
if (!(accessModifier || typeSuffix))
|
|
3237
|
+
continue;
|
|
3238
|
+
parameter.accessModifier && (replaceNode(parameter.accessModifier, void 0), parameter.accessModifier = void 0);
|
|
3239
|
+
let id = binding.ref.id;
|
|
3240
|
+
fields.has(id) || (classExpressions.splice(index2++, 0, [fStatement[0], {
|
|
3241
|
+
type: "FieldDefinition",
|
|
3242
|
+
id,
|
|
3243
|
+
typeSuffix,
|
|
3244
|
+
children: [accessModifier, id, typeSuffix]
|
|
3245
|
+
}, ";"]), fStatement[0] = "");
|
|
3246
|
+
}
|
|
3218
3247
|
}
|
|
3219
3248
|
}
|
|
3220
3249
|
let delimiter = {
|
|
@@ -3228,8 +3257,8 @@ ${js}`
|
|
|
3228
3257
|
bindings: [],
|
|
3229
3258
|
decl: "const"
|
|
3230
3259
|
}));
|
|
3231
|
-
for (let
|
|
3232
|
-
let binding =
|
|
3260
|
+
for (let ref25 = splices, i14 = 0, len13 = ref25.length; i14 < len13; i14++) {
|
|
3261
|
+
let binding = ref25[i14];
|
|
3233
3262
|
assert.equal(binding.type, "PostRestBindingElements", "splice should be of type Binding"), prefix.push(makeNode({
|
|
3234
3263
|
type: "Declaration",
|
|
3235
3264
|
children: ["let ", binding],
|
|
@@ -3259,14 +3288,27 @@ ${js}`
|
|
|
3259
3288
|
} else
|
|
3260
3289
|
return -1;
|
|
3261
3290
|
}
|
|
3291
|
+
function transformArrowFunctionWithYield(f) {
|
|
3292
|
+
let { block, parameters, returnType, async, signature } = f;
|
|
3293
|
+
block?.type === "BlockStatement" && block.implicitlyReturned && (insertReturn(block), block.implicitlyReturned = !1), block?.type === "BlockStatement" && block.bare && !block.root && (block.children.unshift(" {"), block.children.push("}"), block.bare = !1);
|
|
3294
|
+
let generator = ["*"];
|
|
3295
|
+
signature.modifier ??= {}, signature.modifier.generator = !0, signature.generator = generator, signature.children = [async, "function", generator, parameters, returnType], f.type = "FunctionExpression", f.generator = generator, f.children = [async, "function", generator, parameters, returnType, block];
|
|
3296
|
+
let originalParent = f.parent, lhs = makeLeftHandSideExpression(f), ref26;
|
|
3297
|
+
gatherRecursiveWithinFunction(block, ((a6) => typeof a6 == "object" && a6 != null && "token" in a6 && a6.token === "this")).length ? ref26 = makeNode({
|
|
3298
|
+
type: "CallExpression",
|
|
3299
|
+
children: [lhs, ".bind(this)"]
|
|
3300
|
+
}) : ref26 = lhs;
|
|
3301
|
+
let newNode = ref26;
|
|
3302
|
+
newNode !== f && originalParent != null && (replaceNode(f, newNode, originalParent), updateParentPointers(newNode, originalParent));
|
|
3303
|
+
}
|
|
3262
3304
|
function processSignature(f) {
|
|
3263
3305
|
let { block, signature } = f, addAsync = !1, addGenerator = !1;
|
|
3264
3306
|
if (!f.async?.length && hasAwait(block))
|
|
3265
3307
|
if (f.async != null)
|
|
3266
3308
|
addAsync = !0;
|
|
3267
3309
|
else
|
|
3268
|
-
for (let
|
|
3269
|
-
let a =
|
|
3310
|
+
for (let ref27 = gatherRecursiveWithinFunction(block, ($19) => $19.type === "Await"), i15 = 0, len14 = ref27.length; i15 < len14; i15++) {
|
|
3311
|
+
let a = ref27[i15], i = findChildIndex(a.parent, a);
|
|
3270
3312
|
a.parent.children.splice(i + 1, 0, {
|
|
3271
3313
|
type: "Error",
|
|
3272
3314
|
message: `await invalid in ${signature.modifier.get ? "getter" : signature.modifier.set ? "setter" : signature.name}`
|
|
@@ -3275,16 +3317,18 @@ ${js}`
|
|
|
3275
3317
|
if (!f.generator?.length && hasYield(block))
|
|
3276
3318
|
if (f.generator != null)
|
|
3277
3319
|
addGenerator = !0;
|
|
3320
|
+
else if (f.type === "ArrowFunction")
|
|
3321
|
+
transformArrowFunctionWithYield(f);
|
|
3278
3322
|
else
|
|
3279
|
-
for (let
|
|
3280
|
-
let y =
|
|
3323
|
+
for (let ref28 = gatherRecursiveWithinFunction(block, ($20) => $20.type === "YieldExpression"), i16 = 0, len15 = ref28.length; i16 < len15; i16++) {
|
|
3324
|
+
let y = ref28[i16], i = y.children.findIndex(($21) => $21.type === "Yield");
|
|
3281
3325
|
y.children.splice(i + 1, 0, {
|
|
3282
3326
|
type: "Error",
|
|
3283
|
-
message: `yield invalid in ${
|
|
3327
|
+
message: `yield invalid in ${signature.modifier.get ? "getter" : signature.modifier.set ? "setter" : signature.name}`
|
|
3284
3328
|
});
|
|
3285
3329
|
}
|
|
3286
|
-
for (let
|
|
3287
|
-
let overload =
|
|
3330
|
+
for (let ref29 = [f, ...precedingOverloads(f)], i17 = 0, len16 = ref29.length; i17 < len16; i17++) {
|
|
3331
|
+
let overload = ref29[i17];
|
|
3288
3332
|
addAsync && overload.async != null && !overload.async.length && (overload.async.push("async "), overload.signature.modifier.async = !0), addGenerator && overload.generator != null && !overload.generator.length && (overload.generator.push("*"), overload.signature.modifier.generator = !0), overload.signature.modifier.async && !overload.signature.modifier.generator && overload.signature.returnType && !isPromiseType(overload.signature.returnType.t) && replaceNode(
|
|
3289
3333
|
overload.signature.returnType.t,
|
|
3290
3334
|
wrapTypeInPromise(overload.signature.returnType.t),
|
|
@@ -3293,8 +3337,8 @@ ${js}`
|
|
|
3293
3337
|
}
|
|
3294
3338
|
}
|
|
3295
3339
|
function processFunctions(statements, config2) {
|
|
3296
|
-
for (let
|
|
3297
|
-
let f =
|
|
3340
|
+
for (let ref30 = gatherRecursiveAll(statements, ($22) => $22.type === "FunctionExpression" || $22.type === "ArrowFunction" || $22.type === "MethodDefinition"), i18 = 0, len17 = ref30.length; i18 < len17; i18++) {
|
|
3341
|
+
let f = ref30[i18];
|
|
3298
3342
|
(f.type === "FunctionExpression" || f.type === "MethodDefinition") && implicitFunctionBlock(f), processSignature(f), processParams(f), processReturn(f, config2.implicitReturns);
|
|
3299
3343
|
}
|
|
3300
3344
|
}
|
|
@@ -3349,9 +3393,9 @@ ${js}`
|
|
|
3349
3393
|
["", statement]
|
|
3350
3394
|
];
|
|
3351
3395
|
else {
|
|
3352
|
-
let reduction = statement.type === "ForStatement" && statement.reduction,
|
|
3353
|
-
!async && !reduction && !statement.block.empty ?
|
|
3354
|
-
let parentInfo =
|
|
3396
|
+
let reduction = statement.type === "ForStatement" && statement.reduction, ref31;
|
|
3397
|
+
!async && !reduction && !statement.block.empty ? ref31 = blockContainingStatement(exp) : ref31 = void 0;
|
|
3398
|
+
let parentInfo = ref31;
|
|
3355
3399
|
if (parentInfo && iterationValueDiscarded(parentInfo.block, parentInfo.index, consumeRoot)) {
|
|
3356
3400
|
let origSemi = parentInfo.block.expressions[parentInfo.index][2];
|
|
3357
3401
|
statements = [["", statement, origSemi]];
|
|
@@ -3366,24 +3410,27 @@ ${js}`
|
|
|
3366
3410
|
}
|
|
3367
3411
|
let done;
|
|
3368
3412
|
if (!async) {
|
|
3369
|
-
let
|
|
3370
|
-
if ((
|
|
3371
|
-
let { block: parentBlock, index } =
|
|
3413
|
+
let ref32;
|
|
3414
|
+
if ((ref32 = blockContainingStatement(exp)) && typeof ref32 == "object" && "block" in ref32 && "index" in ref32) {
|
|
3415
|
+
let { block: parentBlock, index } = ref32;
|
|
3372
3416
|
statements[0][0] = parentBlock.expressions[index][0], parentBlock.expressions.splice(index, index + 1 - index, ...statements), updateParentPointers(parentBlock), braceBlock(parentBlock), done = !0;
|
|
3373
3417
|
}
|
|
3374
3418
|
}
|
|
3375
3419
|
done || (generator || (statements[statements.length - 1][1] = wrapWithReturn(statements[statements.length - 1][1])), children.splice(i, 1, wrapIIFE(statements, async, generator)), updateParentPointers(exp));
|
|
3376
3420
|
}
|
|
3377
3421
|
function processIterationExpressions(statements, consumeRoot = !1) {
|
|
3378
|
-
for (let
|
|
3379
|
-
let s =
|
|
3422
|
+
for (let ref33 = gatherRecursiveAll(statements, ($23) => $23.type === "IterationExpression"), i19 = 0, len18 = ref33.length; i19 < len18; i19++) {
|
|
3423
|
+
let s = ref33[i19];
|
|
3380
3424
|
expressionizeIteration(s, consumeRoot);
|
|
3381
3425
|
}
|
|
3382
3426
|
}
|
|
3383
3427
|
function skipImplicitArguments(args) {
|
|
3384
3428
|
if (args.length === 1) {
|
|
3385
3429
|
let arg0 = args[0];
|
|
3386
|
-
|
|
3430
|
+
if (arg0.type === "Argument" && (arg0 = arg0.expression), arg0.type === "StatementExpression" && (arg0 = arg0.statement), arg0.type === "IterationExpression")
|
|
3431
|
+
return arg0.subtype !== "DoStatement" && !arg0.async && isEmptyBareBlock(arg0.block);
|
|
3432
|
+
if (arg0.type === "IfStatement")
|
|
3433
|
+
return !arg0.else && isEmptyBareBlock(arg0.then);
|
|
3387
3434
|
}
|
|
3388
3435
|
return !1;
|
|
3389
3436
|
}
|
|
@@ -3392,20 +3439,20 @@ ${js}`
|
|
|
3392
3439
|
let args = [];
|
|
3393
3440
|
if (typeof expression == "object" && expression != null && "type" in expression && expression.type === "ArrowFunction" || typeof expression == "object" && expression != null && "type" in expression && expression.type === "FunctionExpression") {
|
|
3394
3441
|
let { parameters } = expression, parameterList = parameters.parameters, results3 = [];
|
|
3395
|
-
for (let
|
|
3396
|
-
let parameter = parameterList[
|
|
3442
|
+
for (let i20 = 0, len19 = parameterList.length; i20 < len19; i20++) {
|
|
3443
|
+
let parameter = parameterList[i20];
|
|
3397
3444
|
if (typeof parameter == "object" && parameter != null && "type" in parameter && parameter.type === "Parameter") {
|
|
3398
|
-
let
|
|
3399
|
-
if (
|
|
3400
|
-
let initializer =
|
|
3445
|
+
let ref34;
|
|
3446
|
+
if (ref34 = parameter.initializer) {
|
|
3447
|
+
let initializer = ref34;
|
|
3401
3448
|
args.push(initializer.expression, parameter.delim), parameter = {
|
|
3402
3449
|
...parameter,
|
|
3403
3450
|
initializer: void 0,
|
|
3404
|
-
children: parameter.children.filter(((
|
|
3451
|
+
children: parameter.children.filter(((a7) => a7 !== initializer))
|
|
3405
3452
|
};
|
|
3406
3453
|
} else
|
|
3407
3454
|
args.push(parameter.children.filter(
|
|
3408
|
-
((
|
|
3455
|
+
((a8) => a8 !== parameter.typeSuffix)
|
|
3409
3456
|
));
|
|
3410
3457
|
}
|
|
3411
3458
|
results3.push(parameter);
|
|
@@ -3413,12 +3460,12 @@ ${js}`
|
|
|
3413
3460
|
let newParameterList = results3, newParameters = {
|
|
3414
3461
|
...parameters,
|
|
3415
3462
|
parameters: newParameterList,
|
|
3416
|
-
children: parameters.children.map(($
|
|
3463
|
+
children: parameters.children.map(($24) => $24 === parameterList ? newParameterList : $24)
|
|
3417
3464
|
};
|
|
3418
3465
|
expression = {
|
|
3419
3466
|
...expression,
|
|
3420
3467
|
parameters: newParameters,
|
|
3421
|
-
children: expression.children.map(($
|
|
3468
|
+
children: expression.children.map(($25) => $25 === parameters ? newParameters : $25)
|
|
3422
3469
|
};
|
|
3423
3470
|
}
|
|
3424
3471
|
return {
|
|
@@ -3436,7 +3483,7 @@ ${js}`
|
|
|
3436
3483
|
}
|
|
3437
3484
|
function makeAmpersandFunction(rhs) {
|
|
3438
3485
|
let { ref, typeSuffix, body } = rhs;
|
|
3439
|
-
ref == null && (ref = makeRef("$"), inplacePrepend(ref, body)), startsWithPredicate(body, ($
|
|
3486
|
+
ref == null && (ref = makeRef("$"), inplacePrepend(ref, body)), startsWithPredicate(body, ($26) => $26.type === "ObjectExpression") && (body = makeLeftHandSideExpression(body));
|
|
3440
3487
|
let parameterList = [
|
|
3441
3488
|
typeSuffix ? [ref, typeSuffix] : ref
|
|
3442
3489
|
], parameters = makeNode({
|
|
@@ -3467,7 +3514,7 @@ ${js}`
|
|
|
3467
3514
|
});
|
|
3468
3515
|
return isStatement(body) && (braceBlock(block), fn.ampersandBlock = !1), gatherRecursiveWithinFunction(
|
|
3469
3516
|
block,
|
|
3470
|
-
((
|
|
3517
|
+
((a9) => a9 === ref)
|
|
3471
3518
|
).length > 1 && (fn.ampersandBlock = !1), fn;
|
|
3472
3519
|
}
|
|
3473
3520
|
|
|
@@ -3485,7 +3532,8 @@ ${js}`
|
|
|
3485
3532
|
}
|
|
3486
3533
|
function braceBlock(block) {
|
|
3487
3534
|
if (block.bare && !block.root) {
|
|
3488
|
-
block.children.unshift(" {"), block.children.push(
|
|
3535
|
+
block.children.unshift(" {"), hasTrailingComment(block.children) && block.children.push(`
|
|
3536
|
+
`), block.children.push("}");
|
|
3489
3537
|
let { implicitlyReturned } = block;
|
|
3490
3538
|
block.bare = block.implicitlyReturned = !1, implicitlyReturned && processReturn(block.parent, !0);
|
|
3491
3539
|
}
|
|
@@ -4560,13 +4608,30 @@ ${js}`
|
|
|
4560
4608
|
}
|
|
4561
4609
|
return ["(", ...from, ")"];
|
|
4562
4610
|
}
|
|
4611
|
+
function markAllTypeImports(decl) {
|
|
4612
|
+
if (decl.ts)
|
|
4613
|
+
return decl;
|
|
4614
|
+
let { imports } = decl;
|
|
4615
|
+
if (!imports)
|
|
4616
|
+
return decl;
|
|
4617
|
+
let i = imports;
|
|
4618
|
+
if (!i.binding && !i.star) {
|
|
4619
|
+
let specs = i.specifiers;
|
|
4620
|
+
return specs?.length && specs.every(($5) => $5.ts) ? { ...decl, ts: !0 } : decl;
|
|
4621
|
+
}
|
|
4622
|
+
let children = imports.children, namedSpecs = children.at(-1).specifiers;
|
|
4623
|
+
if (!(namedSpecs?.length && namedSpecs.every(($6) => $6.ts)))
|
|
4624
|
+
return decl;
|
|
4625
|
+
let [binding, ...rest] = children, newImports = { ...imports, children: [binding, { ts: !0, children: rest }] }, newDeclChildren = decl.children.map((c) => c === imports ? newImports : c);
|
|
4626
|
+
return { ...decl, imports: newImports, children: newDeclChildren };
|
|
4627
|
+
}
|
|
4563
4628
|
function processStaticImport(decl) {
|
|
4564
4629
|
let { imports, from, children } = decl;
|
|
4565
4630
|
if (!(imports && "rest" in imports))
|
|
4566
|
-
return decl;
|
|
4631
|
+
return markAllTypeImports(decl);
|
|
4567
4632
|
let namedImports = imports.binding ? imports.children.at(-1) : imports, allSpecs = namedImports.specifiers;
|
|
4568
4633
|
if (!(namedImports.rest || allSpecs.some((s) => s.pattern)))
|
|
4569
|
-
return decl;
|
|
4634
|
+
return markAllTypeImports(decl);
|
|
4570
4635
|
let ref = makeRef("imports"), star = { type: "Star", token: "*" }, tsSpecs = allSpecs.filter((s) => s.ts), runtimeSpecs = allSpecs.filter((s) => !s.ts), runtimeNames = runtimeSpecs.flatMap((s) => s.binding.names);
|
|
4571
4636
|
namedImports.rest && runtimeNames.push(...namedImports.rest.binding.names);
|
|
4572
4637
|
let runtimeNamed = {
|
|
@@ -5745,7 +5810,7 @@ const `, convertNamedImportsToObject(runtimeNamed, !0, "destructuring"), " = ",
|
|
|
5745
5810
|
children.push(e.children[0], ":", e2, ...e.children.slice(3));
|
|
5746
5811
|
} else
|
|
5747
5812
|
children.push(":void 0");
|
|
5748
|
-
return children.push(closeParen), makeNode({
|
|
5813
|
+
return children.push(closeParen), b.trailing?.length && children.push(b.trailing), e?.block.trailing?.length && children.push(e.block.trailing), makeNode({
|
|
5749
5814
|
type: "IfExpression",
|
|
5750
5815
|
children
|
|
5751
5816
|
});
|
|
@@ -7416,6 +7481,9 @@ const `, convertNamedImportsToObject(runtimeNamed, !0, "destructuring"), " = ",
|
|
|
7416
7481
|
PostfixedSingleLineNoCommaStatements,
|
|
7417
7482
|
NestedBlockStatements,
|
|
7418
7483
|
NestedBlockStatement,
|
|
7484
|
+
TrailingNestedComments,
|
|
7485
|
+
TrailingInlineComment,
|
|
7486
|
+
TrailingNestedCommentLine,
|
|
7419
7487
|
BlockStatementPart,
|
|
7420
7488
|
Literal,
|
|
7421
7489
|
LiteralContent,
|
|
@@ -8033,6 +8101,7 @@ const `, convertNamedImportsToObject(runtimeNamed, !0, "destructuring"), " = ",
|
|
|
8033
8101
|
CoffeeOfEnabled,
|
|
8034
8102
|
CoffeePrototypeEnabled,
|
|
8035
8103
|
ESArrowFunctionEnabled,
|
|
8104
|
+
ESBraceBlockEnabled,
|
|
8036
8105
|
JSXCodeNestedEnabled,
|
|
8037
8106
|
JSXCodeSameLineEnabled,
|
|
8038
8107
|
ObjectIsEnabled,
|
|
@@ -9608,7 +9677,7 @@ const `, convertNamedImportsToObject(runtimeNamed, !0, "destructuring"), " = ",
|
|
|
9608
9677
|
let $$eventData = $$entered?.data, $$final = TrailingPostfix$parser($$ctx, $$state);
|
|
9609
9678
|
return $$ctx.exit?.("TrailingPostfix", $$state, $$final, $$eventData), $$final;
|
|
9610
9679
|
}
|
|
9611
|
-
var FatArrowBody$0$parser = (0, import_lib2.$S)((0, import_lib2.$N)(EOS), (0, import_lib2.$N)((0, import_lib2.$S)((0, import_lib2.$E)(_), ExpressionizedStatement)), (0, import_lib2.$N)((0, import_lib2.$S)((0, import_lib2.$E)(_), Declaration)), NonPipelineExpression, (0, import_lib2.$N)(TrailingDeclaration), (0, import_lib2.$N)(TrailingPipe), (0, import_lib2.$N)(TrailingPostfix), (0, import_lib2.$N)(SemicolonDelimiter));
|
|
9680
|
+
var FatArrowBody$0$parser = (0, import_lib2.$S)((0, import_lib2.$N)(EOS), (0, import_lib2.$N)((0, import_lib2.$S)((0, import_lib2.$E)(_), ExpressionizedStatement)), (0, import_lib2.$N)((0, import_lib2.$S)((0, import_lib2.$E)(_), Declaration)), NonPipelineExpression, (0, import_lib2.$N)(TrailingDeclaration), (0, import_lib2.$N)(TrailingPipe), (0, import_lib2.$N)(TrailingPostfix), (0, import_lib2.$C)(ESArrowFunctionEnabled, (0, import_lib2.$N)(SemicolonDelimiter)));
|
|
9612
9681
|
function FatArrowBody$0($$ctx, $$state) {
|
|
9613
9682
|
let $$r = FatArrowBody$0$parser($$ctx, $$state);
|
|
9614
9683
|
if (!$$r)
|
|
@@ -10454,7 +10523,7 @@ const `, convertNamedImportsToObject(runtimeNamed, !0, "destructuring"), " = ",
|
|
|
10454
10523
|
let $$eventData = $$entered?.data, $$final = ClassBracedContent$0($$ctx, $$state) || ClassBracedContent$1($$ctx, $$state);
|
|
10455
10524
|
return $$ctx.exit?.("ClassBracedContent", $$state, $$final, $$eventData), $$final;
|
|
10456
10525
|
}
|
|
10457
|
-
var NestedClassElements$parser = (0, import_lib2.$S)(PushIndent, (0, import_lib2.$Q)(NestedClassElement), PopIndent);
|
|
10526
|
+
var NestedClassElements$parser = (0, import_lib2.$S)(PushIndent, (0, import_lib2.$Q)(NestedClassElement), (0, import_lib2.$Q)(TrailingNestedCommentLine), PopIndent);
|
|
10458
10527
|
function NestedClassElements($$ctx, $$state) {
|
|
10459
10528
|
let $$entered = $$ctx.enter?.("NestedClassElements", $$state);
|
|
10460
10529
|
if ($$entered && "cache" in $$entered) return $$entered.cache;
|
|
@@ -10463,9 +10532,9 @@ const `, convertNamedImportsToObject(runtimeNamed, !0, "destructuring"), " = ",
|
|
|
10463
10532
|
$$ctx.exit?.("NestedClassElements", $$state, void 0, $$eventData);
|
|
10464
10533
|
return;
|
|
10465
10534
|
}
|
|
10466
|
-
let $$m = (function(elements) {
|
|
10467
|
-
return elements.length ? elements : $skip;
|
|
10468
|
-
})($$
|
|
10535
|
+
let $$value = $$r.value, $$m = (function(elements, trailing) {
|
|
10536
|
+
return elements.length || trailing.length ? trailing.length ? [...elements, ...trailing] : elements : $skip;
|
|
10537
|
+
})($$value[1], $$value[2]), $$final = $$m !== import_lib2.SKIP ? ($$r.value = $$m, $$r) : void 0;
|
|
10469
10538
|
return $$ctx.exit?.("NestedClassElements", $$state, $$final, $$eventData), $$final;
|
|
10470
10539
|
}
|
|
10471
10540
|
var NestedClassElement$parser = (0, import_lib2.$S)(Nested, ClassElement, StatementDelimiter);
|
|
@@ -13232,7 +13301,7 @@ const `, convertNamedImportsToObject(runtimeNamed, !0, "destructuring"), " = ",
|
|
|
13232
13301
|
})($$r.value[1]);
|
|
13233
13302
|
return $$r.value = $$m, $$ctx.exit?.("ThenClause", $$state, $$r, $$eventData), $$r;
|
|
13234
13303
|
}
|
|
13235
|
-
var ThenBlock$0$parser = (0, import_lib2.$S)(NoBlock, EmptyBlock), ThenBlock$1$parser = ImplicitNestedBlock, ThenBlock$2$parser =
|
|
13304
|
+
var ThenBlock$0$parser = (0, import_lib2.$S)(NoBlock, EmptyBlock), ThenBlock$1$parser = ImplicitNestedBlock, ThenBlock$2$parser = (0, import_lib2.$S)(ESBraceBlockEnabled, ExplicitBlock), ThenBlock$3$parser = (0, import_lib2.$S)((0, import_lib2.$N)(ESBraceBlockEnabled), ObjectSingleLineStatements), ThenBlock$4$parser = SingleLineStatements;
|
|
13236
13305
|
function ThenBlock$0($$ctx, $$state) {
|
|
13237
13306
|
let $$r = ThenBlock$0$parser($$ctx, $$state);
|
|
13238
13307
|
if (!$$r)
|
|
@@ -13246,15 +13315,30 @@ const `, convertNamedImportsToObject(runtimeNamed, !0, "destructuring"), " = ",
|
|
|
13246
13315
|
return ThenBlock$1$parser($$ctx, $$state);
|
|
13247
13316
|
}
|
|
13248
13317
|
function ThenBlock$2($$ctx, $$state) {
|
|
13249
|
-
|
|
13318
|
+
let $$r = ThenBlock$2$parser($$ctx, $$state);
|
|
13319
|
+
if (!$$r)
|
|
13320
|
+
return;
|
|
13321
|
+
let $$m = /* @__PURE__ */ (function($2) {
|
|
13322
|
+
return $2;
|
|
13323
|
+
})($$r.value[1]);
|
|
13324
|
+
return $$r.value = $$m, $$r;
|
|
13250
13325
|
}
|
|
13251
13326
|
function ThenBlock$3($$ctx, $$state) {
|
|
13252
|
-
|
|
13327
|
+
let $$r = ThenBlock$3$parser($$ctx, $$state);
|
|
13328
|
+
if (!$$r)
|
|
13329
|
+
return;
|
|
13330
|
+
let $$m = /* @__PURE__ */ (function($2) {
|
|
13331
|
+
return $2;
|
|
13332
|
+
})($$r.value[1]);
|
|
13333
|
+
return $$r.value = $$m, $$r;
|
|
13334
|
+
}
|
|
13335
|
+
function ThenBlock$4($$ctx, $$state) {
|
|
13336
|
+
return ThenBlock$4$parser($$ctx, $$state);
|
|
13253
13337
|
}
|
|
13254
13338
|
function ThenBlock($$ctx, $$state) {
|
|
13255
13339
|
let $$entered = $$ctx.enter?.("ThenBlock", $$state);
|
|
13256
13340
|
if ($$entered && "cache" in $$entered) return $$entered.cache;
|
|
13257
|
-
let $$eventData = $$entered?.data, $$final = ThenBlock$0($$ctx, $$state) || ThenBlock$1($$ctx, $$state) || ThenBlock$2($$ctx, $$state) || ThenBlock$3($$ctx, $$state);
|
|
13341
|
+
let $$eventData = $$entered?.data, $$final = ThenBlock$0($$ctx, $$state) || ThenBlock$1($$ctx, $$state) || ThenBlock$2($$ctx, $$state) || ThenBlock$3($$ctx, $$state) || ThenBlock$4($$ctx, $$state);
|
|
13258
13342
|
return $$ctx.exit?.("ThenBlock", $$state, $$final, $$eventData), $$final;
|
|
13259
13343
|
}
|
|
13260
13344
|
var BracedThenClause$parser = (0, import_lib2.$S)((0, import_lib2.$Y)(Then), InsertOpenBrace, ThenClause, InsertCloseBrace);
|
|
@@ -13356,9 +13440,15 @@ const `, convertNamedImportsToObject(runtimeNamed, !0, "destructuring"), " = ",
|
|
|
13356
13440
|
let $$eventData = $$entered?.data, $$final = BlockOrEmptyStatement$0($$ctx, $$state) || BlockOrEmptyStatement$1($$ctx, $$state);
|
|
13357
13441
|
return $$ctx.exit?.("BlockOrEmptyStatement", $$state, $$final, $$eventData), $$final;
|
|
13358
13442
|
}
|
|
13359
|
-
var BlockOrEmpty$0$parser = ObjectSingleLineStatements, BlockOrEmpty$1$parser = Block, BlockOrEmpty$2$parser = (0, import_lib2.$S)(NoBlock, EmptyBlock);
|
|
13443
|
+
var BlockOrEmpty$0$parser = (0, import_lib2.$S)((0, import_lib2.$N)(ESBraceBlockEnabled), ObjectSingleLineStatements), BlockOrEmpty$1$parser = Block, BlockOrEmpty$2$parser = (0, import_lib2.$S)(NoBlock, EmptyBlock);
|
|
13360
13444
|
function BlockOrEmpty$0($$ctx, $$state) {
|
|
13361
|
-
|
|
13445
|
+
let $$r = BlockOrEmpty$0$parser($$ctx, $$state);
|
|
13446
|
+
if (!$$r)
|
|
13447
|
+
return;
|
|
13448
|
+
let $$m = /* @__PURE__ */ (function($2) {
|
|
13449
|
+
return $2;
|
|
13450
|
+
})($$r.value[1]);
|
|
13451
|
+
return $$r.value = $$m, $$r;
|
|
13362
13452
|
}
|
|
13363
13453
|
function BlockOrEmpty$1($$ctx, $$state) {
|
|
13364
13454
|
return BlockOrEmpty$1$parser($$ctx, $$state);
|
|
@@ -13648,7 +13738,7 @@ const `, convertNamedImportsToObject(runtimeNamed, !0, "destructuring"), " = ",
|
|
|
13648
13738
|
})($$value[0], $$value[1]);
|
|
13649
13739
|
return $$r.value = $$m, $$ctx.exit?.("PostfixedSingleLineNoCommaStatements", $$state, $$r, $$eventData), $$r;
|
|
13650
13740
|
}
|
|
13651
|
-
var NestedBlockStatements$parser = (0, import_lib2.$S)(PushIndent, (0, import_lib2.$Q)(NestedBlockStatement), PopIndent);
|
|
13741
|
+
var NestedBlockStatements$parser = (0, import_lib2.$S)(PushIndent, (0, import_lib2.$Q)(NestedBlockStatement), TrailingNestedComments, PopIndent);
|
|
13652
13742
|
function NestedBlockStatements($$ctx, $$state) {
|
|
13653
13743
|
let $$entered = $$ctx.enter?.("NestedBlockStatements", $$state);
|
|
13654
13744
|
if ($$entered && "cache" in $$entered) return $$entered.cache;
|
|
@@ -13657,14 +13747,18 @@ const `, convertNamedImportsToObject(runtimeNamed, !0, "destructuring"), " = ",
|
|
|
13657
13747
|
$$ctx.exit?.("NestedBlockStatements", $$state, void 0, $$eventData);
|
|
13658
13748
|
return;
|
|
13659
13749
|
}
|
|
13660
|
-
let $$m = (function(statements) {
|
|
13661
|
-
|
|
13750
|
+
let $$value = $$r.value, $$m = (function(statements, trailing) {
|
|
13751
|
+
if (!(statements.length || trailing.length))
|
|
13752
|
+
return $skip;
|
|
13753
|
+
let expressions = statements.flat(), children = [expressions];
|
|
13754
|
+
return trailing.length && children.push(trailing), {
|
|
13662
13755
|
type: "BlockStatement",
|
|
13663
|
-
expressions
|
|
13664
|
-
children
|
|
13665
|
-
bare: !0
|
|
13666
|
-
|
|
13667
|
-
|
|
13756
|
+
expressions,
|
|
13757
|
+
children,
|
|
13758
|
+
bare: !0,
|
|
13759
|
+
trailing: trailing.length ? trailing : void 0
|
|
13760
|
+
};
|
|
13761
|
+
})($$value[1], $$value[2]), $$final = $$m !== import_lib2.SKIP ? ($$r.value = $$m, $$r) : void 0;
|
|
13668
13762
|
return $$ctx.exit?.("NestedBlockStatements", $$state, $$final, $$eventData), $$final;
|
|
13669
13763
|
}
|
|
13670
13764
|
var NestedBlockStatement$parser = (0, import_lib2.$S)(Nested, (0, import_lib2.$P)(BlockStatementPart));
|
|
@@ -13684,6 +13778,49 @@ const `, convertNamedImportsToObject(runtimeNamed, !0, "destructuring"), " = ",
|
|
|
13684
13778
|
})($$value[0], $$value[1]);
|
|
13685
13779
|
return $$r.value = $$m, $$ctx.exit?.("NestedBlockStatement", $$state, $$r, $$eventData), $$r;
|
|
13686
13780
|
}
|
|
13781
|
+
var TrailingNestedComments$parser = (0, import_lib2.$S)((0, import_lib2.$E)(TrailingInlineComment), (0, import_lib2.$Q)(TrailingNestedCommentLine));
|
|
13782
|
+
function TrailingNestedComments($$ctx, $$state) {
|
|
13783
|
+
let $$entered = $$ctx.enter?.("TrailingNestedComments", $$state);
|
|
13784
|
+
if ($$entered && "cache" in $$entered) return $$entered.cache;
|
|
13785
|
+
let $$eventData = $$entered?.data, $$r = TrailingNestedComments$parser($$ctx, $$state);
|
|
13786
|
+
if (!$$r) {
|
|
13787
|
+
$$ctx.exit?.("TrailingNestedComments", $$state, void 0, $$eventData);
|
|
13788
|
+
return;
|
|
13789
|
+
}
|
|
13790
|
+
let $$value = $$r.value, $$m = (function(inline, lines) {
|
|
13791
|
+
let out = [];
|
|
13792
|
+
return inline && out.push(inline), lines.length && out.push(...lines), out;
|
|
13793
|
+
})($$value[0], $$value[1]);
|
|
13794
|
+
return $$r.value = $$m, $$ctx.exit?.("TrailingNestedComments", $$state, $$r, $$eventData), $$r;
|
|
13795
|
+
}
|
|
13796
|
+
var TrailingInlineComment$parser = (0, import_lib2.$S)((0, import_lib2.$E)(_), SingleLineComment);
|
|
13797
|
+
function TrailingInlineComment($$ctx, $$state) {
|
|
13798
|
+
let $$entered = $$ctx.enter?.("TrailingInlineComment", $$state);
|
|
13799
|
+
if ($$entered && "cache" in $$entered) return $$entered.cache;
|
|
13800
|
+
let $$eventData = $$entered?.data, $$r = TrailingInlineComment$parser($$ctx, $$state);
|
|
13801
|
+
if (!$$r) {
|
|
13802
|
+
$$ctx.exit?.("TrailingInlineComment", $$state, void 0, $$eventData);
|
|
13803
|
+
return;
|
|
13804
|
+
}
|
|
13805
|
+
let $$value = $$r.value, $$m = /* @__PURE__ */ (function(ws, c) {
|
|
13806
|
+
return [ws, c];
|
|
13807
|
+
})($$value[0], $$value[1]);
|
|
13808
|
+
return $$r.value = $$m, $$ctx.exit?.("TrailingInlineComment", $$state, $$r, $$eventData), $$r;
|
|
13809
|
+
}
|
|
13810
|
+
var TrailingNestedCommentLine$parser = (0, import_lib2.$S)(EOL, Indent, SingleLineComment);
|
|
13811
|
+
function TrailingNestedCommentLine($$ctx, $$state) {
|
|
13812
|
+
let $$entered = $$ctx.enter?.("TrailingNestedCommentLine", $$state);
|
|
13813
|
+
if ($$entered && "cache" in $$entered) return $$entered.cache;
|
|
13814
|
+
let $$eventData = $$entered?.data, $$r = TrailingNestedCommentLine$parser($$ctx, $$state);
|
|
13815
|
+
if (!$$r) {
|
|
13816
|
+
$$ctx.exit?.("TrailingNestedCommentLine", $$state, void 0, $$eventData);
|
|
13817
|
+
return;
|
|
13818
|
+
}
|
|
13819
|
+
let $$value = $$r.value, $$m = (function(eol, indent, c) {
|
|
13820
|
+
return indent.level >= state.currentIndent.level ? [eol, indent, c] : $skip;
|
|
13821
|
+
})($$value[0], $$value[1], $$value[2]), $$final = $$m !== import_lib2.SKIP ? ($$r.value = $$m, $$r) : void 0;
|
|
13822
|
+
return $$ctx.exit?.("TrailingNestedCommentLine", $$state, $$final, $$eventData), $$final;
|
|
13823
|
+
}
|
|
13687
13824
|
var BlockStatementPart$parser = (0, import_lib2.$S)((0, import_lib2.$N)(EOS), (0, import_lib2.$E)(_), StatementListItem, StatementDelimiter);
|
|
13688
13825
|
function BlockStatementPart($$ctx, $$state) {
|
|
13689
13826
|
let $$entered = $$ctx.enter?.("BlockStatementPart", $$state);
|
|
@@ -17743,10 +17880,16 @@ const `, convertNamedImportsToObject(runtimeNamed, !0, "destructuring"), " = ",
|
|
|
17743
17880
|
let $$r = CaseClause$2$parser($$ctx, $$state);
|
|
17744
17881
|
if (!$$r)
|
|
17745
17882
|
return;
|
|
17746
|
-
let $$value = $$r.value, $$m =
|
|
17883
|
+
let $$value = $$r.value, $$m = (function($0, cases, block, b) {
|
|
17884
|
+
let children = $0;
|
|
17885
|
+
if (hasTrailingComment(block)) {
|
|
17886
|
+
let bIdx = children.indexOf(b);
|
|
17887
|
+
b = { ...b, token: `
|
|
17888
|
+
` + b.token }, children = [...children.slice(0, bIdx), b, ...children.slice(bIdx + 1)];
|
|
17889
|
+
}
|
|
17747
17890
|
return {
|
|
17748
17891
|
type: "WhenClause",
|
|
17749
|
-
children
|
|
17892
|
+
children,
|
|
17750
17893
|
cases,
|
|
17751
17894
|
block,
|
|
17752
17895
|
break: b
|
|
@@ -18998,7 +19141,7 @@ const `, convertNamedImportsToObject(runtimeNamed, !0, "destructuring"), " = ",
|
|
|
18998
19141
|
let $$eventData = $$entered?.data, $$final = MaybeNestedExpression$0($$ctx, $$state) || MaybeNestedExpression$1($$ctx, $$state);
|
|
18999
19142
|
return $$ctx.exit?.("MaybeNestedExpression", $$state, $$final, $$eventData), $$final;
|
|
19000
19143
|
}
|
|
19001
|
-
var MaybeParenNestedExpression$0$parser = (0, import_lib2.$Y)((0, import_lib2.$S)((0, import_lib2.$E)(_), PostfixStatement, NoBlock)), MaybeParenNestedExpression$1$parser = (0, import_lib2.$S)((0, import_lib2.$N)(EOS), Expression), MaybeParenNestedExpression$2$parser = (0, import_lib2.$S)((0, import_lib2.$Y)(EOS), (0, import_lib2.$C)(ArrayLiteral, ObjectLiteral)), MaybeParenNestedExpression$3$parser = (0, import_lib2.$S)((0, import_lib2.$Y)(EOS), InsertSpace, InsertOpenParen, PushIndent, (0, import_lib2.$E)((0, import_lib2.$S)(Nested, Expression)), PopIndent, (0, import_lib2.$E)(AllowedTrailingCallExpressions), InsertNewline, InsertIndent, InsertCloseParen);
|
|
19144
|
+
var MaybeParenNestedExpression$0$parser = (0, import_lib2.$Y)((0, import_lib2.$S)((0, import_lib2.$E)(_), PostfixStatement, (0, import_lib2.$C)(NoBlock, (0, import_lib2.$S)((0, import_lib2.$E)(_), Semicolon)))), MaybeParenNestedExpression$1$parser = (0, import_lib2.$S)((0, import_lib2.$N)(EOS), Expression), MaybeParenNestedExpression$2$parser = (0, import_lib2.$S)((0, import_lib2.$Y)(EOS), (0, import_lib2.$C)(ArrayLiteral, ObjectLiteral)), MaybeParenNestedExpression$3$parser = (0, import_lib2.$S)((0, import_lib2.$Y)(EOS), InsertSpace, InsertOpenParen, PushIndent, (0, import_lib2.$E)((0, import_lib2.$S)(Nested, Expression)), PopIndent, (0, import_lib2.$E)(AllowedTrailingCallExpressions), InsertNewline, InsertIndent, InsertCloseParen);
|
|
19002
19145
|
function MaybeParenNestedExpression$0($$ctx, $$state) {
|
|
19003
19146
|
let $$r = MaybeParenNestedExpression$0$parser($$ctx, $$state);
|
|
19004
19147
|
if (!$$r)
|
|
@@ -26683,6 +26826,21 @@ const `, convertNamedImportsToObject(runtimeNamed, !0, "destructuring"), " = ",
|
|
|
26683
26826
|
})(), $$final = $$m !== import_lib2.SKIP ? ($$r.value = $$m, $$r) : void 0;
|
|
26684
26827
|
return $$ctx.exit?.("ESArrowFunctionEnabled", $$state, $$final, $$eventData), $$final;
|
|
26685
26828
|
}
|
|
26829
|
+
var ESBraceBlockEnabled$parser = (0, import_lib2.$EXPECT)($L0, 'ESBraceBlockEnabled ""');
|
|
26830
|
+
function ESBraceBlockEnabled($$ctx, $$state) {
|
|
26831
|
+
let $$entered = $$ctx.enter?.("ESBraceBlockEnabled", $$state);
|
|
26832
|
+
if ($$entered && "cache" in $$entered) return $$entered.cache;
|
|
26833
|
+
let $$eventData = $$entered?.data, $$r = ESBraceBlockEnabled$parser($$ctx, $$state);
|
|
26834
|
+
if (!$$r) {
|
|
26835
|
+
$$ctx.exit?.("ESBraceBlockEnabled", $$state, void 0, $$eventData);
|
|
26836
|
+
return;
|
|
26837
|
+
}
|
|
26838
|
+
let $$m = (function() {
|
|
26839
|
+
if (!config.esBraceBlock)
|
|
26840
|
+
return $skip;
|
|
26841
|
+
})(), $$final = $$m !== import_lib2.SKIP ? ($$r.value = $$m, $$r) : void 0;
|
|
26842
|
+
return $$ctx.exit?.("ESBraceBlockEnabled", $$state, $$final, $$eventData), $$final;
|
|
26843
|
+
}
|
|
26686
26844
|
var JSXCodeNestedEnabled$parser = (0, import_lib2.$EXPECT)($L0, 'JSXCodeNestedEnabled ""');
|
|
26687
26845
|
function JSXCodeNestedEnabled($$ctx, $$state) {
|
|
26688
26846
|
let $$entered = $$ctx.enter?.("JSXCodeNestedEnabled", $$state);
|
|
@@ -26930,11 +27088,17 @@ const `, convertNamedImportsToObject(runtimeNamed, !0, "destructuring"), " = ",
|
|
|
26930
27088
|
})($$value, $$value), $$final = $$m !== import_lib2.SKIP ? ($$r.value = $$m, $$r) : void 0;
|
|
26931
27089
|
return $$ctx.exit?.("TrackIndented", $$state, $$final, $$eventData), $$final;
|
|
26932
27090
|
}
|
|
26933
|
-
var PushIndent$parser = (0, import_lib2.$Y)((0, import_lib2.$S)(EOS, TrackIndented));
|
|
27091
|
+
var PushIndent$0$parser = (0, import_lib2.$Y)((0, import_lib2.$S)(EOS, TrackIndented)), PushIndent$1$parser = (0, import_lib2.$Y)((0, import_lib2.$S)(EOL, TrackIndented));
|
|
27092
|
+
function PushIndent$0($$ctx, $$state) {
|
|
27093
|
+
return PushIndent$0$parser($$ctx, $$state);
|
|
27094
|
+
}
|
|
27095
|
+
function PushIndent$1($$ctx, $$state) {
|
|
27096
|
+
return PushIndent$1$parser($$ctx, $$state);
|
|
27097
|
+
}
|
|
26934
27098
|
function PushIndent($$ctx, $$state) {
|
|
26935
27099
|
let $$entered = $$ctx.enter?.("PushIndent", $$state);
|
|
26936
27100
|
if ($$entered && "cache" in $$entered) return $$entered.cache;
|
|
26937
|
-
let $$eventData = $$entered?.data, $$final = PushIndent$
|
|
27101
|
+
let $$eventData = $$entered?.data, $$final = PushIndent$0($$ctx, $$state) || PushIndent$1($$ctx, $$state);
|
|
26938
27102
|
return $$ctx.exit?.("PushIndent", $$state, $$final, $$eventData), $$final;
|
|
26939
27103
|
}
|
|
26940
27104
|
var PopIndent$parser = (0, import_lib2.$EXPECT)($L0, 'PopIndent ""');
|