@danielx/civet 0.7.28 → 0.7.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/browser.js +753 -207
- package/dist/main.js +753 -207
- package/dist/main.mjs +753 -207
- package/package.json +1 -1
package/dist/browser.js
CHANGED
|
@@ -70,7 +70,7 @@ var Civet = (() => {
|
|
|
70
70
|
$N: () => $N2,
|
|
71
71
|
$P: () => $P2,
|
|
72
72
|
$Q: () => $Q2,
|
|
73
|
-
$R: () => $
|
|
73
|
+
$R: () => $R100,
|
|
74
74
|
$R$0: () => $R$02,
|
|
75
75
|
$S: () => $S2,
|
|
76
76
|
$T: () => $T2,
|
|
@@ -107,7 +107,7 @@ var Civet = (() => {
|
|
|
107
107
|
return;
|
|
108
108
|
};
|
|
109
109
|
}
|
|
110
|
-
function $
|
|
110
|
+
function $R100(regExp) {
|
|
111
111
|
return function(_ctx, state2) {
|
|
112
112
|
const { input, pos } = state2;
|
|
113
113
|
regExp.lastIndex = state2.pos;
|
|
@@ -518,6 +518,7 @@ ${body}`;
|
|
|
518
518
|
addPostfixStatement: () => addPostfixStatement,
|
|
519
519
|
adjustBindingElements: () => adjustBindingElements,
|
|
520
520
|
adjustIndexAccess: () => adjustIndexAccess,
|
|
521
|
+
append: () => append,
|
|
521
522
|
attachPostfixStatementAsExpression: () => attachPostfixStatementAsExpression,
|
|
522
523
|
blockWithPrefix: () => blockWithPrefix,
|
|
523
524
|
convertNamedImportsToObject: () => convertNamedImportsToObject,
|
|
@@ -684,7 +685,7 @@ ${body}`;
|
|
|
684
685
|
"ForStatement",
|
|
685
686
|
"IfStatement",
|
|
686
687
|
"IterationStatement",
|
|
687
|
-
"
|
|
688
|
+
"LabelledStatement",
|
|
688
689
|
"ReturnStatement",
|
|
689
690
|
"SwitchStatement",
|
|
690
691
|
"ThrowStatement",
|
|
@@ -729,13 +730,16 @@ ${body}`;
|
|
|
729
730
|
return node.expressions.some((s) => isExit(s[1]));
|
|
730
731
|
}
|
|
731
732
|
case "IterationStatement": {
|
|
732
|
-
return node
|
|
733
|
+
return isLoopStatement(node) && gatherRecursiveWithinFunction(node.block, ($) => $.type === "BreakStatement").length === 0;
|
|
733
734
|
}
|
|
734
735
|
default: {
|
|
735
736
|
return false;
|
|
736
737
|
}
|
|
737
738
|
}
|
|
738
739
|
}
|
|
740
|
+
function isLoopStatement(node) {
|
|
741
|
+
return node.type === "IterationStatement" && node.condition?.type === "ParenthesizedExpression" && node.condition.expression?.type === "Literal" && node.condition.expression?.raw === "true";
|
|
742
|
+
}
|
|
739
743
|
function isComma(node) {
|
|
740
744
|
if (node?.token === ",") {
|
|
741
745
|
return node;
|
|
@@ -806,7 +810,7 @@ ${body}`;
|
|
|
806
810
|
return;
|
|
807
811
|
}
|
|
808
812
|
function prepend(prefix, node) {
|
|
809
|
-
if (!(prefix && prefix
|
|
813
|
+
if (!prefix || Array.isArray(prefix) && len(prefix, 0)) {
|
|
810
814
|
return node;
|
|
811
815
|
}
|
|
812
816
|
if (Array.isArray(node)) {
|
|
@@ -820,6 +824,21 @@ ${body}`;
|
|
|
820
824
|
return [prefix, node];
|
|
821
825
|
}
|
|
822
826
|
}
|
|
827
|
+
function append(node, suffix) {
|
|
828
|
+
if (!suffix || Array.isArray(suffix) && len(suffix, 0)) {
|
|
829
|
+
return node;
|
|
830
|
+
}
|
|
831
|
+
if (Array.isArray(node)) {
|
|
832
|
+
return [...node, suffix];
|
|
833
|
+
} else if (isParent(node)) {
|
|
834
|
+
return {
|
|
835
|
+
...node,
|
|
836
|
+
children: [...node.children, suffix]
|
|
837
|
+
};
|
|
838
|
+
} else {
|
|
839
|
+
return [node, suffix];
|
|
840
|
+
}
|
|
841
|
+
}
|
|
823
842
|
function inplacePrepend(prefix, node) {
|
|
824
843
|
if (!prefix) {
|
|
825
844
|
return;
|
|
@@ -1086,7 +1105,7 @@ ${body}`;
|
|
|
1086
1105
|
}
|
|
1087
1106
|
return ["(", type, ")"];
|
|
1088
1107
|
}
|
|
1089
|
-
function wrapIIFE(expressions, asyncFlag) {
|
|
1108
|
+
function wrapIIFE(expressions, asyncFlag, generator) {
|
|
1090
1109
|
let prefix;
|
|
1091
1110
|
const async = [];
|
|
1092
1111
|
if (asyncFlag) {
|
|
@@ -1112,23 +1131,49 @@ ${body}`;
|
|
|
1112
1131
|
};
|
|
1113
1132
|
const signature = {
|
|
1114
1133
|
modifier: {
|
|
1115
|
-
async: !!async.length
|
|
1134
|
+
async: !!async.length,
|
|
1135
|
+
generator: !!generator
|
|
1116
1136
|
},
|
|
1117
1137
|
returnType: void 0
|
|
1118
1138
|
};
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1139
|
+
let fn;
|
|
1140
|
+
if (generator) {
|
|
1141
|
+
fn = makeNode({
|
|
1142
|
+
type: "FunctionExpression",
|
|
1143
|
+
signature,
|
|
1144
|
+
parameters,
|
|
1145
|
+
returnType: void 0,
|
|
1146
|
+
ts: false,
|
|
1147
|
+
async,
|
|
1148
|
+
block,
|
|
1149
|
+
generator,
|
|
1150
|
+
children: [async, "function", generator, parameters, block]
|
|
1151
|
+
});
|
|
1152
|
+
} else {
|
|
1153
|
+
fn = makeNode({
|
|
1154
|
+
type: "ArrowFunction",
|
|
1155
|
+
signature,
|
|
1156
|
+
parameters,
|
|
1157
|
+
returnType: void 0,
|
|
1158
|
+
ts: false,
|
|
1159
|
+
async,
|
|
1160
|
+
block,
|
|
1161
|
+
children: [async, parameters, "=>", block]
|
|
1162
|
+
});
|
|
1163
|
+
}
|
|
1164
|
+
const children = [makeLeftHandSideExpression(fn), "()"];
|
|
1165
|
+
if (fn.type === "FunctionExpression") {
|
|
1166
|
+
if (gatherRecursiveWithinFunction(block, (a1) => typeof a1 === "object" && a1 != null && "token" in a1 && a1.token === "this").length) {
|
|
1167
|
+
children.splice(1, 0, ".bind(this)");
|
|
1168
|
+
}
|
|
1169
|
+
if (gatherRecursiveWithinFunction(block, (a2) => typeof a2 === "object" && a2 != null && "token" in a2 && a2.token === "arguments").length) {
|
|
1170
|
+
let ref2;
|
|
1171
|
+
children[children.length - 1] = (ref2 = parameters.children)[ref2.length - 1] = "(arguments)";
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1129
1174
|
const exp = makeNode({
|
|
1130
1175
|
type: "CallExpression",
|
|
1131
|
-
children
|
|
1176
|
+
children
|
|
1132
1177
|
});
|
|
1133
1178
|
if (prefix) {
|
|
1134
1179
|
return makeLeftHandSideExpression([prefix, exp]);
|
|
@@ -1749,7 +1794,7 @@ ${body}`;
|
|
|
1749
1794
|
({ type } = exp);
|
|
1750
1795
|
}
|
|
1751
1796
|
let ref4;
|
|
1752
|
-
switch (
|
|
1797
|
+
switch (type) {
|
|
1753
1798
|
case "BreakStatement":
|
|
1754
1799
|
case "ContinueStatement":
|
|
1755
1800
|
case "DebuggerStatement":
|
|
@@ -1970,6 +2015,58 @@ ${body}`;
|
|
|
1970
2015
|
return insertReturn(clause);
|
|
1971
2016
|
});
|
|
1972
2017
|
}
|
|
2018
|
+
function processBreakContinueWith(statement) {
|
|
2019
|
+
let changed = false;
|
|
2020
|
+
for (const control of gatherRecursiveWithinFunction(
|
|
2021
|
+
statement.block,
|
|
2022
|
+
($) => $.type === "BreakStatement" || $.type === "ContinueStatement"
|
|
2023
|
+
)) {
|
|
2024
|
+
let controlName2 = function() {
|
|
2025
|
+
switch (control.type) {
|
|
2026
|
+
case "BreakStatement": {
|
|
2027
|
+
return "break";
|
|
2028
|
+
}
|
|
2029
|
+
case "ContinueStatement": {
|
|
2030
|
+
return "continue";
|
|
2031
|
+
}
|
|
2032
|
+
}
|
|
2033
|
+
};
|
|
2034
|
+
var controlName = controlName2;
|
|
2035
|
+
if (control.with) {
|
|
2036
|
+
if (control.label) {
|
|
2037
|
+
let m1;
|
|
2038
|
+
if (!(m1 = statement.parent, typeof m1 === "object" && m1 != null && "type" in m1 && m1.type === "LabelledStatement" && "label" in m1 && typeof m1.label === "object" && m1.label != null && "name" in m1.label && m1.label.name === control.label.name)) {
|
|
2039
|
+
continue;
|
|
2040
|
+
}
|
|
2041
|
+
} else {
|
|
2042
|
+
const { ancestor } = findAncestor(
|
|
2043
|
+
control,
|
|
2044
|
+
(s) => s === statement || s.type === "IterationStatement" || s.type === "ForStatement" || s.type === "SwitchStatement" && control.type === "BreakStatement"
|
|
2045
|
+
);
|
|
2046
|
+
if (!(ancestor === statement)) {
|
|
2047
|
+
continue;
|
|
2048
|
+
}
|
|
2049
|
+
}
|
|
2050
|
+
control.children.unshift(
|
|
2051
|
+
control.type === "BreakStatement" ? (changed = true, [statement.resultsRef, " =", control.with, ";"]) : (
|
|
2052
|
+
// control.type is "ContinueStatement"
|
|
2053
|
+
[statement.resultsRef, ".push(", trimFirstSpace(control.with), ");"]
|
|
2054
|
+
)
|
|
2055
|
+
);
|
|
2056
|
+
updateParentPointers(control.with, control);
|
|
2057
|
+
const i = control.children.findIndex(($1) => $1?.type === "Error");
|
|
2058
|
+
if (i >= 0) {
|
|
2059
|
+
control.children.splice(i, 1);
|
|
2060
|
+
}
|
|
2061
|
+
const block = control.parent;
|
|
2062
|
+
if (!(block?.type === "BlockStatement")) {
|
|
2063
|
+
throw new Error(`Expected parent of ${controlName2()} to be BlockStatement`);
|
|
2064
|
+
}
|
|
2065
|
+
braceBlock(block);
|
|
2066
|
+
}
|
|
2067
|
+
}
|
|
2068
|
+
return changed;
|
|
2069
|
+
}
|
|
1973
2070
|
function wrapIterationReturningResults(statement, outer, collect) {
|
|
1974
2071
|
if (statement.type === "DoStatement" || statement.type === "ComptimeStatement") {
|
|
1975
2072
|
if (collect) {
|
|
@@ -1985,14 +2082,37 @@ ${body}`;
|
|
|
1985
2082
|
"wrapIterationReturningResults should not be called twice on the same statement"
|
|
1986
2083
|
);
|
|
1987
2084
|
const resultsRef = statement.resultsRef = makeRef("results");
|
|
2085
|
+
let decl = "const";
|
|
2086
|
+
if (statement.type === "IterationStatement" || statement.type === "ForStatement") {
|
|
2087
|
+
if (processBreakContinueWith(statement)) {
|
|
2088
|
+
decl = "let";
|
|
2089
|
+
}
|
|
2090
|
+
}
|
|
2091
|
+
const breakWithOnly = decl === "let" && isLoopStatement(statement) && gatherRecursive(
|
|
2092
|
+
statement.block,
|
|
2093
|
+
(s) => s.type === "BreakStatement" && !s.with,
|
|
2094
|
+
(s) => isFunction(s) || s.type === "IterationStatement"
|
|
2095
|
+
).length === 0;
|
|
1988
2096
|
const declaration = {
|
|
1989
2097
|
type: "Declaration",
|
|
1990
|
-
children: ["
|
|
2098
|
+
children: [decl, " ", resultsRef],
|
|
2099
|
+
decl,
|
|
2100
|
+
names: [],
|
|
2101
|
+
bindings: []
|
|
1991
2102
|
};
|
|
2103
|
+
if (decl === "const") {
|
|
2104
|
+
declaration.children.push("=[]");
|
|
2105
|
+
} else {
|
|
2106
|
+
if (!breakWithOnly) {
|
|
2107
|
+
declaration.children.push(";", resultsRef, "=[]");
|
|
2108
|
+
}
|
|
2109
|
+
}
|
|
1992
2110
|
outer.children.unshift(["", declaration, ";"]);
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
2111
|
+
if (!breakWithOnly) {
|
|
2112
|
+
assignResults(statement.block, (node) => {
|
|
2113
|
+
return [resultsRef, ".push(", node, ")"];
|
|
2114
|
+
});
|
|
2115
|
+
}
|
|
1996
2116
|
if (collect) {
|
|
1997
2117
|
statement.children.push(collect(resultsRef));
|
|
1998
2118
|
} else {
|
|
@@ -2058,8 +2178,8 @@ ${body}`;
|
|
|
2058
2178
|
}
|
|
2059
2179
|
if (hasYield(block) && !f.generator?.length) {
|
|
2060
2180
|
if (f.type === "ArrowFunction") {
|
|
2061
|
-
gatherRecursiveWithinFunction(block, ($) =>
|
|
2062
|
-
const i = y.children.findIndex(($
|
|
2181
|
+
gatherRecursiveWithinFunction(block, ($2) => $2.type === "YieldExpression").forEach((y) => {
|
|
2182
|
+
const i = y.children.findIndex(($3) => $3.type === "Yield");
|
|
2063
2183
|
return y.children.splice(i + 1, 0, {
|
|
2064
2184
|
type: "Error",
|
|
2065
2185
|
message: "Can't use yield inside of => arrow function"
|
|
@@ -2087,31 +2207,55 @@ ${body}`;
|
|
|
2087
2207
|
});
|
|
2088
2208
|
}
|
|
2089
2209
|
function expressionizeIteration(exp) {
|
|
2090
|
-
const { async, subtype, block, children, statement } = exp;
|
|
2210
|
+
const { async, generator, subtype, block, children, statement } = exp;
|
|
2091
2211
|
const i = children.indexOf(statement);
|
|
2092
2212
|
if (i < 0) {
|
|
2093
2213
|
throw new Error("Could not find iteration statement in iteration expression");
|
|
2094
2214
|
}
|
|
2095
2215
|
if (subtype === "DoStatement" || subtype === "ComptimeStatement") {
|
|
2096
|
-
children.splice(i, 1, wrapIIFE([["", statement, void 0]], async));
|
|
2216
|
+
children.splice(i, 1, wrapIIFE([["", statement, void 0]], async, generator));
|
|
2097
2217
|
updateParentPointers(exp);
|
|
2098
2218
|
return;
|
|
2099
2219
|
}
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
[
|
|
2113
|
-
|
|
2114
|
-
|
|
2220
|
+
if (generator) {
|
|
2221
|
+
assignResults(block, (node) => {
|
|
2222
|
+
return {
|
|
2223
|
+
type: "YieldExpression",
|
|
2224
|
+
expression: node,
|
|
2225
|
+
children: ["yield ", node]
|
|
2226
|
+
};
|
|
2227
|
+
});
|
|
2228
|
+
braceBlock(block);
|
|
2229
|
+
children.splice(
|
|
2230
|
+
i,
|
|
2231
|
+
1,
|
|
2232
|
+
wrapIIFE([
|
|
2233
|
+
["", statement, void 0],
|
|
2234
|
+
// Prevent implicit return in generator, by adding an explicit return
|
|
2235
|
+
["", {
|
|
2236
|
+
type: "ReturnStatement",
|
|
2237
|
+
expression: void 0,
|
|
2238
|
+
children: [";return"]
|
|
2239
|
+
}, void 0]
|
|
2240
|
+
], async, generator)
|
|
2241
|
+
);
|
|
2242
|
+
} else {
|
|
2243
|
+
exp.resultsRef ??= makeRef("results");
|
|
2244
|
+
const { resultsRef } = exp;
|
|
2245
|
+
assignResults(block, (node) => {
|
|
2246
|
+
return [resultsRef, ".push(", node, ")"];
|
|
2247
|
+
});
|
|
2248
|
+
braceBlock(block);
|
|
2249
|
+
children.splice(
|
|
2250
|
+
i,
|
|
2251
|
+
1,
|
|
2252
|
+
wrapIIFE([
|
|
2253
|
+
["", ["const ", resultsRef, "=[]"], ";"],
|
|
2254
|
+
["", statement, void 0],
|
|
2255
|
+
["", wrapWithReturn(resultsRef)]
|
|
2256
|
+
], async)
|
|
2257
|
+
);
|
|
2258
|
+
}
|
|
2115
2259
|
updateParentPointers(exp);
|
|
2116
2260
|
}
|
|
2117
2261
|
function skipImplicitArguments(args) {
|
|
@@ -2125,7 +2269,7 @@ ${body}`;
|
|
|
2125
2269
|
return false;
|
|
2126
2270
|
}
|
|
2127
2271
|
function processCoffeeDo(ws, expression) {
|
|
2128
|
-
ws =
|
|
2272
|
+
ws = trimFirstSpace(ws);
|
|
2129
2273
|
const args = [];
|
|
2130
2274
|
if (typeof expression === "object" && expression != null && "type" in expression && expression.type === "ArrowFunction" || typeof expression === "object" && expression != null && "type" in expression && expression.type === "FunctionExpression") {
|
|
2131
2275
|
const { parameters } = expression;
|
|
@@ -2159,7 +2303,7 @@ ${body}`;
|
|
|
2159
2303
|
expression = {
|
|
2160
2304
|
...expression,
|
|
2161
2305
|
parameters: newParameters,
|
|
2162
|
-
children: expression.children.map(($
|
|
2306
|
+
children: expression.children.map(($4) => $4 === parameters ? newParameters : $4)
|
|
2163
2307
|
};
|
|
2164
2308
|
}
|
|
2165
2309
|
return {
|
|
@@ -2180,7 +2324,7 @@ ${body}`;
|
|
|
2180
2324
|
ref = makeRef("$");
|
|
2181
2325
|
inplacePrepend(ref, body);
|
|
2182
2326
|
}
|
|
2183
|
-
if (startsWithPredicate(body, ($
|
|
2327
|
+
if (startsWithPredicate(body, ($5) => $5.type === "ObjectExpression")) {
|
|
2184
2328
|
body = makeLeftHandSideExpression(body);
|
|
2185
2329
|
}
|
|
2186
2330
|
const parameters = makeNode({
|
|
@@ -3284,26 +3428,24 @@ ${body}`;
|
|
|
3284
3428
|
function aggregateDuplicateBindings(bindings) {
|
|
3285
3429
|
const props = gatherRecursiveAll(bindings, ($10) => $10.type === "BindingProperty");
|
|
3286
3430
|
const arrayBindings = gatherRecursiveAll(bindings, ($11) => $11.type === "ArrayBindingPattern");
|
|
3287
|
-
arrayBindings.
|
|
3288
|
-
const { elements } =
|
|
3289
|
-
|
|
3431
|
+
for (let i5 = 0, len4 = arrayBindings.length; i5 < len4; i5++) {
|
|
3432
|
+
const { elements } = arrayBindings[i5];
|
|
3433
|
+
for (let i6 = 0, len5 = elements.length; i6 < len5; i6++) {
|
|
3434
|
+
const element = elements[i6];
|
|
3290
3435
|
if (Array.isArray(element)) {
|
|
3291
3436
|
const [, e] = element;
|
|
3292
3437
|
if (e.type === "Identifier") {
|
|
3293
|
-
|
|
3438
|
+
props.push(e);
|
|
3294
3439
|
} else if (e.type === "BindingRestElement") {
|
|
3295
|
-
|
|
3440
|
+
props.push(e);
|
|
3296
3441
|
}
|
|
3297
|
-
;
|
|
3298
|
-
return;
|
|
3299
3442
|
}
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
});
|
|
3303
|
-
});
|
|
3443
|
+
}
|
|
3444
|
+
}
|
|
3304
3445
|
const declarations = [];
|
|
3305
3446
|
const propsGroupedByName = /* @__PURE__ */ new Map();
|
|
3306
|
-
for (
|
|
3447
|
+
for (let i7 = 0, len6 = props.length; i7 < len6; i7++) {
|
|
3448
|
+
const p = props[i7];
|
|
3307
3449
|
const { name, value } = p;
|
|
3308
3450
|
let m1;
|
|
3309
3451
|
if (m1 = value?.type, m1 === "ArrayBindingPattern" || m1 === "ObjectBindingPattern") {
|
|
@@ -3325,9 +3467,10 @@ ${body}`;
|
|
|
3325
3467
|
pos: 0,
|
|
3326
3468
|
input: key
|
|
3327
3469
|
})) {
|
|
3328
|
-
shared.
|
|
3329
|
-
|
|
3330
|
-
|
|
3470
|
+
for (let i8 = 0, len7 = shared.length; i8 < len7; i8++) {
|
|
3471
|
+
const p = shared[i8];
|
|
3472
|
+
aliasBinding(p, makeRef(`_${key}`, key));
|
|
3473
|
+
}
|
|
3331
3474
|
return;
|
|
3332
3475
|
}
|
|
3333
3476
|
if (shared.length === 1) {
|
|
@@ -3442,7 +3585,7 @@ ${body}`;
|
|
|
3442
3585
|
const blockStatement = ["", statementExp];
|
|
3443
3586
|
let ref;
|
|
3444
3587
|
if (statementExp.type === "IterationExpression") {
|
|
3445
|
-
if (statementExp.async) {
|
|
3588
|
+
if (statementExp.async || statementExp.generator) {
|
|
3446
3589
|
return;
|
|
3447
3590
|
}
|
|
3448
3591
|
const statement2 = statementExp.statement;
|
|
@@ -5220,9 +5363,8 @@ ${js}`
|
|
|
5220
5363
|
children
|
|
5221
5364
|
});
|
|
5222
5365
|
}
|
|
5223
|
-
function expressionizeTypeIf([
|
|
5366
|
+
function expressionizeTypeIf([ifOp, condition, t, e]) {
|
|
5224
5367
|
const children = [
|
|
5225
|
-
ws,
|
|
5226
5368
|
"(",
|
|
5227
5369
|
insertTrimmingSpace(condition, ""),
|
|
5228
5370
|
"?"
|
|
@@ -6006,7 +6148,8 @@ ${js}`
|
|
|
6006
6148
|
type: "IterationExpression",
|
|
6007
6149
|
children: [statement],
|
|
6008
6150
|
block: statement.block,
|
|
6009
|
-
statement
|
|
6151
|
+
statement,
|
|
6152
|
+
generator: statement.generator
|
|
6010
6153
|
};
|
|
6011
6154
|
}
|
|
6012
6155
|
case "IfStatement": {
|
|
@@ -6533,6 +6676,7 @@ ${js}`
|
|
|
6533
6676
|
ReservedBinary,
|
|
6534
6677
|
ArgumentsWithTrailingMemberExpressions,
|
|
6535
6678
|
TrailingMemberExpressions,
|
|
6679
|
+
IndentedTrailingMemberExpression,
|
|
6536
6680
|
AllowedTrailingMemberExpressions,
|
|
6537
6681
|
TrailingCallExpressions,
|
|
6538
6682
|
AllowedTrailingCallExpressions,
|
|
@@ -6801,6 +6945,7 @@ ${js}`
|
|
|
6801
6945
|
BlockStatement,
|
|
6802
6946
|
LabelledStatement,
|
|
6803
6947
|
Label,
|
|
6948
|
+
LabelIdentifier,
|
|
6804
6949
|
LabelledItem,
|
|
6805
6950
|
IfStatement,
|
|
6806
6951
|
ElseClause,
|
|
@@ -7179,6 +7324,8 @@ ${js}`
|
|
|
7179
7324
|
TypePredicate,
|
|
7180
7325
|
Type,
|
|
7181
7326
|
TypeBinary,
|
|
7327
|
+
NestedTypeBinaryChain,
|
|
7328
|
+
NestedTypeBinary,
|
|
7182
7329
|
TypeUnary,
|
|
7183
7330
|
TypeUnarySuffix,
|
|
7184
7331
|
TypeUnaryOp,
|
|
@@ -7187,13 +7334,21 @@ ${js}`
|
|
|
7187
7334
|
TypePrimary,
|
|
7188
7335
|
ImportType,
|
|
7189
7336
|
TypeTuple,
|
|
7190
|
-
|
|
7337
|
+
TypeTupleContent,
|
|
7338
|
+
TypeElementListWithIndentedApplicationForbidden,
|
|
7339
|
+
TypeElementList,
|
|
7191
7340
|
TypeElement,
|
|
7192
|
-
|
|
7193
|
-
|
|
7341
|
+
NestedTypeElementList,
|
|
7342
|
+
NestedTypeElement,
|
|
7343
|
+
NestedTypeBulletedTuple,
|
|
7344
|
+
TypeBulletedTuple,
|
|
7345
|
+
NestedTypeBullet,
|
|
7346
|
+
TypeBullet,
|
|
7347
|
+
TypeWithPostfix,
|
|
7194
7348
|
TypeConditional,
|
|
7195
7349
|
TypeCondition,
|
|
7196
7350
|
TypeIfThenElse,
|
|
7351
|
+
TypeIfClause,
|
|
7197
7352
|
TypeElse,
|
|
7198
7353
|
TypeBlock,
|
|
7199
7354
|
TypeTemplateSubstitution,
|
|
@@ -7208,6 +7363,14 @@ ${js}`
|
|
|
7208
7363
|
TypeFunction,
|
|
7209
7364
|
TypeArrowFunction,
|
|
7210
7365
|
TypeArguments,
|
|
7366
|
+
ImplicitTypeArguments,
|
|
7367
|
+
TypeApplicationStart,
|
|
7368
|
+
ForbiddenImplicitTypeCalls,
|
|
7369
|
+
TypeArgumentList,
|
|
7370
|
+
NestedTypeArgumentList,
|
|
7371
|
+
NestedTypeArgument,
|
|
7372
|
+
SingleLineTypeArgumentList,
|
|
7373
|
+
TypeArgumentDelimited,
|
|
7211
7374
|
TypeArgument,
|
|
7212
7375
|
TypeArgumentDelimiter,
|
|
7213
7376
|
TypeParameters,
|
|
@@ -7236,6 +7399,8 @@ ${js}`
|
|
|
7236
7399
|
InsertCloseBrace,
|
|
7237
7400
|
InsertOpenBracket,
|
|
7238
7401
|
InsertCloseBracket,
|
|
7402
|
+
InsertOpenAngleBracket,
|
|
7403
|
+
InsertCloseAngleBracket,
|
|
7239
7404
|
InsertComma,
|
|
7240
7405
|
InsertSpaceEquals,
|
|
7241
7406
|
InsertConst,
|
|
@@ -7277,7 +7442,8 @@ ${js}`
|
|
|
7277
7442
|
IndentedFurther,
|
|
7278
7443
|
IndentedAtLeast,
|
|
7279
7444
|
NotDedented,
|
|
7280
|
-
Dedented
|
|
7445
|
+
Dedented,
|
|
7446
|
+
PushExtraIndent1
|
|
7281
7447
|
};
|
|
7282
7448
|
var $L0 = (0, import_lib3.$L)("");
|
|
7283
7449
|
var $L1 = (0, import_lib3.$L)("{");
|
|
@@ -7524,7 +7690,7 @@ ${js}`
|
|
|
7524
7690
|
var $R3 = (0, import_lib3.$R)(new RegExp("[0-9]", "suy"));
|
|
7525
7691
|
var $R4 = (0, import_lib3.$R)(new RegExp("(?!\\p{ID_Start}|[_$0-9(\\[{])", "suy"));
|
|
7526
7692
|
var $R5 = (0, import_lib3.$R)(new RegExp("[ \\t]", "suy"));
|
|
7527
|
-
var $R6 = (0, import_lib3.$R)(new RegExp("\\p{ID_Continue}|[\\u200C\\u200D$.#{]", "suy"));
|
|
7693
|
+
var $R6 = (0, import_lib3.$R)(new RegExp("\\p{ID_Continue}|[\\u200C\\u200D$.#{=]", "suy"));
|
|
7528
7694
|
var $R7 = (0, import_lib3.$R)(new RegExp("[&=]", "suy"));
|
|
7529
7695
|
var $R8 = (0, import_lib3.$R)(new RegExp("(?=['\"`])", "suy"));
|
|
7530
7696
|
var $R9 = (0, import_lib3.$R)(new RegExp("(?=[\\/?])", "suy"));
|
|
@@ -7608,14 +7774,16 @@ ${js}`
|
|
|
7608
7774
|
var $R87 = (0, import_lib3.$R)(new RegExp("[^{}<>\\r\\n]+", "suy"));
|
|
7609
7775
|
var $R88 = (0, import_lib3.$R)(new RegExp("[+-]?", "suy"));
|
|
7610
7776
|
var $R89 = (0, import_lib3.$R)(new RegExp("(?=if|unless)", "suy"));
|
|
7611
|
-
var $R90 = (0, import_lib3.$R)(new RegExp("
|
|
7612
|
-
var $R91 = (0, import_lib3.$R)(new RegExp("[\\
|
|
7613
|
-
var $R92 = (0, import_lib3.$R)(new RegExp("[\\
|
|
7614
|
-
var $R93 = (0, import_lib3.$R)(new RegExp("
|
|
7615
|
-
var $R94 = (0, import_lib3.$R)(new RegExp("
|
|
7616
|
-
var $R95 = (0, import_lib3.$R)(new RegExp("(
|
|
7617
|
-
var $R96 = (0, import_lib3.$R)(new RegExp("
|
|
7618
|
-
var $R97 = (0, import_lib3.$R)(new RegExp("[
|
|
7777
|
+
var $R90 = (0, import_lib3.$R)(new RegExp("[|&<!=\\-\u21D2\u2192]", "suy"));
|
|
7778
|
+
var $R91 = (0, import_lib3.$R)(new RegExp("(extends|not|is)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
|
|
7779
|
+
var $R92 = (0, import_lib3.$R)(new RegExp("#![^\\r\\n]*", "suy"));
|
|
7780
|
+
var $R93 = (0, import_lib3.$R)(new RegExp("[\\t ]*", "suy"));
|
|
7781
|
+
var $R94 = (0, import_lib3.$R)(new RegExp("[\\s]*", "suy"));
|
|
7782
|
+
var $R95 = (0, import_lib3.$R)(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?", "suy"));
|
|
7783
|
+
var $R96 = (0, import_lib3.$R)(new RegExp("\\/\\/\\/[^\\r\\n]*", "suy"));
|
|
7784
|
+
var $R97 = (0, import_lib3.$R)(new RegExp("(?=[ \\t\\r\\n\\/#]|$)", "suy"));
|
|
7785
|
+
var $R98 = (0, import_lib3.$R)(new RegExp("\\r\\n|\\n|\\r|$", "suy"));
|
|
7786
|
+
var $R99 = (0, import_lib3.$R)(new RegExp("[^]*", "suy"));
|
|
7619
7787
|
var Program$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Reset, Init, (0, import_lib3.$E)(EOS), TopLevelStatements, __), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
7620
7788
|
var reset = $1;
|
|
7621
7789
|
var init = $2;
|
|
@@ -7802,6 +7970,9 @@ ${js}`
|
|
|
7802
7970
|
var close = $5;
|
|
7803
7971
|
if (skipImplicitArguments(args))
|
|
7804
7972
|
return $skip;
|
|
7973
|
+
let last = args[args.length - 1];
|
|
7974
|
+
if (last?.token === "," && last.implicit)
|
|
7975
|
+
args = args.slice(0, -1);
|
|
7805
7976
|
return {
|
|
7806
7977
|
type: "Call",
|
|
7807
7978
|
args,
|
|
@@ -7834,7 +8005,7 @@ ${js}`
|
|
|
7834
8005
|
function ExplicitArguments(ctx, state2) {
|
|
7835
8006
|
return (0, import_lib3.$EVENT)(ctx, state2, "ExplicitArguments", ExplicitArguments$0);
|
|
7836
8007
|
}
|
|
7837
|
-
var ApplicationStart$0 = (0, import_lib3.$S)(IndentedApplicationAllowed, (0, import_lib3.$Y)((0, import_lib3.$S)(IndentedFurther, (0, import_lib3.$N)(IdentifierBinaryOp), (0, import_lib3.$N)(
|
|
8008
|
+
var ApplicationStart$0 = (0, import_lib3.$S)(IndentedApplicationAllowed, (0, import_lib3.$Y)((0, import_lib3.$S)(IndentedFurther, (0, import_lib3.$N)(IdentifierBinaryOp))), (0, import_lib3.$N)(IndentedTrailingMemberExpression));
|
|
7838
8009
|
var ApplicationStart$1 = (0, import_lib3.$S)((0, import_lib3.$N)(EOS), (0, import_lib3.$Y)((0, import_lib3.$S)(_, (0, import_lib3.$C)(BracedApplicationAllowed, (0, import_lib3.$N)((0, import_lib3.$EXPECT)($L1, 'ApplicationStart "{"'))), (0, import_lib3.$N)(ForbiddenImplicitCalls))));
|
|
7839
8010
|
var ApplicationStart$$ = [ApplicationStart$0, ApplicationStart$1];
|
|
7840
8011
|
function ApplicationStart(ctx, state2) {
|
|
@@ -7875,20 +8046,20 @@ ${js}`
|
|
|
7875
8046
|
function ArgumentsWithTrailingMemberExpressions(ctx, state2) {
|
|
7876
8047
|
return (0, import_lib3.$EVENT)(ctx, state2, "ArgumentsWithTrailingMemberExpressions", ArgumentsWithTrailingMemberExpressions$0);
|
|
7877
8048
|
}
|
|
7878
|
-
var TrailingMemberExpressions$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$Q)(MemberExpressionRest), (0, import_lib3.$Q)(
|
|
7879
|
-
return
|
|
7880
|
-
if (Array.isArray(memberExpressionRest)) {
|
|
7881
|
-
return [ws, ...memberExpressionRest];
|
|
7882
|
-
}
|
|
7883
|
-
return {
|
|
7884
|
-
...memberExpressionRest,
|
|
7885
|
-
children: [ws, ...memberExpressionRest.children]
|
|
7886
|
-
};
|
|
7887
|
-
}));
|
|
8049
|
+
var TrailingMemberExpressions$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$Q)(MemberExpressionRest), (0, import_lib3.$Q)(IndentedTrailingMemberExpression)), function($skip, $loc, $0, $1, $2) {
|
|
8050
|
+
return [...$1, ...$2];
|
|
7888
8051
|
});
|
|
7889
8052
|
function TrailingMemberExpressions(ctx, state2) {
|
|
7890
8053
|
return (0, import_lib3.$EVENT)(ctx, state2, "TrailingMemberExpressions", TrailingMemberExpressions$0);
|
|
7891
8054
|
}
|
|
8055
|
+
var IndentedTrailingMemberExpression$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(IndentedAtLeast, (0, import_lib3.$Y)((0, import_lib3.$S)((0, import_lib3.$E)((0, import_lib3.$EXPECT)($L6, 'IndentedTrailingMemberExpression "?"')), (0, import_lib3.$EXPECT)($L7, 'IndentedTrailingMemberExpression "."'), (0, import_lib3.$N)((0, import_lib3.$EXPECT)($R3, "IndentedTrailingMemberExpression /[0-9]/")))), MemberExpressionRest), function($skip, $loc, $0, $1, $2, $3) {
|
|
8056
|
+
var ws = $1;
|
|
8057
|
+
var rest = $3;
|
|
8058
|
+
return prepend(ws, rest);
|
|
8059
|
+
});
|
|
8060
|
+
function IndentedTrailingMemberExpression(ctx, state2) {
|
|
8061
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "IndentedTrailingMemberExpression", IndentedTrailingMemberExpression$0);
|
|
8062
|
+
}
|
|
7892
8063
|
var AllowedTrailingMemberExpressions$0 = (0, import_lib3.$T)((0, import_lib3.$S)(TrailingMemberPropertyAllowed, TrailingMemberExpressions), function(value) {
|
|
7893
8064
|
return value[1];
|
|
7894
8065
|
});
|
|
@@ -8156,7 +8327,7 @@ ${js}`
|
|
|
8156
8327
|
children: [{ $loc: $1.$loc, token: "satisfies" }, $2, $3]
|
|
8157
8328
|
};
|
|
8158
8329
|
});
|
|
8159
|
-
var NWTypePostfix$1 = (0, import_lib3.$TS)((0, import_lib3.$S)(As, (0, import_lib3.$E)(ExclamationPoint), Type), function($skip, $loc, $0, $1, $2, $3) {
|
|
8330
|
+
var NWTypePostfix$1 = (0, import_lib3.$TS)((0, import_lib3.$S)(As, (0, import_lib3.$E)(ExclamationPoint), (0, import_lib3.$C)(Type, (0, import_lib3.$S)(__, Const))), function($skip, $loc, $0, $1, $2, $3) {
|
|
8160
8331
|
var as = $1;
|
|
8161
8332
|
var ex = $2;
|
|
8162
8333
|
var type = $3;
|
|
@@ -8510,7 +8681,7 @@ ${js}`
|
|
|
8510
8681
|
function ParenthesizedExpression(ctx, state2) {
|
|
8511
8682
|
return (0, import_lib3.$EVENT)(ctx, state2, "ParenthesizedExpression", ParenthesizedExpression$0);
|
|
8512
8683
|
}
|
|
8513
|
-
var Placeholder$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Dot, (0, import_lib3.$N)((0, import_lib3.$EXPECT)($R6, "Placeholder /\\p{ID_Continue}|[\\u200C\\u200D$.#{]/")), (0, import_lib3.$E)(PlaceholderTypeSuffix)), function($skip, $loc, $0, $1, $2, $3) {
|
|
8684
|
+
var Placeholder$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Dot, (0, import_lib3.$N)((0, import_lib3.$EXPECT)($R6, "Placeholder /\\p{ID_Continue}|[\\u200C\\u200D$.#{=]/")), (0, import_lib3.$E)(PlaceholderTypeSuffix)), function($skip, $loc, $0, $1, $2, $3) {
|
|
8514
8685
|
var dot = $1;
|
|
8515
8686
|
var typeSuffix = $3;
|
|
8516
8687
|
return {
|
|
@@ -9463,18 +9634,18 @@ ${js}`
|
|
|
9463
9634
|
var params = $3;
|
|
9464
9635
|
var close = $4;
|
|
9465
9636
|
let tt, before = [], rest, after = [], errors = [];
|
|
9466
|
-
function
|
|
9637
|
+
function append2(p) {
|
|
9467
9638
|
(rest ? after : before).push(p);
|
|
9468
9639
|
}
|
|
9469
9640
|
for (const param of params) {
|
|
9470
9641
|
switch (param.type) {
|
|
9471
9642
|
case "ThisType":
|
|
9472
9643
|
if (tt) {
|
|
9473
|
-
|
|
9644
|
+
append2({
|
|
9474
9645
|
type: "Error",
|
|
9475
9646
|
message: "Only one typed this parameter is allowed"
|
|
9476
9647
|
});
|
|
9477
|
-
|
|
9648
|
+
append2(param);
|
|
9478
9649
|
} else {
|
|
9479
9650
|
tt = trimFirstSpace(param);
|
|
9480
9651
|
if (before.length || rest) {
|
|
@@ -9492,17 +9663,17 @@ ${js}`
|
|
|
9492
9663
|
break;
|
|
9493
9664
|
case "FunctionRestParameter":
|
|
9494
9665
|
if (rest) {
|
|
9495
|
-
|
|
9666
|
+
append2({
|
|
9496
9667
|
type: "Error",
|
|
9497
9668
|
message: "Only one rest parameter is allowed"
|
|
9498
9669
|
});
|
|
9499
|
-
|
|
9670
|
+
append2(param);
|
|
9500
9671
|
} else {
|
|
9501
9672
|
rest = param;
|
|
9502
9673
|
}
|
|
9503
9674
|
break;
|
|
9504
9675
|
default:
|
|
9505
|
-
|
|
9676
|
+
append2(param);
|
|
9506
9677
|
}
|
|
9507
9678
|
}
|
|
9508
9679
|
const names = before.flatMap((p) => p.names);
|
|
@@ -11007,15 +11178,10 @@ ${js}`
|
|
|
11007
11178
|
if (!length)
|
|
11008
11179
|
return $skip;
|
|
11009
11180
|
return list.map((e, i) => {
|
|
11010
|
-
if (i === 0
|
|
11011
|
-
|
|
11012
|
-
|
|
11013
|
-
|
|
11014
|
-
return { ...e, children: [indent, ...e.children] };
|
|
11015
|
-
}
|
|
11016
|
-
if (i === length - 1) {
|
|
11017
|
-
return { ...e, children: [...e.children, delimiter] };
|
|
11018
|
-
}
|
|
11181
|
+
if (i === 0)
|
|
11182
|
+
e = prepend(indent, e);
|
|
11183
|
+
if (i === length - 1)
|
|
11184
|
+
e = append(e, delimiter);
|
|
11019
11185
|
return e;
|
|
11020
11186
|
});
|
|
11021
11187
|
});
|
|
@@ -11045,19 +11211,13 @@ ${js}`
|
|
|
11045
11211
|
var ElementList$1 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$N)(EOS), ArrayElementExpression, (0, import_lib3.$Q)(ElementListRest)), function($skip, $loc, $0, $1, $2, $3) {
|
|
11046
11212
|
var first = $2;
|
|
11047
11213
|
var rest = $3;
|
|
11048
|
-
if (rest.length)
|
|
11049
|
-
return [
|
|
11050
|
-
|
|
11051
|
-
|
|
11052
|
-
|
|
11053
|
-
|
|
11054
|
-
|
|
11055
|
-
...e,
|
|
11056
|
-
children: [...e.children, delim]
|
|
11057
|
-
};
|
|
11058
|
-
}));
|
|
11059
|
-
}
|
|
11060
|
-
return [first];
|
|
11214
|
+
if (!rest.length)
|
|
11215
|
+
return [first];
|
|
11216
|
+
return [
|
|
11217
|
+
append(first, rest[0][0])
|
|
11218
|
+
].concat(
|
|
11219
|
+
rest.map(([_2, e], i) => append(e, rest[i + 1]?.[0]))
|
|
11220
|
+
);
|
|
11061
11221
|
});
|
|
11062
11222
|
var ElementList$$ = [ElementList$0, ElementList$1];
|
|
11063
11223
|
function ElementList(ctx, state2) {
|
|
@@ -11118,9 +11278,10 @@ ${js}`
|
|
|
11118
11278
|
if (!content.length)
|
|
11119
11279
|
return $skip;
|
|
11120
11280
|
content = content.flat();
|
|
11121
|
-
const
|
|
11122
|
-
if (children
|
|
11123
|
-
children.
|
|
11281
|
+
const last = content[content.length - 1];
|
|
11282
|
+
if (last.children?.at(-1)?.implicit) {
|
|
11283
|
+
last.children = last.children.slice(0, -1);
|
|
11284
|
+
}
|
|
11124
11285
|
return {
|
|
11125
11286
|
type: "ArrayExpression",
|
|
11126
11287
|
children: [...open, ...content, close]
|
|
@@ -11140,9 +11301,10 @@ ${js}`
|
|
|
11140
11301
|
// replace first space with bracket
|
|
11141
11302
|
...content[1].flat()
|
|
11142
11303
|
];
|
|
11143
|
-
const
|
|
11144
|
-
if (children
|
|
11145
|
-
children.
|
|
11304
|
+
const last = content[content.length - 1];
|
|
11305
|
+
if (last.children?.at(-1)?.implicit) {
|
|
11306
|
+
last.children = last.children.slice(0, -1);
|
|
11307
|
+
}
|
|
11146
11308
|
return {
|
|
11147
11309
|
type: "ArrayExpression",
|
|
11148
11310
|
children: [open, ...content, close]
|
|
@@ -11154,7 +11316,7 @@ ${js}`
|
|
|
11154
11316
|
var NestedArrayBullet$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Nested, ArrayBullet), function($skip, $loc, $0, $1, $2) {
|
|
11155
11317
|
var indent = $1;
|
|
11156
11318
|
var list = $2;
|
|
11157
|
-
return list.map((e, i) => i === 0 ?
|
|
11319
|
+
return list.map((e, i) => i === 0 ? prepend(indent, e) : e);
|
|
11158
11320
|
});
|
|
11159
11321
|
function NestedArrayBullet(ctx, state2) {
|
|
11160
11322
|
return (0, import_lib3.$EVENT)(ctx, state2, "NestedArrayBullet", NestedArrayBullet$0);
|
|
@@ -11165,15 +11327,13 @@ ${js}`
|
|
|
11165
11327
|
if (!content)
|
|
11166
11328
|
return $skip;
|
|
11167
11329
|
let [list, delimiter] = content;
|
|
11168
|
-
if (list.type === "ArrayExpression")
|
|
11169
|
-
list = [list];
|
|
11170
11330
|
if (!list.length)
|
|
11171
11331
|
return $skip;
|
|
11172
11332
|
list = list.slice();
|
|
11173
|
-
list[0] =
|
|
11333
|
+
list[0] = prepend(bullet, list[0]);
|
|
11174
11334
|
if (delimiter) {
|
|
11175
11335
|
const last = list.length - 1;
|
|
11176
|
-
list[last] =
|
|
11336
|
+
list[last] = append(list[last], delimiter);
|
|
11177
11337
|
}
|
|
11178
11338
|
return list;
|
|
11179
11339
|
});
|
|
@@ -12443,8 +12603,10 @@ ${js}`
|
|
|
12443
12603
|
var Statement$2 = (0, import_lib3.$T)((0, import_lib3.$S)(IfStatement, (0, import_lib3.$N)(ShouldExpressionize)), function(value) {
|
|
12444
12604
|
return value[0];
|
|
12445
12605
|
});
|
|
12446
|
-
var Statement$3 = (0, import_lib3.$
|
|
12447
|
-
|
|
12606
|
+
var Statement$3 = (0, import_lib3.$TS)((0, import_lib3.$S)(IterationStatement, (0, import_lib3.$N)(ShouldExpressionize)), function($skip, $loc, $0, $1, $2) {
|
|
12607
|
+
if ($1.generator)
|
|
12608
|
+
return $skip;
|
|
12609
|
+
return $1;
|
|
12448
12610
|
});
|
|
12449
12611
|
var Statement$4 = (0, import_lib3.$T)((0, import_lib3.$S)(SwitchStatement, (0, import_lib3.$N)(ShouldExpressionize)), function(value) {
|
|
12450
12612
|
return value[0];
|
|
@@ -12515,11 +12677,22 @@ ${js}`
|
|
|
12515
12677
|
var colon = $1;
|
|
12516
12678
|
var id = $2;
|
|
12517
12679
|
var w = $3;
|
|
12518
|
-
return
|
|
12680
|
+
return {
|
|
12681
|
+
type: "Label",
|
|
12682
|
+
name: id.name,
|
|
12683
|
+
children: [id, colon, w]
|
|
12684
|
+
};
|
|
12519
12685
|
});
|
|
12520
12686
|
function Label(ctx, state2) {
|
|
12521
12687
|
return (0, import_lib3.$EVENT)(ctx, state2, "Label", Label$0);
|
|
12522
12688
|
}
|
|
12689
|
+
var LabelIdentifier$0 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$E)(Colon), Identifier), function(value) {
|
|
12690
|
+
var id = value[1];
|
|
12691
|
+
return id;
|
|
12692
|
+
});
|
|
12693
|
+
function LabelIdentifier(ctx, state2) {
|
|
12694
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "LabelIdentifier", LabelIdentifier$0);
|
|
12695
|
+
}
|
|
12523
12696
|
var LabelledItem$0 = Statement;
|
|
12524
12697
|
var LabelledItem$1 = FunctionDeclaration;
|
|
12525
12698
|
var LabelledItem$$ = [LabelledItem$0, LabelledItem$1];
|
|
@@ -12616,7 +12789,8 @@ ${js}`
|
|
|
12616
12789
|
children: [statement],
|
|
12617
12790
|
block: statement.block,
|
|
12618
12791
|
statement,
|
|
12619
|
-
async
|
|
12792
|
+
async,
|
|
12793
|
+
generator: statement.generator
|
|
12620
12794
|
};
|
|
12621
12795
|
});
|
|
12622
12796
|
function IterationExpression(ctx, state2) {
|
|
@@ -12635,8 +12809,9 @@ ${js}`
|
|
|
12635
12809
|
function LoopStatement(ctx, state2) {
|
|
12636
12810
|
return (0, import_lib3.$EVENT)(ctx, state2, "LoopStatement", LoopStatement$0);
|
|
12637
12811
|
}
|
|
12638
|
-
var LoopClause$0 = (0, import_lib3.$
|
|
12639
|
-
var kind = $
|
|
12812
|
+
var LoopClause$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Loop, (0, import_lib3.$E)((0, import_lib3.$S)((0, import_lib3.$E)(_), Star))), function($skip, $loc, $0, $1, $2) {
|
|
12813
|
+
var kind = $1;
|
|
12814
|
+
var generator = $2;
|
|
12640
12815
|
const expression = {
|
|
12641
12816
|
type: "Literal",
|
|
12642
12817
|
children: ["true"],
|
|
@@ -12651,33 +12826,41 @@ ${js}`
|
|
|
12651
12826
|
type: "IterationStatement",
|
|
12652
12827
|
subtype: kind.token,
|
|
12653
12828
|
children: [kind, condition],
|
|
12654
|
-
condition
|
|
12829
|
+
condition,
|
|
12830
|
+
generator
|
|
12655
12831
|
};
|
|
12656
12832
|
});
|
|
12657
12833
|
function LoopClause(ctx, state2) {
|
|
12658
12834
|
return (0, import_lib3.$EVENT)(ctx, state2, "LoopClause", LoopClause$0);
|
|
12659
12835
|
}
|
|
12660
|
-
var DoWhileStatement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Do, NoPostfixBracedOrEmptyBlock, __, WhileClause), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
12661
|
-
var
|
|
12662
|
-
var
|
|
12836
|
+
var DoWhileStatement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Do, (0, import_lib3.$E)((0, import_lib3.$S)((0, import_lib3.$E)(_), Star)), NoPostfixBracedOrEmptyBlock, __, WhileClause), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
12837
|
+
var d = $1;
|
|
12838
|
+
var generator = $2;
|
|
12839
|
+
var block = $3;
|
|
12840
|
+
var ws = $4;
|
|
12841
|
+
var clause = $5;
|
|
12663
12842
|
return {
|
|
12664
12843
|
...clause,
|
|
12665
12844
|
type: "IterationStatement",
|
|
12666
12845
|
subtype: "do-while",
|
|
12667
|
-
children:
|
|
12668
|
-
block
|
|
12846
|
+
children: [d, block, ws, clause],
|
|
12847
|
+
block,
|
|
12848
|
+
generator
|
|
12669
12849
|
};
|
|
12670
12850
|
});
|
|
12671
12851
|
function DoWhileStatement(ctx, state2) {
|
|
12672
12852
|
return (0, import_lib3.$EVENT)(ctx, state2, "DoWhileStatement", DoWhileStatement$0);
|
|
12673
12853
|
}
|
|
12674
|
-
var DoStatement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Do, NoPostfixBracedOrEmptyBlock), function($skip, $loc, $0, $1, $2) {
|
|
12675
|
-
var
|
|
12854
|
+
var DoStatement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Do, (0, import_lib3.$E)((0, import_lib3.$S)((0, import_lib3.$E)(_), Star)), NoPostfixBracedOrEmptyBlock), function($skip, $loc, $0, $1, $2, $3) {
|
|
12855
|
+
var d = $1;
|
|
12856
|
+
var generator = $2;
|
|
12857
|
+
var block = $3;
|
|
12676
12858
|
block = trimFirstSpace(block);
|
|
12677
12859
|
return {
|
|
12678
12860
|
type: "DoStatement",
|
|
12679
12861
|
children: [block],
|
|
12680
|
-
block
|
|
12862
|
+
block,
|
|
12863
|
+
generator
|
|
12681
12864
|
};
|
|
12682
12865
|
});
|
|
12683
12866
|
function DoStatement(ctx, state2) {
|
|
@@ -12712,10 +12895,11 @@ ${js}`
|
|
|
12712
12895
|
function WhileStatement(ctx, state2) {
|
|
12713
12896
|
return (0, import_lib3.$EVENT)(ctx, state2, "WhileStatement", WhileStatement$0);
|
|
12714
12897
|
}
|
|
12715
|
-
var WhileClause$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$C)(While, Until), (0, import_lib3.$E)(_), Condition), function($skip, $loc, $0, $1, $2, $3) {
|
|
12898
|
+
var WhileClause$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$C)(While, Until), (0, import_lib3.$E)((0, import_lib3.$S)((0, import_lib3.$E)(_), Star)), (0, import_lib3.$E)(_), Condition), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
12716
12899
|
var kind = $1;
|
|
12717
|
-
var
|
|
12718
|
-
var
|
|
12900
|
+
var generator = $2;
|
|
12901
|
+
var ws = $3;
|
|
12902
|
+
var condition = $4;
|
|
12719
12903
|
if (kind.negated) {
|
|
12720
12904
|
kind = { ...kind, token: "while" };
|
|
12721
12905
|
condition = negateCondition(condition);
|
|
@@ -12725,6 +12909,7 @@ ${js}`
|
|
|
12725
12909
|
subtype: kind.token,
|
|
12726
12910
|
children: [kind, ws, condition],
|
|
12727
12911
|
condition,
|
|
12912
|
+
generator,
|
|
12728
12913
|
negated: kind.negated
|
|
12729
12914
|
};
|
|
12730
12915
|
});
|
|
@@ -12744,16 +12929,18 @@ ${js}`
|
|
|
12744
12929
|
function ForStatement(ctx, state2) {
|
|
12745
12930
|
return (0, import_lib3.$EVENT)(ctx, state2, "ForStatement", ForStatement$0);
|
|
12746
12931
|
}
|
|
12747
|
-
var ForClause$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(For, __, ForStatementControl), function($skip, $loc, $0, $1, $2, $3) {
|
|
12748
|
-
var
|
|
12932
|
+
var ForClause$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(For, (0, import_lib3.$E)((0, import_lib3.$S)((0, import_lib3.$E)(_), Star)), __, ForStatementControl), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
12933
|
+
var generator = $2;
|
|
12934
|
+
var c = $4;
|
|
12749
12935
|
const { children, declaration } = c;
|
|
12750
12936
|
return {
|
|
12751
12937
|
type: "ForStatement",
|
|
12752
|
-
children: [$1, ...$
|
|
12938
|
+
children: [$1, ...$3, ...children],
|
|
12753
12939
|
declaration,
|
|
12754
12940
|
block: null,
|
|
12755
12941
|
blockPrefix: c.blockPrefix,
|
|
12756
|
-
hoistDec: c.hoistDec
|
|
12942
|
+
hoistDec: c.hoistDec,
|
|
12943
|
+
generator
|
|
12757
12944
|
};
|
|
12758
12945
|
});
|
|
12759
12946
|
function ForClause(ctx, state2) {
|
|
@@ -13520,11 +13707,21 @@ ${js}`
|
|
|
13520
13707
|
function ExpressionStatement(ctx, state2) {
|
|
13521
13708
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "ExpressionStatement", ExpressionStatement$$);
|
|
13522
13709
|
}
|
|
13523
|
-
var KeywordStatement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Break, (0, import_lib3.$E)((0, import_lib3.$S)(_, (0, import_lib3.$E)(
|
|
13710
|
+
var KeywordStatement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Break, (0, import_lib3.$E)((0, import_lib3.$S)(_, LabelIdentifier)), (0, import_lib3.$E)((0, import_lib3.$S)(_, With, MaybeNestedExtendedExpression))), function($skip, $loc, $0, $1, $2, $3) {
|
|
13711
|
+
const children = [$1];
|
|
13712
|
+
if ($2)
|
|
13713
|
+
children.push($2);
|
|
13714
|
+
if ($3)
|
|
13715
|
+
children.push({
|
|
13716
|
+
type: "Error",
|
|
13717
|
+
subtype: "Warning",
|
|
13718
|
+
message: "'break with' outside of loop that returns a value"
|
|
13719
|
+
});
|
|
13524
13720
|
return {
|
|
13525
13721
|
type: "BreakStatement",
|
|
13526
|
-
|
|
13527
|
-
|
|
13722
|
+
label: $2?.[1],
|
|
13723
|
+
with: $3?.[2],
|
|
13724
|
+
children
|
|
13528
13725
|
};
|
|
13529
13726
|
});
|
|
13530
13727
|
var KeywordStatement$1 = (0, import_lib3.$TS)((0, import_lib3.$S)(Continue, _, Switch), function($skip, $loc, $0, $1, $2, $3) {
|
|
@@ -13534,11 +13731,21 @@ ${js}`
|
|
|
13534
13731
|
children: []
|
|
13535
13732
|
};
|
|
13536
13733
|
});
|
|
13537
|
-
var KeywordStatement$2 = (0, import_lib3.$TS)((0, import_lib3.$S)(Continue, (0, import_lib3.$E)((0, import_lib3.$S)(_, (0, import_lib3.$E)(
|
|
13734
|
+
var KeywordStatement$2 = (0, import_lib3.$TS)((0, import_lib3.$S)(Continue, (0, import_lib3.$E)((0, import_lib3.$S)(_, LabelIdentifier)), (0, import_lib3.$E)((0, import_lib3.$S)(_, With, MaybeNestedExtendedExpression))), function($skip, $loc, $0, $1, $2, $3) {
|
|
13735
|
+
const children = [$1];
|
|
13736
|
+
if ($2)
|
|
13737
|
+
children.push($2);
|
|
13738
|
+
if ($3)
|
|
13739
|
+
children.push({
|
|
13740
|
+
type: "Error",
|
|
13741
|
+
subtype: "Warning",
|
|
13742
|
+
message: "'continue with' outside of loop that returns a value"
|
|
13743
|
+
});
|
|
13538
13744
|
return {
|
|
13539
13745
|
type: "ContinueStatement",
|
|
13540
|
-
|
|
13541
|
-
|
|
13746
|
+
label: $2?.[1],
|
|
13747
|
+
with: $3?.[2],
|
|
13748
|
+
children
|
|
13542
13749
|
};
|
|
13543
13750
|
});
|
|
13544
13751
|
var KeywordStatement$3 = DebuggerStatement;
|
|
@@ -15966,9 +16173,42 @@ ${js}`
|
|
|
15966
16173
|
function JSXText(ctx, state2) {
|
|
15967
16174
|
return (0, import_lib3.$EVENT)(ctx, state2, "JSXText", JSXText$0);
|
|
15968
16175
|
}
|
|
15969
|
-
var JSXChildExpression$0 = (0, import_lib3.$
|
|
16176
|
+
var JSXChildExpression$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(Whitespace), LexicalDeclaration), function($skip, $loc, $0, $1, $2) {
|
|
16177
|
+
var d = $2;
|
|
16178
|
+
let names = d.names.concat(
|
|
16179
|
+
d.thisAssignments.map((a) => a[1][1])
|
|
16180
|
+
);
|
|
16181
|
+
names.sort();
|
|
16182
|
+
names = names.filter((name, i) => i === 0 || name !== names[i - 1]);
|
|
16183
|
+
d = {
|
|
16184
|
+
...d,
|
|
16185
|
+
hoistDec: {
|
|
16186
|
+
type: "Declaration",
|
|
16187
|
+
children: [
|
|
16188
|
+
"let ",
|
|
16189
|
+
names.map((n, i) => i === 0 ? [n] : [",", n]).flat()
|
|
16190
|
+
]
|
|
16191
|
+
},
|
|
16192
|
+
children: d.children.slice(1)
|
|
16193
|
+
// drop LetOrConst
|
|
16194
|
+
};
|
|
16195
|
+
if (d.thisAssignments?.length) {
|
|
16196
|
+
d.children.push(...d.splices, ",", ...d.thisAssignments.map(
|
|
16197
|
+
(a, i) => a[a.length - 1] === ";" ? [
|
|
16198
|
+
...a.slice(0, -1),
|
|
16199
|
+
i === d.thisAssignments.length - 1 ? "" : ","
|
|
16200
|
+
] : a
|
|
16201
|
+
));
|
|
16202
|
+
} else if (d.splices?.length) {
|
|
16203
|
+
d.children.push(...d.splices);
|
|
16204
|
+
}
|
|
16205
|
+
d.children.push(",void 0");
|
|
16206
|
+
return d;
|
|
16207
|
+
});
|
|
16208
|
+
var JSXChildExpression$1 = (0, import_lib3.$S)((0, import_lib3.$E)(Whitespace), (0, import_lib3.$E)((0, import_lib3.$S)(DotDotDot, (0, import_lib3.$E)(Whitespace))), PostfixedExpression);
|
|
16209
|
+
var JSXChildExpression$$ = [JSXChildExpression$0, JSXChildExpression$1];
|
|
15970
16210
|
function JSXChildExpression(ctx, state2) {
|
|
15971
|
-
return (0, import_lib3.$
|
|
16211
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "JSXChildExpression", JSXChildExpression$$);
|
|
15972
16212
|
}
|
|
15973
16213
|
var IndentedJSXChildExpression$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(PushIndent, (0, import_lib3.$E)(NestedJSXChildExpression), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
|
|
15974
16214
|
if (!$2)
|
|
@@ -16465,14 +16705,16 @@ ${js}`
|
|
|
16465
16705
|
function TypeSuffix(ctx, state2) {
|
|
16466
16706
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeSuffix", TypeSuffix$$);
|
|
16467
16707
|
}
|
|
16468
|
-
var MaybeNestedType$0 =
|
|
16469
|
-
var MaybeNestedType$1 =
|
|
16708
|
+
var MaybeNestedType$0 = NestedTypeBulletedTuple;
|
|
16709
|
+
var MaybeNestedType$1 = NestedInterfaceBlock;
|
|
16710
|
+
var MaybeNestedType$2 = NestedTypeBinaryChain;
|
|
16711
|
+
var MaybeNestedType$3 = (0, import_lib3.$TS)((0, import_lib3.$S)(PushIndent, (0, import_lib3.$E)((0, import_lib3.$S)(Nested, Type)), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
|
|
16470
16712
|
if (!$2)
|
|
16471
16713
|
return $skip;
|
|
16472
16714
|
return $2;
|
|
16473
16715
|
});
|
|
16474
|
-
var MaybeNestedType$
|
|
16475
|
-
var MaybeNestedType$$ = [MaybeNestedType$0, MaybeNestedType$1, MaybeNestedType$2];
|
|
16716
|
+
var MaybeNestedType$4 = Type;
|
|
16717
|
+
var MaybeNestedType$$ = [MaybeNestedType$0, MaybeNestedType$1, MaybeNestedType$2, MaybeNestedType$3, MaybeNestedType$4];
|
|
16476
16718
|
function MaybeNestedType(ctx, state2) {
|
|
16477
16719
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "MaybeNestedType", MaybeNestedType$$);
|
|
16478
16720
|
}
|
|
@@ -16488,9 +16730,11 @@ ${js}`
|
|
|
16488
16730
|
function ReturnTypeSuffix(ctx, state2) {
|
|
16489
16731
|
return (0, import_lib3.$EVENT)(ctx, state2, "ReturnTypeSuffix", ReturnTypeSuffix$0);
|
|
16490
16732
|
}
|
|
16491
|
-
var ReturnType$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)((0, import_lib3.$S)(__, (0, import_lib3.$EXPECT)($L232, 'ReturnType "asserts"'), NonIdContinue)), TypePredicate), function($skip, $loc, $0, $1, $2) {
|
|
16733
|
+
var ReturnType$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)((0, import_lib3.$S)(__, (0, import_lib3.$EXPECT)($L232, 'ReturnType "asserts"'), NonIdContinue)), ForbidIndentedApplication, (0, import_lib3.$E)(TypePredicate), RestoreIndentedApplication), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
16492
16734
|
var asserts = $1;
|
|
16493
|
-
var t = $
|
|
16735
|
+
var t = $3;
|
|
16736
|
+
if (!t)
|
|
16737
|
+
return $skip;
|
|
16494
16738
|
if (asserts) {
|
|
16495
16739
|
t = {
|
|
16496
16740
|
type: "AssertsType",
|
|
@@ -16509,7 +16753,7 @@ ${js}`
|
|
|
16509
16753
|
function ReturnType(ctx, state2) {
|
|
16510
16754
|
return (0, import_lib3.$EVENT)(ctx, state2, "ReturnType", ReturnType$0);
|
|
16511
16755
|
}
|
|
16512
|
-
var TypePredicate$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(MaybeNestedType, (0, import_lib3.$E)((0, import_lib3.$S)(__,
|
|
16756
|
+
var TypePredicate$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(MaybeNestedType, (0, import_lib3.$E)((0, import_lib3.$S)(__, Is, Type))), function($skip, $loc, $0, $1, $2) {
|
|
16513
16757
|
var lhs = $1;
|
|
16514
16758
|
var rhs = $2;
|
|
16515
16759
|
if (!rhs)
|
|
@@ -16524,11 +16768,11 @@ ${js}`
|
|
|
16524
16768
|
function TypePredicate(ctx, state2) {
|
|
16525
16769
|
return (0, import_lib3.$EVENT)(ctx, state2, "TypePredicate", TypePredicate$0);
|
|
16526
16770
|
}
|
|
16527
|
-
var Type$0 =
|
|
16771
|
+
var Type$0 = TypeWithPostfix;
|
|
16528
16772
|
function Type(ctx, state2) {
|
|
16529
16773
|
return (0, import_lib3.$EVENT)(ctx, state2, "Type", Type$0);
|
|
16530
16774
|
}
|
|
16531
|
-
var TypeBinary$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)((0, import_lib3.$S)(
|
|
16775
|
+
var TypeBinary$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)((0, import_lib3.$S)(NotDedented, TypeBinaryOp, __)), TypeUnary, (0, import_lib3.$Q)((0, import_lib3.$S)(NotDedented, TypeBinaryOp, __, TypeUnary))), function($skip, $loc, $0, $1, $2, $3) {
|
|
16532
16776
|
var optionalPrefix = $1;
|
|
16533
16777
|
var t = $2;
|
|
16534
16778
|
var ops = $3;
|
|
@@ -16543,6 +16787,25 @@ ${js}`
|
|
|
16543
16787
|
function TypeBinary(ctx, state2) {
|
|
16544
16788
|
return (0, import_lib3.$EVENT)(ctx, state2, "TypeBinary", TypeBinary$0);
|
|
16545
16789
|
}
|
|
16790
|
+
var NestedTypeBinaryChain$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(PushIndent, (0, import_lib3.$Q)(NestedTypeBinary), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
|
|
16791
|
+
if (!$2.length)
|
|
16792
|
+
return $skip;
|
|
16793
|
+
return $2;
|
|
16794
|
+
});
|
|
16795
|
+
function NestedTypeBinaryChain(ctx, state2) {
|
|
16796
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeBinaryChain", NestedTypeBinaryChain$0);
|
|
16797
|
+
}
|
|
16798
|
+
var NestedTypeBinary$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Nested, TypeBinaryOp, PushExtraIndent1, (0, import_lib3.$E)(TypeUnary), PopIndent), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
16799
|
+
var indent = $1;
|
|
16800
|
+
var op = $2;
|
|
16801
|
+
var t = $4;
|
|
16802
|
+
if (!t)
|
|
16803
|
+
return $skip;
|
|
16804
|
+
return [indent, op, t];
|
|
16805
|
+
});
|
|
16806
|
+
function NestedTypeBinary(ctx, state2) {
|
|
16807
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeBinary", NestedTypeBinary$0);
|
|
16808
|
+
}
|
|
16546
16809
|
var TypeUnary$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$Q)((0, import_lib3.$S)(__, TypeUnaryOp)), TypePrimary, (0, import_lib3.$Q)(TypeUnarySuffix)), function($skip, $loc, $0, $1, $2, $3) {
|
|
16547
16810
|
var prefix = $1;
|
|
16548
16811
|
var t = $2;
|
|
@@ -16612,7 +16875,7 @@ ${js}`
|
|
|
16612
16875
|
};
|
|
16613
16876
|
});
|
|
16614
16877
|
var TypePrimary$2 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_), TypeTuple), function($skip, $loc, $0, $1, $2) {
|
|
16615
|
-
return
|
|
16878
|
+
return prepend($1, $2);
|
|
16616
16879
|
});
|
|
16617
16880
|
var TypePrimary$3 = InterfaceBlock;
|
|
16618
16881
|
var TypePrimary$4 = (0, import_lib3.$S)((0, import_lib3.$E)(_), TypeFunction);
|
|
@@ -16641,7 +16904,7 @@ ${js}`
|
|
|
16641
16904
|
args: void 0
|
|
16642
16905
|
};
|
|
16643
16906
|
});
|
|
16644
|
-
var TypePrimary$9 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_),
|
|
16907
|
+
var TypePrimary$9 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_), Identifier, (0, import_lib3.$Q)((0, import_lib3.$S)(Dot, IdentifierName)), (0, import_lib3.$E)((0, import_lib3.$C)(TypeArguments, ImplicitTypeArguments))), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
16645
16908
|
var args = $4;
|
|
16646
16909
|
return {
|
|
16647
16910
|
type: "IdentifierType",
|
|
@@ -16650,10 +16913,13 @@ ${js}`
|
|
|
16650
16913
|
args
|
|
16651
16914
|
};
|
|
16652
16915
|
});
|
|
16653
|
-
var TypePrimary$10 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_), OpenParen, (0, import_lib3.$C)(Type, (0, import_lib3.$S)(EOS, Type)), __, CloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
16916
|
+
var TypePrimary$10 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_), OpenParen, AllowAll, (0, import_lib3.$E)((0, import_lib3.$C)(Type, (0, import_lib3.$S)(EOS, Type))), RestoreAll, __, CloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
|
|
16917
|
+
if (!$4)
|
|
16918
|
+
return $skip;
|
|
16654
16919
|
return {
|
|
16655
16920
|
type: "ParenthesizedType",
|
|
16656
|
-
children: $
|
|
16921
|
+
children: [$1, $2, $4, $6, $7]
|
|
16922
|
+
// omit AllowAll/RestoreAll
|
|
16657
16923
|
};
|
|
16658
16924
|
});
|
|
16659
16925
|
var TypePrimary$$ = [TypePrimary$0, TypePrimary$1, TypePrimary$2, TypePrimary$3, TypePrimary$4, TypePrimary$5, TypePrimary$6, TypePrimary$7, TypePrimary$8, TypePrimary$9, TypePrimary$10];
|
|
@@ -16666,18 +16932,58 @@ ${js}`
|
|
|
16666
16932
|
function ImportType(ctx, state2) {
|
|
16667
16933
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "ImportType", ImportType$$);
|
|
16668
16934
|
}
|
|
16669
|
-
var TypeTuple$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(OpenBracket, (0, import_lib3.$
|
|
16935
|
+
var TypeTuple$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(OpenBracket, AllowAll, (0, import_lib3.$E)((0, import_lib3.$S)(TypeTupleContent, __, CloseBracket)), RestoreAll), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
16936
|
+
if (!$3)
|
|
16937
|
+
return $skip;
|
|
16670
16938
|
return {
|
|
16671
16939
|
type: "TypeTuple",
|
|
16672
|
-
children: $
|
|
16940
|
+
children: [$1, ...$3]
|
|
16673
16941
|
};
|
|
16674
16942
|
});
|
|
16675
16943
|
function TypeTuple(ctx, state2) {
|
|
16676
16944
|
return (0, import_lib3.$EVENT)(ctx, state2, "TypeTuple", TypeTuple$0);
|
|
16677
16945
|
}
|
|
16678
|
-
var
|
|
16679
|
-
|
|
16680
|
-
|
|
16946
|
+
var TypeTupleContent$0 = (0, import_lib3.$S)(NestedTypeElementList, (0, import_lib3.$Y)((0, import_lib3.$S)(__, CloseBracket)));
|
|
16947
|
+
var TypeTupleContent$1 = (0, import_lib3.$TS)((0, import_lib3.$S)(TypeElementListWithIndentedApplicationForbidden, ArrayElementDelimiter, (0, import_lib3.$E)(NestedTypeElementList), (0, import_lib3.$Y)((0, import_lib3.$S)(__, CloseBracket))), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
16948
|
+
var list = $1;
|
|
16949
|
+
var delimiter = $2;
|
|
16950
|
+
var nested = $3;
|
|
16951
|
+
if (!nested)
|
|
16952
|
+
return list;
|
|
16953
|
+
return [...list, delimiter, ...nested];
|
|
16954
|
+
});
|
|
16955
|
+
var TypeTupleContent$2 = (0, import_lib3.$TV)((0, import_lib3.$Q)((0, import_lib3.$S)(__, TypeElementListWithIndentedApplicationForbidden, ArrayElementDelimiter)), function($skip, $loc, $0, $1) {
|
|
16956
|
+
return $1.flat();
|
|
16957
|
+
});
|
|
16958
|
+
var TypeTupleContent$$ = [TypeTupleContent$0, TypeTupleContent$1, TypeTupleContent$2];
|
|
16959
|
+
function TypeTupleContent(ctx, state2) {
|
|
16960
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeTupleContent", TypeTupleContent$$);
|
|
16961
|
+
}
|
|
16962
|
+
var TypeElementListWithIndentedApplicationForbidden$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(ForbidIndentedApplication, (0, import_lib3.$E)(TypeElementList), RestoreIndentedApplication), function($skip, $loc, $0, $1, $2, $3) {
|
|
16963
|
+
if ($2)
|
|
16964
|
+
return $2;
|
|
16965
|
+
return $skip;
|
|
16966
|
+
});
|
|
16967
|
+
function TypeElementListWithIndentedApplicationForbidden(ctx, state2) {
|
|
16968
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "TypeElementListWithIndentedApplicationForbidden", TypeElementListWithIndentedApplicationForbidden$0);
|
|
16969
|
+
}
|
|
16970
|
+
var TypeElementList$0 = (0, import_lib3.$T)((0, import_lib3.$S)(TypeBulletedTuple), function(value) {
|
|
16971
|
+
return [value[0]];
|
|
16972
|
+
});
|
|
16973
|
+
var TypeElementList$1 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$N)(EOS), TypeElement, (0, import_lib3.$Q)((0, import_lib3.$S)((0, import_lib3.$S)((0, import_lib3.$E)(_), Comma, (0, import_lib3.$N)(EOS)), TypeElement))), function($skip, $loc, $0, $1, $2, $3) {
|
|
16974
|
+
var first = $2;
|
|
16975
|
+
var rest = $3;
|
|
16976
|
+
if (!rest.length)
|
|
16977
|
+
return [first];
|
|
16978
|
+
return [
|
|
16979
|
+
append(first, rest[0][0])
|
|
16980
|
+
].concat(
|
|
16981
|
+
rest.map(([_2, e], i) => append(e, rest[i + 1]?.[0]))
|
|
16982
|
+
);
|
|
16983
|
+
});
|
|
16984
|
+
var TypeElementList$$ = [TypeElementList$0, TypeElementList$1];
|
|
16985
|
+
function TypeElementList(ctx, state2) {
|
|
16986
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeElementList", TypeElementList$$);
|
|
16681
16987
|
}
|
|
16682
16988
|
var TypeElement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(__, (0, import_lib3.$E)((0, import_lib3.$S)(DotDotDot, __)), IdentifierName, (0, import_lib3.$E)((0, import_lib3.$S)((0, import_lib3.$E)(_), DotDotDot)), (0, import_lib3.$S)(__, (0, import_lib3.$E)((0, import_lib3.$S)(QuestionMark, (0, import_lib3.$E)(_))), Colon, __), Type), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
16683
16989
|
var ws = $1;
|
|
@@ -16711,21 +17017,129 @@ ${js}`
|
|
|
16711
17017
|
function TypeElement(ctx, state2) {
|
|
16712
17018
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeElement", TypeElement$$);
|
|
16713
17019
|
}
|
|
16714
|
-
var
|
|
17020
|
+
var NestedTypeElementList$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(PushIndent, (0, import_lib3.$Q)(NestedTypeElement), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
|
|
16715
17021
|
var types = $2;
|
|
16716
17022
|
if (types.length)
|
|
16717
17023
|
return types;
|
|
16718
17024
|
return $skip;
|
|
16719
17025
|
});
|
|
16720
|
-
function
|
|
16721
|
-
return (0, import_lib3.$EVENT)(ctx, state2, "
|
|
17026
|
+
function NestedTypeElementList(ctx, state2) {
|
|
17027
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeElementList", NestedTypeElementList$0);
|
|
16722
17028
|
}
|
|
16723
|
-
var
|
|
16724
|
-
|
|
16725
|
-
|
|
17029
|
+
var NestedTypeElement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Nested, TypeElementList, ArrayElementDelimiter), function($skip, $loc, $0, $1, $2, $3) {
|
|
17030
|
+
var indent = $1;
|
|
17031
|
+
var list = $2;
|
|
17032
|
+
var delimiter = $3;
|
|
17033
|
+
const { length } = list;
|
|
17034
|
+
if (!length)
|
|
17035
|
+
return $skip;
|
|
17036
|
+
return list.map((e, i) => {
|
|
17037
|
+
if (i === 0)
|
|
17038
|
+
e = prepend(indent, e);
|
|
17039
|
+
if (i === length - 1)
|
|
17040
|
+
e = append(e, delimiter);
|
|
17041
|
+
return e;
|
|
17042
|
+
});
|
|
17043
|
+
});
|
|
17044
|
+
function NestedTypeElement(ctx, state2) {
|
|
17045
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeElement", NestedTypeElement$0);
|
|
17046
|
+
}
|
|
17047
|
+
var NestedTypeBulletedTuple$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$S)(InsertSpace, InsertOpenBracket), PushIndent, (0, import_lib3.$Q)(NestedTypeBullet), InsertCloseBracket, PopIndent), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
17048
|
+
var open = $1;
|
|
17049
|
+
var content = $3;
|
|
17050
|
+
var close = $4;
|
|
17051
|
+
if (!content.length)
|
|
17052
|
+
return $skip;
|
|
17053
|
+
content = content.flat();
|
|
17054
|
+
const last = content[content.length - 1];
|
|
17055
|
+
let children = Array.isArray(last) ? last : last?.children;
|
|
17056
|
+
if (children?.at(-1).implicit) {
|
|
17057
|
+
children = children.slice(0, -1);
|
|
17058
|
+
if (Array.isArray(last)) {
|
|
17059
|
+
content[content.length - 1] = children;
|
|
17060
|
+
} else {
|
|
17061
|
+
content[content.length - 1] = { ...last, children };
|
|
17062
|
+
}
|
|
17063
|
+
}
|
|
17064
|
+
return {
|
|
17065
|
+
type: "TypeTuple",
|
|
17066
|
+
children: [...open, ...content, close]
|
|
17067
|
+
};
|
|
17068
|
+
});
|
|
17069
|
+
function NestedTypeBulletedTuple(ctx, state2) {
|
|
17070
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeBulletedTuple", NestedTypeBulletedTuple$0);
|
|
17071
|
+
}
|
|
17072
|
+
var TypeBulletedTuple$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(InsertOpenBracket, (0, import_lib3.$E)((0, import_lib3.$S)(TypeBullet, (0, import_lib3.$Q)(NestedTypeBullet))), InsertCloseBracket), function($skip, $loc, $0, $1, $2, $3) {
|
|
17073
|
+
var open = $1;
|
|
17074
|
+
var content = $2;
|
|
17075
|
+
var close = $3;
|
|
17076
|
+
if (!content)
|
|
17077
|
+
return $skip;
|
|
17078
|
+
content = [
|
|
17079
|
+
...trimFirstSpace(content[0]),
|
|
17080
|
+
// replace first space with bracket
|
|
17081
|
+
...content[1].flat()
|
|
17082
|
+
];
|
|
17083
|
+
const last = content[content.length - 1];
|
|
17084
|
+
let children = Array.isArray(last) ? last : last?.children;
|
|
17085
|
+
if (children?.at(-1).implicit) {
|
|
17086
|
+
children = children.slice(0, -1);
|
|
17087
|
+
if (Array.isArray(last)) {
|
|
17088
|
+
content[content.length - 1] = children;
|
|
17089
|
+
} else {
|
|
17090
|
+
content[content.length - 1] = { ...last, children };
|
|
17091
|
+
}
|
|
17092
|
+
}
|
|
17093
|
+
return {
|
|
17094
|
+
type: "TypeTuple",
|
|
17095
|
+
children: [open, ...content, close]
|
|
17096
|
+
};
|
|
17097
|
+
});
|
|
17098
|
+
function TypeBulletedTuple(ctx, state2) {
|
|
17099
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "TypeBulletedTuple", TypeBulletedTuple$0);
|
|
17100
|
+
}
|
|
17101
|
+
var NestedTypeBullet$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Nested, TypeBullet), function($skip, $loc, $0, $1, $2) {
|
|
17102
|
+
var indent = $1;
|
|
17103
|
+
var list = $2;
|
|
17104
|
+
return list.map((e, i) => i === 0 ? prepend(indent, e) : e);
|
|
17105
|
+
});
|
|
17106
|
+
function NestedTypeBullet(ctx, state2) {
|
|
17107
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeBullet", NestedTypeBullet$0);
|
|
17108
|
+
}
|
|
17109
|
+
var TypeBullet$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(BulletIndent, (0, import_lib3.$E)((0, import_lib3.$S)(TypeElementList, ArrayBulletDelimiter)), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
|
|
17110
|
+
var bullet = $1;
|
|
17111
|
+
var content = $2;
|
|
17112
|
+
if (!content)
|
|
17113
|
+
return $skip;
|
|
17114
|
+
let [list, delimiter] = content;
|
|
17115
|
+
if (!list.length)
|
|
17116
|
+
return $skip;
|
|
17117
|
+
list = list.slice();
|
|
17118
|
+
list[0] = prepend(bullet, list[0]);
|
|
17119
|
+
if (delimiter) {
|
|
17120
|
+
const last = list.length - 1;
|
|
17121
|
+
list[last] = append(list[last], delimiter);
|
|
17122
|
+
}
|
|
17123
|
+
return list;
|
|
17124
|
+
});
|
|
17125
|
+
function TypeBullet(ctx, state2) {
|
|
17126
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "TypeBullet", TypeBullet$0);
|
|
17127
|
+
}
|
|
17128
|
+
var TypeWithPostfix$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(TypeConditional, (0, import_lib3.$E)((0, import_lib3.$S)((0, import_lib3.$E)((0, import_lib3.$C)(_, IndentedFurther)), TypeIfClause))), function($skip, $loc, $0, $1, $2) {
|
|
17129
|
+
var t = $1;
|
|
17130
|
+
var postfix = $2;
|
|
17131
|
+
if (!postfix)
|
|
17132
|
+
return t;
|
|
17133
|
+
return prepend(
|
|
17134
|
+
postfix[0],
|
|
17135
|
+
expressionizeTypeIf([...postfix[1], $1, void 0])
|
|
17136
|
+
);
|
|
17137
|
+
});
|
|
17138
|
+
function TypeWithPostfix(ctx, state2) {
|
|
17139
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "TypeWithPostfix", TypeWithPostfix$0);
|
|
16726
17140
|
}
|
|
16727
17141
|
var TypeConditional$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_), (0, import_lib3.$EXPECT)($R89, "TypeConditional /(?=if|unless)/"), TypeIfThenElse), function($skip, $loc, $0, $1, $2, $3) {
|
|
16728
|
-
return
|
|
17142
|
+
return prepend($1, expressionizeTypeIf($3));
|
|
16729
17143
|
});
|
|
16730
17144
|
var TypeConditional$1 = (0, import_lib3.$TS)((0, import_lib3.$S)(TypeCondition, NotDedented, QuestionMark, __, Type, __, Colon, __, Type), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
|
|
16731
17145
|
if ($1.negated)
|
|
@@ -16737,7 +17151,7 @@ ${js}`
|
|
|
16737
17151
|
function TypeConditional(ctx, state2) {
|
|
16738
17152
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeConditional", TypeConditional$$);
|
|
16739
17153
|
}
|
|
16740
|
-
var TypeCondition$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(TypeBinary, (0, import_lib3.$E)(IndentedFurther), (0, import_lib3.$C)(ExtendsToken, NotExtendsToken),
|
|
17154
|
+
var TypeCondition$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(TypeBinary, (0, import_lib3.$E)(IndentedFurther), (0, import_lib3.$C)(ExtendsToken, NotExtendsToken), TypeConditional), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
16741
17155
|
return {
|
|
16742
17156
|
type: "TypeCondition",
|
|
16743
17157
|
negated: $3.negated,
|
|
@@ -16747,13 +17161,27 @@ ${js}`
|
|
|
16747
17161
|
function TypeCondition(ctx, state2) {
|
|
16748
17162
|
return (0, import_lib3.$EVENT)(ctx, state2, "TypeCondition", TypeCondition$0);
|
|
16749
17163
|
}
|
|
16750
|
-
var TypeIfThenElse$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(
|
|
16751
|
-
return [
|
|
17164
|
+
var TypeIfThenElse$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(TypeIfClause, TypeBlock, (0, import_lib3.$E)(TypeElse)), function($skip, $loc, $0, $1, $2, $3) {
|
|
17165
|
+
return [...$1, $2, $3];
|
|
16752
17166
|
});
|
|
16753
|
-
var TypeIfThenElse$1 = (0, import_lib3.$S)((0, import_lib3.$E)(_), (0, import_lib3.$C)(If, Unless), TypeCondition, TypeBlock, (0, import_lib3.$E)(TypeElse));
|
|
16754
|
-
var TypeIfThenElse$$ = [TypeIfThenElse$0, TypeIfThenElse$1];
|
|
16755
17167
|
function TypeIfThenElse(ctx, state2) {
|
|
16756
|
-
return (0, import_lib3.$
|
|
17168
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "TypeIfThenElse", TypeIfThenElse$0);
|
|
17169
|
+
}
|
|
17170
|
+
var TypeIfClause$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$C)(If, Unless), OpenParen, AllowAll, (0, import_lib3.$E)(TypeCondition), RestoreAll, CloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
17171
|
+
var condition = $4;
|
|
17172
|
+
if (!condition)
|
|
17173
|
+
return $skip;
|
|
17174
|
+
return [$1, condition];
|
|
17175
|
+
});
|
|
17176
|
+
var TypeIfClause$1 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$C)(If, Unless), ForbidIndentedApplication, (0, import_lib3.$E)(TypeCondition), RestoreIndentedApplication), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
17177
|
+
var condition = $3;
|
|
17178
|
+
if (!condition)
|
|
17179
|
+
return $skip;
|
|
17180
|
+
return [$1, condition];
|
|
17181
|
+
});
|
|
17182
|
+
var TypeIfClause$$ = [TypeIfClause$0, TypeIfClause$1];
|
|
17183
|
+
function TypeIfClause(ctx, state2) {
|
|
17184
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeIfClause", TypeIfClause$$);
|
|
16757
17185
|
}
|
|
16758
17186
|
var TypeElse$0 = (0, import_lib3.$S)(NotDedented, Else, TypeBlock);
|
|
16759
17187
|
function TypeElse(ctx, state2) {
|
|
@@ -16853,12 +17281,18 @@ ${js}`
|
|
|
16853
17281
|
function TypeBinaryOp(ctx, state2) {
|
|
16854
17282
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeBinaryOp", TypeBinaryOp$$);
|
|
16855
17283
|
}
|
|
16856
|
-
var TypeFunction$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)((0, import_lib3.$S)((0, import_lib3.$E)((0, import_lib3.$
|
|
16857
|
-
var type = $
|
|
16858
|
-
|
|
16859
|
-
|
|
17284
|
+
var TypeFunction$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)((0, import_lib3.$S)(Abstract, (0, import_lib3.$E)(_))), (0, import_lib3.$E)((0, import_lib3.$S)(New, (0, import_lib3.$E)(_))), Parameters, __, TypeArrowFunction, (0, import_lib3.$E)(ReturnType)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
17285
|
+
var type = $6;
|
|
17286
|
+
const ret = [...$0];
|
|
17287
|
+
if ($1 && !$2) {
|
|
17288
|
+
ret[1] = {
|
|
17289
|
+
type: "Error",
|
|
17290
|
+
message: "abstract function types must be constructors (abstract new)"
|
|
17291
|
+
};
|
|
16860
17292
|
}
|
|
16861
|
-
|
|
17293
|
+
if (!type)
|
|
17294
|
+
ret.push("void");
|
|
17295
|
+
return ret;
|
|
16862
17296
|
});
|
|
16863
17297
|
function TypeFunction(ctx, state2) {
|
|
16864
17298
|
return (0, import_lib3.$EVENT)(ctx, state2, "TypeFunction", TypeFunction$0);
|
|
@@ -16869,8 +17303,9 @@ ${js}`
|
|
|
16869
17303
|
function TypeArrowFunction(ctx, state2) {
|
|
16870
17304
|
return (0, import_lib3.$EVENT)(ctx, state2, "TypeArrowFunction", TypeArrowFunction$0);
|
|
16871
17305
|
}
|
|
16872
|
-
var TypeArguments$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(OpenAngleBracket, (0, import_lib3.$P)(
|
|
17306
|
+
var TypeArguments$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(OpenAngleBracket, (0, import_lib3.$P)((0, import_lib3.$S)(__, TypeArgumentDelimited)), __, CloseAngleBracket), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
16873
17307
|
var args = $2;
|
|
17308
|
+
args = args.map(([ws, arg]) => [ws, ...arg]);
|
|
16874
17309
|
return {
|
|
16875
17310
|
type: "TypeArguments",
|
|
16876
17311
|
ts: true,
|
|
@@ -16881,7 +17316,91 @@ ${js}`
|
|
|
16881
17316
|
function TypeArguments(ctx, state2) {
|
|
16882
17317
|
return (0, import_lib3.$EVENT)(ctx, state2, "TypeArguments", TypeArguments$0);
|
|
16883
17318
|
}
|
|
16884
|
-
var
|
|
17319
|
+
var ImplicitTypeArguments$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(TypeApplicationStart, InsertOpenAngleBracket, (0, import_lib3.$E)(Trimmed_), TypeArgumentList, InsertCloseAngleBracket), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
17320
|
+
var open = $2;
|
|
17321
|
+
var ws = $3;
|
|
17322
|
+
var args = $4;
|
|
17323
|
+
var close = $5;
|
|
17324
|
+
let last = args[args.length - 1];
|
|
17325
|
+
if (last?.token === ",")
|
|
17326
|
+
args = args.slice(0, -1);
|
|
17327
|
+
return [open, ws, args, close];
|
|
17328
|
+
});
|
|
17329
|
+
function ImplicitTypeArguments(ctx, state2) {
|
|
17330
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "ImplicitTypeArguments", ImplicitTypeArguments$0);
|
|
17331
|
+
}
|
|
17332
|
+
var TypeApplicationStart$0 = (0, import_lib3.$S)(IndentedApplicationAllowed, (0, import_lib3.$Y)((0, import_lib3.$S)(IndentedFurther, (0, import_lib3.$N)(ForbiddenImplicitTypeCalls))));
|
|
17333
|
+
var TypeApplicationStart$1 = (0, import_lib3.$S)((0, import_lib3.$N)(EOS), (0, import_lib3.$Y)((0, import_lib3.$S)(_, (0, import_lib3.$N)(ForbiddenImplicitTypeCalls))));
|
|
17334
|
+
var TypeApplicationStart$$ = [TypeApplicationStart$0, TypeApplicationStart$1];
|
|
17335
|
+
function TypeApplicationStart(ctx, state2) {
|
|
17336
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeApplicationStart", TypeApplicationStart$$);
|
|
17337
|
+
}
|
|
17338
|
+
var ForbiddenImplicitTypeCalls$0 = ReservedBinary;
|
|
17339
|
+
var ForbiddenImplicitTypeCalls$1 = (0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($R90, "ForbiddenImplicitTypeCalls /[|&<!=\\-\u21D2\u2192]/"));
|
|
17340
|
+
var ForbiddenImplicitTypeCalls$2 = (0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($R91, "ForbiddenImplicitTypeCalls /(extends|not|is)(?!\\p{ID_Continue}|[\\u200C\\u200D$])/"));
|
|
17341
|
+
var ForbiddenImplicitTypeCalls$$ = [ForbiddenImplicitTypeCalls$0, ForbiddenImplicitTypeCalls$1, ForbiddenImplicitTypeCalls$2];
|
|
17342
|
+
function ForbiddenImplicitTypeCalls(ctx, state2) {
|
|
17343
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "ForbiddenImplicitTypeCalls", ForbiddenImplicitTypeCalls$$);
|
|
17344
|
+
}
|
|
17345
|
+
var TypeArgumentList$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$N)(EOS), TypeArgument, (0, import_lib3.$Q)((0, import_lib3.$S)(CommaDelimiter, (0, import_lib3.$N)(EOS), (0, import_lib3.$E)(_), TypeArgument)), (0, import_lib3.$P)((0, import_lib3.$S)(CommaDelimiter, (0, import_lib3.$C)(NestedTypeBulletedTuple, NestedInterfaceBlock, NestedTypeArgumentList)))), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
17346
|
+
return [
|
|
17347
|
+
$2,
|
|
17348
|
+
...$3.flatMap(([comma, eos, ws, arg]) => [comma, prepend(ws, arg)]),
|
|
17349
|
+
...$4.flatMap(
|
|
17350
|
+
([comma, args]) => Array.isArray(args) ? [comma, ...args] : [comma, args]
|
|
17351
|
+
)
|
|
17352
|
+
];
|
|
17353
|
+
});
|
|
17354
|
+
var TypeArgumentList$1 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$C)(NestedTypeBulletedTuple, NestedInterfaceBlock), (0, import_lib3.$Q)((0, import_lib3.$S)(CommaDelimiter, (0, import_lib3.$C)(NestedTypeBulletedTuple, NestedInterfaceBlock, NestedTypeArgumentList)))), function($skip, $loc, $0, $1, $2) {
|
|
17355
|
+
return [
|
|
17356
|
+
trimFirstSpace($1),
|
|
17357
|
+
...$2.flatMap(
|
|
17358
|
+
([comma, args]) => Array.isArray(args) ? [comma, ...args] : [comma, args]
|
|
17359
|
+
)
|
|
17360
|
+
];
|
|
17361
|
+
});
|
|
17362
|
+
var TypeArgumentList$2 = NestedTypeArgumentList;
|
|
17363
|
+
var TypeArgumentList$3 = (0, import_lib3.$TS)((0, import_lib3.$S)(TypeArgument, (0, import_lib3.$Q)((0, import_lib3.$S)(CommaDelimiter, (0, import_lib3.$E)(_), TypeArgument))), function($skip, $loc, $0, $1, $2) {
|
|
17364
|
+
return [
|
|
17365
|
+
$1,
|
|
17366
|
+
...$2.flatMap(([comma, ws, arg]) => [comma, prepend(ws, arg)])
|
|
17367
|
+
];
|
|
17368
|
+
});
|
|
17369
|
+
var TypeArgumentList$$ = [TypeArgumentList$0, TypeArgumentList$1, TypeArgumentList$2, TypeArgumentList$3];
|
|
17370
|
+
function TypeArgumentList(ctx, state2) {
|
|
17371
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeArgumentList", TypeArgumentList$$);
|
|
17372
|
+
}
|
|
17373
|
+
var NestedTypeArgumentList$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(PushIndent, (0, import_lib3.$Q)(NestedTypeArgument), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
|
|
17374
|
+
var args = $2;
|
|
17375
|
+
if (!args.length)
|
|
17376
|
+
return $skip;
|
|
17377
|
+
return args.flat();
|
|
17378
|
+
});
|
|
17379
|
+
function NestedTypeArgumentList(ctx, state2) {
|
|
17380
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeArgumentList", NestedTypeArgumentList$0);
|
|
17381
|
+
}
|
|
17382
|
+
var NestedTypeArgument$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Nested, SingleLineTypeArgumentList, TypeArgumentDelimiter), function($skip, $loc, $0, $1, $2, $3) {
|
|
17383
|
+
var indent = $1;
|
|
17384
|
+
var args = $2;
|
|
17385
|
+
var comma = $3;
|
|
17386
|
+
let [arg0, ...rest] = args;
|
|
17387
|
+
arg0 = prepend(indent, arg0);
|
|
17388
|
+
return [arg0, ...rest, comma];
|
|
17389
|
+
});
|
|
17390
|
+
function NestedTypeArgument(ctx, state2) {
|
|
17391
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeArgument", NestedTypeArgument$0);
|
|
17392
|
+
}
|
|
17393
|
+
var SingleLineTypeArgumentList$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$S)((0, import_lib3.$E)(_), TypeArgument), (0, import_lib3.$Q)((0, import_lib3.$S)((0, import_lib3.$S)((0, import_lib3.$E)(_), Comma), (0, import_lib3.$S)((0, import_lib3.$E)(_), TypeArgument)))), function($skip, $loc, $0, $1, $2) {
|
|
17394
|
+
return [$1, ...$2.flat()];
|
|
17395
|
+
});
|
|
17396
|
+
function SingleLineTypeArgumentList(ctx, state2) {
|
|
17397
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "SingleLineTypeArgumentList", SingleLineTypeArgumentList$0);
|
|
17398
|
+
}
|
|
17399
|
+
var TypeArgumentDelimited$0 = (0, import_lib3.$S)(TypeArgument, TypeArgumentDelimiter);
|
|
17400
|
+
function TypeArgumentDelimited(ctx, state2) {
|
|
17401
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "TypeArgumentDelimited", TypeArgumentDelimited$0);
|
|
17402
|
+
}
|
|
17403
|
+
var TypeArgument$0 = Type;
|
|
16885
17404
|
function TypeArgument(ctx, state2) {
|
|
16886
17405
|
return (0, import_lib3.$EVENT)(ctx, state2, "TypeArgument", TypeArgument$0);
|
|
16887
17406
|
}
|
|
@@ -16928,15 +17447,15 @@ ${js}`
|
|
|
16928
17447
|
function ThisType(ctx, state2) {
|
|
16929
17448
|
return (0, import_lib3.$EVENT)(ctx, state2, "ThisType", ThisType$0);
|
|
16930
17449
|
}
|
|
16931
|
-
var Shebang$0 = (0, import_lib3.$S)((0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($
|
|
17450
|
+
var Shebang$0 = (0, import_lib3.$S)((0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($R92, "Shebang /#![^\\r\\n]*/")), EOL);
|
|
16932
17451
|
function Shebang(ctx, state2) {
|
|
16933
17452
|
return (0, import_lib3.$EVENT)(ctx, state2, "Shebang", Shebang$0);
|
|
16934
17453
|
}
|
|
16935
|
-
var CivetPrologue$0 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($
|
|
17454
|
+
var CivetPrologue$0 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($R93, "CivetPrologue /[\\t ]*/"), DoubleQuote, CivetPrologueContent, DoubleQuote, SimpleStatementDelimiter, (0, import_lib3.$EXPECT)($R20, "CivetPrologue /[ \\t]*/"), (0, import_lib3.$C)(EOL, (0, import_lib3.$Y)(RestOfLine))), function(value) {
|
|
16936
17455
|
var content = value[2];
|
|
16937
17456
|
return content;
|
|
16938
17457
|
});
|
|
16939
|
-
var CivetPrologue$1 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($
|
|
17458
|
+
var CivetPrologue$1 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($R93, "CivetPrologue /[\\t ]*/"), SingleQuote, CivetPrologueContent, SingleQuote, SimpleStatementDelimiter, (0, import_lib3.$EXPECT)($R20, "CivetPrologue /[ \\t]*/"), (0, import_lib3.$C)(EOL, (0, import_lib3.$Y)(RestOfLine))), function(value) {
|
|
16940
17459
|
var content = value[2];
|
|
16941
17460
|
return content;
|
|
16942
17461
|
});
|
|
@@ -16944,7 +17463,7 @@ ${js}`
|
|
|
16944
17463
|
function CivetPrologue(ctx, state2) {
|
|
16945
17464
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "CivetPrologue", CivetPrologue$$);
|
|
16946
17465
|
}
|
|
16947
|
-
var CivetPrologueContent$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($L238, 'CivetPrologueContent "civet"'), NonIdContinue, (0, import_lib3.$Q)(CivetOption), (0, import_lib3.$EXPECT)($
|
|
17466
|
+
var CivetPrologueContent$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($L238, 'CivetPrologueContent "civet"'), NonIdContinue, (0, import_lib3.$Q)(CivetOption), (0, import_lib3.$EXPECT)($R94, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
16948
17467
|
var options = $3;
|
|
16949
17468
|
return {
|
|
16950
17469
|
type: "CivetPrologue",
|
|
@@ -16955,7 +17474,7 @@ ${js}`
|
|
|
16955
17474
|
function CivetPrologueContent(ctx, state2) {
|
|
16956
17475
|
return (0, import_lib3.$EVENT)(ctx, state2, "CivetPrologueContent", CivetPrologueContent$0);
|
|
16957
17476
|
}
|
|
16958
|
-
var CivetOption$0 = (0, import_lib3.$TR)((0, import_lib3.$EXPECT)($
|
|
17477
|
+
var CivetOption$0 = (0, import_lib3.$TR)((0, import_lib3.$EXPECT)($R95, "CivetOption /\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
|
|
16959
17478
|
const optionName = $2.replace(/-+([a-z]?)/g, (_2, l) => {
|
|
16960
17479
|
if (l)
|
|
16961
17480
|
return l.toUpperCase();
|
|
@@ -16972,11 +17491,11 @@ ${js}`
|
|
|
16972
17491
|
function CivetOption(ctx, state2) {
|
|
16973
17492
|
return (0, import_lib3.$EVENT)(ctx, state2, "CivetOption", CivetOption$0);
|
|
16974
17493
|
}
|
|
16975
|
-
var UnknownPrologue$0 = (0, import_lib3.$S)((0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($
|
|
17494
|
+
var UnknownPrologue$0 = (0, import_lib3.$S)((0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($R93, "UnknownPrologue /[\\t ]*/")), StringLiteral, (0, import_lib3.$TEXT)(SimpleStatementDelimiter), EOS);
|
|
16976
17495
|
function UnknownPrologue(ctx, state2) {
|
|
16977
17496
|
return (0, import_lib3.$EVENT)(ctx, state2, "UnknownPrologue", UnknownPrologue$0);
|
|
16978
17497
|
}
|
|
16979
|
-
var TripleSlashDirective$0 = (0, import_lib3.$S)((0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($
|
|
17498
|
+
var TripleSlashDirective$0 = (0, import_lib3.$S)((0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($R96, "TripleSlashDirective /\\/\\/\\/[^\\r\\n]*/")), (0, import_lib3.$E)(EOS));
|
|
16980
17499
|
function TripleSlashDirective(ctx, state2) {
|
|
16981
17500
|
return (0, import_lib3.$EVENT)(ctx, state2, "TripleSlashDirective", TripleSlashDirective$0);
|
|
16982
17501
|
}
|
|
@@ -16992,13 +17511,13 @@ ${js}`
|
|
|
16992
17511
|
function PrologueString(ctx, state2) {
|
|
16993
17512
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "PrologueString", PrologueString$$);
|
|
16994
17513
|
}
|
|
16995
|
-
var EOS$0 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($
|
|
17514
|
+
var EOS$0 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($R97, "EOS /(?=[ \\t\\r\\n\\/#]|$)/"), (0, import_lib3.$P)(RestOfLine)), function(value) {
|
|
16996
17515
|
return value[1];
|
|
16997
17516
|
});
|
|
16998
17517
|
function EOS(ctx, state2) {
|
|
16999
17518
|
return (0, import_lib3.$EVENT)(ctx, state2, "EOS", EOS$0);
|
|
17000
17519
|
}
|
|
17001
|
-
var EOL$0 = (0, import_lib3.$TR)((0, import_lib3.$EXPECT)($
|
|
17520
|
+
var EOL$0 = (0, import_lib3.$TR)((0, import_lib3.$EXPECT)($R98, "EOL /\\r\\n|\\n|\\r|$/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
|
|
17002
17521
|
return { $loc, token: $0 };
|
|
17003
17522
|
});
|
|
17004
17523
|
function EOL(ctx, state2) {
|
|
@@ -17064,6 +17583,18 @@ ${js}`
|
|
|
17064
17583
|
function InsertCloseBracket(ctx, state2) {
|
|
17065
17584
|
return (0, import_lib3.$EVENT)(ctx, state2, "InsertCloseBracket", InsertCloseBracket$0);
|
|
17066
17585
|
}
|
|
17586
|
+
var InsertOpenAngleBracket$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'InsertOpenAngleBracket ""'), function($skip, $loc, $0, $1) {
|
|
17587
|
+
return { $loc, token: "<" };
|
|
17588
|
+
});
|
|
17589
|
+
function InsertOpenAngleBracket(ctx, state2) {
|
|
17590
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "InsertOpenAngleBracket", InsertOpenAngleBracket$0);
|
|
17591
|
+
}
|
|
17592
|
+
var InsertCloseAngleBracket$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'InsertCloseAngleBracket ""'), function($skip, $loc, $0, $1) {
|
|
17593
|
+
return { $loc, token: ">" };
|
|
17594
|
+
});
|
|
17595
|
+
function InsertCloseAngleBracket(ctx, state2) {
|
|
17596
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "InsertCloseAngleBracket", InsertCloseAngleBracket$0);
|
|
17597
|
+
}
|
|
17067
17598
|
var InsertComma$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'InsertComma ""'), function($skip, $loc, $0, $1) {
|
|
17068
17599
|
return { $loc, token: ",", implicit: true };
|
|
17069
17600
|
});
|
|
@@ -17396,7 +17927,7 @@ ${js}`
|
|
|
17396
17927
|
function Prologue(ctx, state2) {
|
|
17397
17928
|
return (0, import_lib3.$EVENT)(ctx, state2, "Prologue", Prologue$0);
|
|
17398
17929
|
}
|
|
17399
|
-
var ProloguePrefix$0 = (0, import_lib3.$S)(Prologue, (0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($
|
|
17930
|
+
var ProloguePrefix$0 = (0, import_lib3.$S)(Prologue, (0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($R99, "ProloguePrefix /[^]*/")));
|
|
17400
17931
|
function ProloguePrefix(ctx, state2) {
|
|
17401
17932
|
return (0, import_lib3.$EVENT)(ctx, state2, "ProloguePrefix", ProloguePrefix$0);
|
|
17402
17933
|
}
|
|
@@ -17486,6 +18017,20 @@ ${js}`
|
|
|
17486
18017
|
function Dedented(ctx, state2) {
|
|
17487
18018
|
return (0, import_lib3.$EVENT)(ctx, state2, "Dedented", Dedented$0);
|
|
17488
18019
|
}
|
|
18020
|
+
var PushExtraIndent1$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'PushExtraIndent1 ""'), function($skip, $loc, $0, $1) {
|
|
18021
|
+
const indent = {
|
|
18022
|
+
token: "",
|
|
18023
|
+
$loc,
|
|
18024
|
+
level: state.currentIndent.level + 1
|
|
18025
|
+
};
|
|
18026
|
+
if (config.verbose)
|
|
18027
|
+
console.log("pushing bonus indent", indent);
|
|
18028
|
+
state.indentLevels.push(indent);
|
|
18029
|
+
return indent;
|
|
18030
|
+
});
|
|
18031
|
+
function PushExtraIndent1(ctx, state2) {
|
|
18032
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "PushExtraIndent1", PushExtraIndent1$0);
|
|
18033
|
+
}
|
|
17489
18034
|
var parser = function() {
|
|
17490
18035
|
const { fail, validate, reset } = (0, import_lib3.Validator)();
|
|
17491
18036
|
let ctx = { expectation: "", fail };
|
|
@@ -17945,6 +18490,7 @@ ${js}`
|
|
|
17945
18490
|
"PopIndent",
|
|
17946
18491
|
"TrackIndented",
|
|
17947
18492
|
"BulletIndent",
|
|
18493
|
+
"PushExtraIndent1",
|
|
17948
18494
|
// JSX
|
|
17949
18495
|
"PushJSXOpeningElement",
|
|
17950
18496
|
"PushJSXOpeningFragment",
|