@danielx/civet 0.11.1 → 0.11.2
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 +13 -0
- package/dist/browser.js +250 -193
- package/dist/civet +27 -29
- package/dist/main.js +306 -215
- package/dist/main.mjs +306 -215
- package/dist/types.d.ts +4 -0
- package/dist/unplugin/unplugin.js +17 -10
- package/dist/unplugin/unplugin.mjs +17 -10
- package/package.json +1 -1
package/dist/browser.js
CHANGED
|
@@ -879,6 +879,51 @@ ${body}`), super(message), this.header = header, this.body = body, this.filename
|
|
|
879
879
|
children: [t]
|
|
880
880
|
};
|
|
881
881
|
}
|
|
882
|
+
function typeOfExpression(expression) {
|
|
883
|
+
let t;
|
|
884
|
+
if (isASTNodeObject(expression)) {
|
|
885
|
+
switch (expression.type) {
|
|
886
|
+
case "Literal": {
|
|
887
|
+
switch (expression.subtype) {
|
|
888
|
+
case "NullLiteral":
|
|
889
|
+
return;
|
|
890
|
+
default:
|
|
891
|
+
t = literalType(expression);
|
|
892
|
+
}
|
|
893
|
+
break;
|
|
894
|
+
}
|
|
895
|
+
case "RegularExpressionLiteral":
|
|
896
|
+
case "TemplateLiteral": {
|
|
897
|
+
t = literalType(expression);
|
|
898
|
+
break;
|
|
899
|
+
}
|
|
900
|
+
case "Identifier":
|
|
901
|
+
if (expression.name === "undefined")
|
|
902
|
+
return;
|
|
903
|
+
case "MemberExpression": {
|
|
904
|
+
t = {
|
|
905
|
+
type: "TypeTypeof",
|
|
906
|
+
children: ["typeof ", expression],
|
|
907
|
+
expression
|
|
908
|
+
};
|
|
909
|
+
break;
|
|
910
|
+
}
|
|
911
|
+
default:
|
|
912
|
+
return;
|
|
913
|
+
}
|
|
914
|
+
return t;
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
function typeSuffixForExpression(expression) {
|
|
918
|
+
let t = typeOfExpression(expression);
|
|
919
|
+
if (t != null)
|
|
920
|
+
return {
|
|
921
|
+
type: "TypeSuffix",
|
|
922
|
+
ts: !0,
|
|
923
|
+
t,
|
|
924
|
+
children: [": ", t]
|
|
925
|
+
};
|
|
926
|
+
}
|
|
882
927
|
function makeNumericLiteral(n) {
|
|
883
928
|
let s = n.toString();
|
|
884
929
|
return {
|
|
@@ -1528,8 +1573,8 @@ ${body}`), super(message), this.header = header, this.body = body, this.filename
|
|
|
1528
1573
|
{
|
|
1529
1574
|
let results1 = [];
|
|
1530
1575
|
for (let ref7 = pattern.elements, i7 = 0, len6 = ref7.length; i7 < len6; i7++) {
|
|
1531
|
-
let elem = ref7[i7], { typeSuffix } = elem;
|
|
1532
|
-
typeSuffix ??= elem.binding?.typeSuffix, typeSuffix && count
|
|
1576
|
+
let elem = ref7[i7], { typeSuffix, initializer } = elem;
|
|
1577
|
+
typeSuffix ??= elem.binding?.typeSuffix, typeSuffix && count++, initializer != null && (typeSuffix ??= typeSuffixForExpression(trimFirstSpace(initializer.expression)));
|
|
1533
1578
|
let typeElement = [typeSuffix?.t, elem.delim];
|
|
1534
1579
|
typeSuffix?.optional && (typeElement[0] = parenthesizeType(typeElement[0]), typeElement.unshift("undefined |")), elem.type === "BindingRestElement" ? (typeElement[0] ??= "unknown[]", typeElement.unshift(elem.dots)) : typeElement[0] ??= "unknown", results1.push(typeElement);
|
|
1535
1580
|
}
|
|
@@ -1550,8 +1595,8 @@ ${body}`), super(message), this.header = header, this.body = body, this.filename
|
|
|
1550
1595
|
{
|
|
1551
1596
|
let restType, results2 = [];
|
|
1552
1597
|
for (let ref8 = pattern.properties, i8 = 0, len7 = ref8.length; i8 < len7; i8++) {
|
|
1553
|
-
let prop = ref8[i8], { typeSuffix } = prop;
|
|
1554
|
-
switch (typeSuffix ??= prop.value?.typeSuffix, typeSuffix && count++, typeSuffix ??= {
|
|
1598
|
+
let prop = ref8[i8], { typeSuffix, initializer } = prop;
|
|
1599
|
+
switch (typeSuffix ??= prop.value?.typeSuffix, typeSuffix && count++, initializer != null && (typeSuffix ??= typeSuffixForExpression(trimFirstSpace(initializer.expression))), typeSuffix ??= {
|
|
1555
1600
|
type: "TypeSuffix",
|
|
1556
1601
|
ts: !0,
|
|
1557
1602
|
children: [": unknown"]
|
|
@@ -2449,16 +2494,21 @@ ${js}`
|
|
|
2449
2494
|
function assignResults(node, collect) {
|
|
2450
2495
|
if (!node) return;
|
|
2451
2496
|
switch (node.type) {
|
|
2452
|
-
case "BlockStatement":
|
|
2497
|
+
case "BlockStatement": {
|
|
2453
2498
|
if (node.expressions.length) {
|
|
2454
2499
|
let ref5;
|
|
2455
2500
|
assignResults((ref5 = node.expressions)[ref5.length - 1], collect);
|
|
2456
2501
|
} else
|
|
2457
|
-
node.expressions.push(["", collect("void 0"), ";"]);
|
|
2502
|
+
node.expressions.push(["", collect("void 0"), ";"]), updateParentPointers(node);
|
|
2458
2503
|
return;
|
|
2459
|
-
|
|
2460
|
-
|
|
2504
|
+
}
|
|
2505
|
+
case "CaseBlock": {
|
|
2506
|
+
for (let ref6 = node.clauses, i4 = 0, len3 = ref6.length; i4 < len3; i4++) {
|
|
2507
|
+
let clause = ref6[i4];
|
|
2508
|
+
assignResults(clause, collect);
|
|
2509
|
+
}
|
|
2461
2510
|
return;
|
|
2511
|
+
}
|
|
2462
2512
|
case "WhenClause":
|
|
2463
2513
|
case "DefaultClause":
|
|
2464
2514
|
case "PatternClause": {
|
|
@@ -2474,7 +2524,7 @@ ${js}`
|
|
|
2474
2524
|
exp = exp;
|
|
2475
2525
|
let outer = exp;
|
|
2476
2526
|
exp.type === "LabelledStatement" && (exp = exp.statement);
|
|
2477
|
-
let
|
|
2527
|
+
let ref7, ref8, m1;
|
|
2478
2528
|
switch (exp.type) {
|
|
2479
2529
|
case "BreakStatement":
|
|
2480
2530
|
case "ContinueStatement":
|
|
@@ -2484,13 +2534,13 @@ ${js}`
|
|
|
2484
2534
|
case "ThrowStatement":
|
|
2485
2535
|
return;
|
|
2486
2536
|
case "Declaration": {
|
|
2487
|
-
let
|
|
2488
|
-
exp.bindings?.length ?
|
|
2489
|
-
let value =
|
|
2537
|
+
let ref9;
|
|
2538
|
+
exp.bindings?.length ? ref9 = patternAsValue((ref7 = exp.bindings)[ref7.length - 1].pattern) : ref9 = "void 0";
|
|
2539
|
+
let value = ref9;
|
|
2490
2540
|
exp.children.push([
|
|
2491
2541
|
"",
|
|
2492
2542
|
[";", collect(value)]
|
|
2493
|
-
]);
|
|
2543
|
+
]), updateParentPointers(exp);
|
|
2494
2544
|
return;
|
|
2495
2545
|
}
|
|
2496
2546
|
case "FunctionExpression": {
|
|
@@ -2498,7 +2548,7 @@ ${js}`
|
|
|
2498
2548
|
exp.children.push([
|
|
2499
2549
|
"",
|
|
2500
2550
|
[";", collect(exp.id)]
|
|
2501
|
-
]);
|
|
2551
|
+
]), updateParentPointers(exp);
|
|
2502
2552
|
return;
|
|
2503
2553
|
}
|
|
2504
2554
|
break;
|
|
@@ -2513,11 +2563,11 @@ ${js}`
|
|
|
2513
2563
|
case "BlockStatement": {
|
|
2514
2564
|
if (exp.expressions.some(isExit))
|
|
2515
2565
|
return;
|
|
2516
|
-
assignResults(exp.expressions[
|
|
2566
|
+
assignResults((ref8 = exp.expressions)[ref8.length - 1], collect);
|
|
2517
2567
|
return;
|
|
2518
2568
|
}
|
|
2519
2569
|
case "IfStatement": {
|
|
2520
|
-
assignResults(exp.then, collect), exp.else ? assignResults(exp.else.block, collect) : (braceBlock(exp.then), exp.children.push([" else {", collect("void 0"), "}"]));
|
|
2570
|
+
assignResults(exp.then, collect), exp.else ? assignResults(exp.else.block, collect) : (braceBlock(exp.then), exp.children.push([" else {", collect("void 0"), "}"]), updateParentPointers(exp));
|
|
2521
2571
|
return;
|
|
2522
2572
|
}
|
|
2523
2573
|
case "PatternMatchingStatement": {
|
|
@@ -2525,15 +2575,15 @@ ${js}`
|
|
|
2525
2575
|
return;
|
|
2526
2576
|
}
|
|
2527
2577
|
case "SwitchStatement": {
|
|
2528
|
-
for (let
|
|
2529
|
-
let clause =
|
|
2578
|
+
for (let ref10 = exp.caseBlock.clauses, i5 = 0, len4 = ref10.length; i5 < len4; i5++) {
|
|
2579
|
+
let clause = ref10[i5];
|
|
2530
2580
|
assignResults(clause, collect);
|
|
2531
2581
|
}
|
|
2532
2582
|
return;
|
|
2533
2583
|
}
|
|
2534
2584
|
case "TryStatement": {
|
|
2535
|
-
for (let
|
|
2536
|
-
let block =
|
|
2585
|
+
for (let ref11 = exp.blocks, i6 = 0, len5 = ref11.length; i6 < len5; i6++) {
|
|
2586
|
+
let block = ref11[i6];
|
|
2537
2587
|
assignResults(block, collect);
|
|
2538
2588
|
}
|
|
2539
2589
|
return;
|
|
@@ -2543,13 +2593,16 @@ ${js}`
|
|
|
2543
2593
|
return;
|
|
2544
2594
|
let semi2 = exp.children.lastIndexOf(";");
|
|
2545
2595
|
if (0 <= semi2 && semi2 < exp.children.length - 1) {
|
|
2546
|
-
exp.children.splice(semi2 + 1, 1 / 0, collect(exp.children.slice(semi2 + 1)));
|
|
2596
|
+
exp.children.splice(semi2 + 1, 1 / 0, collect(exp.children.slice(semi2 + 1))), updateParentPointers(exp);
|
|
2547
2597
|
return;
|
|
2548
2598
|
}
|
|
2549
2599
|
break;
|
|
2550
2600
|
}
|
|
2551
2601
|
}
|
|
2552
|
-
node[node.length - 1]?.type
|
|
2602
|
+
if (node[node.length - 1]?.type === "SemicolonDelimiter")
|
|
2603
|
+
return;
|
|
2604
|
+
let parent = node[1].parent;
|
|
2605
|
+
node[1] = collect(node[1]), parent != null && updateParentPointers(parent);
|
|
2553
2606
|
}
|
|
2554
2607
|
function insertReturn(node) {
|
|
2555
2608
|
if (!node) return;
|
|
@@ -2573,9 +2626,9 @@ ${js}`
|
|
|
2573
2626
|
assert.notEqual(breakIndex, -1, "Could not find break in when clause"), node.children.splice(breakIndex, 1), node.break = void 0;
|
|
2574
2627
|
}
|
|
2575
2628
|
if (insertReturn(node.block), !isExit(node.block)) {
|
|
2576
|
-
let comment = hasTrailingComment(node.block.expressions),
|
|
2629
|
+
let comment = hasTrailingComment(node.block.expressions), ref12;
|
|
2577
2630
|
node.block.expressions.push([
|
|
2578
|
-
comment ? (
|
|
2631
|
+
comment ? (ref12 = node.block.expressions)[ref12.length - 1][0] || `
|
|
2579
2632
|
` : "",
|
|
2580
2633
|
wrapWithReturn(void 0, node, !comment)
|
|
2581
2634
|
]);
|
|
@@ -2593,7 +2646,7 @@ ${js}`
|
|
|
2593
2646
|
return;
|
|
2594
2647
|
let outer = exp;
|
|
2595
2648
|
exp.type === "LabelledStatement" && (exp = exp.statement);
|
|
2596
|
-
let
|
|
2649
|
+
let ref13, m3;
|
|
2597
2650
|
switch (exp.type) {
|
|
2598
2651
|
case "BreakStatement":
|
|
2599
2652
|
case "ContinueStatement":
|
|
@@ -2603,9 +2656,9 @@ ${js}`
|
|
|
2603
2656
|
case "ThrowStatement":
|
|
2604
2657
|
return;
|
|
2605
2658
|
case "Declaration": {
|
|
2606
|
-
let
|
|
2607
|
-
exp.bindings?.length ?
|
|
2608
|
-
let value =
|
|
2659
|
+
let ref14;
|
|
2660
|
+
exp.bindings?.length ? ref14 = [" ", patternAsValue((ref13 = exp.bindings)[ref13.length - 1].pattern)] : ref14 = [];
|
|
2661
|
+
let value = ref14, parent = outer.parent, index = findChildIndex(parent?.expressions, outer);
|
|
2609
2662
|
assert.notEqual(index, -1, "Could not find declaration in parent"), parent.expressions.splice(index + 1, 0, [
|
|
2610
2663
|
"",
|
|
2611
2664
|
{
|
|
@@ -2656,15 +2709,15 @@ ${js}`
|
|
|
2656
2709
|
return;
|
|
2657
2710
|
}
|
|
2658
2711
|
case "SwitchStatement": {
|
|
2659
|
-
for (let
|
|
2660
|
-
let clause =
|
|
2712
|
+
for (let ref15 = exp.caseBlock.clauses, i7 = 0, len6 = ref15.length; i7 < len6; i7++) {
|
|
2713
|
+
let clause = ref15[i7];
|
|
2661
2714
|
insertReturn(clause);
|
|
2662
2715
|
}
|
|
2663
2716
|
return;
|
|
2664
2717
|
}
|
|
2665
2718
|
case "TryStatement": {
|
|
2666
|
-
for (let
|
|
2667
|
-
let block =
|
|
2719
|
+
for (let ref16 = exp.blocks, i8 = 0, len7 = ref16.length; i8 < len7; i8++) {
|
|
2720
|
+
let block = ref16[i8];
|
|
2668
2721
|
insertReturn(block);
|
|
2669
2722
|
}
|
|
2670
2723
|
return;
|
|
@@ -2842,8 +2895,8 @@ ${js}`
|
|
|
2842
2895
|
return !1;
|
|
2843
2896
|
let reduction = statement.type === "ForStatement" && statement.reduction;
|
|
2844
2897
|
function fillBlock(expression) {
|
|
2845
|
-
let
|
|
2846
|
-
return m5 = (
|
|
2898
|
+
let ref17, m5;
|
|
2899
|
+
return m5 = (ref17 = block.expressions)[ref17.length - 1], Array.isArray(m5) && m5.length >= 2 && typeof m5[1] == "object" && m5[1] != null && "type" in m5[1] && m5[1].type === "EmptyStatement" && "implicit" in m5[1] && m5[1].implicit === !0 && block.expressions.pop(), block.expressions.push(expression), block.empty = !1, braceBlock(block);
|
|
2847
2900
|
}
|
|
2848
2901
|
if (reduction)
|
|
2849
2902
|
switch (reduction.subtype) {
|
|
@@ -2889,8 +2942,8 @@ ${js}`
|
|
|
2889
2942
|
function append2(p) {
|
|
2890
2943
|
(rest ? after : before).push(p);
|
|
2891
2944
|
}
|
|
2892
|
-
for (let
|
|
2893
|
-
let param =
|
|
2945
|
+
for (let ref18 = parameters.parameters, i9 = 0, len8 = ref18.length; i9 < len8; i9++) {
|
|
2946
|
+
let param = ref18[i9];
|
|
2894
2947
|
switch (param.type) {
|
|
2895
2948
|
case "ThisType": {
|
|
2896
2949
|
if (tt)
|
|
@@ -2899,7 +2952,7 @@ ${js}`
|
|
|
2899
2952
|
message: "Only one typed this parameter is allowed"
|
|
2900
2953
|
}), append2(param);
|
|
2901
2954
|
else if (tt = trimFirstSpace(param), before.length || rest) {
|
|
2902
|
-
let
|
|
2955
|
+
let ref19, delim = (ref19 = tt.children)[ref19.length - 1];
|
|
2903
2956
|
Array.isArray(delim) && (delim = delim[delim.length - 1]), typeof delim == "object" && delim != null && "token" in delim && delim.token === "," || (tt = {
|
|
2904
2957
|
...tt,
|
|
2905
2958
|
children: [...tt.children, ", "]
|
|
@@ -3028,11 +3081,11 @@ ${js}`
|
|
|
3028
3081
|
for (; m7 = classExpressions[index2 - 1]?.[1], typeof m7 == "object" && m7 != null && "type" in m7 && m7.type === "MethodDefinition" && "name" in m7 && m7.name === "constructor"; )
|
|
3029
3082
|
index2--;
|
|
3030
3083
|
let fStatement = classExpressions[index2];
|
|
3031
|
-
for (let
|
|
3032
|
-
let parameter =
|
|
3084
|
+
for (let ref20 = gatherRecursive(parameters, ($14) => $14.type === "Parameter"), i10 = 0, len9 = ref20.length; i10 < len9; i10++) {
|
|
3085
|
+
let parameter = ref20[i10], { accessModifier } = parameter;
|
|
3033
3086
|
if (accessModifier || parameter.typeSuffix)
|
|
3034
|
-
for (let
|
|
3035
|
-
let binding =
|
|
3087
|
+
for (let ref21 = gatherRecursive(parameter, ($15) => $15.type === "AtBinding"), i11 = 0, len10 = ref21.length; i11 < len10; i11++) {
|
|
3088
|
+
let binding = ref21[i11], typeSuffix = binding.parent?.typeSuffix;
|
|
3036
3089
|
if (!(accessModifier || typeSuffix))
|
|
3037
3090
|
continue;
|
|
3038
3091
|
parameter.accessModifier && (replaceNode(parameter.accessModifier, void 0), parameter.accessModifier = void 0);
|
|
@@ -3058,8 +3111,8 @@ ${js}`
|
|
|
3058
3111
|
bindings: [],
|
|
3059
3112
|
decl: "const"
|
|
3060
3113
|
}));
|
|
3061
|
-
for (let
|
|
3062
|
-
let binding =
|
|
3114
|
+
for (let ref22 = splices, i12 = 0, len11 = ref22.length; i12 < len11; i12++) {
|
|
3115
|
+
let binding = ref22[i12];
|
|
3063
3116
|
assert.equal(binding.type, "PostRestBindingElements", "splice should be of type Binding"), prefix.push(makeNode({
|
|
3064
3117
|
type: "Declaration",
|
|
3065
3118
|
children: ["let ", binding],
|
|
@@ -3097,8 +3150,8 @@ ${js}`
|
|
|
3097
3150
|
if (f.async != null)
|
|
3098
3151
|
f.async.push("async "), signature.modifier.async = !0;
|
|
3099
3152
|
else
|
|
3100
|
-
for (let
|
|
3101
|
-
let a =
|
|
3153
|
+
for (let ref23 = gatherRecursiveWithinFunction(block, ($17) => $17.type === "Await"), i13 = 0, len12 = ref23.length; i13 < len12; i13++) {
|
|
3154
|
+
let a = ref23[i13], i = findChildIndex(a.parent, a);
|
|
3102
3155
|
a.parent.children.splice(i + 1, 0, {
|
|
3103
3156
|
type: "Error",
|
|
3104
3157
|
message: `await invalid in ${signature.modifier.get ? "getter" : signature.modifier.set ? "setter" : signature.name}`
|
|
@@ -3108,8 +3161,8 @@ ${js}`
|
|
|
3108
3161
|
if (f.generator != null)
|
|
3109
3162
|
f.generator.push("*"), signature.modifier.generator = !0;
|
|
3110
3163
|
else
|
|
3111
|
-
for (let
|
|
3112
|
-
let y =
|
|
3164
|
+
for (let ref24 = gatherRecursiveWithinFunction(block, ($18) => $18.type === "YieldExpression"), i14 = 0, len13 = ref24.length; i14 < len13; i14++) {
|
|
3165
|
+
let y = ref24[i14], i = y.children.findIndex(($19) => $19.type === "Yield");
|
|
3113
3166
|
y.children.splice(i + 1, 0, {
|
|
3114
3167
|
type: "Error",
|
|
3115
3168
|
message: `yield invalid in ${f.type === "ArrowFunction" ? "=> arrow function" : signature.modifier.get ? "getter" : signature.modifier.set ? "setter" : signature.name}`
|
|
@@ -3122,8 +3175,8 @@ ${js}`
|
|
|
3122
3175
|
);
|
|
3123
3176
|
}
|
|
3124
3177
|
function processFunctions(statements, config2) {
|
|
3125
|
-
for (let
|
|
3126
|
-
let f =
|
|
3178
|
+
for (let ref25 = gatherRecursiveAll(statements, ($20) => $20.type === "FunctionExpression" || $20.type === "ArrowFunction" || $20.type === "MethodDefinition"), i15 = 0, len14 = ref25.length; i15 < len14; i15++) {
|
|
3179
|
+
let f = ref25[i15];
|
|
3127
3180
|
(f.type === "FunctionExpression" || f.type === "MethodDefinition") && implicitFunctionBlock(f), processSignature(f), processParams(f), processReturn(f, config2.implicitReturns);
|
|
3128
3181
|
}
|
|
3129
3182
|
}
|
|
@@ -3170,17 +3223,17 @@ ${js}`
|
|
|
3170
3223
|
}
|
|
3171
3224
|
let done;
|
|
3172
3225
|
if (!async) {
|
|
3173
|
-
let
|
|
3174
|
-
if ((
|
|
3175
|
-
let { block: parentBlock, index } =
|
|
3226
|
+
let ref26;
|
|
3227
|
+
if ((ref26 = blockContainingStatement(exp)) && typeof ref26 == "object" && "block" in ref26 && "index" in ref26) {
|
|
3228
|
+
let { block: parentBlock, index } = ref26;
|
|
3176
3229
|
statements[0][0] = parentBlock.expressions[index][0], parentBlock.expressions.splice(index, index + 1 - index, ...statements), updateParentPointers(parentBlock), braceBlock(parentBlock), done = !0;
|
|
3177
3230
|
}
|
|
3178
3231
|
}
|
|
3179
3232
|
done || (generator || (statements[statements.length - 1][1] = wrapWithReturn(statements[statements.length - 1][1])), children.splice(i, 1, wrapIIFE(statements, async, generator)), updateParentPointers(exp));
|
|
3180
3233
|
}
|
|
3181
3234
|
function processIterationExpressions(statements) {
|
|
3182
|
-
for (let
|
|
3183
|
-
let s =
|
|
3235
|
+
for (let ref27 = gatherRecursiveAll(statements, ($21) => $21.type === "IterationExpression"), i16 = 0, len15 = ref27.length; i16 < len15; i16++) {
|
|
3236
|
+
let s = ref27[i16];
|
|
3184
3237
|
expressionizeIteration(s);
|
|
3185
3238
|
}
|
|
3186
3239
|
}
|
|
@@ -3196,12 +3249,12 @@ ${js}`
|
|
|
3196
3249
|
let args = [];
|
|
3197
3250
|
if (typeof expression == "object" && expression != null && "type" in expression && expression.type === "ArrowFunction" || typeof expression == "object" && expression != null && "type" in expression && expression.type === "FunctionExpression") {
|
|
3198
3251
|
let { parameters } = expression, parameterList = parameters.parameters, results1 = [];
|
|
3199
|
-
for (let
|
|
3200
|
-
let parameter = parameterList[
|
|
3252
|
+
for (let i17 = 0, len16 = parameterList.length; i17 < len16; i17++) {
|
|
3253
|
+
let parameter = parameterList[i17];
|
|
3201
3254
|
if (typeof parameter == "object" && parameter != null && "type" in parameter && parameter.type === "Parameter") {
|
|
3202
|
-
let
|
|
3203
|
-
if (
|
|
3204
|
-
let initializer =
|
|
3255
|
+
let ref28;
|
|
3256
|
+
if (ref28 = parameter.initializer) {
|
|
3257
|
+
let initializer = ref28;
|
|
3205
3258
|
args.push(initializer.expression, parameter.delim), parameter = {
|
|
3206
3259
|
...parameter,
|
|
3207
3260
|
initializer: void 0,
|
|
@@ -3297,8 +3350,8 @@ ${js}`
|
|
|
3297
3350
|
function unbraceBlock(block) {
|
|
3298
3351
|
if (block.bare)
|
|
3299
3352
|
return;
|
|
3300
|
-
let ref;
|
|
3301
|
-
block.children[0] === " {" && (ref = block.children)[ref.length - 1] === "}" && (block.children.shift(), block.children.pop(), block.bare = !0);
|
|
3353
|
+
let m, ref;
|
|
3354
|
+
m = block.children[0], (m === " {" || m === "{") && (ref = block.children)[ref.length - 1] === "}" && (block.children.shift(), block.children.pop(), block.bare = !0);
|
|
3302
3355
|
}
|
|
3303
3356
|
function duplicateBlock(block) {
|
|
3304
3357
|
let expressions = [...block.expressions], children;
|
|
@@ -3321,17 +3374,6 @@ ${js}`
|
|
|
3321
3374
|
empty: !0
|
|
3322
3375
|
};
|
|
3323
3376
|
}
|
|
3324
|
-
function makeBlockFragment() {
|
|
3325
|
-
let expressions = [];
|
|
3326
|
-
return {
|
|
3327
|
-
type: "BlockStatement",
|
|
3328
|
-
children: expressions,
|
|
3329
|
-
parent: void 0,
|
|
3330
|
-
expressions,
|
|
3331
|
-
bare: !1,
|
|
3332
|
-
root: !1
|
|
3333
|
-
};
|
|
3334
|
-
}
|
|
3335
3377
|
function replaceBlockExpression(node, child, replacement) {
|
|
3336
3378
|
let found = !1, { expressions } = node;
|
|
3337
3379
|
for (let i1 = 0, len3 = expressions.length; i1 < len3; i1++) {
|
|
@@ -3360,17 +3402,25 @@ ${js}`
|
|
|
3360
3402
|
});
|
|
3361
3403
|
}
|
|
3362
3404
|
function insertHoistDec(block, node, dec) {
|
|
3363
|
-
|
|
3405
|
+
insertBeforeInBlock(block, node, ["", dec, ";"]);
|
|
3406
|
+
}
|
|
3407
|
+
function insertBeforeInBlock(block, node, ...statements) {
|
|
3408
|
+
let index = findChildIndex(block.expressions, node);
|
|
3364
3409
|
if (index < 0)
|
|
3365
|
-
throw new Error("
|
|
3366
|
-
|
|
3367
|
-
|
|
3410
|
+
throw new Error("insertBeforeInBlock couldn't find existing statement in block");
|
|
3411
|
+
insertBlockStatements(block, index, ...statements);
|
|
3412
|
+
}
|
|
3413
|
+
function insertBlockStatements(block, index, ...statements) {
|
|
3414
|
+
if (!statements.length)
|
|
3415
|
+
return;
|
|
3416
|
+
let { expressions } = block, before = expressions[index];
|
|
3417
|
+
statements[0][0] && before?.[0] ? (Array.isArray(statements[0][0]) || (statements[0][0] = [statements[0][0]]), Array.isArray(before[0]) || (before[0] = [before[0]]), statements[0][0] = [...before[0], ...statements[0][0]]) : statements[0][0] ||= before?.[0], before[0] = "", expressions.splice(index, 0, ...statements), updateParentPointers(block), braceBlock(block);
|
|
3368
3418
|
}
|
|
3369
3419
|
function processBlocks(statements) {
|
|
3370
3420
|
insertSemicolon(statements);
|
|
3371
3421
|
for (let ref1 = gatherRecursive(statements, ($) => $.type === "BlockStatement"), i2 = 0, len12 = ref1.length; i2 < len12; i2++) {
|
|
3372
|
-
let block = ref1[i2],
|
|
3373
|
-
if (block.unwrapObject && block.expressions.length === 1 && (
|
|
3422
|
+
let block = ref1[i2], m1;
|
|
3423
|
+
if (block.unwrapObject && block.expressions.length === 1 && (m1 = block.expressions[0][1], typeof m1 == "object" && m1 != null && "type" in m1 && m1.type === "ParenthesizedExpression" && "implicit" in m1 && m1.implicit === !0 && "expression" in m1 && typeof m1.expression == "object" && m1.expression != null && "type" in m1.expression && m1.expression.type === "ObjectExpression")) {
|
|
3374
3424
|
let object = block.expressions[0][1].expression;
|
|
3375
3425
|
if (!(() => {
|
|
3376
3426
|
let results = !0;
|
|
@@ -3384,8 +3434,8 @@ ${js}`
|
|
|
3384
3434
|
continue;
|
|
3385
3435
|
block.expressions[0][1] = block.expressions[0][1].expression, unbraceBlock(block);
|
|
3386
3436
|
for (let ref2 = object.properties, i3 = 0, len22 = ref2.length; i3 < len22; i3++) {
|
|
3387
|
-
let i = i3, prop = ref2[i3],
|
|
3388
|
-
|
|
3437
|
+
let i = i3, prop = ref2[i3], m2;
|
|
3438
|
+
m2 = prop.name, typeof m2 == "object" && m2 != null && "type" in m2 && m2.type === "ComputedPropertyName" && "implicit" in m2 && m2.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
3439
|
let colon = prop.children.indexOf(": ");
|
|
3390
3440
|
colon < 0 || prop.children[colon - 1] === prop.name && prop.children.splice(colon - 1, 2);
|
|
3391
3441
|
}
|
|
@@ -3437,8 +3487,8 @@ ${js}`
|
|
|
3437
3487
|
}
|
|
3438
3488
|
}
|
|
3439
3489
|
function blockContainingStatement(exp) {
|
|
3440
|
-
let child = exp, parent = exp.parent,
|
|
3441
|
-
for (; parent != null && (
|
|
3490
|
+
let child = exp, parent = exp.parent, m3;
|
|
3491
|
+
for (; parent != null && (m3 = parent.type, m3 === "StatementExpression" || m3 === "PipelineExpression" || m3 === "UnwrappedExpression"); )
|
|
3442
3492
|
child = parent, parent = parent.parent;
|
|
3443
3493
|
if (parent?.type !== "BlockStatement")
|
|
3444
3494
|
return;
|
|
@@ -4106,22 +4156,15 @@ ${js}`
|
|
|
4106
4156
|
let binding = bindings[i3], { typeSuffix, initializer } = binding;
|
|
4107
4157
|
if (typeSuffix && typeSuffix.optional) {
|
|
4108
4158
|
if (initializer && !typeSuffix.t) {
|
|
4109
|
-
let expression = trimFirstSpace(initializer.expression)
|
|
4110
|
-
if (
|
|
4111
|
-
typeSuffix.children.push(": ", typeSuffix.t = {
|
|
4112
|
-
type: "TypeTypeof",
|
|
4113
|
-
children: ["typeof ", expression],
|
|
4114
|
-
expression
|
|
4115
|
-
});
|
|
4116
|
-
else if (expression.type === "Literal" || expression.type === "RegularExpressionLiteral" || expression.type === "TemplateLiteral")
|
|
4117
|
-
typeSuffix.children.push(": ", typeSuffix.t = literalType(expression));
|
|
4118
|
-
else {
|
|
4159
|
+
let expression = trimFirstSpace(initializer.expression);
|
|
4160
|
+
if (typeSuffix.t = typeOfExpression(expression), typeSuffix.t == null) {
|
|
4119
4161
|
spliceChild(binding, typeSuffix, 1, {
|
|
4120
4162
|
type: "Error",
|
|
4121
|
-
message: `Optional type can only be inferred from literals or member expressions, not ${expression.type}`
|
|
4163
|
+
message: typeof expression == "object" && expression != null && "type" in expression && expression.type === "Literal" && "subtype" in expression && expression.subtype === "NullLiteral" ? "Optional type can't be inferred from null" : typeof expression == "object" && expression != null && "type" in expression && expression.type === "Identifier" && "name" in expression && expression.name === "undefined" ? "Optional type can't be inferred from undefined" : `Optional type can only be inferred from literals or member expressions, not ${expression.type}`
|
|
4122
4164
|
});
|
|
4123
4165
|
continue;
|
|
4124
4166
|
}
|
|
4167
|
+
typeSuffix.children.push(": ", typeSuffix.t);
|
|
4125
4168
|
}
|
|
4126
4169
|
typeSuffix.t ? convertOptionalType(typeSuffix) : (spliceChild(binding, typeSuffix, 1), binding.children.push(initializer = binding.initializer = {
|
|
4127
4170
|
type: "Initializer",
|
|
@@ -4148,9 +4191,9 @@ ${js}`
|
|
|
4148
4191
|
}
|
|
4149
4192
|
function prependStatementExpressionBlock(initializer, statement) {
|
|
4150
4193
|
let { expression: exp } = initializer, ws;
|
|
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"))
|
|
4194
|
+
if (Array.isArray(exp) && exp.length === 2 && isWhitespaceOrEmpty(exp[0]) && (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"))
|
|
4152
4195
|
return;
|
|
4153
|
-
let
|
|
4196
|
+
let statementExp = exp.statement, blockStatement = [ws || "", statementExp, ";"], pre = [blockStatement], ref;
|
|
4154
4197
|
if (statementExp.type === "IterationExpression") {
|
|
4155
4198
|
if (statementExp.async || statementExp.generator)
|
|
4156
4199
|
return;
|
|
@@ -4160,8 +4203,7 @@ ${js}`
|
|
|
4160
4203
|
if (statement2.type === "DoStatement") {
|
|
4161
4204
|
ref = initializer.expression = initializer.children[2] = makeRef(), assignResults(blockStatement, (resultNode) => makeNode({
|
|
4162
4205
|
type: "AssignmentExpression",
|
|
4163
|
-
children: [ref, " = ", resultNode]
|
|
4164
|
-
parent: statement2
|
|
4206
|
+
children: [ref, " = ", resultNode]
|
|
4165
4207
|
}));
|
|
4166
4208
|
let refDec = {
|
|
4167
4209
|
type: "Declaration",
|
|
@@ -4174,8 +4216,7 @@ ${js}`
|
|
|
4174
4216
|
} else {
|
|
4175
4217
|
ref = initializer.expression = initializer.children[2] = makeRef(), assignResults(blockStatement, (resultNode) => makeNode({
|
|
4176
4218
|
type: "AssignmentExpression",
|
|
4177
|
-
children: [ref, " = ", resultNode]
|
|
4178
|
-
parent: statement
|
|
4219
|
+
children: [ref, " = ", resultNode]
|
|
4179
4220
|
}));
|
|
4180
4221
|
let refDec = {
|
|
4181
4222
|
type: "Declaration",
|
|
@@ -4183,7 +4224,11 @@ ${js}`
|
|
|
4183
4224
|
};
|
|
4184
4225
|
pre.unshift(["", refDec, ";"]);
|
|
4185
4226
|
}
|
|
4186
|
-
|
|
4227
|
+
let ref3;
|
|
4228
|
+
if (!((ref3 = blockContainingStatement(statement)) && typeof ref3 == "object" && "block" in ref3 && "index" in ref3))
|
|
4229
|
+
throw new Error("Couldn't find block in prependStatementExpressionBlock");
|
|
4230
|
+
let { block, index } = ref3;
|
|
4231
|
+
return insertBlockStatements(block, index, ...pre), ref;
|
|
4187
4232
|
}
|
|
4188
4233
|
function processDeclarationCondition(condition, rootCondition, parent) {
|
|
4189
4234
|
if (condition.type !== "DeclarationCondition")
|
|
@@ -4260,8 +4305,8 @@ ${js}`
|
|
|
4260
4305
|
if (conditions.length) {
|
|
4261
4306
|
let children = condition.children;
|
|
4262
4307
|
if (s.negated) {
|
|
4263
|
-
let
|
|
4264
|
-
if (
|
|
4308
|
+
let m;
|
|
4309
|
+
if (m = condition.expression, !(typeof m == "object" && m != null && "type" in m && m.type === "UnaryExpression" && "children" in m && Array.isArray(m.children) && len2(m.children, 2) && Array.isArray(m.children[0]) && len2(m.children[0], 1) && m.children[0][0] === "!" && typeof m.children[1] == "object" && m.children[1] != null && "type" in m.children[1] && m.children[1].type === "ParenthesizedExpression"))
|
|
4265
4310
|
throw new Error("Unsupported negated condition");
|
|
4266
4311
|
({ children } = condition.expression.children[1]);
|
|
4267
4312
|
}
|
|
@@ -4285,11 +4330,11 @@ ${js}`
|
|
|
4285
4330
|
if (index < 0)
|
|
4286
4331
|
throw new Error("Couldn't find where in block to put postfix declaration");
|
|
4287
4332
|
ancestor.expressions.splice(index + 1, 0, ...blockPrefix), updateParentPointers(ancestor), braceBlock(ancestor);
|
|
4288
|
-
let
|
|
4333
|
+
let ref4;
|
|
4289
4334
|
switch (s.type) {
|
|
4290
4335
|
case "IfStatement": {
|
|
4291
|
-
if (
|
|
4292
|
-
let elseBlock =
|
|
4336
|
+
if (ref4 = s.else?.block) {
|
|
4337
|
+
let elseBlock = ref4;
|
|
4293
4338
|
elseBlock.bare && !elseBlock.semicolon && elseBlock.children.push(elseBlock.semicolon = ";"), ancestor.expressions.splice(index + 1 + blockPrefix.length, 0, ["", elseBlock]), s.children = s.children.filter((a1) => a1 !== s.else), s.else = void 0;
|
|
4294
4339
|
}
|
|
4295
4340
|
let block = s.then;
|
|
@@ -4324,41 +4369,32 @@ ${js}`
|
|
|
4324
4369
|
let { ref: ref2, statementDeclaration } = condition.expression;
|
|
4325
4370
|
if (!blockPrefix)
|
|
4326
4371
|
return;
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
children: ["(", ref2, ")"],
|
|
4330
|
-
expression: ref2,
|
|
4331
|
-
parent: s
|
|
4332
|
-
};
|
|
4333
|
-
if (s.children = s.children.map(function(c) {
|
|
4334
|
-
return c === s.condition ? newCondition : c;
|
|
4335
|
-
}), s.condition = newCondition, updateParentPointers(s), statementDeclaration) {
|
|
4336
|
-
let block = makeEmptyBlock();
|
|
4337
|
-
replaceBlockExpression(s.parent, s, block), block.expressions.push(["", s]), s.children.splice(s.children.findIndex(($5) => $5.token === "switch"), 0, blockPrefix), s.parent = block;
|
|
4338
|
-
} else {
|
|
4339
|
-
let block = blockWithPrefix([["", [{
|
|
4372
|
+
if (replaceNode(s.condition, parenthesizeExpression(ref2), s), !statementDeclaration) {
|
|
4373
|
+
let declStatement = ["", [{
|
|
4340
4374
|
type: "Declaration",
|
|
4341
4375
|
children: ["let ", ...condition.expression.children]
|
|
4342
|
-
}], ";"]
|
|
4343
|
-
|
|
4376
|
+
}], ";"];
|
|
4377
|
+
blockPrefix.unshift(declStatement);
|
|
4344
4378
|
}
|
|
4379
|
+
let block = blockWithPrefix(blockPrefix, makeEmptyBlock());
|
|
4380
|
+
updateParentPointers(block, s.parent), replaceBlockExpression(s.parent, s, block), block.expressions.push(["", s]), s.parent = block;
|
|
4345
4381
|
break;
|
|
4346
4382
|
}
|
|
4347
4383
|
}
|
|
4348
4384
|
}
|
|
4349
4385
|
function dynamizeFromClause(from) {
|
|
4350
4386
|
from = from.slice(1), from = trimFirstSpace(from);
|
|
4351
|
-
let
|
|
4352
|
-
if (
|
|
4353
|
-
let assert2 =
|
|
4354
|
-
|
|
4387
|
+
let ref5;
|
|
4388
|
+
if (ref5 = from[from.length - 1]?.assertion) {
|
|
4389
|
+
let assert2 = ref5, ref6;
|
|
4390
|
+
ref6 = from[from.length - 1], ref6.children = ref6.children.filter((a2) => a2 !== assert2), from.push(", {", assert2.keyword, ":", assert2.object, "}");
|
|
4355
4391
|
}
|
|
4356
4392
|
return ["(", ...from, ")"];
|
|
4357
4393
|
}
|
|
4358
4394
|
function dynamizeImportDeclaration(decl) {
|
|
4359
|
-
let { imports } = decl, { star, binding, specifiers } = imports, justDefault = binding && !specifiers && !star,
|
|
4360
|
-
binding ? specifiers ?
|
|
4361
|
-
let pattern =
|
|
4395
|
+
let { imports } = decl, { star, binding, specifiers } = imports, justDefault = binding && !specifiers && !star, ref7;
|
|
4396
|
+
binding ? specifiers ? ref7 = makeRef() : ref7 = binding : ref7 = convertNamedImportsToObject(imports, !0);
|
|
4397
|
+
let pattern = ref7, c = "const", expression = [
|
|
4362
4398
|
justDefault ? "(" : void 0,
|
|
4363
4399
|
{ type: "Await", children: ["await"] },
|
|
4364
4400
|
" ",
|
|
@@ -5093,45 +5129,51 @@ ${js}`
|
|
|
5093
5129
|
// unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\auto-dec.civet.jsx
|
|
5094
5130
|
var concatAssign2 = (lhs, rhs) => (rhs?.[Symbol.isConcatSpreadable] ?? Array.isArray(rhs) ? lhs.push.apply(lhs, rhs) : lhs.push(rhs), lhs);
|
|
5095
5131
|
function findDecs(statements) {
|
|
5096
|
-
let declarationNames = gatherNodes(statements, ($) => $.type === "Declaration").flatMap((
|
|
5132
|
+
let declarationNames = gatherNodes(statements, ($) => $.type === "Declaration").flatMap(($1) => $1.names), globals = getConfig().globals || [];
|
|
5097
5133
|
return new Set(globals.concat(declarationNames));
|
|
5098
5134
|
}
|
|
5099
5135
|
function createConstLetDecs(statements, scopes, letOrConst) {
|
|
5100
5136
|
function findVarDecs(statements2, decs) {
|
|
5101
|
-
let declarationNames = gatherRecursive(statements2, (node) => node.type === "Declaration" && node.children && node.children.length > 0 && node.children[0].token && node.children[0].token.startsWith("var") || node.type === "FunctionExpression").filter((
|
|
5137
|
+
let declarationNames = gatherRecursive(statements2, (node) => node.type === "Declaration" && node.children && node.children.length > 0 && node.children[0].token && node.children[0].token.startsWith("var") || node.type === "FunctionExpression").filter(($2) => $2.type === "Declaration").flatMap(($3) => $3.names);
|
|
5102
5138
|
return new Set(declarationNames);
|
|
5103
5139
|
}
|
|
5104
5140
|
let declaredIdentifiers = findVarDecs(statements);
|
|
5105
5141
|
function hasDec(name) {
|
|
5106
|
-
return declaredIdentifiers.has(name) || scopes.some(($
|
|
5142
|
+
return declaredIdentifiers.has(name) || scopes.some(($4) => $4.has(name));
|
|
5107
5143
|
}
|
|
5108
5144
|
function gatherBlockOrOther(statement) {
|
|
5109
|
-
return gatherNodes(statement, (
|
|
5145
|
+
return gatherNodes(statement, ($5) => $5.type === "BlockStatement" || $5.type === "AssignmentExpression" || $5.type === "Declaration").flatMap((node) => node.type === "BlockStatement" ? node.bare ? gatherBlockOrOther(node.expressions) : node : node.children && node.children.length ? [...gatherBlockOrOther(node.children), node] : []);
|
|
5110
5146
|
}
|
|
5111
5147
|
let currentScope = /* @__PURE__ */ new Set();
|
|
5112
5148
|
scopes.push(currentScope);
|
|
5113
|
-
let fnNodes = gatherNodes(statements, isFunction), forNodes = gatherNodes(statements, (
|
|
5114
|
-
for (let
|
|
5115
|
-
let nodes = gatherBlockOrOther(statement), undeclaredIdentifiers = [];
|
|
5116
|
-
for (let
|
|
5117
|
-
|
|
5118
|
-
|
|
5149
|
+
let fnNodes = gatherNodes(statements, isFunction), forNodes = gatherNodes(statements, ($6) => $6.type === "ForStatement"), targetStatements = [];
|
|
5150
|
+
for (let i1 = 0, len3 = statements.length; i1 < len3; i1++) {
|
|
5151
|
+
let statement = statements[i1], nodes = gatherBlockOrOther(statement), undeclaredIdentifiers = [];
|
|
5152
|
+
for (let i2 = 0, len12 = nodes.length; i2 < len12; i2++) {
|
|
5153
|
+
let node = nodes[i2];
|
|
5154
|
+
if (node.type === "BlockStatement") {
|
|
5155
|
+
let block = node, fnNode = fnNodes.find(($7) => $7.block === block), forNode = forNodes.find(($8) => $8.block === block);
|
|
5119
5156
|
fnNode != null ? (scopes.push(new Set(fnNode.parameters.names)), createConstLetDecs(block.expressions, scopes, letOrConst), scopes.pop()) : forNode != null ? (scopes.push(new Set(forNode.declaration.names)), createConstLetDecs(block.expressions, scopes, letOrConst), scopes.pop()) : createConstLetDecs(block.expressions, scopes, letOrConst);
|
|
5120
5157
|
continue;
|
|
5121
5158
|
}
|
|
5122
|
-
if (node.names == null)
|
|
5159
|
+
if (node.names == null)
|
|
5160
|
+
continue;
|
|
5123
5161
|
let names = node.names.filter((name) => !hasDec(name));
|
|
5124
|
-
node.type
|
|
5162
|
+
node.type === "AssignmentExpression" && undeclaredIdentifiers.push(...names);
|
|
5163
|
+
for (let i3 = 0, len22 = names.length; i3 < len22; i3++) {
|
|
5164
|
+
let name = names[i3];
|
|
5165
|
+
currentScope.add(name);
|
|
5166
|
+
}
|
|
5125
5167
|
}
|
|
5126
|
-
if (undeclaredIdentifiers.length
|
|
5127
|
-
let indent = statement[0], firstIdentifier = gatherNodes(statement[1], (
|
|
5128
|
-
if (undeclaredIdentifiers.length
|
|
5168
|
+
if (undeclaredIdentifiers.length) {
|
|
5169
|
+
let indent = statement[0], firstIdentifier = gatherNodes(statement[1], ($9) => $9.type === "Identifier")[0];
|
|
5170
|
+
if (undeclaredIdentifiers.length === 1 && statement[1].type === "AssignmentExpression" && statement[1].names.length === 1 && statement[1].names[0] === undeclaredIdentifiers[0] && firstIdentifier && firstIdentifier.names == undeclaredIdentifiers[0] && gatherNodes(statement[1], ($10) => $10.type === "ObjectBindingPattern").length === 0)
|
|
5129
5171
|
statement[1].children.unshift([`${letOrConst} `]);
|
|
5130
5172
|
else {
|
|
5131
5173
|
let tail = `
|
|
5132
5174
|
`;
|
|
5133
|
-
gatherNodes(indent, (
|
|
5134
|
-
`)).length
|
|
5175
|
+
gatherNodes(indent, ($11) => $11.token && $11.token.endsWith(`
|
|
5176
|
+
`)).length && (tail = void 0), targetStatements.push([indent, {
|
|
5135
5177
|
type: "Declaration",
|
|
5136
5178
|
children: ["let ", ...undeclaredIdentifiers.join(", ")],
|
|
5137
5179
|
names: undeclaredIdentifiers
|
|
@@ -5144,20 +5186,20 @@ ${js}`
|
|
|
5144
5186
|
}
|
|
5145
5187
|
function createVarDecs(block, scopes, pushVar) {
|
|
5146
5188
|
function hasDec(name) {
|
|
5147
|
-
return scopes.some(($
|
|
5189
|
+
return scopes.some(($12) => $12.has(name));
|
|
5148
5190
|
}
|
|
5149
5191
|
function findAssignments(statements2, decs2) {
|
|
5150
|
-
let assignmentStatements2 = gatherNodes(statements2, ($
|
|
5192
|
+
let assignmentStatements2 = gatherNodes(statements2, ($13) => $13.type === "AssignmentExpression");
|
|
5151
5193
|
return assignmentStatements2.length && concatAssign2(
|
|
5152
5194
|
assignmentStatements2,
|
|
5153
5195
|
findAssignments(assignmentStatements2.map((s) => s.children), decs2)
|
|
5154
|
-
), assignmentStatements2.filter(($
|
|
5196
|
+
), assignmentStatements2.filter(($14) => $14.parent?.type !== "CoffeeClassPublic");
|
|
5155
5197
|
}
|
|
5156
5198
|
pushVar ??= (name) => (varIds.push(name), decs.add(name));
|
|
5157
5199
|
let { expressions: statements } = block, decs = findDecs(statements);
|
|
5158
5200
|
scopes.push(decs);
|
|
5159
5201
|
let varIds = [];
|
|
5160
|
-
findAssignments(statements, scopes).flatMap(($
|
|
5202
|
+
findAssignments(statements, scopes).flatMap(($15) => $15?.names || []).filter((x, i, a) => {
|
|
5161
5203
|
if (!hasDec(x)) return a.indexOf(x) === i;
|
|
5162
5204
|
}).forEach(pushVar);
|
|
5163
5205
|
let fnNodes = gatherNodes(statements, isFunction), forNodes = gatherNodes(statements, (s) => s.type === "ForStatement"), blockNodes = new Set(gatherNodes(statements, (s) => s.type === "BlockStatement"));
|
|
@@ -5998,20 +6040,18 @@ ${js}`
|
|
|
5998
6040
|
let exp = ref12[i7];
|
|
5999
6041
|
if (exp.names !== null)
|
|
6000
6042
|
continue;
|
|
6001
|
-
let { lhs: $1, expression: $2 } = exp, tail = [], len3 = $1.length,
|
|
6043
|
+
let { lhs: $1, expression: $2 } = exp, tail = [], len3 = $1.length, ref13, ref14;
|
|
6002
6044
|
if (blockContainingStatement(exp) && !(ref13 = $1[$1.length - 1])?.[ref13.length - 1]?.special && !isShortCircuitOp((ref14 = $1[$1.length - 1])?.[ref14.length - 1])) {
|
|
6003
|
-
block = makeBlockFragment();
|
|
6004
6045
|
let ref15;
|
|
6005
6046
|
if (ref15 = prependStatementExpressionBlock(
|
|
6006
6047
|
{ type: "Initializer", expression: $2, children: [void 0, void 0, $2] },
|
|
6007
|
-
|
|
6048
|
+
exp
|
|
6008
6049
|
)) {
|
|
6009
6050
|
let ref = ref15;
|
|
6010
|
-
|
|
6011
|
-
}
|
|
6012
|
-
block = void 0;
|
|
6051
|
+
replaceNode($2, ref, exp), $2 = ref;
|
|
6052
|
+
}
|
|
6013
6053
|
}
|
|
6014
|
-
if ($1.some(($
|
|
6054
|
+
if ($1.some(($7) => $7[$7.length - 1].special)) {
|
|
6015
6055
|
if ($1.length !== 1) throw new Error("Only one assignment with id= is allowed");
|
|
6016
6056
|
let [, lhs, , op] = $1[0], { call, omitLhs } = op, index = exp.children.indexOf($2);
|
|
6017
6057
|
if (index < 0) throw new Error("Assertion error: exp not in AssignmentExpression");
|
|
@@ -6052,7 +6092,7 @@ ${js}`
|
|
|
6052
6092
|
message: "Slice range cannot be decreasing in assignment"
|
|
6053
6093
|
});
|
|
6054
6094
|
break;
|
|
6055
|
-
} else m3 = lhs.type, (m3 === "ObjectBindingPattern" || m3 === "ArrayBindingPattern" || m3 === "NamedBindingPattern") && (processBindingPatternLHS(lhs, tail), gatherRecursiveAll(lhs, ($
|
|
6095
|
+
} else m3 = lhs.type, (m3 === "ObjectBindingPattern" || m3 === "ArrayBindingPattern" || m3 === "NamedBindingPattern") && (processBindingPatternLHS(lhs, tail), gatherRecursiveAll(lhs, ($8) => $8.type === "Ref").forEach(refsToDeclare.add.bind(refsToDeclare)));
|
|
6056
6096
|
}
|
|
6057
6097
|
i--;
|
|
6058
6098
|
}
|
|
@@ -6073,7 +6113,7 @@ ${js}`
|
|
|
6073
6113
|
}
|
|
6074
6114
|
i--;
|
|
6075
6115
|
}
|
|
6076
|
-
if (refsToDeclare.size && (exp.hoistDec ? exp.hoistDec.children.push([...refsToDeclare].map(($
|
|
6116
|
+
if (refsToDeclare.size && (exp.hoistDec ? exp.hoistDec.children.push([...refsToDeclare].map(($9) => [",", $9])) : exp.hoistDec = {
|
|
6077
6117
|
type: "Declaration",
|
|
6078
6118
|
children: ["let ", [...refsToDeclare].map((r, i2) => i2 ? [",", r] : r)],
|
|
6079
6119
|
names: []
|
|
@@ -6082,7 +6122,6 @@ ${js}`
|
|
|
6082
6122
|
if (index < 0) throw new Error("Assertion error: exp not in AssignmentExpression");
|
|
6083
6123
|
exp.children.splice(index + 1, 0, ...tail);
|
|
6084
6124
|
}
|
|
6085
|
-
block && (replaceNode(exp, block), block.expressions.push(["", exp]), exp.parent = block);
|
|
6086
6125
|
}
|
|
6087
6126
|
}
|
|
6088
6127
|
function unchainOptionalMemberExpression(exp, ref, innerExp) {
|
|
@@ -6143,7 +6182,7 @@ ${js}`
|
|
|
6143
6182
|
}
|
|
6144
6183
|
function processTypes(node) {
|
|
6145
6184
|
let results1 = [];
|
|
6146
|
-
for (let ref17 = gatherRecursiveAll(node, ($
|
|
6185
|
+
for (let ref17 = gatherRecursiveAll(node, ($10) => $10.type === "TypeUnary"), i8 = 0, len7 = ref17.length; i8 < len7; i8++) {
|
|
6147
6186
|
let unary = ref17[i8], suffixIndex = unary.suffix.length - 1, results2 = [];
|
|
6148
6187
|
for (; suffixIndex >= 0; ) {
|
|
6149
6188
|
let suffix = unary.suffix[suffixIndex];
|
|
@@ -6243,7 +6282,7 @@ ${js}`
|
|
|
6243
6282
|
return results1;
|
|
6244
6283
|
}
|
|
6245
6284
|
function processStatementExpressions(statements) {
|
|
6246
|
-
for (let ref19 = gatherRecursiveAll(statements, ($
|
|
6285
|
+
for (let ref19 = gatherRecursiveAll(statements, ($11) => $11.type === "StatementExpression"), i9 = 0, len8 = ref19.length; i9 < len8; i9++) {
|
|
6247
6286
|
let exp = ref19[i9], { maybe, statement } = exp;
|
|
6248
6287
|
if ((maybe || statement.type === "ThrowStatement") && blockContainingStatement(exp)) {
|
|
6249
6288
|
replaceNode(exp, statement);
|
|
@@ -6357,9 +6396,9 @@ ${js}`
|
|
|
6357
6396
|
}
|
|
6358
6397
|
}
|
|
6359
6398
|
function processCoffeeClasses(statements) {
|
|
6360
|
-
for (let ref23 = gatherRecursiveAll(statements, ($
|
|
6399
|
+
for (let ref23 = gatherRecursiveAll(statements, ($12) => $12.type === "ClassExpression"), i11 = 0, len10 = ref23.length; i11 < len10; i11++) {
|
|
6361
6400
|
let ce = ref23[i11], { expressions } = ce.body, indent = expressions[0]?.[0] ?? `
|
|
6362
|
-
`, autoBinds = expressions.filter(($
|
|
6401
|
+
`, autoBinds = expressions.filter(($13) => $13[1]?.autoBind);
|
|
6363
6402
|
if (autoBinds.length) {
|
|
6364
6403
|
let construct;
|
|
6365
6404
|
for (let [, c] of expressions)
|
|
@@ -6403,17 +6442,17 @@ ${js}`
|
|
|
6403
6442
|
})()
|
|
6404
6443
|
);
|
|
6405
6444
|
}
|
|
6406
|
-
let public_static_function_assignments = expressions.filter(($
|
|
6445
|
+
let public_static_function_assignments = expressions.filter(($14) => $14[1]?.type === "CoffeeClassPublic" && $14[1].assignment?.expression?.type === "FunctionExpression").map(($15) => $15[1].assignment);
|
|
6407
6446
|
for (let public_static_function_assignment of public_static_function_assignments) {
|
|
6408
6447
|
let id = public_static_function_assignment.lhs[0][1];
|
|
6409
6448
|
replaceNode(public_static_function_assignment, convertFunctionToMethod(id, public_static_function_assignment.expression));
|
|
6410
6449
|
}
|
|
6411
|
-
let public_static_arrow_function_assignments = expressions.filter(($
|
|
6450
|
+
let public_static_arrow_function_assignments = expressions.filter(($16) => $16[1]?.type === "CoffeeClassPublic" && $16[1].assignment?.expression?.type === "ArrowFunction").map(($17) => $17[1].assignment);
|
|
6412
6451
|
for (let public_static_arrow_function_assignment of public_static_arrow_function_assignments) {
|
|
6413
6452
|
let id = public_static_arrow_function_assignment.lhs[0][1];
|
|
6414
6453
|
replaceNode(public_static_arrow_function_assignment, convertArrowFunctionToMethod(id, public_static_arrow_function_assignment.expression));
|
|
6415
6454
|
}
|
|
6416
|
-
let privates = expressions.filter(($
|
|
6455
|
+
let privates = expressions.filter(($18) => $18[1]?.type === "CoffeeClassPrivate");
|
|
6417
6456
|
if (!privates.length)
|
|
6418
6457
|
continue;
|
|
6419
6458
|
let { parent } = ce;
|
|
@@ -6450,30 +6489,30 @@ ${js}`
|
|
|
6450
6489
|
root.expressions,
|
|
6451
6490
|
root.topLevelAwait,
|
|
6452
6491
|
root.topLevelYield ? "*" : void 0
|
|
6453
|
-
), statements = [["", rootIIFE]], root.children = root.children.map(($
|
|
6492
|
+
), statements = [["", rootIIFE]], root.children = root.children.map(($19) => $19 === root.expressions ? statements : $19), root.expressions = statements), hoistRefDecs(statements), processFunctions(statements, config2), config2.coffeeClasses && processCoffeeClasses(statements), statements.unshift(...extractPreludeFor(statements)), config2.autoLet ? createConstLetDecs(statements, [], "let") : config2.autoConst ? createConstLetDecs(statements, [], "const") : config2.autoVar && createVarDecs(root, []), config2.repl && processRepl(root, rootIIFE), processBlocks(statements), populateRefs(statements), adjustAtBindings(statements), getSync() && processComptime(statements);
|
|
6454
6493
|
}
|
|
6455
6494
|
async function processProgramAsync(root) {
|
|
6456
6495
|
let { expressions: statements } = root;
|
|
6457
6496
|
await processComptime(statements);
|
|
6458
6497
|
}
|
|
6459
6498
|
function processRepl(root, rootIIFE) {
|
|
6460
|
-
let topBlock = gatherRecursive(rootIIFE, ($
|
|
6461
|
-
for (let ref24 = gatherRecursiveWithinFunction(topBlock, ($
|
|
6499
|
+
let topBlock = gatherRecursive(rootIIFE, ($20) => $20.type === "BlockStatement")[0], i = 0;
|
|
6500
|
+
for (let ref24 = gatherRecursiveWithinFunction(topBlock, ($21) => $21.type === "Declaration"), i14 = 0, len12 = ref24.length; i14 < len12; i14++) {
|
|
6462
6501
|
let decl = ref24[i14];
|
|
6463
6502
|
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(",")}`, ";"]));
|
|
6464
6503
|
}
|
|
6465
|
-
for (let ref25 = gatherRecursive(topBlock, ($
|
|
6504
|
+
for (let ref25 = gatherRecursive(topBlock, ($22) => $22.type === "FunctionExpression"), i15 = 0, len13 = ref25.length; i15 < len13; i15++) {
|
|
6466
6505
|
let func = ref25[i15];
|
|
6467
6506
|
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}`, ";"])));
|
|
6468
6507
|
}
|
|
6469
|
-
for (let ref26 = gatherRecursiveWithinFunction(topBlock, ($
|
|
6508
|
+
for (let ref26 = gatherRecursiveWithinFunction(topBlock, ($23) => $23.type === "ClassExpression"), i16 = 0, len14 = ref26.length; i16 < len14; i16++) {
|
|
6470
6509
|
let classExp = ref26[i16], m8;
|
|
6471
6510
|
(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}`, ";"]));
|
|
6472
6511
|
}
|
|
6473
6512
|
}
|
|
6474
6513
|
function processPlaceholders(statements) {
|
|
6475
6514
|
let placeholderMap = /* @__PURE__ */ new Map(), liftedIfs = /* @__PURE__ */ new Set();
|
|
6476
|
-
for (let ref27 = gatherRecursiveAll(statements, ($
|
|
6515
|
+
for (let ref27 = gatherRecursiveAll(statements, ($24) => $24.type === "Placeholder"), i17 = 0, len15 = ref27.length; i17 < len15; i17++) {
|
|
6477
6516
|
let exp = ref27[i17], ancestor;
|
|
6478
6517
|
if (exp.subtype === ".") {
|
|
6479
6518
|
({ ancestor } = findAncestor(
|
|
@@ -6660,7 +6699,7 @@ ${js}`
|
|
|
6660
6699
|
}
|
|
6661
6700
|
lastType = child.type;
|
|
6662
6701
|
}
|
|
6663
|
-
return type.length === 1 ? type[0] : (type = type.flatMap(($
|
|
6702
|
+
return type.length === 1 ? type[0] : (type = type.flatMap(($25) => [$25, ", "]), type.pop(), ["[", type, "]"]);
|
|
6664
6703
|
}
|
|
6665
6704
|
}
|
|
6666
6705
|
|
|
@@ -6720,6 +6759,7 @@ ${js}`
|
|
|
6720
6759
|
Tuple,
|
|
6721
6760
|
NWTypePostfix,
|
|
6722
6761
|
UpdateExpression,
|
|
6762
|
+
UpdateExpressionPattern,
|
|
6723
6763
|
UpdateExpressionSymbol,
|
|
6724
6764
|
AssignmentExpression,
|
|
6725
6765
|
NonPipelineAssignmentExpression,
|
|
@@ -6855,7 +6895,7 @@ ${js}`
|
|
|
6855
6895
|
OperatorPrecedence,
|
|
6856
6896
|
OperatorAssociativity,
|
|
6857
6897
|
ThinArrowFunction,
|
|
6858
|
-
|
|
6898
|
+
ThinArrow,
|
|
6859
6899
|
ExplicitBlock,
|
|
6860
6900
|
EmptyBracedContent,
|
|
6861
6901
|
ImplicitNestedBlock,
|
|
@@ -7515,7 +7555,7 @@ ${js}`
|
|
|
7515
7555
|
Dedented,
|
|
7516
7556
|
PushExtraIndent1
|
|
7517
7557
|
};
|
|
7518
|
-
var $L0 = (0, import_lib2.$L)(""), $L1 = (0, import_lib2.$L)("{"), $L2 = (0, import_lib2.$L)("/ "), $L3 = (0, import_lib2.$L)("="), $L4 = (0, import_lib2.$L)("("), $L5 = (0, import_lib2.$L)("... "), $L6 = (0, import_lib2.$L)("?"), $L7 = (0, import_lib2.$L)("."), $L8 = (0, import_lib2.$L)("tuple"), $L9 = (0, import_lib2.$L)("++"), $L10 = (0, import_lib2.$L)("--"), $L11 = (0, import_lib2.$L)("\u29FA"), $L12 = (0, import_lib2.$L)("\u2014"), $L13 = (0, import_lib2.$L)("=>"), $L14 = (0, import_lib2.$L)("\u21D2"), $L15 = (0, import_lib2.$L)("import"), $L16 = (0, import_lib2.$L)(":"), $L17 = (0, import_lib2.$L)(" "), $L18 = (0, import_lib2.$L)("<"), $L19 = (0, import_lib2.$L)("implements"), $L20 = (0, import_lib2.$L)("<:"), $L21 = (0, import_lib2.$L)("^"), $L22 = (0, import_lib2.$L)("<?"), $L23 = (0, import_lib2.$L)("-"), $L24 = (0, import_lib2.$L)("import.meta"), $L25 = (0, import_lib2.$L)("return.value"), $L26 = (0, import_lib2.$L)(","), $L27 = (0, import_lib2.$L)("tighter"), $L28 = (0, import_lib2.$L)("looser"), $L29 = (0, import_lib2.$L)("same"), $L30 = (0, import_lib2.$L)("left"), $L31 = (0, import_lib2.$L)("right"), $L32 = (0, import_lib2.$L)("non"), $L33 = (0, import_lib2.$L)("relational"), $L34 = (0, import_lib2.$L)("arguments"), $L35 = (0, import_lib2.$L)("->"), $L36 = (0, import_lib2.$L)("\u2192"), $L37 = (0, import_lib2.$L)("}"), $L38 = (0, import_lib2.$L)("null"), $L39 = (0, import_lib2.$L)("true"), $L40 = (0, import_lib2.$L)("false"), $L41 = (0, import_lib2.$L)("yes"), $L42 = (0, import_lib2.$L)("on"), $L43 = (0, import_lib2.$L)("no"), $L44 = (0, import_lib2.$L)("off"), $L45 = (0, import_lib2.$L)(">"), $L46 = (0, import_lib2.$L)("]"), $L47 = (0, import_lib2.$L)("\u2022"), $L48 = (0, import_lib2.$L)("//"), $L49 = (0, import_lib2.$L)("**="), $L50 = (0, import_lib2.$L)("*="), $L51 = (0, import_lib2.$L)("%/"), $L52 = (0, import_lib2.$L)("\xF7"), $L53 = (0, import_lib2.$L)("%%"), $L54 = (0, import_lib2.$L)("/="), $L55 = (0, import_lib2.$L)("%="), $L56 = (0, import_lib2.$L)("+="), $L57 = (0, import_lib2.$L)("-="), $L58 = (0, import_lib2.$L)("<<="), $L59 = (0, import_lib2.$L)("\u226A="), $L60 = (0, import_lib2.$L)(">>>="), $L61 = (0, import_lib2.$L)("\u22D9="), $L62 = (0, import_lib2.$L)(">>="), $L63 = (0, import_lib2.$L)("\u226B="), $L64 = (0, import_lib2.$L)("&&="), $L65 = (0, import_lib2.$L)("&="), $L66 = (0, import_lib2.$L)("^="), $L67 = (0, import_lib2.$L)("||="), $L68 = (0, import_lib2.$L)("\u2016="), $L69 = (0, import_lib2.$L)("|="), $L70 = (0, import_lib2.$L)("??="), $L71 = (0, import_lib2.$L)("\u2047="), $L72 = (0, import_lib2.$L)("?="), $L73 = (0, import_lib2.$L)("and="), $L74 = (0, import_lib2.$L)("or="), $L75 = (0, import_lib2.$L)("*"), $L76 = (0, import_lib2.$L)("**"), $L77 = (0, import_lib2.$L)("/"), $L78 = (0, import_lib2.$L)("%"), $L79 = (0, import_lib2.$L)("+"), $L80 = (0, import_lib2.$L)("<="), $L81 = (0, import_lib2.$L)("\u2264"), $L82 = (0, import_lib2.$L)(">="), $L83 = (0, import_lib2.$L)("\u2265"), $L84 = (0, import_lib2.$L)("!<?"), $L85 = (0, import_lib2.$L)("<<"), $L86 = (0, import_lib2.$L)("\u226A"), $L87 = (0, import_lib2.$L)(">>>"), $L88 = (0, import_lib2.$L)("\u22D9"), $L89 = (0, import_lib2.$L)(">>"), $L90 = (0, import_lib2.$L)("\u226B"), $L91 = (0, import_lib2.$L)("!=="), $L92 = (0, import_lib2.$L)("\u2262"), $L93 = (0, import_lib2.$L)("!="), $L94 = (0, import_lib2.$L)("\u2260"), $L95 = (0, import_lib2.$L)("isnt"), $L96 = (0, import_lib2.$L)("==="), $L97 = (0, import_lib2.$L)("\u2263"), $L98 = (0, import_lib2.$L)("\u2A76"), $L99 = (0, import_lib2.$L)("=="), $L100 = (0, import_lib2.$L)("\u2261"), $L101 = (0, import_lib2.$L)("\u2A75"), $L102 = (0, import_lib2.$L)("and"), $L103 = (0, import_lib2.$L)("&&"), $L104 = (0, import_lib2.$L)("or"), $L105 = (0, import_lib2.$L)("||"), $L106 = (0, import_lib2.$L)("\u2016"), $L107 = (0, import_lib2.$L)("^^"), $L108 = (0, import_lib2.$L)("xor"), $L109 = (0, import_lib2.$L)("xnor"), $L110 = (0, import_lib2.$L)("??"), $L111 = (0, import_lib2.$L)("\u2047"), $L112 = (0, import_lib2.$L)("instanceof"), $L113 = (0, import_lib2.$L)("\u2208"), $L114 = (0, import_lib2.$L)("\u220B"), $L115 = (0, import_lib2.$L)("\u220C"), $L116 = (0, import_lib2.$L)("\u2209"), $L117 = (0, import_lib2.$L)("&"), $L118 = (0, import_lib2.$L)("|"), $L119 = (0, import_lib2.$L)(";"), $L120 = (0, import_lib2.$L)("some"), $L121 = (0, import_lib2.$L)("every"), $L122 = (0, import_lib2.$L)("count"), $L123 = (0, import_lib2.$L)("first"), $L124 = (0, import_lib2.$L)("sum"), $L125 = (0, import_lib2.$L)("product"), $L126 = (0, import_lib2.$L)("min"), $L127 = (0, import_lib2.$L)("max"), $L128 = (0, import_lib2.$L)("join"), $L129 = (0, import_lib2.$L)("concat"), $L130 = (0, import_lib2.$L)("break"), $L131 = (0, import_lib2.$L)("continue"), $L132 = (0, import_lib2.$L)("debugger"), $L133 = (0, import_lib2.$L)("require"), $L134 = (0, import_lib2.$L)("with"), $L135 = (0, import_lib2.$L)("assert"), $L136 = (0, import_lib2.$L)(":="), $L137 = (0, import_lib2.$L)("\u2254"), $L138 = (0, import_lib2.$L)(".="), $L139 = (0, import_lib2.$L)("::="), $L140 = (0, import_lib2.$L)("/*"), $L141 = (0, import_lib2.$L)("*/"), $L142 = (0, import_lib2.$L)("\\"), $L143 = (0, import_lib2.$L)(")"), $L144 = (0, import_lib2.$L)("abstract"), $L145 = (0, import_lib2.$L)("as"), $L146 = (0, import_lib2.$L)("@"), $L147 = (0, import_lib2.$L)("@@"), $L148 = (0, import_lib2.$L)("async"), $L149 = (0, import_lib2.$L)("await"), $L150 = (0, import_lib2.$L)("`"), $L151 = (0, import_lib2.$L)("by"), $L152 = (0, import_lib2.$L)("case"), $L153 = (0, import_lib2.$L)("catch"), $L154 = (0, import_lib2.$L)("class"), $L155 = (0, import_lib2.$L)("#{"), $L156 = (0, import_lib2.$L)("comptime"), $L157 = (0, import_lib2.$L)("declare"), $L158 = (0, import_lib2.$L)("default"), $L159 = (0, import_lib2.$L)("delete"), $L160 = (0, import_lib2.$L)("do"), $L161 = (0, import_lib2.$L)(".."), $L162 = (0, import_lib2.$L)("\u2025"), $L163 = (0, import_lib2.$L)("..."), $L164 = (0, import_lib2.$L)("\u2026"), $L165 = (0, import_lib2.$L)("::"), $L166 = (0, import_lib2.$L)('"'), $L167 = (0, import_lib2.$L)("each"), $L168 = (0, import_lib2.$L)("else"), $L169 = (0, import_lib2.$L)("!"), $L170 = (0, import_lib2.$L)("export"), $L171 = (0, import_lib2.$L)("extends"), $L172 = (0, import_lib2.$L)("finally"), $L173 = (0, import_lib2.$L)("for"), $L174 = (0, import_lib2.$L)("from"), $L175 = (0, import_lib2.$L)("function"), $L176 = (0, import_lib2.$L)("get"), $L177 = (0, import_lib2.$L)("set"), $L178 = (0, import_lib2.$L)("#"), $L179 = (0, import_lib2.$L)("if"), $L180 = (0, import_lib2.$L)("in"), $L181 = (0, import_lib2.$L)("infer"), $L182 = (0, import_lib2.$L)("let"), $L183 = (0, import_lib2.$L)("const"), $L184 = (0, import_lib2.$L)("is"), $L185 = (0, import_lib2.$L)("var"), $L186 = (0, import_lib2.$L)("like"), $L187 = (0, import_lib2.$L)("loop"), $L188 = (0, import_lib2.$L)("new"), $L189 = (0, import_lib2.$L)("not"), $L190 = (0, import_lib2.$L)("of"), $L191 = (0, import_lib2.$L)("["), $L192 = (0, import_lib2.$L)("operator"), $L193 = (0, import_lib2.$L)("override"), $L194 = (0, import_lib2.$L)("own"), $L195 = (0, import_lib2.$L)("public"), $L196 = (0, import_lib2.$L)("private"), $L197 = (0, import_lib2.$L)("protected"), $L198 = (0, import_lib2.$L)("||>"), $L199 = (0, import_lib2.$L)("|\u25B7"), $L200 = (0, import_lib2.$L)("|>="), $L201 = (0, import_lib2.$L)("\u25B7="), $L202 = (0, import_lib2.$L)("|>"), $L203 = (0, import_lib2.$L)("\u25B7"), $L204 = (0, import_lib2.$L)("readonly"), $L205 = (0, import_lib2.$L)("return"), $L206 = (0, import_lib2.$L)("satisfies"), $L207 = (0, import_lib2.$L)("'"), $L208 = (0, import_lib2.$L)("static"), $L209 = (0, import_lib2.$L)("${"), $L210 = (0, import_lib2.$L)("super"), $L211 = (0, import_lib2.$L)("switch"), $L212 = (0, import_lib2.$L)("target"), $L213 = (0, import_lib2.$L)("then"), $L214 = (0, import_lib2.$L)("this"), $L215 = (0, import_lib2.$L)("throw"), $L216 = (0, import_lib2.$L)('"""'), $L217 = (0, import_lib2.$L)("'''"), $L218 = (0, import_lib2.$L)("///"), $L219 = (0, import_lib2.$L)("```"), $L220 = (0, import_lib2.$L)("try"), $L221 = (0, import_lib2.$L)("typeof"), $L222 = (0, import_lib2.$L)("undefined"), $L223 = (0, import_lib2.$L)("unless"), $L224 = (0, import_lib2.$L)("until"), $L225 = (0, import_lib2.$L)("using"), $L226 = (0, import_lib2.$L)("void"), $L227 = (0, import_lib2.$L)("when"), $L228 = (0, import_lib2.$L)("while"), $L229 = (0, import_lib2.$L)("yield"), $L230 = (0, import_lib2.$L)("/>"), $L231 = (0, import_lib2.$L)("</"), $L232 = (0, import_lib2.$L)("<>"), $L233 = (0, import_lib2.$L)("</>"), $L234 = (0, import_lib2.$L)("<!--"), $L235 = (0, import_lib2.$L)("-->"), $L236 = (0, import_lib2.$L)("type"), $L237 = (0, import_lib2.$L)("enum"), $L238 = (0, import_lib2.$L)("interface"), $L239 = (0, import_lib2.$L)("global"), $L240 = (0, import_lib2.$L)("module"), $L241 = (0, import_lib2.$L)("namespace"), $L242 = (0, import_lib2.$L)("asserts"), $L243 = (0, import_lib2.$L)("keyof"), $L244 = (0, import_lib2.$L)("???"), $L245 = (0, import_lib2.$L)("unique"), $L246 = (0, import_lib2.$L)("symbol"), $L247 = (0, import_lib2.$L)("[]"), $L248 = (0, import_lib2.$L)("civet"), $R0 = (0, import_lib2.$R)(new RegExp("(?=async|debugger|if|unless|comptime|do|for|loop|until|while|switch|throw|try)", "suy")), $R1 = (0, import_lib2.$R)(new RegExp("&(?=\\s)", "suy")), $R2 = (0, import_lib2.$R)(new RegExp("(as|of|by|satisfies|then|when|implements|xor|xnor)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy")), $R3 = (0, import_lib2.$R)(new RegExp("[0-9]", "suy")), $R4 = (0, import_lib2.$R)(new RegExp("(?!\\p{ID_Start}|[_$0-9(\\[{])", "suy")), $R5 = (0, import_lib2.$R)(new RegExp("[ \\t]", "suy")), $R6 = (0, import_lib2.$R)(new RegExp("\\p{ID_Continue}|[\\u200C\\u200D$.#{=]", "suy")), $R7 = (0, import_lib2.$R)(new RegExp("[&=]", "suy")), $R8 = (0, import_lib2.$R)(new RegExp("(?=['\"`])", "suy")), $R9 = (0, import_lib2.$R)(new RegExp("(?=[\\/?])", "suy")), $R10 = (0, import_lib2.$R)(new RegExp("(?=[\\/\\[{?.!@#'\u2019:])", "suy")), $R11 = (0, import_lib2.$R)(new RegExp("%%?", "suy")), $R12 = (0, import_lib2.$R)(new RegExp("[.\\s]", "suy")), $R13 = (0, import_lib2.$R)(new RegExp("[)\\]}]", "suy")), $R14 = (0, import_lib2.$R)(new RegExp("[+-]", "suy")), $R15 = (0, import_lib2.$R)(new RegExp("\\+\\+|--|\u29FA|\u2014|[\\+\\-&]\\S", "suy")), $R16 = (0, import_lib2.$R)(new RegExp(`(?=[0-9.'"tfyno])`, "suy")), $R17 = (0, import_lib2.$R)(new RegExp("(?=true|false|yes|no|on|off)", "suy")), $R18 = (0, import_lib2.$R)(new RegExp("(?=\\p{ID_Start}|[_$])", "suy")), $R19 = (0, import_lib2.$R)(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$])*", "suy")), $R20 = (0, import_lib2.$R)(new RegExp("(?=\\[|\\s*[.\u2022\\/])", "suy")), $R21 = (0, import_lib2.$R)(new RegExp("([<>])(=?)|([\u2264\u2265])", "suy")), $R22 = (0, import_lib2.$R)(new RegExp("[ \\t]*", "suy")), $R23 = (0, import_lib2.$R)(new RegExp("[ \\t]+", "suy")), $R24 = (0, import_lib2.$R)(new RegExp("[!+-]?", "suy")), $R25 = (0, import_lib2.$R)(new RegExp("(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*", "suy")), $R26 = (0, import_lib2.$R)(new RegExp("[=>]", "suy")), $R27 = (0, import_lib2.$R)(new RegExp("(?=\\p{ID_Start}|[_$^\u226A\u226B\u22D9\u2264\u2265\u2208\u220B\u2209\u220C\u2263\u2261\u2262\u2260=\u2A76\u2A75\u2016\u2047&|*\\/!?%\xF7<>\u29FA+-])", "suy")), $R28 = (0, import_lib2.$R)(new RegExp("!\\^\\^?", "suy")), $R29 = (0, import_lib2.$R)(new RegExp("(?!\\+\\+|--)[!~+-](?!\\s)", "suy")), $R30 = (0, import_lib2.$R)(new RegExp("[:.]", "suy")), $R31 = (0, import_lib2.$R)(new RegExp("(?=for|if|loop|unless|until|while)", "suy")), $R32 = (0, import_lib2.$R)(new RegExp("(?:loop|while|until|for|do)(?!\\p{ID_Continue})", "suy")), $R33 = (0, import_lib2.$R)(new RegExp("(?=loop|comptime|do|for|until|while)", "suy")), $R34 = (0, import_lib2.$R)(new RegExp('[^;"\\s=>]+', "suy")), $R35 = (0, import_lib2.$R)(new RegExp("(?=[0-9.])", "suy")), $R36 = (0, import_lib2.$R)(new RegExp("(?:0|[1-9](?:_[0-9]|[0-9])*)n", "suy")), $R37 = (0, import_lib2.$R)(new RegExp("(?:0|[1-9](?:_[0-9]|[0-9])*)(?=\\.(?:\\p{ID_Start}|[_$]))", "suy")), $R38 = (0, import_lib2.$R)(new RegExp("(?:0|[1-9](?:_[0-9]|[0-9])*)(?:\\.(?:[0-9](?:_[0-9]|[0-9])*))?", "suy")), $R39 = (0, import_lib2.$R)(new RegExp("(?:\\.[0-9](?:_[0-9]|[0-9])*)", "suy")), $R40 = (0, import_lib2.$R)(new RegExp("(?:[eE][+-]?[0-9]+(?:_[0-9]|[0-9])*)", "suy")), $R41 = (0, import_lib2.$R)(new RegExp("0[bB][01](?:[01]|_[01])*n?", "suy")), $R42 = (0, import_lib2.$R)(new RegExp("0[oO][0-7](?:[0-7]|_[0-7])*n?", "suy")), $R43 = (0, import_lib2.$R)(new RegExp("0[xX][0-9a-fA-F](?:[0-9a-fA-F]|_[0-9a-fA-F])*n?", "suy")), $R44 = (0, import_lib2.$R)(new RegExp("(?=[0-9])", "suy")), $R45 = (0, import_lib2.$R)(new RegExp("(?:0|[1-9](?:_[0-9]|[0-9])*)", "suy")), $R46 = (0, import_lib2.$R)(new RegExp('(?:\\\\.|[^"])*', "suy")), $R47 = (0, import_lib2.$R)(new RegExp("(?:\\\\.|[^'])*", "suy")), $R48 = (0, import_lib2.$R)(new RegExp('(?:"(?!"")|#(?!\\{)|\\\\.|[^#"])+', "suy")), $R49 = (0, import_lib2.$R)(new RegExp('(?:"(?!"")|\\\\.|[^"])+', "suy")), $R50 = (0, import_lib2.$R)(new RegExp("(?:'(?!'')|\\\\.|[^'])*", "suy")), $R51 = (0, import_lib2.$R)(new RegExp('(?:\\\\.|#(?!\\{)|[^"#])+', "suy")), $R52 = (0, import_lib2.$R)(new RegExp("(?:\\\\.|[^\\]])*", "suy")), $R53 = (0, import_lib2.$R)(new RegExp("(?:\\\\.)", "suy")), $R54 = (0, import_lib2.$R)(new RegExp("[\\s]+", "suy")), $R55 = (0, import_lib2.$R)(new RegExp("\\/(?!\\/\\/)", "suy")), $R56 = (0, import_lib2.$R)(new RegExp("[^[\\/\\s#$\\\\]+|[#$]", "suy")), $R57 = (0, import_lib2.$R)(new RegExp("[*\\/\\r\\n]", "suy")), $R58 = (0, import_lib2.$R)(new RegExp("(?:\\\\.|[^[\\/\\r\\n])+", "suy")), $R59 = (0, import_lib2.$R)(new RegExp("(?:\\p{ID_Continue}|[\\u200C\\u200D$])*", "suy")), $R60 = (0, import_lib2.$R)(new RegExp("(?=[`'\"])", "suy")), $R61 = (0, import_lib2.$R)(new RegExp("(?:\\$(?!\\{)|\\\\.|[^$`])+", "suy")), $R62 = (0, import_lib2.$R)(new RegExp("(?:\\$(?!\\{)|`(?!``)|\\\\.|[^$`])+", "suy")), $R63 = (0, import_lib2.$R)(new RegExp("(?:on|off|yes|no)(?!\\p{ID_Continue})", "suy")), $R64 = (0, import_lib2.$R)(new RegExp("(?:isnt)(?!\\p{ID_Continue})", "suy")), $R65 = (0, import_lib2.$R)(new RegExp("(?:by)(?!\\p{ID_Continue})", "suy")), $R66 = (0, import_lib2.$R)(new RegExp("(?:of)(?!\\p{ID_Continue})", "suy")), $R67 = (0, import_lib2.$R)(new RegExp("(?:and|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|function|if|import|in|instanceof|interface|is|let|loop|new|not|null|or|private|protected|public|return|static|super|switch|this|throw|true|try|typeof|unless|until|var|void|while|with|yield)(?!\\p{ID_Continue})", "suy")), $R68 = (0, import_lib2.$R)(new RegExp("(?=\\/|#)", "suy")), $R69 = (0, import_lib2.$R)(new RegExp("\\/\\/(?!\\/)[^\\r\\n]*", "suy")), $R70 = (0, import_lib2.$R)(new RegExp(".", "suy")), $R71 = (0, import_lib2.$R)(new RegExp("#(?!##(?!#))([^\\r\\n]*)", "suy")), $R72 = (0, import_lib2.$R)(new RegExp("[^]*?###", "suy")), $R73 = (0, import_lib2.$R)(new RegExp("###(?!#)", "suy")), $R74 = (0, import_lib2.$R)(new RegExp("\\/\\*(?:(?!\\*\\/)[^\\r\\n])*\\*\\/", "suy")), $R75 = (0, import_lib2.$R)(new RegExp("(?=[ \\t\\/\\\\])", "suy")), $R76 = (0, import_lib2.$R)(new RegExp("(?=\\s|\\/|#)", "suy")), $R77 = (0, import_lib2.$R)(new RegExp("(?!\\p{ID_Continue})", "suy")), $R78 = (0, import_lib2.$R)(new RegExp("[=:]", "suy")), $R79 = (0, import_lib2.$R)(new RegExp("['\u2019]s", "suy")), $R80 = (0, import_lib2.$R)(new RegExp("\\s", "suy")), $R81 = (0, import_lib2.$R)(new RegExp("(?=[<])", "suy")), $R82 = (0, import_lib2.$R)(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*", "suy")), $R83 = (0, import_lib2.$R)(new RegExp("[!+-]", "suy")), $R84 = (0, import_lib2.$R)(new RegExp("[\\s>]|\\/>", "suy")), $R85 = (0, import_lib2.$R)(new RegExp("(?:[\\w\\-:]+|\\([^()]*\\)|\\[[^\\[\\]]*\\])+", "suy")), $R86 = (0, import_lib2.$R)(new RegExp(`"[^"]*"|'[^']*'`, "suy")), $R87 = (0, import_lib2.$R)(new RegExp("[<>]", "suy")), $R88 = (0, import_lib2.$R)(new RegExp("[!~+-](?!\\s|[!~+-]*&)", "suy")), $R89 = (0, import_lib2.$R)(new RegExp("(?:-[^-]|[^-]*)*", "suy")), $R90 = (0, import_lib2.$R)(new RegExp("[^{}<>\\r\\n]+", "suy")), $R91 = (0, import_lib2.$R)(new RegExp("[+-]?", "suy")), $R92 = (0, import_lib2.$R)(new RegExp("(?=if|unless)", "suy")), $R93 = (0, import_lib2.$R)(new RegExp("[|&<!=\\-\u21D2\u2192]", "suy")), $R94 = (0, import_lib2.$R)(new RegExp("(extends|not|is)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy")), $R95 = (0, import_lib2.$R)(new RegExp("const|in|out", "suy")), $R96 = (0, import_lib2.$R)(new RegExp("#![^\\r\\n]*", "suy")), $R97 = (0, import_lib2.$R)(new RegExp("[\\t ]*", "suy")), $R98 = (0, import_lib2.$R)(new RegExp("[\\s]*", "suy")), $R99 = (0, import_lib2.$R)(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([\\p{ID_Continue}.,+-]*))?", "suy")), $R100 = (0, import_lib2.$R)(new RegExp("\\/\\/\\/[^\\r\\n]*", "suy")), $R101 = (0, import_lib2.$R)(new RegExp("(?=[ \\t\\r\\n\\/#]|$)", "suy")), $R102 = (0, import_lib2.$R)(new RegExp("\\r\\n|\\n|\\r|$", "suy")), $R103 = (0, import_lib2.$R)(new RegExp("[^]*", "suy")), Program$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(Reset, Init, (0, import_lib2.$E)(EOS), TopLevelStatements, __), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
7558
|
+
var $L0 = (0, import_lib2.$L)(""), $L1 = (0, import_lib2.$L)("{"), $L2 = (0, import_lib2.$L)("/ "), $L3 = (0, import_lib2.$L)("="), $L4 = (0, import_lib2.$L)("("), $L5 = (0, import_lib2.$L)("... "), $L6 = (0, import_lib2.$L)("?"), $L7 = (0, import_lib2.$L)("."), $L8 = (0, import_lib2.$L)("tuple"), $L9 = (0, import_lib2.$L)("++"), $L10 = (0, import_lib2.$L)("--"), $L11 = (0, import_lib2.$L)("\u29FA"), $L12 = (0, import_lib2.$L)("\u2014"), $L13 = (0, import_lib2.$L)("=>"), $L14 = (0, import_lib2.$L)("\u21D2"), $L15 = (0, import_lib2.$L)("import"), $L16 = (0, import_lib2.$L)(":"), $L17 = (0, import_lib2.$L)(" "), $L18 = (0, import_lib2.$L)("<"), $L19 = (0, import_lib2.$L)("implements"), $L20 = (0, import_lib2.$L)("<:"), $L21 = (0, import_lib2.$L)("^"), $L22 = (0, import_lib2.$L)("<?"), $L23 = (0, import_lib2.$L)("-"), $L24 = (0, import_lib2.$L)("import.meta"), $L25 = (0, import_lib2.$L)("return.value"), $L26 = (0, import_lib2.$L)(","), $L27 = (0, import_lib2.$L)("tighter"), $L28 = (0, import_lib2.$L)("looser"), $L29 = (0, import_lib2.$L)("same"), $L30 = (0, import_lib2.$L)("left"), $L31 = (0, import_lib2.$L)("right"), $L32 = (0, import_lib2.$L)("non"), $L33 = (0, import_lib2.$L)("relational"), $L34 = (0, import_lib2.$L)("arguments"), $L35 = (0, import_lib2.$L)("->"), $L36 = (0, import_lib2.$L)("\u2192"), $L37 = (0, import_lib2.$L)("}"), $L38 = (0, import_lib2.$L)("null"), $L39 = (0, import_lib2.$L)("true"), $L40 = (0, import_lib2.$L)("false"), $L41 = (0, import_lib2.$L)("yes"), $L42 = (0, import_lib2.$L)("on"), $L43 = (0, import_lib2.$L)("no"), $L44 = (0, import_lib2.$L)("off"), $L45 = (0, import_lib2.$L)(">"), $L46 = (0, import_lib2.$L)("]"), $L47 = (0, import_lib2.$L)("\u2022"), $L48 = (0, import_lib2.$L)("//"), $L49 = (0, import_lib2.$L)("**="), $L50 = (0, import_lib2.$L)("*="), $L51 = (0, import_lib2.$L)("%/"), $L52 = (0, import_lib2.$L)("\xF7"), $L53 = (0, import_lib2.$L)("%%"), $L54 = (0, import_lib2.$L)("/="), $L55 = (0, import_lib2.$L)("%="), $L56 = (0, import_lib2.$L)("+="), $L57 = (0, import_lib2.$L)("-="), $L58 = (0, import_lib2.$L)("<<="), $L59 = (0, import_lib2.$L)("\u226A="), $L60 = (0, import_lib2.$L)(">>>="), $L61 = (0, import_lib2.$L)("\u22D9="), $L62 = (0, import_lib2.$L)(">>="), $L63 = (0, import_lib2.$L)("\u226B="), $L64 = (0, import_lib2.$L)("&&="), $L65 = (0, import_lib2.$L)("&="), $L66 = (0, import_lib2.$L)("^="), $L67 = (0, import_lib2.$L)("||="), $L68 = (0, import_lib2.$L)("\u2016="), $L69 = (0, import_lib2.$L)("|="), $L70 = (0, import_lib2.$L)("??="), $L71 = (0, import_lib2.$L)("\u2047="), $L72 = (0, import_lib2.$L)("?="), $L73 = (0, import_lib2.$L)("and="), $L74 = (0, import_lib2.$L)("or="), $L75 = (0, import_lib2.$L)("*"), $L76 = (0, import_lib2.$L)("**"), $L77 = (0, import_lib2.$L)("/"), $L78 = (0, import_lib2.$L)("%"), $L79 = (0, import_lib2.$L)("+"), $L80 = (0, import_lib2.$L)("<="), $L81 = (0, import_lib2.$L)("\u2264"), $L82 = (0, import_lib2.$L)(">="), $L83 = (0, import_lib2.$L)("\u2265"), $L84 = (0, import_lib2.$L)("!<?"), $L85 = (0, import_lib2.$L)("<<"), $L86 = (0, import_lib2.$L)("\u226A"), $L87 = (0, import_lib2.$L)(">>>"), $L88 = (0, import_lib2.$L)("\u22D9"), $L89 = (0, import_lib2.$L)(">>"), $L90 = (0, import_lib2.$L)("\u226B"), $L91 = (0, import_lib2.$L)("!=="), $L92 = (0, import_lib2.$L)("\u2262"), $L93 = (0, import_lib2.$L)("!="), $L94 = (0, import_lib2.$L)("\u2260"), $L95 = (0, import_lib2.$L)("isnt"), $L96 = (0, import_lib2.$L)("==="), $L97 = (0, import_lib2.$L)("\u2263"), $L98 = (0, import_lib2.$L)("\u2A76"), $L99 = (0, import_lib2.$L)("=="), $L100 = (0, import_lib2.$L)("\u2261"), $L101 = (0, import_lib2.$L)("\u2A75"), $L102 = (0, import_lib2.$L)("and"), $L103 = (0, import_lib2.$L)("&&"), $L104 = (0, import_lib2.$L)("or"), $L105 = (0, import_lib2.$L)("||"), $L106 = (0, import_lib2.$L)("\u2016"), $L107 = (0, import_lib2.$L)("^^"), $L108 = (0, import_lib2.$L)("xor"), $L109 = (0, import_lib2.$L)("xnor"), $L110 = (0, import_lib2.$L)("??"), $L111 = (0, import_lib2.$L)("\u2047"), $L112 = (0, import_lib2.$L)("instanceof"), $L113 = (0, import_lib2.$L)("\u2208"), $L114 = (0, import_lib2.$L)("\u220B"), $L115 = (0, import_lib2.$L)("\u220C"), $L116 = (0, import_lib2.$L)("\u2209"), $L117 = (0, import_lib2.$L)("&"), $L118 = (0, import_lib2.$L)("|"), $L119 = (0, import_lib2.$L)(";"), $L120 = (0, import_lib2.$L)("some"), $L121 = (0, import_lib2.$L)("every"), $L122 = (0, import_lib2.$L)("count"), $L123 = (0, import_lib2.$L)("first"), $L124 = (0, import_lib2.$L)("sum"), $L125 = (0, import_lib2.$L)("product"), $L126 = (0, import_lib2.$L)("min"), $L127 = (0, import_lib2.$L)("max"), $L128 = (0, import_lib2.$L)("join"), $L129 = (0, import_lib2.$L)("concat"), $L130 = (0, import_lib2.$L)("break"), $L131 = (0, import_lib2.$L)("continue"), $L132 = (0, import_lib2.$L)("debugger"), $L133 = (0, import_lib2.$L)("require"), $L134 = (0, import_lib2.$L)("with"), $L135 = (0, import_lib2.$L)("assert"), $L136 = (0, import_lib2.$L)(":="), $L137 = (0, import_lib2.$L)("\u2254"), $L138 = (0, import_lib2.$L)(".="), $L139 = (0, import_lib2.$L)("::="), $L140 = (0, import_lib2.$L)("/*"), $L141 = (0, import_lib2.$L)("*/"), $L142 = (0, import_lib2.$L)("\\"), $L143 = (0, import_lib2.$L)(")"), $L144 = (0, import_lib2.$L)("abstract"), $L145 = (0, import_lib2.$L)("as"), $L146 = (0, import_lib2.$L)("@"), $L147 = (0, import_lib2.$L)("@@"), $L148 = (0, import_lib2.$L)("async"), $L149 = (0, import_lib2.$L)("await"), $L150 = (0, import_lib2.$L)("`"), $L151 = (0, import_lib2.$L)("by"), $L152 = (0, import_lib2.$L)("case"), $L153 = (0, import_lib2.$L)("catch"), $L154 = (0, import_lib2.$L)("class"), $L155 = (0, import_lib2.$L)("#{"), $L156 = (0, import_lib2.$L)("comptime"), $L157 = (0, import_lib2.$L)("declare"), $L158 = (0, import_lib2.$L)("default"), $L159 = (0, import_lib2.$L)("delete"), $L160 = (0, import_lib2.$L)("do"), $L161 = (0, import_lib2.$L)(".."), $L162 = (0, import_lib2.$L)("\u2025"), $L163 = (0, import_lib2.$L)("..."), $L164 = (0, import_lib2.$L)("\u2026"), $L165 = (0, import_lib2.$L)("::"), $L166 = (0, import_lib2.$L)('"'), $L167 = (0, import_lib2.$L)("each"), $L168 = (0, import_lib2.$L)("else"), $L169 = (0, import_lib2.$L)("!"), $L170 = (0, import_lib2.$L)("export"), $L171 = (0, import_lib2.$L)("extends"), $L172 = (0, import_lib2.$L)("finally"), $L173 = (0, import_lib2.$L)("for"), $L174 = (0, import_lib2.$L)("from"), $L175 = (0, import_lib2.$L)("function"), $L176 = (0, import_lib2.$L)("get"), $L177 = (0, import_lib2.$L)("set"), $L178 = (0, import_lib2.$L)("#"), $L179 = (0, import_lib2.$L)("if"), $L180 = (0, import_lib2.$L)("in"), $L181 = (0, import_lib2.$L)("infer"), $L182 = (0, import_lib2.$L)("let"), $L183 = (0, import_lib2.$L)("const"), $L184 = (0, import_lib2.$L)("is"), $L185 = (0, import_lib2.$L)("var"), $L186 = (0, import_lib2.$L)("like"), $L187 = (0, import_lib2.$L)("loop"), $L188 = (0, import_lib2.$L)("new"), $L189 = (0, import_lib2.$L)("not"), $L190 = (0, import_lib2.$L)("of"), $L191 = (0, import_lib2.$L)("["), $L192 = (0, import_lib2.$L)("operator"), $L193 = (0, import_lib2.$L)("override"), $L194 = (0, import_lib2.$L)("own"), $L195 = (0, import_lib2.$L)("public"), $L196 = (0, import_lib2.$L)("private"), $L197 = (0, import_lib2.$L)("protected"), $L198 = (0, import_lib2.$L)("||>"), $L199 = (0, import_lib2.$L)("|\u25B7"), $L200 = (0, import_lib2.$L)("|>="), $L201 = (0, import_lib2.$L)("\u25B7="), $L202 = (0, import_lib2.$L)("|>"), $L203 = (0, import_lib2.$L)("\u25B7"), $L204 = (0, import_lib2.$L)("readonly"), $L205 = (0, import_lib2.$L)("return"), $L206 = (0, import_lib2.$L)("satisfies"), $L207 = (0, import_lib2.$L)("'"), $L208 = (0, import_lib2.$L)("static"), $L209 = (0, import_lib2.$L)("${"), $L210 = (0, import_lib2.$L)("super"), $L211 = (0, import_lib2.$L)("switch"), $L212 = (0, import_lib2.$L)("target"), $L213 = (0, import_lib2.$L)("then"), $L214 = (0, import_lib2.$L)("this"), $L215 = (0, import_lib2.$L)("throw"), $L216 = (0, import_lib2.$L)('"""'), $L217 = (0, import_lib2.$L)("'''"), $L218 = (0, import_lib2.$L)("///"), $L219 = (0, import_lib2.$L)("```"), $L220 = (0, import_lib2.$L)("try"), $L221 = (0, import_lib2.$L)("typeof"), $L222 = (0, import_lib2.$L)("undefined"), $L223 = (0, import_lib2.$L)("unless"), $L224 = (0, import_lib2.$L)("until"), $L225 = (0, import_lib2.$L)("using"), $L226 = (0, import_lib2.$L)("void"), $L227 = (0, import_lib2.$L)("when"), $L228 = (0, import_lib2.$L)("while"), $L229 = (0, import_lib2.$L)("yield"), $L230 = (0, import_lib2.$L)("/>"), $L231 = (0, import_lib2.$L)("</"), $L232 = (0, import_lib2.$L)("<>"), $L233 = (0, import_lib2.$L)("</>"), $L234 = (0, import_lib2.$L)("<!--"), $L235 = (0, import_lib2.$L)("-->"), $L236 = (0, import_lib2.$L)("type"), $L237 = (0, import_lib2.$L)("enum"), $L238 = (0, import_lib2.$L)("interface"), $L239 = (0, import_lib2.$L)("global"), $L240 = (0, import_lib2.$L)("module"), $L241 = (0, import_lib2.$L)("namespace"), $L242 = (0, import_lib2.$L)("asserts"), $L243 = (0, import_lib2.$L)("keyof"), $L244 = (0, import_lib2.$L)("???"), $L245 = (0, import_lib2.$L)("unique"), $L246 = (0, import_lib2.$L)("symbol"), $L247 = (0, import_lib2.$L)("[]"), $L248 = (0, import_lib2.$L)("civet"), $R0 = (0, import_lib2.$R)(new RegExp("(?=async|debugger|if|unless|comptime|do|for|loop|until|while|switch|throw|try)", "suy")), $R1 = (0, import_lib2.$R)(new RegExp("&(?=\\s)", "suy")), $R2 = (0, import_lib2.$R)(new RegExp("(as|of|by|satisfies|then|when|implements|xor|xnor)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy")), $R3 = (0, import_lib2.$R)(new RegExp("[0-9]", "suy")), $R4 = (0, import_lib2.$R)(new RegExp("(?!\\p{ID_Start}|[_$0-9(\\[{])", "suy")), $R5 = (0, import_lib2.$R)(new RegExp("[ \\t]", "suy")), $R6 = (0, import_lib2.$R)(new RegExp("\\p{ID_Continue}|[\\u200C\\u200D$.#{=]", "suy")), $R7 = (0, import_lib2.$R)(new RegExp("[&=]", "suy")), $R8 = (0, import_lib2.$R)(new RegExp("(?=['\"`])", "suy")), $R9 = (0, import_lib2.$R)(new RegExp("(?=[\\/?])", "suy")), $R10 = (0, import_lib2.$R)(new RegExp("(?=[\\/\\[{?.!@#'\u2019:])", "suy")), $R11 = (0, import_lib2.$R)(new RegExp("%%?", "suy")), $R12 = (0, import_lib2.$R)(new RegExp("[.\\s]", "suy")), $R13 = (0, import_lib2.$R)(new RegExp("[)\\]}]", "suy")), $R14 = (0, import_lib2.$R)(new RegExp("[+-]", "suy")), $R15 = (0, import_lib2.$R)(new RegExp("\\+\\+|--|\u29FA|\u2014|[\\+\\-&]\\S", "suy")), $R16 = (0, import_lib2.$R)(new RegExp(`(?=[0-9.'"tfyno])`, "suy")), $R17 = (0, import_lib2.$R)(new RegExp("(?=true|false|yes|no|on|off)", "suy")), $R18 = (0, import_lib2.$R)(new RegExp("(?=\\p{ID_Start}|[_$])", "suy")), $R19 = (0, import_lib2.$R)(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$])*", "suy")), $R20 = (0, import_lib2.$R)(new RegExp("(?=\\[|\\s*[.\u2022\\/])", "suy")), $R21 = (0, import_lib2.$R)(new RegExp("([<>])(=?)|([\u2264\u2265])", "suy")), $R22 = (0, import_lib2.$R)(new RegExp("[ \\t]*", "suy")), $R23 = (0, import_lib2.$R)(new RegExp("[ \\t]+", "suy")), $R24 = (0, import_lib2.$R)(new RegExp("[!+-]?", "suy")), $R25 = (0, import_lib2.$R)(new RegExp("(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*", "suy")), $R26 = (0, import_lib2.$R)(new RegExp("[=>]", "suy")), $R27 = (0, import_lib2.$R)(new RegExp("(?=\\p{ID_Start}|[_$^\u226A\u226B\u22D9\u2264\u2265\u2208\u220B\u2209\u220C\u2263\u2261\u2262\u2260=\u2A76\u2A75\u2016\u2047&|*\\/!?%\xF7<>\u29FA+-])", "suy")), $R28 = (0, import_lib2.$R)(new RegExp("!\\^\\^?", "suy")), $R29 = (0, import_lib2.$R)(new RegExp("(?!\\+\\+|--)[!~+-](?!\\s)", "suy")), $R30 = (0, import_lib2.$R)(new RegExp("[:.]", "suy")), $R31 = (0, import_lib2.$R)(new RegExp("(?=for|if|loop|unless|until|while)", "suy")), $R32 = (0, import_lib2.$R)(new RegExp("(?:loop|while|until|for|do)(?!\\p{ID_Continue})", "suy")), $R33 = (0, import_lib2.$R)(new RegExp("(?=loop|comptime|do|for|until|while)", "suy")), $R34 = (0, import_lib2.$R)(new RegExp('[^;"\\s=>]+', "suy")), $R35 = (0, import_lib2.$R)(new RegExp("(?=[0-9.])", "suy")), $R36 = (0, import_lib2.$R)(new RegExp("(?:0|[1-9](?:_[0-9]|[0-9])*)n", "suy")), $R37 = (0, import_lib2.$R)(new RegExp("(?:0|[1-9](?:_[0-9]|[0-9])*)(?=\\.(?:\\p{ID_Start}|[_$]))", "suy")), $R38 = (0, import_lib2.$R)(new RegExp("(?:0|[1-9](?:_[0-9]|[0-9])*)(?:\\.(?:[0-9](?:_[0-9]|[0-9])*))?", "suy")), $R39 = (0, import_lib2.$R)(new RegExp("(?:\\.[0-9](?:_[0-9]|[0-9])*)", "suy")), $R40 = (0, import_lib2.$R)(new RegExp("(?:[eE][+-]?[0-9]+(?:_[0-9]|[0-9])*)", "suy")), $R41 = (0, import_lib2.$R)(new RegExp("0[bB][01](?:[01]|_[01])*n?", "suy")), $R42 = (0, import_lib2.$R)(new RegExp("0[oO][0-7](?:[0-7]|_[0-7])*n?", "suy")), $R43 = (0, import_lib2.$R)(new RegExp("0[xX][0-9a-fA-F](?:[0-9a-fA-F]|_[0-9a-fA-F])*n?", "suy")), $R44 = (0, import_lib2.$R)(new RegExp("(?=[0-9])", "suy")), $R45 = (0, import_lib2.$R)(new RegExp("(?:0|[1-9](?:_[0-9]|[0-9])*)", "suy")), $R46 = (0, import_lib2.$R)(new RegExp('(?:\\\\.|[^"])*', "suy")), $R47 = (0, import_lib2.$R)(new RegExp("(?:\\\\.|[^'])*", "suy")), $R48 = (0, import_lib2.$R)(new RegExp('(?:"(?!"")|#(?!\\{)|\\\\.|[^#"])+', "suy")), $R49 = (0, import_lib2.$R)(new RegExp('(?:"(?!"")|\\\\.|[^"])+', "suy")), $R50 = (0, import_lib2.$R)(new RegExp("(?:'(?!'')|\\\\.|[^'])*", "suy")), $R51 = (0, import_lib2.$R)(new RegExp('(?:\\\\.|#(?!\\{)|[^"#])+', "suy")), $R52 = (0, import_lib2.$R)(new RegExp("(?:\\\\.|[^\\]])*", "suy")), $R53 = (0, import_lib2.$R)(new RegExp("(?:\\\\.)", "suy")), $R54 = (0, import_lib2.$R)(new RegExp("[\\s]+", "suy")), $R55 = (0, import_lib2.$R)(new RegExp("\\/(?!\\/\\/)", "suy")), $R56 = (0, import_lib2.$R)(new RegExp("[^[\\/\\s#$\\\\]+|[#$]", "suy")), $R57 = (0, import_lib2.$R)(new RegExp("[*\\/\\r\\n]", "suy")), $R58 = (0, import_lib2.$R)(new RegExp("(?:\\\\.|[^[\\/\\r\\n])+", "suy")), $R59 = (0, import_lib2.$R)(new RegExp("(?:\\p{ID_Continue}|[\\u200C\\u200D$])*", "suy")), $R60 = (0, import_lib2.$R)(new RegExp("(?=[`'\"])", "suy")), $R61 = (0, import_lib2.$R)(new RegExp("(?:\\$(?!\\{)|\\\\.|[^$`])+", "suy")), $R62 = (0, import_lib2.$R)(new RegExp("(?:\\$(?!\\{)|`(?!``)|\\\\.|[^$`])+", "suy")), $R63 = (0, import_lib2.$R)(new RegExp("(?:on|off|yes|no)(?!\\p{ID_Continue})", "suy")), $R64 = (0, import_lib2.$R)(new RegExp("(?:isnt)(?!\\p{ID_Continue})", "suy")), $R65 = (0, import_lib2.$R)(new RegExp("(?:by)(?!\\p{ID_Continue})", "suy")), $R66 = (0, import_lib2.$R)(new RegExp("(?:of)(?!\\p{ID_Continue})", "suy")), $R67 = (0, import_lib2.$R)(new RegExp("(?:and|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|function|if|import|in|instanceof|interface|is|let|loop|new|not|null|or|private|protected|public|return|static|super|switch|this|throw|true|try|typeof|unless|until|var|void|while|with|yield)(?!\\p{ID_Continue})", "suy")), $R68 = (0, import_lib2.$R)(new RegExp("(?=\\/|#)", "suy")), $R69 = (0, import_lib2.$R)(new RegExp("\\/\\/(?!\\/)[^\\r\\n]*", "suy")), $R70 = (0, import_lib2.$R)(new RegExp(".", "suy")), $R71 = (0, import_lib2.$R)(new RegExp("#(?!##(?!#))([^\\r\\n]*)", "suy")), $R72 = (0, import_lib2.$R)(new RegExp("[^]*?###", "suy")), $R73 = (0, import_lib2.$R)(new RegExp("###(?!#)", "suy")), $R74 = (0, import_lib2.$R)(new RegExp("\\/\\*(?:(?!\\*\\/)[^\\r\\n])*\\*\\/", "suy")), $R75 = (0, import_lib2.$R)(new RegExp("(?=[ \\t\\/\\\\#])", "suy")), $R76 = (0, import_lib2.$R)(new RegExp("(?=\\s|\\/|#)", "suy")), $R77 = (0, import_lib2.$R)(new RegExp("(?!\\p{ID_Continue})", "suy")), $R78 = (0, import_lib2.$R)(new RegExp("[=:]", "suy")), $R79 = (0, import_lib2.$R)(new RegExp("['\u2019]s", "suy")), $R80 = (0, import_lib2.$R)(new RegExp("\\s", "suy")), $R81 = (0, import_lib2.$R)(new RegExp("(?=[<])", "suy")), $R82 = (0, import_lib2.$R)(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*", "suy")), $R83 = (0, import_lib2.$R)(new RegExp("[!+-]", "suy")), $R84 = (0, import_lib2.$R)(new RegExp("[\\s>]|\\/>", "suy")), $R85 = (0, import_lib2.$R)(new RegExp("(?:[\\w\\-:]+|\\([^()]*\\)|\\[[^\\[\\]]*\\])+", "suy")), $R86 = (0, import_lib2.$R)(new RegExp(`"[^"]*"|'[^']*'`, "suy")), $R87 = (0, import_lib2.$R)(new RegExp("[<>]", "suy")), $R88 = (0, import_lib2.$R)(new RegExp("[!~+-](?!\\s|[!~+-]*&)", "suy")), $R89 = (0, import_lib2.$R)(new RegExp("(?:-[^-]|[^-]*)*", "suy")), $R90 = (0, import_lib2.$R)(new RegExp("[^{}<>\\r\\n]+", "suy")), $R91 = (0, import_lib2.$R)(new RegExp("[+-]?", "suy")), $R92 = (0, import_lib2.$R)(new RegExp("(?=if|unless)", "suy")), $R93 = (0, import_lib2.$R)(new RegExp("[|&<!=\\-\u21D2\u2192]", "suy")), $R94 = (0, import_lib2.$R)(new RegExp("(extends|not|is)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy")), $R95 = (0, import_lib2.$R)(new RegExp("const|in|out", "suy")), $R96 = (0, import_lib2.$R)(new RegExp("#![^\\r\\n]*", "suy")), $R97 = (0, import_lib2.$R)(new RegExp("[\\t ]*", "suy")), $R98 = (0, import_lib2.$R)(new RegExp("[\\s]*", "suy")), $R99 = (0, import_lib2.$R)(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([\\p{ID_Continue}.,+-]*))?", "suy")), $R100 = (0, import_lib2.$R)(new RegExp("\\/\\/\\/[^\\r\\n]*", "suy")), $R101 = (0, import_lib2.$R)(new RegExp("(?=[ \\t\\r\\n\\/#]|$)", "suy")), $R102 = (0, import_lib2.$R)(new RegExp("\\r\\n|\\n|\\r|$", "suy")), $R103 = (0, import_lib2.$R)(new RegExp("[^]*", "suy")), Program$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(Reset, Init, (0, import_lib2.$E)(EOS), TopLevelStatements, __), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
7519
7559
|
var reset = $1, init = $2, ws1 = $3, statements = $4, ws2 = $5;
|
|
7520
7560
|
let program = {
|
|
7521
7561
|
type: "BlockStatement",
|
|
@@ -8002,6 +8042,10 @@ ${js}`
|
|
|
8002
8042
|
function UpdateExpression(ctx, state2) {
|
|
8003
8043
|
return (0, import_lib2.$EVENT_C)(ctx, state2, "UpdateExpression", UpdateExpression$$);
|
|
8004
8044
|
}
|
|
8045
|
+
var UpdateExpressionPattern$0 = NamedBindingPattern, UpdateExpressionPattern$1 = UpdateExpression, UpdateExpressionPattern$$ = [UpdateExpressionPattern$0, UpdateExpressionPattern$1];
|
|
8046
|
+
function UpdateExpressionPattern(ctx, state2) {
|
|
8047
|
+
return (0, import_lib2.$EVENT_C)(ctx, state2, "UpdateExpressionPattern", UpdateExpressionPattern$$);
|
|
8048
|
+
}
|
|
8005
8049
|
var UpdateExpressionSymbol$0 = (0, import_lib2.$TV)((0, import_lib2.$C)((0, import_lib2.$EXPECT)($L9, 'UpdateExpressionSymbol "++"'), (0, import_lib2.$EXPECT)($L10, 'UpdateExpressionSymbol "--"')), function($skip, $loc, $0, $1) {
|
|
8006
8050
|
return { $loc, token: $1 };
|
|
8007
8051
|
}), UpdateExpressionSymbol$1 = (0, import_lib2.$TV)((0, import_lib2.$EXPECT)($L11, 'UpdateExpressionSymbol "\u29FA"'), function($skip, $loc, $0, $1) {
|
|
@@ -8045,7 +8089,7 @@ ${js}`
|
|
|
8045
8089
|
function NonPipelineAssignmentExpressionTail(ctx, state2) {
|
|
8046
8090
|
return (0, import_lib2.$EVENT_C)(ctx, state2, "NonPipelineAssignmentExpressionTail", NonPipelineAssignmentExpressionTail$$);
|
|
8047
8091
|
}
|
|
8048
|
-
var ActualAssignment$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$P)((0, import_lib2.$S)(NotDedented,
|
|
8092
|
+
var ActualAssignment$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$P)((0, import_lib2.$S)(NotDedented, UpdateExpressionPattern, WAssignmentOp)), MaybeNestedExpression), function($skip, $loc, $0, $1, $2) {
|
|
8049
8093
|
return $1 = $1.map((x) => [x[0], x[1], ...x[2]]), $0 = [$1, $2], {
|
|
8050
8094
|
type: "AssignmentExpression",
|
|
8051
8095
|
children: $0,
|
|
@@ -8060,7 +8104,7 @@ ${js}`
|
|
|
8060
8104
|
function ActualAssignment(ctx, state2) {
|
|
8061
8105
|
return (0, import_lib2.$EVENT)(ctx, state2, "ActualAssignment", ActualAssignment$0);
|
|
8062
8106
|
}
|
|
8063
|
-
var NonPipelineActualAssignment$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$P)((0, import_lib2.$S)(NotDedented,
|
|
8107
|
+
var NonPipelineActualAssignment$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$P)((0, import_lib2.$S)(NotDedented, UpdateExpressionPattern, WAssignmentOp)), MaybeNestedNonPipelineExpression), function($skip, $loc, $0, $1, $2) {
|
|
8064
8108
|
return $1 = $1.map((x) => [x[0], x[1], ...x[2]]), $0 = [$1, $2], {
|
|
8065
8109
|
type: "AssignmentExpression",
|
|
8066
8110
|
children: $0,
|
|
@@ -8208,7 +8252,11 @@ ${js}`
|
|
|
8208
8252
|
...first,
|
|
8209
8253
|
...rest.map(([nested, line]) => [nested, ...line]).flat()
|
|
8210
8254
|
] : $skip;
|
|
8211
|
-
}), PipelineExpressionBody$1 = (0, import_lib2.$P)((0, import_lib2.$S)(NotDedented, Pipe, __, PipelineTailItem)),
|
|
8255
|
+
}), PipelineExpressionBody$1 = (0, import_lib2.$T)((0, import_lib2.$S)(NewlineBinaryOpAllowed, (0, import_lib2.$P)((0, import_lib2.$S)(NotDedented, Pipe, __, PipelineTailItem))), function(value) {
|
|
8256
|
+
return value[1];
|
|
8257
|
+
}), PipelineExpressionBody$2 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$N)(NewlineBinaryOpAllowed), PipelineExpressionBodySameLine), function($skip, $loc, $0, $1, $2) {
|
|
8258
|
+
return $2.length ? $2 : $skip;
|
|
8259
|
+
}), PipelineExpressionBody$$ = [PipelineExpressionBody$0, PipelineExpressionBody$1, PipelineExpressionBody$2];
|
|
8212
8260
|
function PipelineExpressionBody(ctx, state2) {
|
|
8213
8261
|
return (0, import_lib2.$EVENT_C)(ctx, state2, "PipelineExpressionBody", PipelineExpressionBody$$);
|
|
8214
8262
|
}
|
|
@@ -8233,8 +8281,8 @@ ${js}`
|
|
|
8233
8281
|
return makeAmpersandFunction({
|
|
8234
8282
|
body: [" ", $1, ...$2]
|
|
8235
8283
|
});
|
|
8236
|
-
}), PipelineTailItem$4 = (0, import_lib2.$
|
|
8237
|
-
return
|
|
8284
|
+
}), PipelineTailItem$4 = (0, import_lib2.$TS)((0, import_lib2.$S)(ForbidNewlineBinaryOp, (0, import_lib2.$E)(PipelineHeadItem), RestoreNewlineBinaryOp), function($skip, $loc, $0, $1, $2, $3) {
|
|
8285
|
+
return $2 || $skip;
|
|
8238
8286
|
}), PipelineTailItem$$ = [PipelineTailItem$0, PipelineTailItem$1, PipelineTailItem$2, PipelineTailItem$3, PipelineTailItem$4];
|
|
8239
8287
|
function PipelineTailItem(ctx, state2) {
|
|
8240
8288
|
return (0, import_lib2.$EVENT_C)(ctx, state2, "PipelineTailItem", PipelineTailItem$$);
|
|
@@ -8697,7 +8745,7 @@ ${js}`
|
|
|
8697
8745
|
children: $0,
|
|
8698
8746
|
expression
|
|
8699
8747
|
};
|
|
8700
|
-
}), LeftHandSideExpression$1 =
|
|
8748
|
+
}), LeftHandSideExpression$1 = CallExpression, LeftHandSideExpression$$ = [LeftHandSideExpression$0, LeftHandSideExpression$1];
|
|
8701
8749
|
function LeftHandSideExpression(ctx, state2) {
|
|
8702
8750
|
return (0, import_lib2.$EVENT_C)(ctx, state2, "LeftHandSideExpression", LeftHandSideExpression$$);
|
|
8703
8751
|
}
|
|
@@ -9769,10 +9817,14 @@ ${js}`
|
|
|
9769
9817
|
function OperatorAssociativity(ctx, state2) {
|
|
9770
9818
|
return (0, import_lib2.$EVENT)(ctx, state2, "OperatorAssociativity", OperatorAssociativity$0);
|
|
9771
9819
|
}
|
|
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)(_),
|
|
9773
|
-
var async = $1, parameters = $2, returnType = $3, arrow = $5, block = $6;
|
|
9820
|
+
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)(_), ThinArrow, (0, import_lib2.$C)(BracedObjectSingleLineStatements, NoCommaBracedOrEmptyBlock)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
9821
|
+
var async = $1, parameters = $2, returnType = $3, ws = $4, arrow = $5, block = $6;
|
|
9774
9822
|
async || (async = []);
|
|
9775
9823
|
let generator = [];
|
|
9824
|
+
if ((!parameters.implicit || returnType || ws) && !block.bare) {
|
|
9825
|
+
let [first, ...rest] = block.children;
|
|
9826
|
+
(first === " {" || first?.[0]?.token === " ") && (block = { ...block, children: [first.slice(1), ...rest] });
|
|
9827
|
+
}
|
|
9776
9828
|
return {
|
|
9777
9829
|
type: "FunctionExpression",
|
|
9778
9830
|
id: void 0,
|
|
@@ -9797,6 +9849,7 @@ ${js}`
|
|
|
9797
9849
|
generator,
|
|
9798
9850
|
parameters,
|
|
9799
9851
|
returnType,
|
|
9852
|
+
ws,
|
|
9800
9853
|
block
|
|
9801
9854
|
]
|
|
9802
9855
|
};
|
|
@@ -9804,11 +9857,11 @@ ${js}`
|
|
|
9804
9857
|
function ThinArrowFunction(ctx, state2) {
|
|
9805
9858
|
return (0, import_lib2.$EVENT)(ctx, state2, "ThinArrowFunction", ThinArrowFunction$0);
|
|
9806
9859
|
}
|
|
9807
|
-
var
|
|
9860
|
+
var ThinArrow$0 = (0, import_lib2.$TV)((0, import_lib2.$C)((0, import_lib2.$EXPECT)($L35, 'ThinArrow "->"'), (0, import_lib2.$EXPECT)($L36, 'ThinArrow "\u2192"')), function($skip, $loc, $0, $1) {
|
|
9808
9861
|
return { $loc, token: "->" };
|
|
9809
9862
|
});
|
|
9810
|
-
function
|
|
9811
|
-
return (0, import_lib2.$EVENT)(ctx, state2, "
|
|
9863
|
+
function ThinArrow(ctx, state2) {
|
|
9864
|
+
return (0, import_lib2.$EVENT)(ctx, state2, "ThinArrow", ThinArrow$0);
|
|
9812
9865
|
}
|
|
9813
9866
|
var ExplicitBlock$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), OpenBrace, AllowAll, (0, import_lib2.$E)((0, import_lib2.$C)(NestedBlockStatements, SingleLineStatements, EmptyBracedContent)), RestoreAll, __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
|
|
9814
9867
|
var ws1 = $1, open = $2, block = $4, ws2 = $6, close = $7;
|
|
@@ -13439,9 +13492,9 @@ ${js}`
|
|
|
13439
13492
|
}
|
|
13440
13493
|
var InlineComment$0 = (0, import_lib2.$TR)((0, import_lib2.$EXPECT)($R74, "InlineComment /\\/\\*(?:(?!\\*\\/)[^\\r\\n])*\\*\\//"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
|
|
13441
13494
|
return { $loc, token: $0 };
|
|
13442
|
-
});
|
|
13495
|
+
}), InlineComment$1 = CoffeeMultiLineComment, InlineComment$$ = [InlineComment$0, InlineComment$1];
|
|
13443
13496
|
function InlineComment(ctx, state2) {
|
|
13444
|
-
return (0, import_lib2.$
|
|
13497
|
+
return (0, import_lib2.$EVENT_C)(ctx, state2, "InlineComment", InlineComment$$);
|
|
13445
13498
|
}
|
|
13446
13499
|
var RestOfLine$0 = (0, import_lib2.$S)((0, import_lib2.$Q)((0, import_lib2.$C)(NonNewlineWhitespace, Comment)), EOL);
|
|
13447
13500
|
function RestOfLine(ctx, state2) {
|
|
@@ -13451,7 +13504,7 @@ ${js}`
|
|
|
13451
13504
|
function TrailingComment(ctx, state2) {
|
|
13452
13505
|
return (0, import_lib2.$EVENT)(ctx, state2, "TrailingComment", TrailingComment$0);
|
|
13453
13506
|
}
|
|
13454
|
-
var _$0 = (0, import_lib2.$T)((0, import_lib2.$S)((0, import_lib2.$EXPECT)($R75, "_ /(?=[ \\t
|
|
13507
|
+
var _$0 = (0, import_lib2.$T)((0, import_lib2.$S)((0, import_lib2.$EXPECT)($R75, "_ /(?=[ \\t\\/\\\\#])/"), (0, import_lib2.$P)((0, import_lib2.$C)(NonNewlineWhitespace, InlineComment))), function(value) {
|
|
13455
13508
|
return value[1];
|
|
13456
13509
|
});
|
|
13457
13510
|
function _(ctx, state2) {
|
|
@@ -16707,11 +16760,15 @@ ${counts}`;
|
|
|
16707
16760
|
if (options.sourceMap || options.inlineMap) {
|
|
16708
16761
|
options.sourceMap = new SourceMap2(src);
|
|
16709
16762
|
let code = generate_civet_default(ast2, options);
|
|
16710
|
-
|
|
16711
|
-
|
|
16712
|
-
code
|
|
16713
|
-
|
|
16714
|
-
}
|
|
16763
|
+
if (checkErrors(), options.inlineMap) {
|
|
16764
|
+
let outputFilename = options.outputFilename ?? (options.js ? filename2 + ".jsx" : filename2 + ".tsx");
|
|
16765
|
+
return `${code}
|
|
16766
|
+
${options.sourceMap.comment(filename2, outputFilename)}`;
|
|
16767
|
+
} else
|
|
16768
|
+
return {
|
|
16769
|
+
code,
|
|
16770
|
+
sourceMap: options.sourceMap
|
|
16771
|
+
};
|
|
16715
16772
|
}
|
|
16716
16773
|
let result = generate_civet_default(ast2, options);
|
|
16717
16774
|
return options.errors?.length && (delete options.errors, options.sourceMap = new SourceMap2(src), generate_civet_default(ast2, options), checkErrors()), result;
|