@danielx/civet 0.8.7 → 0.8.9
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 +27 -7
- package/dist/browser.js +1169 -734
- package/dist/main.js +1169 -734
- package/dist/main.mjs +1169 -734
- package/dist/types.d.ts +1 -0
- package/dist/unplugin/unplugin.js +47 -22
- package/dist/unplugin/unplugin.mjs +47 -22
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -58,7 +58,7 @@ var require_machine = __commonJS({
|
|
|
58
58
|
$EVENT: () => $EVENT2,
|
|
59
59
|
$EVENT_C: () => $EVENT_C2,
|
|
60
60
|
$EXPECT: () => $EXPECT2,
|
|
61
|
-
$L: () => $
|
|
61
|
+
$L: () => $L246,
|
|
62
62
|
$N: () => $N2,
|
|
63
63
|
$P: () => $P2,
|
|
64
64
|
$Q: () => $Q2,
|
|
@@ -83,7 +83,7 @@ var require_machine = __commonJS({
|
|
|
83
83
|
return result;
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
|
-
function $
|
|
86
|
+
function $L246(str) {
|
|
87
87
|
return function(_ctx, state2) {
|
|
88
88
|
const { input, pos } = state2, { length } = str, end = pos + length;
|
|
89
89
|
if (input.substring(pos, end) === str) {
|
|
@@ -576,7 +576,8 @@ __export(lib_exports, {
|
|
|
576
576
|
stripTrailingImplicitComma: () => stripTrailingImplicitComma,
|
|
577
577
|
trimFirstSpace: () => trimFirstSpace,
|
|
578
578
|
typeOfJSX: () => typeOfJSX,
|
|
579
|
-
wrapIIFE: () => wrapIIFE
|
|
579
|
+
wrapIIFE: () => wrapIIFE,
|
|
580
|
+
wrapTypeInPromise: () => wrapTypeInPromise
|
|
580
581
|
});
|
|
581
582
|
|
|
582
583
|
// source/parser/util.civet
|
|
@@ -916,32 +917,54 @@ function literalValue(literal) {
|
|
|
916
917
|
case "false":
|
|
917
918
|
return false;
|
|
918
919
|
}
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
920
|
+
let ref3;
|
|
921
|
+
switch (literal.subtype) {
|
|
922
|
+
case "StringLiteral": {
|
|
923
|
+
assert.equal(
|
|
924
|
+
raw.startsWith('"') && raw.endsWith('"') || raw.startsWith("'") && raw.endsWith("'"),
|
|
925
|
+
true,
|
|
926
|
+
"String literal should begin and end in single or double quotes"
|
|
927
|
+
);
|
|
928
|
+
return raw.slice(1, -1);
|
|
929
|
+
}
|
|
930
|
+
case "NumericLiteral": {
|
|
931
|
+
raw = raw.replace(/_/g, "");
|
|
932
|
+
if (raw.endsWith("n")) {
|
|
933
|
+
return BigInt(raw.slice(0, -1));
|
|
934
|
+
} else if (raw.match(/[\.eE]/)) {
|
|
935
|
+
return parseFloat(raw);
|
|
936
|
+
} else if ((ref3 = raw.match(/^[+-]?0(.)/)) && Array.isArray(ref3) && len(ref3, 2)) {
|
|
937
|
+
const [, base] = ref3;
|
|
938
|
+
switch (base.toLowerCase()) {
|
|
939
|
+
case "x":
|
|
940
|
+
return parseInt(raw.replace(/0[xX]/, ""), 16);
|
|
941
|
+
case "b":
|
|
942
|
+
return parseInt(raw.replace(/0[bB]/, ""), 2);
|
|
943
|
+
case "o":
|
|
944
|
+
return parseInt(raw.replace(/0[oO]/, ""), 8);
|
|
945
|
+
}
|
|
940
946
|
}
|
|
947
|
+
return parseInt(raw, 10);
|
|
948
|
+
}
|
|
949
|
+
default: {
|
|
950
|
+
throw new Error("Unrecognized literal " + JSON.stringify(literal));
|
|
941
951
|
}
|
|
942
|
-
return parseInt(raw, 10);
|
|
943
952
|
}
|
|
944
|
-
|
|
953
|
+
}
|
|
954
|
+
function makeNumericLiteral(n) {
|
|
955
|
+
const s = n.toString();
|
|
956
|
+
return {
|
|
957
|
+
type: "Literal",
|
|
958
|
+
subtype: "NumericLiteral",
|
|
959
|
+
raw: s,
|
|
960
|
+
children: [
|
|
961
|
+
{
|
|
962
|
+
type: "NumericLiteral",
|
|
963
|
+
token: s
|
|
964
|
+
}
|
|
965
|
+
// missing $loc
|
|
966
|
+
]
|
|
967
|
+
};
|
|
945
968
|
}
|
|
946
969
|
function startsWith(target, value) {
|
|
947
970
|
if (!target)
|
|
@@ -1002,21 +1025,39 @@ function hasImportDeclaration(exp) {
|
|
|
1002
1025
|
function hasExportDeclaration(exp) {
|
|
1003
1026
|
return gatherRecursiveWithinFunction(exp, ($4) => $4.type === "ExportDeclaration").length > 0;
|
|
1004
1027
|
}
|
|
1005
|
-
function deepCopy(
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1028
|
+
function deepCopy(root) {
|
|
1029
|
+
const copied = /* @__PURE__ */ new Map();
|
|
1030
|
+
return recurse(root);
|
|
1031
|
+
function recurse(node) {
|
|
1032
|
+
if (!(node != null && typeof node === "object")) {
|
|
1033
|
+
return node;
|
|
1034
|
+
}
|
|
1035
|
+
if (!copied.has(node)) {
|
|
1036
|
+
if (Array.isArray(node)) {
|
|
1037
|
+
const array = new Array(node.length);
|
|
1038
|
+
copied.set(node, array);
|
|
1039
|
+
for (let i4 = 0, len4 = node.length; i4 < len4; i4++) {
|
|
1040
|
+
const i = i4;
|
|
1041
|
+
const item = node[i4];
|
|
1042
|
+
array[i] = recurse(item);
|
|
1043
|
+
}
|
|
1044
|
+
} else if (node?.type === "Ref") {
|
|
1045
|
+
copied.set(node, node);
|
|
1046
|
+
} else {
|
|
1047
|
+
const obj = {};
|
|
1048
|
+
copied.set(node, obj);
|
|
1049
|
+
for (const key in node) {
|
|
1050
|
+
const value = node[key];
|
|
1051
|
+
if (key === "parent") {
|
|
1052
|
+
obj.parent = copied.get(value) ?? value;
|
|
1053
|
+
} else {
|
|
1054
|
+
obj[key] = recurse(value);
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
return copied.get(node);
|
|
1012
1060
|
}
|
|
1013
|
-
if (node?.type === "Ref")
|
|
1014
|
-
return node;
|
|
1015
|
-
return Object.fromEntries(
|
|
1016
|
-
Object.entries(node).map(([key, value]) => {
|
|
1017
|
-
return [key, deepCopy(value)];
|
|
1018
|
-
})
|
|
1019
|
-
);
|
|
1020
1061
|
}
|
|
1021
1062
|
function removeHoistDecs(node) {
|
|
1022
1063
|
if (node == null)
|
|
@@ -1090,8 +1131,8 @@ function updateParentPointers(node, parent, depth = 1) {
|
|
|
1090
1131
|
return;
|
|
1091
1132
|
}
|
|
1092
1133
|
if (Array.isArray(node)) {
|
|
1093
|
-
for (let
|
|
1094
|
-
const child = node[
|
|
1134
|
+
for (let i5 = 0, len5 = node.length; i5 < len5; i5++) {
|
|
1135
|
+
const child = node[i5];
|
|
1095
1136
|
updateParentPointers(child, parent, depth);
|
|
1096
1137
|
}
|
|
1097
1138
|
return;
|
|
@@ -1101,8 +1142,8 @@ function updateParentPointers(node, parent, depth = 1) {
|
|
|
1101
1142
|
node.parent = parent;
|
|
1102
1143
|
}
|
|
1103
1144
|
if (depth && isParent(node)) {
|
|
1104
|
-
for (let
|
|
1105
|
-
const child =
|
|
1145
|
+
for (let ref4 = node.children, i6 = 0, len6 = ref4.length; i6 < len6; i6++) {
|
|
1146
|
+
const child = ref4[i6];
|
|
1106
1147
|
updateParentPointers(child, node, depth - 1);
|
|
1107
1148
|
}
|
|
1108
1149
|
}
|
|
@@ -1139,7 +1180,7 @@ function spliceChild(node, child, del, ...replacements) {
|
|
|
1139
1180
|
return children.splice(index, del, ...replacements);
|
|
1140
1181
|
}
|
|
1141
1182
|
function convertOptionalType(suffix) {
|
|
1142
|
-
if (suffix.t.type === "
|
|
1183
|
+
if (suffix.t.type === "TypeAsserts") {
|
|
1143
1184
|
spliceChild(suffix, suffix.optional, 1, suffix.optional = {
|
|
1144
1185
|
type: "Error",
|
|
1145
1186
|
message: "Can't use optional ?: syntax with asserts type"
|
|
@@ -1161,7 +1202,7 @@ var typeNeedsNoParens = /* @__PURE__ */ new Set([
|
|
|
1161
1202
|
"TypeIdentifier",
|
|
1162
1203
|
"ImportType",
|
|
1163
1204
|
"TypeLiteral",
|
|
1164
|
-
"
|
|
1205
|
+
"TypeTuple",
|
|
1165
1206
|
"TypeParenthesized"
|
|
1166
1207
|
]);
|
|
1167
1208
|
function parenthesizeType(type) {
|
|
@@ -1239,8 +1280,8 @@ function wrapIIFE(expressions, asyncFlag, generator) {
|
|
|
1239
1280
|
children.splice(1, 0, ".bind(this)");
|
|
1240
1281
|
}
|
|
1241
1282
|
if (gatherRecursiveWithinFunction(block, (a2) => typeof a2 === "object" && a2 != null && "token" in a2 && a2.token === "arguments").length) {
|
|
1242
|
-
let
|
|
1243
|
-
children[children.length - 1] = (
|
|
1283
|
+
let ref5;
|
|
1284
|
+
children[children.length - 1] = (ref5 = parameters.children)[ref5.length - 1] = "(arguments)";
|
|
1244
1285
|
}
|
|
1245
1286
|
}
|
|
1246
1287
|
let exp = makeNode({
|
|
@@ -1278,9 +1319,9 @@ function wrapWithReturn(expression) {
|
|
|
1278
1319
|
}
|
|
1279
1320
|
function flatJoin(array, separator) {
|
|
1280
1321
|
const result = [];
|
|
1281
|
-
for (let
|
|
1282
|
-
const i =
|
|
1283
|
-
const items = array[
|
|
1322
|
+
for (let i7 = 0, len7 = array.length; i7 < len7; i7++) {
|
|
1323
|
+
const i = i7;
|
|
1324
|
+
const items = array[i7];
|
|
1284
1325
|
if (i) {
|
|
1285
1326
|
result.push(separator);
|
|
1286
1327
|
}
|
|
@@ -1851,6 +1892,13 @@ var declareHelper = {
|
|
|
1851
1892
|
").push(rhs), lhs);\n"
|
|
1852
1893
|
]]);
|
|
1853
1894
|
},
|
|
1895
|
+
AutoPromise(ref) {
|
|
1896
|
+
state.prelude.push([
|
|
1897
|
+
"",
|
|
1898
|
+
ts(["type ", ref, "<T> = T extends Promise<unknown> ? T : Promise<T>"]),
|
|
1899
|
+
";\n"
|
|
1900
|
+
]);
|
|
1901
|
+
},
|
|
1854
1902
|
JSX(jsxRef) {
|
|
1855
1903
|
state.prelude.push([
|
|
1856
1904
|
"",
|
|
@@ -1956,12 +2004,17 @@ function gen(root, options) {
|
|
|
1956
2004
|
));
|
|
1957
2005
|
return "";
|
|
1958
2006
|
}
|
|
1959
|
-
if (
|
|
2007
|
+
if ("$loc" in node) {
|
|
1960
2008
|
const { token, $loc } = node;
|
|
1961
|
-
|
|
2009
|
+
if ($loc != null) {
|
|
2010
|
+
updateSourceMap?.(token, $loc.pos);
|
|
2011
|
+
}
|
|
1962
2012
|
return token;
|
|
1963
2013
|
}
|
|
1964
2014
|
if (!node.children) {
|
|
2015
|
+
if (node.token != null) {
|
|
2016
|
+
return node.token;
|
|
2017
|
+
}
|
|
1965
2018
|
switch (node.type) {
|
|
1966
2019
|
case "Ref": {
|
|
1967
2020
|
throw new Error(`Unpopulated ref ${stringify(node)}`);
|
|
@@ -2141,6 +2194,9 @@ function serialize(value, context) {
|
|
|
2141
2194
|
throw new TypeError("cannot serialize native function");
|
|
2142
2195
|
}
|
|
2143
2196
|
if (/^class[\s{]/u.test(string)) {
|
|
2197
|
+
if (!Object.isExtensible(val)) {
|
|
2198
|
+
string = `Object.preventExtensions(${string})`;
|
|
2199
|
+
}
|
|
2144
2200
|
return string;
|
|
2145
2201
|
}
|
|
2146
2202
|
if (stack.has(val)) {
|
|
@@ -2168,6 +2224,9 @@ function serialize(value, context) {
|
|
|
2168
2224
|
}
|
|
2169
2225
|
string = `Object.defineProperties(${string},${recurse(props)})`;
|
|
2170
2226
|
}
|
|
2227
|
+
if (!Object.isExtensible(val)) {
|
|
2228
|
+
string = `Object.preventExtensions(${string})`;
|
|
2229
|
+
}
|
|
2171
2230
|
stack.delete(val);
|
|
2172
2231
|
return string;
|
|
2173
2232
|
} else if (typeof val === "symbol") {
|
|
@@ -2333,9 +2392,49 @@ function getTypeArguments(args) {
|
|
|
2333
2392
|
function isVoidType(t) {
|
|
2334
2393
|
return typeof t === "object" && t != null && "type" in t && t.type === "TypeLiteral" && "t" in t && typeof t.t === "object" && t.t != null && "type" in t.t && t.t.type === "VoidType";
|
|
2335
2394
|
}
|
|
2395
|
+
function isPromiseType(t) {
|
|
2396
|
+
return typeof t === "object" && t != null && "type" in t && t.type === "TypeIdentifier" && "raw" in t && t.raw === "Promise";
|
|
2397
|
+
}
|
|
2336
2398
|
function isPromiseVoidType(t) {
|
|
2337
|
-
|
|
2338
|
-
|
|
2399
|
+
if (!isPromiseType(t)) {
|
|
2400
|
+
return false;
|
|
2401
|
+
}
|
|
2402
|
+
const args = getTypeArguments(t.args?.args);
|
|
2403
|
+
return args.length === 1 && isVoidType(args[0].t);
|
|
2404
|
+
}
|
|
2405
|
+
function wrapTypeInPromise(t) {
|
|
2406
|
+
if (isPromiseType(t)) {
|
|
2407
|
+
return t;
|
|
2408
|
+
}
|
|
2409
|
+
return wrapTypeInApplication(t, getHelperRef("AutoPromise"), "Promise");
|
|
2410
|
+
}
|
|
2411
|
+
function wrapTypeInApplication(t, id, raw) {
|
|
2412
|
+
const ws = getTrimmingSpace(t);
|
|
2413
|
+
t = trimFirstSpace(t);
|
|
2414
|
+
const innerArgs = [{
|
|
2415
|
+
type: "TypeArgument",
|
|
2416
|
+
ts: true,
|
|
2417
|
+
t,
|
|
2418
|
+
children: [t]
|
|
2419
|
+
}];
|
|
2420
|
+
const args = {
|
|
2421
|
+
type: "TypeArguments",
|
|
2422
|
+
ts: true,
|
|
2423
|
+
args: innerArgs,
|
|
2424
|
+
children: ["<", innerArgs, ">"]
|
|
2425
|
+
};
|
|
2426
|
+
if (!(raw != null)) {
|
|
2427
|
+
if (!(typeof id === "string")) {
|
|
2428
|
+
throw new Error("wrapTypeInApplication requires string id or raw argument");
|
|
2429
|
+
}
|
|
2430
|
+
raw = id;
|
|
2431
|
+
}
|
|
2432
|
+
return {
|
|
2433
|
+
type: "TypeIdentifier",
|
|
2434
|
+
raw,
|
|
2435
|
+
args,
|
|
2436
|
+
children: [ws, id, args]
|
|
2437
|
+
};
|
|
2339
2438
|
}
|
|
2340
2439
|
function implicitFunctionBlock(f) {
|
|
2341
2440
|
if (f.abstract || f.block || f.signature?.optional)
|
|
@@ -2396,7 +2495,8 @@ function processReturnValue(func) {
|
|
|
2396
2495
|
}
|
|
2397
2496
|
const ref = makeRef("ret");
|
|
2398
2497
|
let declaration;
|
|
2399
|
-
values.
|
|
2498
|
+
for (let i1 = 0, len3 = values.length; i1 < len3; i1++) {
|
|
2499
|
+
const value = values[i1];
|
|
2400
2500
|
value.children = [ref];
|
|
2401
2501
|
const { ancestor, child } = findAncestor(
|
|
2402
2502
|
value,
|
|
@@ -2404,21 +2504,41 @@ function processReturnValue(func) {
|
|
|
2404
2504
|
isFunction
|
|
2405
2505
|
);
|
|
2406
2506
|
if (ancestor) {
|
|
2407
|
-
|
|
2507
|
+
declaration ??= child;
|
|
2408
2508
|
}
|
|
2409
|
-
|
|
2410
|
-
return;
|
|
2411
|
-
});
|
|
2509
|
+
}
|
|
2412
2510
|
let returnType = func.returnType ?? func.signature?.returnType;
|
|
2413
2511
|
if (returnType) {
|
|
2414
2512
|
const { t } = returnType;
|
|
2415
2513
|
let m;
|
|
2416
2514
|
if (m = t.type, m === "TypePredicate") {
|
|
2417
|
-
|
|
2418
|
-
|
|
2515
|
+
const token = { token: "boolean" };
|
|
2516
|
+
const literal = {
|
|
2517
|
+
type: "TypeLiteral",
|
|
2518
|
+
t: token,
|
|
2519
|
+
children: [token]
|
|
2520
|
+
};
|
|
2521
|
+
returnType = {
|
|
2522
|
+
type: "ReturnTypeAnnotation",
|
|
2523
|
+
ts: true,
|
|
2524
|
+
t: literal,
|
|
2525
|
+
children: [": ", literal]
|
|
2526
|
+
};
|
|
2527
|
+
} else if (m === "TypeAsserts") {
|
|
2419
2528
|
returnType = void 0;
|
|
2420
2529
|
}
|
|
2421
2530
|
}
|
|
2531
|
+
if (returnType) {
|
|
2532
|
+
returnType = deepCopy(returnType);
|
|
2533
|
+
addParentPointers(returnType);
|
|
2534
|
+
if (func.signature.modifier.async) {
|
|
2535
|
+
replaceNode(
|
|
2536
|
+
returnType.t,
|
|
2537
|
+
makeNode(wrapTypeInApplication(returnType.t, "Awaited")),
|
|
2538
|
+
returnType
|
|
2539
|
+
);
|
|
2540
|
+
}
|
|
2541
|
+
}
|
|
2422
2542
|
if (declaration) {
|
|
2423
2543
|
if (!(declaration.typeSuffix != null)) {
|
|
2424
2544
|
declaration.children[1] = declaration.typeSuffix = returnType;
|
|
@@ -2426,11 +2546,11 @@ function processReturnValue(func) {
|
|
|
2426
2546
|
} else {
|
|
2427
2547
|
block.expressions.unshift([
|
|
2428
2548
|
getIndent(block.expressions[0]),
|
|
2429
|
-
{
|
|
2549
|
+
makeNode({
|
|
2430
2550
|
type: "Declaration",
|
|
2431
2551
|
children: ["let ", ref, returnType],
|
|
2432
2552
|
names: []
|
|
2433
|
-
},
|
|
2553
|
+
}),
|
|
2434
2554
|
";"
|
|
2435
2555
|
]);
|
|
2436
2556
|
}
|
|
@@ -2848,19 +2968,15 @@ function wrapIterationReturningResults(statement, collect) {
|
|
|
2848
2968
|
"wrapIterationReturningResults should not be called twice on the same statement"
|
|
2849
2969
|
);
|
|
2850
2970
|
const resultsRef = statement.resultsRef = makeRef("results");
|
|
2851
|
-
const
|
|
2971
|
+
const declaration = iterationDeclaration(statement);
|
|
2852
2972
|
const { ancestor, child } = findAncestor(statement, ($4) => $4.type === "BlockStatement");
|
|
2853
2973
|
assert.notNull(ancestor, `Could not find block containing ${statement.type}`);
|
|
2854
2974
|
const index = findChildIndex(ancestor.expressions, child);
|
|
2975
|
+
assert.notEqual(index, -1, `Could not find ${statement.type} in containing block`);
|
|
2855
2976
|
const iterationTuple = ancestor.expressions[index];
|
|
2856
2977
|
ancestor.expressions.splice(index, 0, [iterationTuple[0], declaration, ";"]);
|
|
2857
2978
|
iterationTuple[0] = "";
|
|
2858
2979
|
braceBlock(ancestor);
|
|
2859
|
-
if (!breakWithOnly) {
|
|
2860
|
-
assignResults(statement.block, (node) => {
|
|
2861
|
-
return [resultsRef, ".push(", node, ")"];
|
|
2862
|
-
});
|
|
2863
|
-
}
|
|
2864
2980
|
if (collect) {
|
|
2865
2981
|
statement.children.push(collect(resultsRef));
|
|
2866
2982
|
} else {
|
|
@@ -2868,15 +2984,16 @@ function wrapIterationReturningResults(statement, collect) {
|
|
|
2868
2984
|
}
|
|
2869
2985
|
}
|
|
2870
2986
|
function iterationDeclaration(statement) {
|
|
2871
|
-
const { resultsRef } = statement;
|
|
2872
|
-
|
|
2987
|
+
const { resultsRef, block } = statement;
|
|
2988
|
+
const reduction = statement.type === "ForStatement" && statement.reduction;
|
|
2989
|
+
let decl = reduction ? "let" : "const";
|
|
2873
2990
|
if (statement.type === "IterationStatement" || statement.type === "ForStatement") {
|
|
2874
2991
|
if (processBreakContinueWith(statement)) {
|
|
2875
2992
|
decl = "let";
|
|
2876
2993
|
}
|
|
2877
2994
|
}
|
|
2878
2995
|
const breakWithOnly = decl === "let" && isLoopStatement(statement) && gatherRecursive(
|
|
2879
|
-
|
|
2996
|
+
block,
|
|
2880
2997
|
(s) => s.type === "BreakStatement" && !s.with,
|
|
2881
2998
|
(s) => isFunction(s) || s.type === "IterationStatement"
|
|
2882
2999
|
).length === 0;
|
|
@@ -2887,14 +3004,124 @@ function iterationDeclaration(statement) {
|
|
|
2887
3004
|
names: [],
|
|
2888
3005
|
bindings: []
|
|
2889
3006
|
};
|
|
2890
|
-
if (
|
|
2891
|
-
declaration.children.push("=
|
|
3007
|
+
if (reduction) {
|
|
3008
|
+
declaration.children.push("=" + (() => {
|
|
3009
|
+
switch (reduction.subtype) {
|
|
3010
|
+
case "some": {
|
|
3011
|
+
return "false";
|
|
3012
|
+
}
|
|
3013
|
+
case "every": {
|
|
3014
|
+
return "true";
|
|
3015
|
+
}
|
|
3016
|
+
case "min": {
|
|
3017
|
+
return "Infinity";
|
|
3018
|
+
}
|
|
3019
|
+
case "max": {
|
|
3020
|
+
return "-Infinity";
|
|
3021
|
+
}
|
|
3022
|
+
case "product": {
|
|
3023
|
+
return "1";
|
|
3024
|
+
}
|
|
3025
|
+
default: {
|
|
3026
|
+
return "0";
|
|
3027
|
+
}
|
|
3028
|
+
}
|
|
3029
|
+
})());
|
|
2892
3030
|
} else {
|
|
2893
|
-
if (
|
|
2894
|
-
declaration.children.push("
|
|
3031
|
+
if (decl === "const") {
|
|
3032
|
+
declaration.children.push("=[]");
|
|
3033
|
+
} else {
|
|
3034
|
+
if (!breakWithOnly) {
|
|
3035
|
+
declaration.children.push(";", resultsRef, "=[]");
|
|
3036
|
+
}
|
|
3037
|
+
}
|
|
3038
|
+
}
|
|
3039
|
+
if (!breakWithOnly) {
|
|
3040
|
+
if (iterationDefaultBody(statement)) {
|
|
3041
|
+
return declaration;
|
|
3042
|
+
}
|
|
3043
|
+
if (!block.empty) {
|
|
3044
|
+
assignResults(block, (node) => {
|
|
3045
|
+
if (!reduction) {
|
|
3046
|
+
return [resultsRef, ".push(", node, ")"];
|
|
3047
|
+
}
|
|
3048
|
+
switch (reduction.subtype) {
|
|
3049
|
+
case "some": {
|
|
3050
|
+
return ["if (", node, ") {", resultsRef, " = true; break}"];
|
|
3051
|
+
}
|
|
3052
|
+
case "every": {
|
|
3053
|
+
return [
|
|
3054
|
+
"if (!",
|
|
3055
|
+
makeLeftHandSideExpression(node),
|
|
3056
|
+
") {",
|
|
3057
|
+
resultsRef,
|
|
3058
|
+
" = false; break}"
|
|
3059
|
+
];
|
|
3060
|
+
}
|
|
3061
|
+
case "count": {
|
|
3062
|
+
return ["if (", node, ") ++", resultsRef];
|
|
3063
|
+
}
|
|
3064
|
+
case "sum": {
|
|
3065
|
+
return [resultsRef, " += ", node];
|
|
3066
|
+
}
|
|
3067
|
+
case "product": {
|
|
3068
|
+
return [resultsRef, " *= ", node];
|
|
3069
|
+
}
|
|
3070
|
+
case "min": {
|
|
3071
|
+
return [resultsRef, " = Math.min(", resultsRef, ", ", node, ")"];
|
|
3072
|
+
}
|
|
3073
|
+
case "max": {
|
|
3074
|
+
return [resultsRef, " = Math.max(", resultsRef, ", ", node, ")"];
|
|
3075
|
+
}
|
|
3076
|
+
}
|
|
3077
|
+
});
|
|
2895
3078
|
}
|
|
2896
3079
|
}
|
|
2897
|
-
return
|
|
3080
|
+
return declaration;
|
|
3081
|
+
}
|
|
3082
|
+
function iterationDefaultBody(statement) {
|
|
3083
|
+
const { block, resultsRef } = statement;
|
|
3084
|
+
if (!block.empty) {
|
|
3085
|
+
return false;
|
|
3086
|
+
}
|
|
3087
|
+
const reduction = statement.type === "ForStatement" && statement.reduction;
|
|
3088
|
+
function fillBlock(expression) {
|
|
3089
|
+
let ref8;
|
|
3090
|
+
let m2;
|
|
3091
|
+
if (m2 = (ref8 = block.expressions)[ref8.length - 1], Array.isArray(m2) && m2.length >= 2 && typeof m2[1] === "object" && m2[1] != null && "type" in m2[1] && m2[1].type === "EmptyStatement" && "implicit" in m2[1] && m2[1].implicit === true) {
|
|
3092
|
+
block.expressions.pop();
|
|
3093
|
+
}
|
|
3094
|
+
block.expressions.push(expression);
|
|
3095
|
+
block.empty = false;
|
|
3096
|
+
return braceBlock(block);
|
|
3097
|
+
}
|
|
3098
|
+
if (reduction) {
|
|
3099
|
+
switch (reduction.subtype) {
|
|
3100
|
+
case "some": {
|
|
3101
|
+
fillBlock(["", [resultsRef, " = true; break"]]);
|
|
3102
|
+
block.empty = false;
|
|
3103
|
+
braceBlock(block);
|
|
3104
|
+
return true;
|
|
3105
|
+
}
|
|
3106
|
+
case "every": {
|
|
3107
|
+
fillBlock(["", [resultsRef, " = false; break"]]);
|
|
3108
|
+
block.empty = false;
|
|
3109
|
+
braceBlock(block);
|
|
3110
|
+
return true;
|
|
3111
|
+
}
|
|
3112
|
+
case "count": {
|
|
3113
|
+
fillBlock(["", ["++", resultsRef]]);
|
|
3114
|
+
block.empty = false;
|
|
3115
|
+
braceBlock(block);
|
|
3116
|
+
return true;
|
|
3117
|
+
}
|
|
3118
|
+
}
|
|
3119
|
+
}
|
|
3120
|
+
if (statement.type === "ForStatement" && statement.declaration?.type === "ForDeclaration") {
|
|
3121
|
+
fillBlock(["", patternAsValue(statement.declaration.binding)]);
|
|
3122
|
+
block.empty = false;
|
|
3123
|
+
}
|
|
3124
|
+
return false;
|
|
2898
3125
|
}
|
|
2899
3126
|
function processParams(f) {
|
|
2900
3127
|
const { type, parameters, block } = f;
|
|
@@ -2925,18 +3152,18 @@ function processParams(f) {
|
|
|
2925
3152
|
const classExpressions = ancestor.body.expressions;
|
|
2926
3153
|
let index = findChildIndex(classExpressions, f);
|
|
2927
3154
|
assert.notEqual(index, -1, "Could not find constructor in class");
|
|
2928
|
-
let
|
|
2929
|
-
while (
|
|
3155
|
+
let m3;
|
|
3156
|
+
while (m3 = classExpressions[index - 1]?.[1], typeof m3 === "object" && m3 != null && "type" in m3 && m3.type === "MethodDefinition" && "name" in m3 && m3.name === "constructor") {
|
|
2930
3157
|
index--;
|
|
2931
3158
|
}
|
|
2932
3159
|
const fStatement = classExpressions[index];
|
|
2933
|
-
for (let
|
|
2934
|
-
const parameter =
|
|
3160
|
+
for (let ref9 = gatherRecursive(parameters, ($9) => $9.type === "Parameter"), i2 = 0, len1 = ref9.length; i2 < len1; i2++) {
|
|
3161
|
+
const parameter = ref9[i2];
|
|
2935
3162
|
if (!parameter.typeSuffix) {
|
|
2936
3163
|
continue;
|
|
2937
3164
|
}
|
|
2938
|
-
for (let
|
|
2939
|
-
const binding =
|
|
3165
|
+
for (let ref10 = gatherRecursive(parameter, ($10) => $10.type === "AtBinding"), i3 = 0, len22 = ref10.length; i3 < len22; i3++) {
|
|
3166
|
+
const binding = ref10[i3];
|
|
2940
3167
|
const typeSuffix = binding.parent?.typeSuffix;
|
|
2941
3168
|
if (!typeSuffix) {
|
|
2942
3169
|
continue;
|
|
@@ -2990,11 +3217,11 @@ function processParams(f) {
|
|
|
2990
3217
|
}
|
|
2991
3218
|
function processSignature(f) {
|
|
2992
3219
|
const { block, signature } = f;
|
|
2993
|
-
if (
|
|
3220
|
+
if (!f.async?.length && hasAwait(block)) {
|
|
2994
3221
|
f.async.push("async ");
|
|
2995
3222
|
signature.modifier.async = true;
|
|
2996
3223
|
}
|
|
2997
|
-
if (
|
|
3224
|
+
if (!f.generator?.length && hasYield(block)) {
|
|
2998
3225
|
if (f.type === "ArrowFunction") {
|
|
2999
3226
|
gatherRecursiveWithinFunction(block, ($11) => $11.type === "YieldExpression").forEach((y) => {
|
|
3000
3227
|
const i = y.children.findIndex(($12) => $12.type === "Yield");
|
|
@@ -3008,21 +3235,26 @@ function processSignature(f) {
|
|
|
3008
3235
|
signature.modifier.generator = true;
|
|
3009
3236
|
}
|
|
3010
3237
|
}
|
|
3238
|
+
if (signature.modifier.async && !signature.modifier.generator && signature.returnType && !isPromiseType(signature.returnType.t)) {
|
|
3239
|
+
replaceNode(signature.returnType.t, wrapTypeInPromise(signature.returnType.t));
|
|
3240
|
+
}
|
|
3011
3241
|
}
|
|
3012
3242
|
function processFunctions(statements, config2) {
|
|
3013
|
-
gatherRecursiveAll(statements, (
|
|
3243
|
+
for (let ref11 = gatherRecursiveAll(statements, ($13) => $13.type === "FunctionExpression" || $13.type === "ArrowFunction"), i4 = 0, len3 = ref11.length; i4 < len3; i4++) {
|
|
3244
|
+
const f = ref11[i4];
|
|
3014
3245
|
if (f.type === "FunctionExpression") {
|
|
3015
3246
|
implicitFunctionBlock(f);
|
|
3016
3247
|
}
|
|
3017
3248
|
processSignature(f);
|
|
3018
3249
|
processParams(f);
|
|
3019
|
-
|
|
3020
|
-
}
|
|
3021
|
-
gatherRecursiveAll(statements, (
|
|
3250
|
+
processReturn(f, config2.implicitReturns);
|
|
3251
|
+
}
|
|
3252
|
+
for (let ref12 = gatherRecursiveAll(statements, ($14) => $14.type === "MethodDefinition"), i5 = 0, len4 = ref12.length; i5 < len4; i5++) {
|
|
3253
|
+
const f = ref12[i5];
|
|
3022
3254
|
implicitFunctionBlock(f);
|
|
3023
3255
|
processParams(f);
|
|
3024
|
-
|
|
3025
|
-
}
|
|
3256
|
+
processReturn(f, config2.implicitReturns);
|
|
3257
|
+
}
|
|
3026
3258
|
}
|
|
3027
3259
|
function expressionizeIteration(exp) {
|
|
3028
3260
|
let { async, generator, block, children, statement } = exp;
|
|
@@ -3035,47 +3267,65 @@ function expressionizeIteration(exp) {
|
|
|
3035
3267
|
updateParentPointers(exp);
|
|
3036
3268
|
return;
|
|
3037
3269
|
}
|
|
3270
|
+
let statements;
|
|
3038
3271
|
if (generator) {
|
|
3272
|
+
if (statement.reduction) {
|
|
3273
|
+
children.unshift({
|
|
3274
|
+
type: "Error",
|
|
3275
|
+
message: `Cannot use reduction (${statement.reduction.subtype}) with generators`
|
|
3276
|
+
});
|
|
3277
|
+
}
|
|
3278
|
+
iterationDefaultBody(statement);
|
|
3039
3279
|
assignResults(block, (node) => {
|
|
3040
3280
|
return {
|
|
3041
3281
|
type: "YieldExpression",
|
|
3042
3282
|
expression: node,
|
|
3043
|
-
children: [
|
|
3283
|
+
children: [
|
|
3284
|
+
{
|
|
3285
|
+
type: "Yield",
|
|
3286
|
+
token: "yield "
|
|
3287
|
+
},
|
|
3288
|
+
node
|
|
3289
|
+
]
|
|
3044
3290
|
};
|
|
3045
3291
|
});
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
wrapIIFE([
|
|
3050
|
-
["", statement, void 0],
|
|
3051
|
-
// Prevent implicit return in generator, by adding an explicit return
|
|
3052
|
-
["", {
|
|
3053
|
-
type: "ReturnStatement",
|
|
3054
|
-
expression: void 0,
|
|
3055
|
-
children: [";return"]
|
|
3056
|
-
}, void 0]
|
|
3057
|
-
], async, generator)
|
|
3058
|
-
);
|
|
3292
|
+
statements = [
|
|
3293
|
+
["", statement]
|
|
3294
|
+
];
|
|
3059
3295
|
} else {
|
|
3060
3296
|
const resultsRef = statement.resultsRef ??= makeRef("results");
|
|
3061
|
-
const
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3297
|
+
const declaration = iterationDeclaration(statement);
|
|
3298
|
+
statements = [
|
|
3299
|
+
["", declaration, ";"],
|
|
3300
|
+
["", statement, statement.block.bare ? ";" : void 0],
|
|
3301
|
+
["", resultsRef]
|
|
3302
|
+
];
|
|
3303
|
+
}
|
|
3304
|
+
let done;
|
|
3305
|
+
if (!async) {
|
|
3306
|
+
let ref13;
|
|
3307
|
+
if ((ref13 = blockContainingStatement(exp)) && typeof ref13 === "object" && "block" in ref13 && "index" in ref13) {
|
|
3308
|
+
const { block: parentBlock, index } = ref13;
|
|
3309
|
+
statements[0][0] = parentBlock.expressions[index][0];
|
|
3310
|
+
parentBlock.expressions.splice(index, index + 1 - index, ...statements);
|
|
3311
|
+
updateParentPointers(parentBlock);
|
|
3312
|
+
braceBlock(parentBlock);
|
|
3313
|
+
done = true;
|
|
3067
3314
|
}
|
|
3068
|
-
children.splice(
|
|
3069
|
-
i,
|
|
3070
|
-
1,
|
|
3071
|
-
wrapIIFE([
|
|
3072
|
-
["", declaration, ";"],
|
|
3073
|
-
["", statement, void 0],
|
|
3074
|
-
["", wrapWithReturn(resultsRef)]
|
|
3075
|
-
], async)
|
|
3076
|
-
);
|
|
3077
3315
|
}
|
|
3078
|
-
|
|
3316
|
+
if (!done) {
|
|
3317
|
+
if (!generator) {
|
|
3318
|
+
statements[statements.length - 1][1] = wrapWithReturn(statements[statements.length - 1][1]);
|
|
3319
|
+
}
|
|
3320
|
+
children.splice(i, 1, wrapIIFE(statements, async, generator));
|
|
3321
|
+
updateParentPointers(exp);
|
|
3322
|
+
}
|
|
3323
|
+
}
|
|
3324
|
+
function processIterationExpressions(statements) {
|
|
3325
|
+
for (let ref14 = gatherRecursiveAll(statements, ($15) => $15.type === "IterationExpression"), i6 = 0, len5 = ref14.length; i6 < len5; i6++) {
|
|
3326
|
+
const s = ref14[i6];
|
|
3327
|
+
expressionizeIteration(s);
|
|
3328
|
+
}
|
|
3079
3329
|
}
|
|
3080
3330
|
function skipImplicitArguments(args) {
|
|
3081
3331
|
if (args.length === 1) {
|
|
@@ -3099,12 +3349,12 @@ function processCoffeeDo(ws, expression) {
|
|
|
3099
3349
|
...parameters,
|
|
3100
3350
|
children: (() => {
|
|
3101
3351
|
const results1 = [];
|
|
3102
|
-
for (let
|
|
3103
|
-
let parameter =
|
|
3352
|
+
for (let ref15 = parameters.children, i7 = 0, len6 = ref15.length; i7 < len6; i7++) {
|
|
3353
|
+
let parameter = ref15[i7];
|
|
3104
3354
|
if (typeof parameter === "object" && parameter != null && "type" in parameter && parameter.type === "Parameter") {
|
|
3105
|
-
let
|
|
3106
|
-
if (
|
|
3107
|
-
const initializer =
|
|
3355
|
+
let ref16;
|
|
3356
|
+
if (ref16 = parameter.initializer) {
|
|
3357
|
+
const initializer = ref16;
|
|
3108
3358
|
args.push(initializer.expression, parameter.delim);
|
|
3109
3359
|
parameter = {
|
|
3110
3360
|
...parameter,
|
|
@@ -3125,7 +3375,7 @@ function processCoffeeDo(ws, expression) {
|
|
|
3125
3375
|
expression = {
|
|
3126
3376
|
...expression,
|
|
3127
3377
|
parameters: newParameters,
|
|
3128
|
-
children: expression.children.map(($
|
|
3378
|
+
children: expression.children.map(($16) => $16 === parameters ? newParameters : $16)
|
|
3129
3379
|
};
|
|
3130
3380
|
}
|
|
3131
3381
|
return {
|
|
@@ -3147,7 +3397,7 @@ function makeAmpersandFunction(rhs) {
|
|
|
3147
3397
|
ref = makeRef("$");
|
|
3148
3398
|
inplacePrepend(ref, body);
|
|
3149
3399
|
}
|
|
3150
|
-
if (startsWithPredicate(body, ($
|
|
3400
|
+
if (startsWithPredicate(body, ($17) => $17.type === "ObjectExpression")) {
|
|
3151
3401
|
body = makeLeftHandSideExpression(body);
|
|
3152
3402
|
}
|
|
3153
3403
|
const parameters = makeNode({
|
|
@@ -3387,6 +3637,28 @@ function needsPrecedingSemicolon(exp) {
|
|
|
3387
3637
|
}
|
|
3388
3638
|
}
|
|
3389
3639
|
}
|
|
3640
|
+
function blockContainingStatement(exp) {
|
|
3641
|
+
let child = exp;
|
|
3642
|
+
let parent = exp.parent;
|
|
3643
|
+
let m;
|
|
3644
|
+
while (parent != null && (m = parent.type, m === "StatementExpression" || m === "PipelineExpression" || m === "UnwrappedExpression")) {
|
|
3645
|
+
child = parent;
|
|
3646
|
+
parent = parent.parent;
|
|
3647
|
+
}
|
|
3648
|
+
if (!(parent?.type === "BlockStatement")) {
|
|
3649
|
+
return;
|
|
3650
|
+
}
|
|
3651
|
+
const index = findChildIndex(parent.expressions, child);
|
|
3652
|
+
assert.notEqual(index, -1, "Could not find statement in parent block");
|
|
3653
|
+
if (!(parent.expressions[index][1] === child)) {
|
|
3654
|
+
return;
|
|
3655
|
+
}
|
|
3656
|
+
return {
|
|
3657
|
+
block: parent,
|
|
3658
|
+
index,
|
|
3659
|
+
child
|
|
3660
|
+
};
|
|
3661
|
+
}
|
|
3390
3662
|
|
|
3391
3663
|
// source/parser/op.civet
|
|
3392
3664
|
var precedenceOrder = [
|
|
@@ -4648,8 +4920,9 @@ function convertWithClause(withClause, extendsClause) {
|
|
|
4648
4920
|
|
|
4649
4921
|
// source/parser/unary.civet
|
|
4650
4922
|
function processUnaryExpression(pre, exp, post) {
|
|
4651
|
-
if (!(pre.length || post))
|
|
4923
|
+
if (!(pre.length || post)) {
|
|
4652
4924
|
return exp;
|
|
4925
|
+
}
|
|
4653
4926
|
if (post?.token === "?") {
|
|
4654
4927
|
post = {
|
|
4655
4928
|
$loc: post.$loc,
|
|
@@ -4680,29 +4953,25 @@ function processUnaryExpression(pre, exp, post) {
|
|
|
4680
4953
|
}
|
|
4681
4954
|
return exp;
|
|
4682
4955
|
}
|
|
4683
|
-
if (exp
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
children: [literal, post]
|
|
4697
|
-
};
|
|
4698
|
-
}
|
|
4699
|
-
return literal;
|
|
4956
|
+
if (exp?.type === "Literal" && pre.length) {
|
|
4957
|
+
let [...ref] = pre, [last] = ref.splice(-1);
|
|
4958
|
+
let m;
|
|
4959
|
+
if (m = last?.token, m === "+" || m === "-") {
|
|
4960
|
+
last = last;
|
|
4961
|
+
exp = {
|
|
4962
|
+
...exp,
|
|
4963
|
+
children: [last, ...exp.children],
|
|
4964
|
+
raw: `${last.token}${exp.raw}`
|
|
4965
|
+
};
|
|
4966
|
+
pre = pre.slice(0, -1);
|
|
4967
|
+
if (!(pre.length || post)) {
|
|
4968
|
+
return exp;
|
|
4700
4969
|
}
|
|
4701
4970
|
}
|
|
4702
4971
|
}
|
|
4703
|
-
let
|
|
4704
|
-
while (
|
|
4705
|
-
const l =
|
|
4972
|
+
let ref1;
|
|
4973
|
+
while (ref1 = pre.length) {
|
|
4974
|
+
const l = ref1;
|
|
4706
4975
|
const last = pre[l - 1];
|
|
4707
4976
|
if (last.type === "Await") {
|
|
4708
4977
|
if (last.op) {
|
|
@@ -4715,8 +4984,8 @@ function processUnaryExpression(pre, exp, post) {
|
|
|
4715
4984
|
};
|
|
4716
4985
|
pre = pre.slice(0, -1);
|
|
4717
4986
|
} else {
|
|
4718
|
-
let
|
|
4719
|
-
if (
|
|
4987
|
+
let m1;
|
|
4988
|
+
if (m1 = firstNonSpace(exp), typeof m1 === "string" && /^[ \t]*\n/.test(m1) || typeof m1 === "object" && m1 != null && "token" in m1 && typeof m1.token === "string" && /^[ \t]*\n/.test(m1.token)) {
|
|
4720
4989
|
exp = parenthesizeExpression(exp);
|
|
4721
4990
|
}
|
|
4722
4991
|
exp = {
|
|
@@ -4820,6 +5089,7 @@ function constructInvocation(fn, arg) {
|
|
|
4820
5089
|
updateParentPointers(ref);
|
|
4821
5090
|
return makeNode({
|
|
4822
5091
|
type: "UnwrappedExpression",
|
|
5092
|
+
expression: body,
|
|
4823
5093
|
children: [skipIfOnlyWS(fn.leadingComment), body, skipIfOnlyWS(fn.trailingComment)]
|
|
4824
5094
|
});
|
|
4825
5095
|
}
|
|
@@ -4856,6 +5126,17 @@ function constructPipeStep(fn, arg, returning) {
|
|
|
4856
5126
|
returning
|
|
4857
5127
|
];
|
|
4858
5128
|
}
|
|
5129
|
+
case "throw": {
|
|
5130
|
+
const statement = { type: "ThrowStatement", children };
|
|
5131
|
+
return [
|
|
5132
|
+
{
|
|
5133
|
+
type: "StatementExpression",
|
|
5134
|
+
statement,
|
|
5135
|
+
children: [statement]
|
|
5136
|
+
},
|
|
5137
|
+
null
|
|
5138
|
+
];
|
|
5139
|
+
}
|
|
4859
5140
|
case "return": {
|
|
4860
5141
|
return [{
|
|
4861
5142
|
type: "ReturnStatement",
|
|
@@ -5140,25 +5421,40 @@ function forRange(open, forDeclaration, range, stepExp, close) {
|
|
|
5140
5421
|
const infinite = typeof end === "object" && end != null && "type" in end && end.type === "Identifier" && "name" in end && end.name === "Infinity";
|
|
5141
5422
|
let stepRef, asc;
|
|
5142
5423
|
if (stepExp) {
|
|
5143
|
-
stepExp =
|
|
5424
|
+
stepExp = trimFirstSpace(stepExp);
|
|
5144
5425
|
stepRef = maybeRef(stepExp, "step");
|
|
5145
5426
|
} else if (infinite) {
|
|
5146
|
-
stepExp = stepRef =
|
|
5427
|
+
stepExp = stepRef = makeNumericLiteral(1);
|
|
5147
5428
|
} else if (increasing != null) {
|
|
5148
5429
|
if (increasing) {
|
|
5149
|
-
stepExp = stepRef =
|
|
5430
|
+
stepExp = stepRef = makeNumericLiteral(1);
|
|
5150
5431
|
asc = true;
|
|
5151
5432
|
} else {
|
|
5152
|
-
stepExp = stepRef =
|
|
5433
|
+
stepExp = stepRef = makeNumericLiteral(-1);
|
|
5153
5434
|
asc = false;
|
|
5154
5435
|
}
|
|
5155
5436
|
}
|
|
5156
5437
|
let ref2;
|
|
5438
|
+
if (stepExp?.type === "Literal") {
|
|
5439
|
+
try {
|
|
5440
|
+
ref2 = literalValue(stepExp);
|
|
5441
|
+
} catch (e) {
|
|
5442
|
+
ref2 = void 0;
|
|
5443
|
+
}
|
|
5444
|
+
} else {
|
|
5445
|
+
ref2 = void 0;
|
|
5446
|
+
}
|
|
5447
|
+
;
|
|
5448
|
+
const stepValue = ref2;
|
|
5449
|
+
if (typeof stepValue === "number") {
|
|
5450
|
+
asc = stepValue > 0;
|
|
5451
|
+
}
|
|
5452
|
+
let ref3;
|
|
5157
5453
|
if (stepRef)
|
|
5158
|
-
|
|
5454
|
+
ref3 = start;
|
|
5159
5455
|
else
|
|
5160
|
-
|
|
5161
|
-
let startRef =
|
|
5456
|
+
ref3 = maybeRef(start, "start");
|
|
5457
|
+
let startRef = ref3;
|
|
5162
5458
|
let endRef = maybeRef(end, "end");
|
|
5163
5459
|
const startRefDec = startRef !== start ? [startRef, " = ", start, ", "] : [];
|
|
5164
5460
|
const endRefDec = endRef !== end ? [endRef, " = ", end, ", "] : [];
|
|
@@ -5170,11 +5466,11 @@ function forRange(open, forDeclaration, range, stepExp, close) {
|
|
|
5170
5466
|
];
|
|
5171
5467
|
}
|
|
5172
5468
|
let ascDec = [], ascRef;
|
|
5173
|
-
if (
|
|
5469
|
+
if (stepExp) {
|
|
5174
5470
|
if (!(stepRef === stepExp)) {
|
|
5175
5471
|
ascDec = [", ", stepRef, " = ", stepExp];
|
|
5176
5472
|
}
|
|
5177
|
-
} else if ("Literal"
|
|
5473
|
+
} else if (start?.type === "Literal" && "Literal" === end?.type) {
|
|
5178
5474
|
asc = literalValue(start) <= literalValue(end);
|
|
5179
5475
|
if ("StringLiteral" === start.subtype && start.subtype === end.subtype) {
|
|
5180
5476
|
startRef = literalValue(start).charCodeAt(0).toString();
|
|
@@ -5185,10 +5481,11 @@ function forRange(open, forDeclaration, range, stepExp, close) {
|
|
|
5185
5481
|
ascDec = [", ", ascRef, " = ", startRef, " <= ", endRef];
|
|
5186
5482
|
}
|
|
5187
5483
|
let varAssign = [], varLetAssign = varAssign, varLet = varAssign, blockPrefix;
|
|
5188
|
-
|
|
5189
|
-
|
|
5484
|
+
let names = forDeclaration?.names;
|
|
5485
|
+
if (forDeclaration?.decl) {
|
|
5486
|
+
if (forDeclaration.decl === "let") {
|
|
5190
5487
|
const varName = forDeclaration.children.splice(1);
|
|
5191
|
-
varAssign = [...
|
|
5488
|
+
varAssign = [...trimFirstSpace(varName), " = "];
|
|
5192
5489
|
varLet = [",", ...varName, " = ", counterRef];
|
|
5193
5490
|
} else {
|
|
5194
5491
|
const value = "StringLiteral" === start.subtype ? ["String.fromCharCode(", counterRef, ")"] : counterRef;
|
|
@@ -5197,26 +5494,41 @@ function forRange(open, forDeclaration, range, stepExp, close) {
|
|
|
5197
5494
|
];
|
|
5198
5495
|
}
|
|
5199
5496
|
} else if (forDeclaration) {
|
|
5497
|
+
assert.equal(
|
|
5498
|
+
forDeclaration.type,
|
|
5499
|
+
"AssignmentExpression",
|
|
5500
|
+
"Internal error: Coffee-style for loop must be an assignment expression"
|
|
5501
|
+
);
|
|
5200
5502
|
varAssign = varLetAssign = [forDeclaration, " = "];
|
|
5503
|
+
names = [];
|
|
5201
5504
|
}
|
|
5202
5505
|
const declaration = {
|
|
5203
5506
|
type: "Declaration",
|
|
5204
5507
|
children: ["let ", ...startRefDec, ...endRefDec, counterRef, " = ", ...varLetAssign, startRef, ...varLet, ...ascDec],
|
|
5205
|
-
names
|
|
5508
|
+
names
|
|
5206
5509
|
};
|
|
5207
5510
|
const counterPart = right.inclusive ? [counterRef, " <= ", endRef, " : ", counterRef, " >= ", endRef] : [counterRef, " < ", endRef, " : ", counterRef, " > ", endRef];
|
|
5208
|
-
const condition = infinite ? [] : asc != null ? asc ? counterPart.slice(0, 3) : counterPart.slice(4) : stepRef ? [stepRef, " !== 0 && (", stepRef, " > 0 ? ", ...counterPart, ")"] : [ascRef, " ? ", ...counterPart];
|
|
5209
|
-
const increment =
|
|
5511
|
+
const condition = infinite || stepValue === 0 ? [] : asc != null ? asc ? counterPart.slice(0, 3) : counterPart.slice(4) : stepRef ? [stepRef, " !== 0 && (", stepRef, " > 0 ? ", ...counterPart, ")"] : [ascRef, " ? ", ...counterPart];
|
|
5512
|
+
const increment = stepValue === 1 ? [...varAssign, "++", counterRef] : stepValue === -1 ? [...varAssign, "--", counterRef] : stepRef ? [...varAssign, counterRef, " += ", stepRef] : ascRef ? [...varAssign, ascRef, " ? ++", counterRef, " : --", counterRef] : [...varAssign, asc ? "++" : "--", counterRef];
|
|
5210
5513
|
return {
|
|
5211
|
-
declaration,
|
|
5514
|
+
// This declaration doesn't always appear in the output,
|
|
5515
|
+
// but it's still helpful for determining the primary loop variable
|
|
5516
|
+
declaration: forDeclaration,
|
|
5212
5517
|
children: [range.error, open, declaration, "; ", ...condition, "; ", ...increment, close],
|
|
5213
5518
|
blockPrefix
|
|
5214
5519
|
};
|
|
5215
5520
|
}
|
|
5216
|
-
function processForInOf($0
|
|
5521
|
+
function processForInOf($0) {
|
|
5217
5522
|
let [awaits, eachOwn, open, declaration, declaration2, ws, inOf, exp, step, close] = $0;
|
|
5218
5523
|
if (exp.type === "RangeExpression" && inOf.token === "of" && !declaration2) {
|
|
5219
|
-
return forRange(
|
|
5524
|
+
return forRange(
|
|
5525
|
+
open,
|
|
5526
|
+
declaration,
|
|
5527
|
+
exp,
|
|
5528
|
+
step && prepend(trimFirstSpace(step[0]), trimFirstSpace(step[2])),
|
|
5529
|
+
// omit "by" token
|
|
5530
|
+
close
|
|
5531
|
+
);
|
|
5220
5532
|
} else if (step) {
|
|
5221
5533
|
throw new Error("for..of/in cannot use 'by' except with range literals");
|
|
5222
5534
|
}
|
|
@@ -5232,22 +5544,22 @@ function processForInOf($0, getRef) {
|
|
|
5232
5544
|
if (declaration2) {
|
|
5233
5545
|
const [, , ws22, decl22] = declaration2;
|
|
5234
5546
|
blockPrefix.push(["", [
|
|
5235
|
-
|
|
5547
|
+
trimFirstSpace(ws22),
|
|
5236
5548
|
decl22,
|
|
5237
5549
|
" = ",
|
|
5238
5550
|
counterRef
|
|
5239
5551
|
], ";"]);
|
|
5240
5552
|
assignmentNames.push(...decl22.names);
|
|
5241
5553
|
}
|
|
5242
|
-
const expRefDec = expRef2 !== exp ? [
|
|
5554
|
+
const expRefDec = expRef2 !== exp ? [trimFirstSpace(expRef2), " = ", trimFirstSpace(exp), ", "] : [];
|
|
5243
5555
|
blockPrefix.push(["", {
|
|
5244
5556
|
type: "Declaration",
|
|
5245
|
-
children: [declaration, " = ",
|
|
5557
|
+
children: [declaration, " = ", trimFirstSpace(expRef2), "[", counterRef, "]"],
|
|
5246
5558
|
names: assignmentNames
|
|
5247
5559
|
}, ";"]);
|
|
5248
5560
|
declaration = {
|
|
5249
5561
|
type: "Declaration",
|
|
5250
|
-
children: ["let ", ...expRefDec, counterRef, " = 0, ", lenRef, " = ",
|
|
5562
|
+
children: ["let ", ...expRefDec, counterRef, " = 0, ", lenRef, " = ", trimFirstSpace(expRef2), ".length"],
|
|
5251
5563
|
names: []
|
|
5252
5564
|
};
|
|
5253
5565
|
const condition = [counterRef, " < ", lenRef, "; "];
|
|
@@ -5295,7 +5607,7 @@ function processForInOf($0, getRef) {
|
|
|
5295
5607
|
return {
|
|
5296
5608
|
declaration,
|
|
5297
5609
|
blockPrefix,
|
|
5298
|
-
children: [awaits, eachOwnError, open, declaration, ws, inOf, expRef ?? exp,
|
|
5610
|
+
children: [awaits, eachOwnError, open, declaration, ws, inOf, expRef ?? exp, close]
|
|
5299
5611
|
// omit declaration2, replace eachOwn with eachOwnError, replace exp with expRef
|
|
5300
5612
|
};
|
|
5301
5613
|
}
|
|
@@ -5312,7 +5624,7 @@ function processForInOf($0, getRef) {
|
|
|
5312
5624
|
};
|
|
5313
5625
|
blockPrefix.push(["", {
|
|
5314
5626
|
type: "Declaration",
|
|
5315
|
-
children: [
|
|
5627
|
+
children: [trimFirstSpace(ws2), decl2, " = ", counterRef, "++"],
|
|
5316
5628
|
names: decl2.names
|
|
5317
5629
|
}, ";"]);
|
|
5318
5630
|
break;
|
|
@@ -5331,13 +5643,13 @@ function processForInOf($0, getRef) {
|
|
|
5331
5643
|
};
|
|
5332
5644
|
}
|
|
5333
5645
|
if (own) {
|
|
5334
|
-
const hasPropRef =
|
|
5335
|
-
blockPrefix.push(["", ["if (!", hasPropRef, "(",
|
|
5646
|
+
const hasPropRef = getHelperRef("hasProp");
|
|
5647
|
+
blockPrefix.push(["", ["if (!", hasPropRef, "(", trimFirstSpace(expRef2), ", ", trimFirstSpace(pattern), ")) continue"], ";"]);
|
|
5336
5648
|
}
|
|
5337
5649
|
if (decl2) {
|
|
5338
5650
|
blockPrefix.push(["", {
|
|
5339
5651
|
type: "Declaration",
|
|
5340
|
-
children: [
|
|
5652
|
+
children: [trimFirstSpace(ws2), decl2, " = ", trimFirstSpace(expRef2), "[", trimFirstSpace(pattern), "]"],
|
|
5341
5653
|
names: decl2.names
|
|
5342
5654
|
}, ";"]);
|
|
5343
5655
|
}
|
|
@@ -5350,7 +5662,7 @@ function processForInOf($0, getRef) {
|
|
|
5350
5662
|
}
|
|
5351
5663
|
return {
|
|
5352
5664
|
declaration,
|
|
5353
|
-
children: [awaits, eachOwnError, open, declaration, ws, inOf, exp,
|
|
5665
|
+
children: [awaits, eachOwnError, open, declaration, ws, inOf, exp, close],
|
|
5354
5666
|
// omit declaration2, replace each with eachOwnError
|
|
5355
5667
|
blockPrefix,
|
|
5356
5668
|
hoistDec
|
|
@@ -5483,7 +5795,7 @@ function createVarDecs(block, scopes, pushVar) {
|
|
|
5483
5795
|
return createVarDecs(block2, scopes, pushVar);
|
|
5484
5796
|
});
|
|
5485
5797
|
forNodes.forEach(({ block: block2, declaration }) => {
|
|
5486
|
-
scopes.push(new Set(declaration
|
|
5798
|
+
scopes.push(new Set(declaration?.names));
|
|
5487
5799
|
createVarDecs(block2, scopes, pushVar);
|
|
5488
5800
|
return scopes.pop();
|
|
5489
5801
|
});
|
|
@@ -6447,8 +6759,8 @@ function processBindingPatternLHS(lhs, tail) {
|
|
|
6447
6759
|
tail.push(...splices.map((s) => [", ", s]), ...thisAssignments.map((a) => [", ", a]));
|
|
6448
6760
|
}
|
|
6449
6761
|
function processAssignments(statements) {
|
|
6450
|
-
gatherRecursiveAll(statements, (
|
|
6451
|
-
function
|
|
6762
|
+
for (let ref6 = gatherRecursiveAll(statements, ($3) => $3.type === "AssignmentExpression" || $3.type === "UpdateExpression"), i5 = 0, len4 = ref6.length; i5 < len4; i5++) {
|
|
6763
|
+
let extractAssignment2 = function(lhs) {
|
|
6452
6764
|
let expr = lhs;
|
|
6453
6765
|
while (expr.type === "ParenthesizedExpression") {
|
|
6454
6766
|
expr = expr.expression;
|
|
@@ -6466,17 +6778,20 @@ function processAssignments(statements) {
|
|
|
6466
6778
|
}
|
|
6467
6779
|
;
|
|
6468
6780
|
return;
|
|
6469
|
-
}
|
|
6781
|
+
};
|
|
6782
|
+
var extractAssignment = extractAssignment2;
|
|
6783
|
+
const exp = ref6[i5];
|
|
6470
6784
|
const pre = [], post = [];
|
|
6471
|
-
let
|
|
6785
|
+
let ref7;
|
|
6472
6786
|
switch (exp.type) {
|
|
6473
6787
|
case "AssignmentExpression": {
|
|
6474
|
-
if (!exp.lhs)
|
|
6475
|
-
|
|
6788
|
+
if (!exp.lhs) {
|
|
6789
|
+
continue;
|
|
6790
|
+
}
|
|
6476
6791
|
exp.lhs.forEach((lhsPart, i) => {
|
|
6477
|
-
let
|
|
6478
|
-
if (
|
|
6479
|
-
const newLhs =
|
|
6792
|
+
let ref8;
|
|
6793
|
+
if (ref8 = extractAssignment2(lhsPart[1])) {
|
|
6794
|
+
const newLhs = ref8;
|
|
6480
6795
|
return lhsPart[1] = newLhs;
|
|
6481
6796
|
}
|
|
6482
6797
|
;
|
|
@@ -6485,8 +6800,8 @@ function processAssignments(statements) {
|
|
|
6485
6800
|
break;
|
|
6486
6801
|
}
|
|
6487
6802
|
case "UpdateExpression": {
|
|
6488
|
-
if (
|
|
6489
|
-
const newLhs =
|
|
6803
|
+
if (ref7 = extractAssignment2(exp.assigned)) {
|
|
6804
|
+
const newLhs = ref7;
|
|
6490
6805
|
const i = exp.children.indexOf(exp.assigned);
|
|
6491
6806
|
exp.assigned = exp.children[i] = newLhs;
|
|
6492
6807
|
}
|
|
@@ -6494,15 +6809,17 @@ function processAssignments(statements) {
|
|
|
6494
6809
|
break;
|
|
6495
6810
|
}
|
|
6496
6811
|
}
|
|
6497
|
-
if (pre.length)
|
|
6812
|
+
if (pre.length) {
|
|
6498
6813
|
exp.children.unshift(...pre);
|
|
6499
|
-
|
|
6814
|
+
}
|
|
6815
|
+
if (post.length) {
|
|
6500
6816
|
exp.children.push(...post);
|
|
6817
|
+
}
|
|
6501
6818
|
if (exp.type === "UpdateExpression") {
|
|
6502
6819
|
const { assigned } = exp;
|
|
6503
6820
|
const ref = makeRef();
|
|
6504
6821
|
const newMemberExp = unchainOptionalMemberExpression(assigned, ref, (children) => {
|
|
6505
|
-
return exp.children.map(($
|
|
6822
|
+
return exp.children.map(($4) => $4 === assigned ? children : $4);
|
|
6506
6823
|
});
|
|
6507
6824
|
if (newMemberExp !== assigned) {
|
|
6508
6825
|
if (newMemberExp.usesRef) {
|
|
@@ -6512,169 +6829,163 @@ function processAssignments(statements) {
|
|
|
6512
6829
|
names: []
|
|
6513
6830
|
};
|
|
6514
6831
|
}
|
|
6515
|
-
|
|
6832
|
+
replaceNode(exp, newMemberExp);
|
|
6516
6833
|
}
|
|
6517
|
-
;
|
|
6518
|
-
return;
|
|
6519
6834
|
}
|
|
6520
|
-
|
|
6521
|
-
|
|
6522
|
-
|
|
6523
|
-
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
block = void 0;
|
|
6542
|
-
}
|
|
6835
|
+
}
|
|
6836
|
+
for (let ref9 = gatherRecursiveAll(statements, ($5) => $5.type === "AssignmentExpression"), i6 = 0, len5 = ref9.length; i6 < len5; i6++) {
|
|
6837
|
+
const exp = ref9[i6];
|
|
6838
|
+
if (!(exp.names === null)) {
|
|
6839
|
+
continue;
|
|
6840
|
+
}
|
|
6841
|
+
let { lhs: $1, expression: $2 } = exp, tail = [], len3 = $1.length;
|
|
6842
|
+
let block;
|
|
6843
|
+
let ref10;
|
|
6844
|
+
if (exp.parent?.type === "BlockStatement" && !(ref10 = $1[$1.length - 1])?.[ref10.length - 1]?.special) {
|
|
6845
|
+
block = makeBlockFragment();
|
|
6846
|
+
let ref11;
|
|
6847
|
+
if (ref11 = prependStatementExpressionBlock(
|
|
6848
|
+
{ type: "Initializer", expression: $2, children: [void 0, void 0, $2] },
|
|
6849
|
+
block
|
|
6850
|
+
)) {
|
|
6851
|
+
const ref = ref11;
|
|
6852
|
+
exp.children = exp.children.map(($6) => $6 === $2 ? ref : $6);
|
|
6853
|
+
$2 = ref;
|
|
6854
|
+
} else {
|
|
6855
|
+
block = void 0;
|
|
6543
6856
|
}
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
6547
|
-
|
|
6548
|
-
|
|
6549
|
-
|
|
6550
|
-
|
|
6551
|
-
|
|
6552
|
-
|
|
6553
|
-
exp
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
)
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6857
|
+
}
|
|
6858
|
+
let ref12;
|
|
6859
|
+
if ($1.some(($7) => (ref12 = $7)[ref12.length - 1].special)) {
|
|
6860
|
+
if ($1.length !== 1)
|
|
6861
|
+
throw new Error("Only one assignment with id= is allowed");
|
|
6862
|
+
const [, lhs, , op] = $1[0];
|
|
6863
|
+
const { call, omitLhs } = op;
|
|
6864
|
+
const index = exp.children.indexOf($2);
|
|
6865
|
+
if (index < 0)
|
|
6866
|
+
throw new Error("Assertion error: exp not in AssignmentExpression");
|
|
6867
|
+
exp.children.splice(
|
|
6868
|
+
index,
|
|
6869
|
+
1,
|
|
6870
|
+
exp.expression = $2 = [call, "(", lhs, ", ", $2, ")"]
|
|
6871
|
+
);
|
|
6872
|
+
if (omitLhs) {
|
|
6873
|
+
replaceNode(exp, $2);
|
|
6874
|
+
continue;
|
|
6561
6875
|
}
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
|
|
6576
|
-
|
|
6876
|
+
}
|
|
6877
|
+
let wrapped = false;
|
|
6878
|
+
let i = 0;
|
|
6879
|
+
while (i < len3) {
|
|
6880
|
+
const lastAssignment = $1[i++];
|
|
6881
|
+
const [, lhs, , op] = lastAssignment;
|
|
6882
|
+
if (!(op.token === "=")) {
|
|
6883
|
+
continue;
|
|
6884
|
+
}
|
|
6885
|
+
let m2;
|
|
6886
|
+
if (m2 = lhs.type, m2 === "ObjectExpression" || m2 === "ObjectBindingPattern") {
|
|
6887
|
+
if (!wrapped) {
|
|
6888
|
+
wrapped = true;
|
|
6889
|
+
lhs.children.splice(0, 0, "(");
|
|
6890
|
+
tail.push(")");
|
|
6577
6891
|
}
|
|
6578
6892
|
}
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
|
|
6594
|
-
|
|
6893
|
+
}
|
|
6894
|
+
const refsToDeclare = /* @__PURE__ */ new Set();
|
|
6895
|
+
i = len3 - 1;
|
|
6896
|
+
while (i >= 0) {
|
|
6897
|
+
const lastAssignment = $1[i];
|
|
6898
|
+
if (lastAssignment[3].token === "=") {
|
|
6899
|
+
const lhs = lastAssignment[1];
|
|
6900
|
+
let m3;
|
|
6901
|
+
if (lhs.type === "MemberExpression") {
|
|
6902
|
+
const members = lhs.children;
|
|
6903
|
+
const lastMember = members[members.length - 1];
|
|
6904
|
+
if (typeof lastMember === "object" && lastMember != null && "type" in lastMember && lastMember.type === "CallExpression" && "children" in lastMember && Array.isArray(lastMember.children) && lastMember.children.length >= 1 && lastMember.children[0] === peekHelperRef("rslice")) {
|
|
6905
|
+
lastMember.children.push({
|
|
6906
|
+
type: "Error",
|
|
6907
|
+
message: "Slice range cannot be decreasing in assignment"
|
|
6908
|
+
});
|
|
6909
|
+
break;
|
|
6910
|
+
}
|
|
6911
|
+
if (lastMember.type === "SliceExpression") {
|
|
6912
|
+
const { start, end, children: c } = lastMember;
|
|
6913
|
+
c[0].token = ".splice(";
|
|
6914
|
+
c[1] = start;
|
|
6915
|
+
c[2] = ", ";
|
|
6916
|
+
if (end) {
|
|
6917
|
+
c[3] = [end, " - ", start];
|
|
6918
|
+
} else {
|
|
6919
|
+
c[3] = ["1/0"];
|
|
6595
6920
|
}
|
|
6596
|
-
|
|
6597
|
-
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
c[2] = ", ";
|
|
6601
|
-
if (end) {
|
|
6602
|
-
c[3] = [end, " - ", start];
|
|
6603
|
-
} else {
|
|
6604
|
-
c[3] = ["1/0"];
|
|
6605
|
-
}
|
|
6606
|
-
c[4] = [", ...", $2];
|
|
6607
|
-
c[5] = ")";
|
|
6921
|
+
c[4] = [", ...", $2];
|
|
6922
|
+
c[5] = ")";
|
|
6923
|
+
lastAssignment.pop();
|
|
6924
|
+
if (isWhitespaceOrEmpty(lastAssignment[2]))
|
|
6608
6925
|
lastAssignment.pop();
|
|
6609
|
-
|
|
6610
|
-
|
|
6611
|
-
if ($1.length > 1) {
|
|
6612
|
-
throw new Error("Not implemented yet! TODO: Handle multiple splice assignments");
|
|
6613
|
-
}
|
|
6614
|
-
exp.children = [$1];
|
|
6615
|
-
exp.names = [];
|
|
6616
|
-
break;
|
|
6926
|
+
if ($1.length > 1) {
|
|
6927
|
+
throw new Error("Not implemented yet! TODO: Handle multiple splice assignments");
|
|
6617
6928
|
}
|
|
6618
|
-
|
|
6619
|
-
|
|
6620
|
-
|
|
6929
|
+
exp.children = [$1];
|
|
6930
|
+
exp.names = [];
|
|
6931
|
+
break;
|
|
6621
6932
|
}
|
|
6933
|
+
} else if (m3 = lhs.type, m3 === "ObjectBindingPattern" || m3 === "ArrayBindingPattern") {
|
|
6934
|
+
processBindingPatternLHS(lhs, tail);
|
|
6935
|
+
gatherRecursiveAll(lhs, ($8) => $8.type === "Ref").forEach(refsToDeclare.add.bind(refsToDeclare));
|
|
6622
6936
|
}
|
|
6623
|
-
i--;
|
|
6624
6937
|
}
|
|
6625
|
-
i
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
|
|
6630
|
-
|
|
6631
|
-
|
|
6632
|
-
|
|
6633
|
-
|
|
6634
|
-
|
|
6635
|
-
|
|
6636
|
-
|
|
6637
|
-
|
|
6638
|
-
|
|
6639
|
-
|
|
6640
|
-
|
|
6641
|
-
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
|
|
6645
|
-
newMemberExp.parent = exp;
|
|
6646
|
-
$2 = newMemberExp;
|
|
6938
|
+
i--;
|
|
6939
|
+
}
|
|
6940
|
+
i = len3 - 1;
|
|
6941
|
+
const optionalChainRef = makeRef();
|
|
6942
|
+
while (i >= 0) {
|
|
6943
|
+
const assignment = $1[i];
|
|
6944
|
+
const [ws1, lhs, ws2, op] = assignment;
|
|
6945
|
+
if (lhs.type === "MemberExpression" || lhs.type === "CallExpression") {
|
|
6946
|
+
const newMemberExp = unchainOptionalMemberExpression(lhs, optionalChainRef, (children) => {
|
|
6947
|
+
const assigns = $1.splice(i + 1, len3 - 1 - i);
|
|
6948
|
+
$1.pop();
|
|
6949
|
+
return [ws1, ...children, ws2, op, ...assigns, $2];
|
|
6950
|
+
});
|
|
6951
|
+
if (newMemberExp !== lhs) {
|
|
6952
|
+
if (newMemberExp.usesRef) {
|
|
6953
|
+
exp.hoistDec = {
|
|
6954
|
+
type: "Declaration",
|
|
6955
|
+
children: ["let ", optionalChainRef],
|
|
6956
|
+
names: []
|
|
6957
|
+
};
|
|
6647
6958
|
}
|
|
6959
|
+
replaceNode($2, newMemberExp);
|
|
6960
|
+
$2 = newMemberExp;
|
|
6648
6961
|
}
|
|
6649
|
-
i--;
|
|
6650
|
-
}
|
|
6651
|
-
if (refsToDeclare.size) {
|
|
6652
|
-
if (exp.hoistDec) {
|
|
6653
|
-
exp.hoistDec.children.push([...refsToDeclare].map(($7) => [",", $7]));
|
|
6654
|
-
} else {
|
|
6655
|
-
exp.hoistDec = {
|
|
6656
|
-
type: "Declaration",
|
|
6657
|
-
children: ["let ", [...refsToDeclare].map((r, i2) => i2 ? [",", r] : r)],
|
|
6658
|
-
names: []
|
|
6659
|
-
};
|
|
6660
|
-
}
|
|
6661
|
-
}
|
|
6662
|
-
exp.names = $1.flatMap(([, l]) => l.names || []);
|
|
6663
|
-
if (tail.length) {
|
|
6664
|
-
const index = exp.children.indexOf($2);
|
|
6665
|
-
if (index < 0)
|
|
6666
|
-
throw new Error("Assertion error: exp not in AssignmentExpression");
|
|
6667
|
-
exp.children.splice(index + 1, 0, ...tail);
|
|
6668
6962
|
}
|
|
6669
|
-
|
|
6670
|
-
|
|
6671
|
-
|
|
6672
|
-
|
|
6673
|
-
|
|
6963
|
+
i--;
|
|
6964
|
+
}
|
|
6965
|
+
if (refsToDeclare.size) {
|
|
6966
|
+
if (exp.hoistDec) {
|
|
6967
|
+
exp.hoistDec.children.push([...refsToDeclare].map(($9) => [",", $9]));
|
|
6968
|
+
} else {
|
|
6969
|
+
exp.hoistDec = {
|
|
6970
|
+
type: "Declaration",
|
|
6971
|
+
children: ["let ", [...refsToDeclare].map((r, i2) => i2 ? [",", r] : r)],
|
|
6972
|
+
names: []
|
|
6973
|
+
};
|
|
6674
6974
|
}
|
|
6675
|
-
return exp;
|
|
6676
6975
|
}
|
|
6677
|
-
|
|
6976
|
+
exp.names = $1.flatMap(([, l]) => l.names || []);
|
|
6977
|
+
if (tail.length) {
|
|
6978
|
+
const index = exp.children.indexOf($2);
|
|
6979
|
+
if (index < 0)
|
|
6980
|
+
throw new Error("Assertion error: exp not in AssignmentExpression");
|
|
6981
|
+
exp.children.splice(index + 1, 0, ...tail);
|
|
6982
|
+
}
|
|
6983
|
+
if (block) {
|
|
6984
|
+
replaceNode(exp, block);
|
|
6985
|
+
block.expressions.push(["", exp]);
|
|
6986
|
+
exp.parent = block;
|
|
6987
|
+
}
|
|
6988
|
+
}
|
|
6678
6989
|
}
|
|
6679
6990
|
function unchainOptionalMemberExpression(exp, ref, innerExp) {
|
|
6680
6991
|
let j = 0;
|
|
@@ -6724,9 +7035,9 @@ function unchainOptionalMemberExpression(exp, ref, innerExp) {
|
|
|
6724
7035
|
}
|
|
6725
7036
|
j++;
|
|
6726
7037
|
}
|
|
6727
|
-
let
|
|
6728
|
-
if (
|
|
6729
|
-
const l =
|
|
7038
|
+
let ref13;
|
|
7039
|
+
if (ref13 = conditions.length) {
|
|
7040
|
+
const l = ref13;
|
|
6730
7041
|
const cs = flatJoin(conditions, " && ");
|
|
6731
7042
|
return {
|
|
6732
7043
|
...exp,
|
|
@@ -6765,28 +7076,28 @@ function processTypes(node) {
|
|
|
6765
7076
|
if (!unary.suffix.length) {
|
|
6766
7077
|
return;
|
|
6767
7078
|
}
|
|
6768
|
-
let
|
|
7079
|
+
let ref14;
|
|
6769
7080
|
let m4;
|
|
6770
|
-
if (m4 = (
|
|
7081
|
+
if (m4 = (ref14 = unary.suffix)[ref14.length - 1], typeof m4 === "object" && m4 != null && "token" in m4 && m4.token === "?") {
|
|
6771
7082
|
const { token } = m4;
|
|
6772
7083
|
let last;
|
|
6773
7084
|
let count = 0;
|
|
6774
|
-
let
|
|
6775
|
-
while (unary.suffix.length && (
|
|
7085
|
+
let ref15;
|
|
7086
|
+
while (unary.suffix.length && (ref15 = unary.suffix)[ref15.length - 1]?.token === "?") {
|
|
6776
7087
|
last = unary.suffix.pop();
|
|
6777
7088
|
count++;
|
|
6778
7089
|
}
|
|
6779
|
-
let
|
|
6780
|
-
while (unary.suffix.length && (
|
|
7090
|
+
let ref16;
|
|
7091
|
+
while (unary.suffix.length && (ref16 = unary.suffix)[ref16.length - 1]?.type === "NonNullAssertion") {
|
|
6781
7092
|
unary.suffix.pop();
|
|
6782
7093
|
}
|
|
6783
|
-
let
|
|
7094
|
+
let ref17;
|
|
6784
7095
|
if (unary.suffix.length || unary.prefix.length)
|
|
6785
|
-
|
|
7096
|
+
ref17 = unary;
|
|
6786
7097
|
else
|
|
6787
|
-
|
|
6788
|
-
const t =
|
|
6789
|
-
if (unary.parent?.type === "
|
|
7098
|
+
ref17 = unary.t;
|
|
7099
|
+
const t = ref17;
|
|
7100
|
+
if (unary.parent?.type === "TypeElement" && !unary.parent.name) {
|
|
6790
7101
|
if (count === 1) {
|
|
6791
7102
|
unary.suffix.push(last);
|
|
6792
7103
|
return;
|
|
@@ -6813,12 +7124,12 @@ function processTypes(node) {
|
|
|
6813
7124
|
}
|
|
6814
7125
|
} else if (typeof m4 === "object" && m4 != null && "type" in m4 && m4.type === "NonNullAssertion") {
|
|
6815
7126
|
const { type } = m4;
|
|
6816
|
-
let
|
|
6817
|
-
while (unary.suffix.length && (
|
|
7127
|
+
let ref18;
|
|
7128
|
+
while (unary.suffix.length && (ref18 = unary.suffix)[ref18.length - 1]?.type === "NonNullAssertion") {
|
|
6818
7129
|
unary.suffix.pop();
|
|
6819
7130
|
}
|
|
6820
|
-
let
|
|
6821
|
-
while (unary.suffix.length && (
|
|
7131
|
+
let ref19;
|
|
7132
|
+
while (unary.suffix.length && (ref19 = unary.suffix)[ref19.length - 1]?.token === "?") {
|
|
6822
7133
|
unary.suffix.pop();
|
|
6823
7134
|
}
|
|
6824
7135
|
const t = trimFirstSpace(
|
|
@@ -6844,35 +7155,41 @@ function processTypes(node) {
|
|
|
6844
7155
|
});
|
|
6845
7156
|
}
|
|
6846
7157
|
function processStatementExpressions(statements) {
|
|
6847
|
-
gatherRecursiveAll(statements, ($
|
|
6848
|
-
const exp =
|
|
6849
|
-
const { statement } = exp;
|
|
6850
|
-
|
|
7158
|
+
for (let ref20 = gatherRecursiveAll(statements, ($10) => $10.type === "StatementExpression"), i7 = 0, len6 = ref20.length; i7 < len6; i7++) {
|
|
7159
|
+
const exp = ref20[i7];
|
|
7160
|
+
const { maybe, statement } = exp;
|
|
7161
|
+
if ((maybe || statement.type === "ThrowStatement") && blockContainingStatement(exp)) {
|
|
7162
|
+
replaceNode(exp, statement);
|
|
7163
|
+
continue;
|
|
7164
|
+
}
|
|
7165
|
+
let ref21;
|
|
6851
7166
|
switch (statement.type) {
|
|
6852
7167
|
case "IfStatement": {
|
|
6853
|
-
if (
|
|
6854
|
-
const expression =
|
|
6855
|
-
|
|
7168
|
+
if (ref21 = expressionizeIfStatement(statement)) {
|
|
7169
|
+
const expression = ref21;
|
|
7170
|
+
replaceNode(statement, expression, exp);
|
|
6856
7171
|
} else {
|
|
6857
|
-
|
|
7172
|
+
replaceNode(statement, wrapIIFE([["", statement]]), exp);
|
|
6858
7173
|
}
|
|
7174
|
+
;
|
|
7175
|
+
break;
|
|
6859
7176
|
}
|
|
6860
7177
|
case "IterationExpression": {
|
|
6861
7178
|
if (statement.subtype === "ComptimeStatement") {
|
|
6862
|
-
|
|
7179
|
+
replaceNode(
|
|
6863
7180
|
statement,
|
|
6864
7181
|
expressionizeComptime(statement.statement),
|
|
6865
7182
|
exp
|
|
6866
7183
|
);
|
|
6867
7184
|
}
|
|
6868
7185
|
;
|
|
6869
|
-
|
|
7186
|
+
break;
|
|
6870
7187
|
}
|
|
6871
7188
|
default: {
|
|
6872
|
-
|
|
7189
|
+
replaceNode(statement, wrapIIFE([["", statement]]), exp);
|
|
6873
7190
|
}
|
|
6874
7191
|
}
|
|
6875
|
-
}
|
|
7192
|
+
}
|
|
6876
7193
|
}
|
|
6877
7194
|
function processNegativeIndexAccess(statements) {
|
|
6878
7195
|
gatherRecursiveAll(statements, (n) => n.type === "NegativeIndex").forEach((exp) => {
|
|
@@ -6920,7 +7237,7 @@ function processProgram(root) {
|
|
|
6920
7237
|
if (config2.iife || config2.repl) {
|
|
6921
7238
|
rootIIFE = wrapIIFE(root.expressions, root.topLevelAwait);
|
|
6922
7239
|
const newExpressions = [["", rootIIFE]];
|
|
6923
|
-
root.children = root.children.map(($
|
|
7240
|
+
root.children = root.children.map(($11) => $11 === root.expressions ? newExpressions : $11);
|
|
6924
7241
|
root.expressions = newExpressions;
|
|
6925
7242
|
}
|
|
6926
7243
|
addParentPointers(root);
|
|
@@ -6934,7 +7251,7 @@ function processProgram(root) {
|
|
|
6934
7251
|
processAssignments(statements);
|
|
6935
7252
|
processStatementExpressions(statements);
|
|
6936
7253
|
processPatternMatching(statements);
|
|
6937
|
-
|
|
7254
|
+
processIterationExpressions(statements);
|
|
6938
7255
|
hoistRefDecs(statements);
|
|
6939
7256
|
processFunctions(statements, config2);
|
|
6940
7257
|
statements.unshift(...state2.prelude);
|
|
@@ -6960,17 +7277,17 @@ async function processProgramAsync(root) {
|
|
|
6960
7277
|
await processComptime(statements);
|
|
6961
7278
|
}
|
|
6962
7279
|
function processRepl(root, rootIIFE) {
|
|
6963
|
-
const topBlock = gatherRecursive(rootIIFE, ($
|
|
7280
|
+
const topBlock = gatherRecursive(rootIIFE, ($12) => $12.type === "BlockStatement")[0];
|
|
6964
7281
|
let i = 0;
|
|
6965
|
-
for (let
|
|
6966
|
-
const decl =
|
|
7282
|
+
for (let ref22 = gatherRecursiveWithinFunction(topBlock, ($13) => $13.type === "Declaration"), i8 = 0, len7 = ref22.length; i8 < len7; i8++) {
|
|
7283
|
+
const decl = ref22[i8];
|
|
6967
7284
|
if (decl.parent === topBlock || decl.decl === "var") {
|
|
6968
7285
|
decl.children.shift();
|
|
6969
7286
|
root.expressions.splice(i++, 0, ["", `var ${decl.names.join(",")};`]);
|
|
6970
7287
|
}
|
|
6971
7288
|
}
|
|
6972
|
-
for (let
|
|
6973
|
-
const func =
|
|
7289
|
+
for (let ref23 = gatherRecursive(topBlock, ($14) => $14.type === "FunctionExpression"), i9 = 0, len8 = ref23.length; i9 < len8; i9++) {
|
|
7290
|
+
const func = ref23[i9];
|
|
6974
7291
|
if (func.name && func.parent?.type === "BlockStatement") {
|
|
6975
7292
|
if (func.parent === topBlock) {
|
|
6976
7293
|
replaceNode(func, void 0);
|
|
@@ -6982,8 +7299,8 @@ function processRepl(root, rootIIFE) {
|
|
|
6982
7299
|
}
|
|
6983
7300
|
}
|
|
6984
7301
|
}
|
|
6985
|
-
for (let
|
|
6986
|
-
const classExp =
|
|
7302
|
+
for (let ref24 = gatherRecursiveWithinFunction(topBlock, ($15) => $15.type === "ClassExpression"), i10 = 0, len9 = ref24.length; i10 < len9; i10++) {
|
|
7303
|
+
const classExp = ref24[i10];
|
|
6987
7304
|
let m5;
|
|
6988
7305
|
if (classExp.name && classExp.parent === topBlock || (m5 = classExp.parent, typeof m5 === "object" && m5 != null && "type" in m5 && m5.type === "ReturnStatement" && "parent" in m5 && m5.parent === topBlock)) {
|
|
6989
7306
|
classExp.children.unshift(classExp.name, "=");
|
|
@@ -6992,7 +7309,7 @@ function processRepl(root, rootIIFE) {
|
|
|
6992
7309
|
}
|
|
6993
7310
|
}
|
|
6994
7311
|
function populateRefs(statements) {
|
|
6995
|
-
const refNodes = gatherRecursive(statements, ($
|
|
7312
|
+
const refNodes = gatherRecursive(statements, ($16) => $16.type === "Ref");
|
|
6996
7313
|
if (refNodes.length) {
|
|
6997
7314
|
const ids = gatherRecursive(statements, (s) => s.type === "Identifier");
|
|
6998
7315
|
const names = new Set(ids.flatMap(({ names: names2 }) => names2 || []));
|
|
@@ -7015,13 +7332,14 @@ function populateRefs(statements) {
|
|
|
7015
7332
|
function processPlaceholders(statements) {
|
|
7016
7333
|
const placeholderMap = /* @__PURE__ */ new Map();
|
|
7017
7334
|
const liftedIfs = /* @__PURE__ */ new Set();
|
|
7018
|
-
gatherRecursiveAll(statements, ($
|
|
7335
|
+
gatherRecursiveAll(statements, ($17) => $17.type === "Placeholder").forEach((_exp) => {
|
|
7019
7336
|
const exp = _exp;
|
|
7020
7337
|
let ancestor;
|
|
7021
7338
|
if (exp.subtype === ".") {
|
|
7022
|
-
({ ancestor } = findAncestor(exp, ($
|
|
7339
|
+
({ ancestor } = findAncestor(exp, ($18) => $18.type === "Call"));
|
|
7023
7340
|
ancestor = ancestor?.parent;
|
|
7024
|
-
|
|
7341
|
+
let m6;
|
|
7342
|
+
while (ancestor?.parent != null && (m6 = ancestor.parent.type, m6 === "UnaryExpression" || m6 === "NewExpression" || m6 === "AwaitExpression" || m6 === "ThrowStatement" || m6 === "StatementExpression")) {
|
|
7025
7343
|
ancestor = ancestor.parent;
|
|
7026
7344
|
}
|
|
7027
7345
|
if (!ancestor) {
|
|
@@ -7038,10 +7356,10 @@ function processPlaceholders(statements) {
|
|
|
7038
7356
|
if (type === "IfStatement") {
|
|
7039
7357
|
liftedIfs.add(ancestor2);
|
|
7040
7358
|
}
|
|
7041
|
-
let m6;
|
|
7042
7359
|
let m7;
|
|
7360
|
+
let m8;
|
|
7043
7361
|
return type === "Call" || // Block, except for if/else blocks when condition already lifted
|
|
7044
|
-
type === "BlockStatement" && !((
|
|
7362
|
+
type === "BlockStatement" && !((m7 = ancestor2.parent, typeof m7 === "object" && m7 != null && "type" in m7 && m7.type === "IfStatement") && liftedIfs.has(ancestor2.parent)) && !((m8 = ancestor2.parent, typeof m8 === "object" && m8 != null && "type" in m8 && m8.type === "ElseClause" && "parent" in m8 && typeof m8.parent === "object" && m8.parent != null && "type" in m8.parent && m8.parent.type === "IfStatement") && liftedIfs.has(ancestor2.parent.parent)) || type === "PipelineExpression" || // Declaration
|
|
7045
7363
|
type === "Initializer" || // Right-hand side of assignment
|
|
7046
7364
|
type === "AssignmentExpression" && findChildIndex(ancestor2, child2) === ancestor2.children.indexOf(ancestor2.expression) || type === "ReturnStatement" || type === "YieldExpression";
|
|
7047
7365
|
}));
|
|
@@ -7117,11 +7435,11 @@ function processPlaceholders(statements) {
|
|
|
7117
7435
|
for (const [ancestor, placeholders] of placeholderMap) {
|
|
7118
7436
|
let ref = makeRef("$");
|
|
7119
7437
|
let typeSuffix;
|
|
7120
|
-
for (let
|
|
7121
|
-
const placeholder = placeholders[
|
|
7438
|
+
for (let i11 = 0, len10 = placeholders.length; i11 < len10; i11++) {
|
|
7439
|
+
const placeholder = placeholders[i11];
|
|
7122
7440
|
typeSuffix ??= placeholder.typeSuffix;
|
|
7123
|
-
let
|
|
7124
|
-
replaceNode((
|
|
7441
|
+
let ref25;
|
|
7442
|
+
replaceNode((ref25 = placeholder.children)[ref25.length - 1], ref);
|
|
7125
7443
|
}
|
|
7126
7444
|
const { parent } = ancestor;
|
|
7127
7445
|
const body = maybeUnwrap(ancestor);
|
|
@@ -7142,16 +7460,16 @@ function processPlaceholders(statements) {
|
|
|
7142
7460
|
}
|
|
7143
7461
|
case "PipelineExpression": {
|
|
7144
7462
|
const i = findChildIndex(parent, ancestor);
|
|
7145
|
-
let
|
|
7463
|
+
let ref26;
|
|
7146
7464
|
if (i === 1) {
|
|
7147
|
-
|
|
7465
|
+
ref26 = ancestor === parent.children[i];
|
|
7148
7466
|
} else if (i === 2) {
|
|
7149
|
-
|
|
7467
|
+
ref26 = ancestor === parent.children[i][findChildIndex(parent.children[i], ancestor)][3];
|
|
7150
7468
|
} else {
|
|
7151
|
-
|
|
7469
|
+
ref26 = void 0;
|
|
7152
7470
|
}
|
|
7153
7471
|
;
|
|
7154
|
-
outer =
|
|
7472
|
+
outer = ref26;
|
|
7155
7473
|
break;
|
|
7156
7474
|
}
|
|
7157
7475
|
case "AssignmentExpression":
|
|
@@ -7166,9 +7484,9 @@ function processPlaceholders(statements) {
|
|
|
7166
7484
|
fnExp = makeLeftHandSideExpression(fnExp);
|
|
7167
7485
|
}
|
|
7168
7486
|
replaceNode(ancestor, fnExp, parent);
|
|
7169
|
-
let
|
|
7170
|
-
if (
|
|
7171
|
-
const ws =
|
|
7487
|
+
let ref27;
|
|
7488
|
+
if (ref27 = getTrimmingSpace(body)) {
|
|
7489
|
+
const ws = ref27;
|
|
7172
7490
|
inplaceInsertTrimmingSpace(body, "");
|
|
7173
7491
|
inplacePrepend(ws, fnExp);
|
|
7174
7492
|
}
|
|
@@ -7213,8 +7531,8 @@ function reorderBindingRestProperty(props) {
|
|
|
7213
7531
|
}
|
|
7214
7532
|
];
|
|
7215
7533
|
}
|
|
7216
|
-
let
|
|
7217
|
-
if (Array.isArray(rest.delim) && (
|
|
7534
|
+
let ref28;
|
|
7535
|
+
if (Array.isArray(rest.delim) && (ref28 = rest.delim)[ref28.length - 1]?.token === ",") {
|
|
7218
7536
|
rest.delim = rest.delim.slice(0, -1);
|
|
7219
7537
|
rest.children = [...rest.children.slice(0, -1), rest.delim];
|
|
7220
7538
|
}
|
|
@@ -7239,9 +7557,9 @@ function replaceNodes(root, predicate, replacer) {
|
|
|
7239
7557
|
return root;
|
|
7240
7558
|
}
|
|
7241
7559
|
}
|
|
7242
|
-
for (let
|
|
7243
|
-
const i =
|
|
7244
|
-
const node = array[
|
|
7560
|
+
for (let i12 = 0, len11 = array.length; i12 < len11; i12++) {
|
|
7561
|
+
const i = i12;
|
|
7562
|
+
const node = array[i12];
|
|
7245
7563
|
if (!(node != null)) {
|
|
7246
7564
|
return;
|
|
7247
7565
|
}
|
|
@@ -7253,34 +7571,6 @@ function replaceNodes(root, predicate, replacer) {
|
|
|
7253
7571
|
}
|
|
7254
7572
|
return root;
|
|
7255
7573
|
}
|
|
7256
|
-
function replaceNodesRecursive(root, predicate, replacer) {
|
|
7257
|
-
if (!(root != null)) {
|
|
7258
|
-
return root;
|
|
7259
|
-
}
|
|
7260
|
-
const array = Array.isArray(root) ? root : root.children;
|
|
7261
|
-
if (!array) {
|
|
7262
|
-
if (predicate(root)) {
|
|
7263
|
-
return replacer(root, root);
|
|
7264
|
-
} else {
|
|
7265
|
-
return root;
|
|
7266
|
-
}
|
|
7267
|
-
}
|
|
7268
|
-
for (let i10 = 0, len9 = array.length; i10 < len9; i10++) {
|
|
7269
|
-
const i = i10;
|
|
7270
|
-
const node = array[i10];
|
|
7271
|
-
if (!(node != null)) {
|
|
7272
|
-
continue;
|
|
7273
|
-
}
|
|
7274
|
-
if (predicate(node)) {
|
|
7275
|
-
const ret = replacer(node, root);
|
|
7276
|
-
replaceNodesRecursive(ret, predicate, replacer);
|
|
7277
|
-
array[i] = ret;
|
|
7278
|
-
} else {
|
|
7279
|
-
replaceNodesRecursive(node, predicate, replacer);
|
|
7280
|
-
}
|
|
7281
|
-
}
|
|
7282
|
-
return root;
|
|
7283
|
-
}
|
|
7284
7574
|
function typeOfJSX(node, config2) {
|
|
7285
7575
|
switch (node.type) {
|
|
7286
7576
|
case "JSXElement":
|
|
@@ -7561,6 +7851,8 @@ var grammar = {
|
|
|
7561
7851
|
BooleanLiteral,
|
|
7562
7852
|
_BooleanLiteral,
|
|
7563
7853
|
CoffeeScriptBooleanLiteral,
|
|
7854
|
+
SymbolLiteral,
|
|
7855
|
+
SymbolElement,
|
|
7564
7856
|
Identifier,
|
|
7565
7857
|
IdentifierName,
|
|
7566
7858
|
IdentifierReference,
|
|
@@ -7661,6 +7953,8 @@ var grammar = {
|
|
|
7661
7953
|
WhileClause,
|
|
7662
7954
|
ForStatement,
|
|
7663
7955
|
ForClause,
|
|
7956
|
+
ForStatementControlWithWhen,
|
|
7957
|
+
ForReduction,
|
|
7664
7958
|
ForStatementControl,
|
|
7665
7959
|
WhenCondition,
|
|
7666
7960
|
CoffeeForStatementParameters,
|
|
@@ -8074,7 +8368,7 @@ var grammar = {
|
|
|
8074
8368
|
InlineInterfacePropertyDelimiter,
|
|
8075
8369
|
TypeBinaryOp,
|
|
8076
8370
|
TypeFunction,
|
|
8077
|
-
|
|
8371
|
+
TypeFunctionArrow,
|
|
8078
8372
|
TypeArguments,
|
|
8079
8373
|
ImplicitTypeArguments,
|
|
8080
8374
|
TypeApplicationStart,
|
|
@@ -8281,128 +8575,135 @@ var $L116 = (0, import_lib4.$L)("\u2209");
|
|
|
8281
8575
|
var $L117 = (0, import_lib4.$L)("&");
|
|
8282
8576
|
var $L118 = (0, import_lib4.$L)("|");
|
|
8283
8577
|
var $L119 = (0, import_lib4.$L)(";");
|
|
8284
|
-
var $L120 = (0, import_lib4.$L)("
|
|
8285
|
-
var $L121 = (0, import_lib4.$L)("
|
|
8286
|
-
var $L122 = (0, import_lib4.$L)("
|
|
8287
|
-
var $L123 = (0, import_lib4.$L)("
|
|
8288
|
-
var $L124 = (0, import_lib4.$L)("
|
|
8289
|
-
var $L125 = (0, import_lib4.$L)("
|
|
8290
|
-
var $L126 = (0, import_lib4.$L)("
|
|
8291
|
-
var $L127 = (0, import_lib4.$L)("
|
|
8292
|
-
var $L128 = (0, import_lib4.$L)("
|
|
8293
|
-
var $L129 = (0, import_lib4.$L)("
|
|
8294
|
-
var $L130 = (0, import_lib4.$L)("
|
|
8295
|
-
var $L131 = (0, import_lib4.$L)("
|
|
8296
|
-
var $L132 = (0, import_lib4.$L)("
|
|
8297
|
-
var $L133 = (0, import_lib4.$L)("
|
|
8298
|
-
var $L134 = (0, import_lib4.$L)("
|
|
8299
|
-
var $L135 = (0, import_lib4.$L)("
|
|
8300
|
-
var $L136 = (0, import_lib4.$L)("
|
|
8301
|
-
var $L137 = (0, import_lib4.$L)("
|
|
8302
|
-
var $L138 = (0, import_lib4.$L)("
|
|
8303
|
-
var $L139 = (0, import_lib4.$L)("
|
|
8304
|
-
var $L140 = (0, import_lib4.$L)("
|
|
8305
|
-
var $L141 = (0, import_lib4.$L)("
|
|
8306
|
-
var $L142 = (0, import_lib4.$L)("
|
|
8307
|
-
var $L143 = (0, import_lib4.$L)("
|
|
8308
|
-
var $L144 = (0, import_lib4.$L)("
|
|
8309
|
-
var $L145 = (0, import_lib4.$L)("
|
|
8310
|
-
var $L146 = (0, import_lib4.$L)("
|
|
8311
|
-
var $L147 = (0, import_lib4.$L)("
|
|
8312
|
-
var $L148 = (0, import_lib4.$L)("
|
|
8313
|
-
var $L149 = (0, import_lib4.$L)("
|
|
8314
|
-
var $L150 = (0, import_lib4.$L)("
|
|
8315
|
-
var $L151 = (0, import_lib4.$L)("
|
|
8316
|
-
var $L152 = (0, import_lib4.$L)("
|
|
8317
|
-
var $L153 = (0, import_lib4.$L)("
|
|
8318
|
-
var $L154 = (0, import_lib4.$L)("
|
|
8319
|
-
var $L155 = (0, import_lib4.$L)("
|
|
8320
|
-
var $L156 = (0, import_lib4.$L)(
|
|
8321
|
-
var $L157 = (0, import_lib4.$L)("
|
|
8322
|
-
var $L158 = (0, import_lib4.$L)("
|
|
8323
|
-
var $L159 = (0, import_lib4.$L)("
|
|
8324
|
-
var $L160 = (0, import_lib4.$L)("
|
|
8325
|
-
var $L161 = (0, import_lib4.$L)("
|
|
8326
|
-
var $L162 = (0, import_lib4.$L)("
|
|
8327
|
-
var $L163 = (0, import_lib4.$L)("
|
|
8328
|
-
var $L164 = (0, import_lib4.$L)("
|
|
8329
|
-
var $L165 = (0, import_lib4.$L)("
|
|
8330
|
-
var $L166 = (0, import_lib4.$L)("
|
|
8331
|
-
var $L167 = (0, import_lib4.$L)("
|
|
8332
|
-
var $L168 = (0, import_lib4.$L)("
|
|
8333
|
-
var $L169 = (0, import_lib4.$L)("
|
|
8334
|
-
var $L170 = (0, import_lib4.$L)("
|
|
8335
|
-
var $L171 = (0, import_lib4.$L)("
|
|
8336
|
-
var $L172 = (0, import_lib4.$L)("
|
|
8337
|
-
var $L173 = (0, import_lib4.$L)("
|
|
8338
|
-
var $L174 = (0, import_lib4.$L)("
|
|
8339
|
-
var $L175 = (0, import_lib4.$L)("
|
|
8340
|
-
var $L176 = (0, import_lib4.$L)("
|
|
8341
|
-
var $L177 = (0, import_lib4.$L)("
|
|
8342
|
-
var $L178 = (0, import_lib4.$L)("
|
|
8343
|
-
var $L179 = (0, import_lib4.$L)("
|
|
8344
|
-
var $L180 = (0, import_lib4.$L)("
|
|
8345
|
-
var $L181 = (0, import_lib4.$L)("
|
|
8346
|
-
var $L182 = (0, import_lib4.$L)("
|
|
8347
|
-
var $L183 = (0, import_lib4.$L)("
|
|
8348
|
-
var $L184 = (0, import_lib4.$L)("
|
|
8349
|
-
var $L185 = (0, import_lib4.$L)("
|
|
8350
|
-
var $L186 = (0, import_lib4.$L)("
|
|
8351
|
-
var $L187 = (0, import_lib4.$L)("
|
|
8352
|
-
var $L188 = (0, import_lib4.$L)("
|
|
8353
|
-
var $L189 = (0, import_lib4.$L)("
|
|
8354
|
-
var $L190 = (0, import_lib4.$L)("
|
|
8355
|
-
var $L191 = (0, import_lib4.$L)("
|
|
8356
|
-
var $L192 = (0, import_lib4.$L)("
|
|
8357
|
-
var $L193 = (0, import_lib4.$L)("
|
|
8358
|
-
var $L194 = (0, import_lib4.$L)("
|
|
8359
|
-
var $L195 = (0, import_lib4.$L)("
|
|
8360
|
-
var $L196 = (0, import_lib4.$L)("
|
|
8361
|
-
var $L197 = (0, import_lib4.$L)("
|
|
8362
|
-
var $L198 = (0, import_lib4.$L)("
|
|
8363
|
-
var $L199 = (0, import_lib4.$L)("
|
|
8364
|
-
var $L200 = (0, import_lib4.$L)("
|
|
8365
|
-
var $L201 = (0, import_lib4.$L)("
|
|
8366
|
-
var $L202 = (0, import_lib4.$L)("
|
|
8367
|
-
var $L203 = (0, import_lib4.$L)("
|
|
8368
|
-
var $L204 = (0, import_lib4.$L)("
|
|
8369
|
-
var $L205 = (0, import_lib4.$L)("
|
|
8370
|
-
var $L206 = (0, import_lib4.$L)(
|
|
8371
|
-
var $L207 = (0, import_lib4.$L)("
|
|
8372
|
-
var $L208 = (0, import_lib4.$L)("
|
|
8373
|
-
var $L209 = (0, import_lib4.$L)("
|
|
8374
|
-
var $L210 = (0, import_lib4.$L)("
|
|
8375
|
-
var $L211 = (0, import_lib4.$L)("
|
|
8376
|
-
var $L212 = (0, import_lib4.$L)("
|
|
8377
|
-
var $L213 = (0, import_lib4.$L)("
|
|
8378
|
-
var $L214 = (0, import_lib4.$L)("
|
|
8379
|
-
var $L215 = (0, import_lib4.$L)("
|
|
8380
|
-
var $L216 = (0, import_lib4.$L)("
|
|
8381
|
-
var $L217 = (0, import_lib4.$L)("
|
|
8382
|
-
var $L218 = (0, import_lib4.$L)("
|
|
8383
|
-
var $L219 = (0, import_lib4.$L)("
|
|
8384
|
-
var $L220 = (0, import_lib4.$L)("
|
|
8385
|
-
var $L221 = (0, import_lib4.$L)("
|
|
8386
|
-
var $L222 = (0, import_lib4.$L)("
|
|
8387
|
-
var $L223 = (0, import_lib4.$L)("
|
|
8388
|
-
var $L224 = (0, import_lib4.$L)("
|
|
8389
|
-
var $L225 = (0, import_lib4.$L)("
|
|
8390
|
-
var $L226 = (0, import_lib4.$L)("
|
|
8391
|
-
var $L227 = (0, import_lib4.$L)("
|
|
8392
|
-
var $L228 = (0, import_lib4.$L)("
|
|
8393
|
-
var $L229 = (0, import_lib4.$L)("
|
|
8394
|
-
var $L230 = (0, import_lib4.$L)("
|
|
8395
|
-
var $L231 = (0, import_lib4.$L)("
|
|
8396
|
-
var $L232 = (0, import_lib4.$L)("
|
|
8397
|
-
var $L233 = (0, import_lib4.$L)("
|
|
8398
|
-
var $L234 = (0, import_lib4.$L)("
|
|
8399
|
-
var $L235 = (0, import_lib4.$L)("
|
|
8400
|
-
var $L236 = (0, import_lib4.$L)("
|
|
8401
|
-
var $L237 = (0, import_lib4.$L)("
|
|
8402
|
-
var $L238 = (0, import_lib4.$L)("
|
|
8578
|
+
var $L120 = (0, import_lib4.$L)("some");
|
|
8579
|
+
var $L121 = (0, import_lib4.$L)("every");
|
|
8580
|
+
var $L122 = (0, import_lib4.$L)("count");
|
|
8581
|
+
var $L123 = (0, import_lib4.$L)("sum");
|
|
8582
|
+
var $L124 = (0, import_lib4.$L)("product");
|
|
8583
|
+
var $L125 = (0, import_lib4.$L)("min");
|
|
8584
|
+
var $L126 = (0, import_lib4.$L)("max");
|
|
8585
|
+
var $L127 = (0, import_lib4.$L)("break");
|
|
8586
|
+
var $L128 = (0, import_lib4.$L)("continue");
|
|
8587
|
+
var $L129 = (0, import_lib4.$L)("debugger");
|
|
8588
|
+
var $L130 = (0, import_lib4.$L)("require");
|
|
8589
|
+
var $L131 = (0, import_lib4.$L)("with");
|
|
8590
|
+
var $L132 = (0, import_lib4.$L)("assert");
|
|
8591
|
+
var $L133 = (0, import_lib4.$L)(":=");
|
|
8592
|
+
var $L134 = (0, import_lib4.$L)("\u2254");
|
|
8593
|
+
var $L135 = (0, import_lib4.$L)(".=");
|
|
8594
|
+
var $L136 = (0, import_lib4.$L)("::=");
|
|
8595
|
+
var $L137 = (0, import_lib4.$L)("/*");
|
|
8596
|
+
var $L138 = (0, import_lib4.$L)("*/");
|
|
8597
|
+
var $L139 = (0, import_lib4.$L)("\\");
|
|
8598
|
+
var $L140 = (0, import_lib4.$L)(")");
|
|
8599
|
+
var $L141 = (0, import_lib4.$L)("abstract");
|
|
8600
|
+
var $L142 = (0, import_lib4.$L)("as");
|
|
8601
|
+
var $L143 = (0, import_lib4.$L)("@");
|
|
8602
|
+
var $L144 = (0, import_lib4.$L)("@@");
|
|
8603
|
+
var $L145 = (0, import_lib4.$L)("async");
|
|
8604
|
+
var $L146 = (0, import_lib4.$L)("await");
|
|
8605
|
+
var $L147 = (0, import_lib4.$L)("`");
|
|
8606
|
+
var $L148 = (0, import_lib4.$L)("by");
|
|
8607
|
+
var $L149 = (0, import_lib4.$L)("case");
|
|
8608
|
+
var $L150 = (0, import_lib4.$L)("catch");
|
|
8609
|
+
var $L151 = (0, import_lib4.$L)("class");
|
|
8610
|
+
var $L152 = (0, import_lib4.$L)("#{");
|
|
8611
|
+
var $L153 = (0, import_lib4.$L)("comptime");
|
|
8612
|
+
var $L154 = (0, import_lib4.$L)("declare");
|
|
8613
|
+
var $L155 = (0, import_lib4.$L)("default");
|
|
8614
|
+
var $L156 = (0, import_lib4.$L)("delete");
|
|
8615
|
+
var $L157 = (0, import_lib4.$L)("do");
|
|
8616
|
+
var $L158 = (0, import_lib4.$L)("..");
|
|
8617
|
+
var $L159 = (0, import_lib4.$L)("\u2025");
|
|
8618
|
+
var $L160 = (0, import_lib4.$L)("...");
|
|
8619
|
+
var $L161 = (0, import_lib4.$L)("\u2026");
|
|
8620
|
+
var $L162 = (0, import_lib4.$L)("::");
|
|
8621
|
+
var $L163 = (0, import_lib4.$L)('"');
|
|
8622
|
+
var $L164 = (0, import_lib4.$L)("each");
|
|
8623
|
+
var $L165 = (0, import_lib4.$L)("else");
|
|
8624
|
+
var $L166 = (0, import_lib4.$L)("!");
|
|
8625
|
+
var $L167 = (0, import_lib4.$L)("export");
|
|
8626
|
+
var $L168 = (0, import_lib4.$L)("extends");
|
|
8627
|
+
var $L169 = (0, import_lib4.$L)("finally");
|
|
8628
|
+
var $L170 = (0, import_lib4.$L)("for");
|
|
8629
|
+
var $L171 = (0, import_lib4.$L)("from");
|
|
8630
|
+
var $L172 = (0, import_lib4.$L)("function");
|
|
8631
|
+
var $L173 = (0, import_lib4.$L)("get");
|
|
8632
|
+
var $L174 = (0, import_lib4.$L)("set");
|
|
8633
|
+
var $L175 = (0, import_lib4.$L)("#");
|
|
8634
|
+
var $L176 = (0, import_lib4.$L)("if");
|
|
8635
|
+
var $L177 = (0, import_lib4.$L)("in");
|
|
8636
|
+
var $L178 = (0, import_lib4.$L)("infer");
|
|
8637
|
+
var $L179 = (0, import_lib4.$L)("let");
|
|
8638
|
+
var $L180 = (0, import_lib4.$L)("const");
|
|
8639
|
+
var $L181 = (0, import_lib4.$L)("is");
|
|
8640
|
+
var $L182 = (0, import_lib4.$L)("var");
|
|
8641
|
+
var $L183 = (0, import_lib4.$L)("like");
|
|
8642
|
+
var $L184 = (0, import_lib4.$L)("loop");
|
|
8643
|
+
var $L185 = (0, import_lib4.$L)("new");
|
|
8644
|
+
var $L186 = (0, import_lib4.$L)("not");
|
|
8645
|
+
var $L187 = (0, import_lib4.$L)("of");
|
|
8646
|
+
var $L188 = (0, import_lib4.$L)("[");
|
|
8647
|
+
var $L189 = (0, import_lib4.$L)("operator");
|
|
8648
|
+
var $L190 = (0, import_lib4.$L)("override");
|
|
8649
|
+
var $L191 = (0, import_lib4.$L)("own");
|
|
8650
|
+
var $L192 = (0, import_lib4.$L)("public");
|
|
8651
|
+
var $L193 = (0, import_lib4.$L)("private");
|
|
8652
|
+
var $L194 = (0, import_lib4.$L)("protected");
|
|
8653
|
+
var $L195 = (0, import_lib4.$L)("||>");
|
|
8654
|
+
var $L196 = (0, import_lib4.$L)("|\u25B7");
|
|
8655
|
+
var $L197 = (0, import_lib4.$L)("|>=");
|
|
8656
|
+
var $L198 = (0, import_lib4.$L)("\u25B7=");
|
|
8657
|
+
var $L199 = (0, import_lib4.$L)("|>");
|
|
8658
|
+
var $L200 = (0, import_lib4.$L)("\u25B7");
|
|
8659
|
+
var $L201 = (0, import_lib4.$L)("readonly");
|
|
8660
|
+
var $L202 = (0, import_lib4.$L)("return");
|
|
8661
|
+
var $L203 = (0, import_lib4.$L)("satisfies");
|
|
8662
|
+
var $L204 = (0, import_lib4.$L)("'");
|
|
8663
|
+
var $L205 = (0, import_lib4.$L)("static");
|
|
8664
|
+
var $L206 = (0, import_lib4.$L)("${");
|
|
8665
|
+
var $L207 = (0, import_lib4.$L)("super");
|
|
8666
|
+
var $L208 = (0, import_lib4.$L)("switch");
|
|
8667
|
+
var $L209 = (0, import_lib4.$L)("target");
|
|
8668
|
+
var $L210 = (0, import_lib4.$L)("then");
|
|
8669
|
+
var $L211 = (0, import_lib4.$L)("this");
|
|
8670
|
+
var $L212 = (0, import_lib4.$L)("throw");
|
|
8671
|
+
var $L213 = (0, import_lib4.$L)('"""');
|
|
8672
|
+
var $L214 = (0, import_lib4.$L)("'''");
|
|
8673
|
+
var $L215 = (0, import_lib4.$L)("///");
|
|
8674
|
+
var $L216 = (0, import_lib4.$L)("```");
|
|
8675
|
+
var $L217 = (0, import_lib4.$L)("try");
|
|
8676
|
+
var $L218 = (0, import_lib4.$L)("typeof");
|
|
8677
|
+
var $L219 = (0, import_lib4.$L)("undefined");
|
|
8678
|
+
var $L220 = (0, import_lib4.$L)("unless");
|
|
8679
|
+
var $L221 = (0, import_lib4.$L)("until");
|
|
8680
|
+
var $L222 = (0, import_lib4.$L)("using");
|
|
8681
|
+
var $L223 = (0, import_lib4.$L)("void");
|
|
8682
|
+
var $L224 = (0, import_lib4.$L)("when");
|
|
8683
|
+
var $L225 = (0, import_lib4.$L)("while");
|
|
8684
|
+
var $L226 = (0, import_lib4.$L)("yield");
|
|
8685
|
+
var $L227 = (0, import_lib4.$L)("/>");
|
|
8686
|
+
var $L228 = (0, import_lib4.$L)("</");
|
|
8687
|
+
var $L229 = (0, import_lib4.$L)("<>");
|
|
8688
|
+
var $L230 = (0, import_lib4.$L)("</>");
|
|
8689
|
+
var $L231 = (0, import_lib4.$L)("<!--");
|
|
8690
|
+
var $L232 = (0, import_lib4.$L)("-->");
|
|
8691
|
+
var $L233 = (0, import_lib4.$L)("type");
|
|
8692
|
+
var $L234 = (0, import_lib4.$L)("enum");
|
|
8693
|
+
var $L235 = (0, import_lib4.$L)("interface");
|
|
8694
|
+
var $L236 = (0, import_lib4.$L)("global");
|
|
8695
|
+
var $L237 = (0, import_lib4.$L)("module");
|
|
8696
|
+
var $L238 = (0, import_lib4.$L)("namespace");
|
|
8697
|
+
var $L239 = (0, import_lib4.$L)("asserts");
|
|
8698
|
+
var $L240 = (0, import_lib4.$L)("keyof");
|
|
8699
|
+
var $L241 = (0, import_lib4.$L)("???");
|
|
8700
|
+
var $L242 = (0, import_lib4.$L)("unique");
|
|
8701
|
+
var $L243 = (0, import_lib4.$L)("symbol");
|
|
8702
|
+
var $L244 = (0, import_lib4.$L)("[]");
|
|
8703
|
+
var $L245 = (0, import_lib4.$L)("civet");
|
|
8403
8704
|
var $R0 = (0, import_lib4.$R)(new RegExp("(?=async|debugger|if|unless|comptime|do|for|loop|until|while|switch|throw|try)", "suy"));
|
|
8404
8705
|
var $R1 = (0, import_lib4.$R)(new RegExp("&(?=\\s)", "suy"));
|
|
8405
|
-
var $R2 = (0, import_lib4.$R)(new RegExp("(as|of|satisfies|then|when|implements|xor|xnor)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
|
|
8706
|
+
var $R2 = (0, import_lib4.$R)(new RegExp("(as|of|by|satisfies|then|when|implements|xor|xnor)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
|
|
8406
8707
|
var $R3 = (0, import_lib4.$R)(new RegExp("[0-9]", "suy"));
|
|
8407
8708
|
var $R4 = (0, import_lib4.$R)(new RegExp("(?!\\p{ID_Start}|[_$0-9(\\[{])", "suy"));
|
|
8408
8709
|
var $R5 = (0, import_lib4.$R)(new RegExp("[ \\t]", "suy"));
|
|
@@ -8629,12 +8930,7 @@ var StatementExpression$1 = (0, import_lib4.$TS)((0, import_lib4.$S)(IfStatement
|
|
|
8629
8930
|
return $skip;
|
|
8630
8931
|
return $1;
|
|
8631
8932
|
});
|
|
8632
|
-
var StatementExpression$2 =
|
|
8633
|
-
if ($1.block.implicit && $1.subtype !== "DoStatement" && $1.subtype !== "ComptimeStatement") {
|
|
8634
|
-
return $skip;
|
|
8635
|
-
}
|
|
8636
|
-
return $1;
|
|
8637
|
-
});
|
|
8933
|
+
var StatementExpression$2 = IterationExpression;
|
|
8638
8934
|
var StatementExpression$3 = SwitchStatement;
|
|
8639
8935
|
var StatementExpression$4 = ThrowStatement;
|
|
8640
8936
|
var StatementExpression$5 = TryStatement;
|
|
@@ -8732,7 +9028,7 @@ var ForbiddenImplicitCalls$$ = [ForbiddenImplicitCalls$0, ForbiddenImplicitCalls
|
|
|
8732
9028
|
function ForbiddenImplicitCalls(ctx, state2) {
|
|
8733
9029
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "ForbiddenImplicitCalls", ForbiddenImplicitCalls$$);
|
|
8734
9030
|
}
|
|
8735
|
-
var ReservedBinary$0 = (0, import_lib4.$R$0)((0, import_lib4.$EXPECT)($R2, "ReservedBinary /(as|of|satisfies|then|when|implements|xor|xnor)(?!\\p{ID_Continue}|[\\u200C\\u200D$])/"));
|
|
9031
|
+
var ReservedBinary$0 = (0, import_lib4.$R$0)((0, import_lib4.$EXPECT)($R2, "ReservedBinary /(as|of|by|satisfies|then|when|implements|xor|xnor)(?!\\p{ID_Continue}|[\\u200C\\u200D$])/"));
|
|
8736
9032
|
function ReservedBinary(ctx, state2) {
|
|
8737
9033
|
return (0, import_lib4.$EVENT)(ctx, state2, "ReservedBinary", ReservedBinary$0);
|
|
8738
9034
|
}
|
|
@@ -9363,7 +9659,7 @@ var PipelineHeadItem$$ = [PipelineHeadItem$0, PipelineHeadItem$1];
|
|
|
9363
9659
|
function PipelineHeadItem(ctx, state2) {
|
|
9364
9660
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "PipelineHeadItem", PipelineHeadItem$$);
|
|
9365
9661
|
}
|
|
9366
|
-
var PipelineTailItem$0 = (0, import_lib4.$T)((0, import_lib4.$S)((0, import_lib4.$C)(AwaitOp, Yield, Return), (0, import_lib4.$N)(AccessStart)), function(value) {
|
|
9662
|
+
var PipelineTailItem$0 = (0, import_lib4.$T)((0, import_lib4.$S)((0, import_lib4.$C)(AwaitOp, Yield, Return, Throw), (0, import_lib4.$N)(AccessStart), (0, import_lib4.$N)(MaybeNestedExpression)), function(value) {
|
|
9367
9663
|
return value[0];
|
|
9368
9664
|
});
|
|
9369
9665
|
var PipelineTailItem$1 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L15, 'PipelineTailItem "import"'), (0, import_lib4.$N)(AccessStart)), function($skip, $loc, $0, $1, $2) {
|
|
@@ -9395,8 +9691,9 @@ var PrimaryExpression$7 = ClassExpression;
|
|
|
9395
9691
|
var PrimaryExpression$8 = RegularExpressionLiteral;
|
|
9396
9692
|
var PrimaryExpression$9 = ParenthesizedExpression;
|
|
9397
9693
|
var PrimaryExpression$10 = Placeholder;
|
|
9398
|
-
var PrimaryExpression$11 =
|
|
9399
|
-
var PrimaryExpression
|
|
9694
|
+
var PrimaryExpression$11 = SymbolLiteral;
|
|
9695
|
+
var PrimaryExpression$12 = JSXImplicitFragment;
|
|
9696
|
+
var PrimaryExpression$$ = [PrimaryExpression$0, PrimaryExpression$1, PrimaryExpression$2, PrimaryExpression$3, PrimaryExpression$4, PrimaryExpression$5, PrimaryExpression$6, PrimaryExpression$7, PrimaryExpression$8, PrimaryExpression$9, PrimaryExpression$10, PrimaryExpression$11, PrimaryExpression$12];
|
|
9400
9697
|
function PrimaryExpression(ctx, state2) {
|
|
9401
9698
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "PrimaryExpression", PrimaryExpression$$);
|
|
9402
9699
|
}
|
|
@@ -10225,7 +10522,7 @@ var PropertyAccessModifier$$ = [PropertyAccessModifier$0, PropertyAccessModifier
|
|
|
10225
10522
|
function PropertyAccessModifier(ctx, state2) {
|
|
10226
10523
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "PropertyAccessModifier", PropertyAccessModifier$$);
|
|
10227
10524
|
}
|
|
10228
|
-
var PropertyAccess$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(AccessStart, (0, import_lib4.$C)(TemplateLiteral, StringLiteral, IntegerLiteral)), function($skip, $loc, $0, $1, $2) {
|
|
10525
|
+
var PropertyAccess$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(AccessStart, (0, import_lib4.$C)(TemplateLiteral, StringLiteral, IntegerLiteral, SymbolLiteral)), function($skip, $loc, $0, $1, $2) {
|
|
10229
10526
|
var dot = $1;
|
|
10230
10527
|
var literal = $2;
|
|
10231
10528
|
return {
|
|
@@ -11769,6 +12066,55 @@ var CoffeeScriptBooleanLiteral$$ = [CoffeeScriptBooleanLiteral$0, CoffeeScriptBo
|
|
|
11769
12066
|
function CoffeeScriptBooleanLiteral(ctx, state2) {
|
|
11770
12067
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "CoffeeScriptBooleanLiteral", CoffeeScriptBooleanLiteral$$);
|
|
11771
12068
|
}
|
|
12069
|
+
var SymbolLiteral$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(Colon, (0, import_lib4.$C)(IdentifierName, StringLiteral)), function($skip, $loc, $0, $1, $2) {
|
|
12070
|
+
var colon = $1;
|
|
12071
|
+
var id = $2;
|
|
12072
|
+
let name, token;
|
|
12073
|
+
if (id.type === "Identifier") {
|
|
12074
|
+
({ name, children: [token] } = id);
|
|
12075
|
+
} else {
|
|
12076
|
+
name = literalValue({
|
|
12077
|
+
type: "Literal",
|
|
12078
|
+
subtype: "StringLiteral",
|
|
12079
|
+
raw: id.token,
|
|
12080
|
+
children: [id]
|
|
12081
|
+
});
|
|
12082
|
+
token = id;
|
|
12083
|
+
}
|
|
12084
|
+
if (config.symbols.includes(name)) {
|
|
12085
|
+
return {
|
|
12086
|
+
type: "SymbolLiteral",
|
|
12087
|
+
children: id.type === "Identifier" ? [
|
|
12088
|
+
{ ...colon, token: "Symbol." },
|
|
12089
|
+
token
|
|
12090
|
+
] : [
|
|
12091
|
+
{ ...colon, token: "Symbol[" },
|
|
12092
|
+
token,
|
|
12093
|
+
"]"
|
|
12094
|
+
],
|
|
12095
|
+
name
|
|
12096
|
+
};
|
|
12097
|
+
} else {
|
|
12098
|
+
return {
|
|
12099
|
+
type: "SymbolLiteral",
|
|
12100
|
+
children: [
|
|
12101
|
+
{ ...colon, token: "Symbol.for(" },
|
|
12102
|
+
id.type === "Identifier" ? ['"', token, '"'] : token,
|
|
12103
|
+
")"
|
|
12104
|
+
],
|
|
12105
|
+
name
|
|
12106
|
+
};
|
|
12107
|
+
}
|
|
12108
|
+
});
|
|
12109
|
+
function SymbolLiteral(ctx, state2) {
|
|
12110
|
+
return (0, import_lib4.$EVENT)(ctx, state2, "SymbolLiteral", SymbolLiteral$0);
|
|
12111
|
+
}
|
|
12112
|
+
var SymbolElement$0 = (0, import_lib4.$T)((0, import_lib4.$S)(SymbolLiteral), function(value) {
|
|
12113
|
+
return ["[", value[0], "]"];
|
|
12114
|
+
});
|
|
12115
|
+
function SymbolElement(ctx, state2) {
|
|
12116
|
+
return (0, import_lib4.$EVENT)(ctx, state2, "SymbolElement", SymbolElement$0);
|
|
12117
|
+
}
|
|
11772
12118
|
var Identifier$0 = (0, import_lib4.$T)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($R17, "Identifier /(?=\\p{ID_Start}|[_$])/"), (0, import_lib4.$N)(ReservedWord), IdentifierName), function(value) {
|
|
11773
12119
|
var id = value[2];
|
|
11774
12120
|
return id;
|
|
@@ -12516,7 +12862,8 @@ var PropertyName$3 = (0, import_lib4.$TV)((0, import_lib4.$TEXT)((0, import_lib4
|
|
|
12516
12862
|
});
|
|
12517
12863
|
var PropertyName$4 = IdentifierName;
|
|
12518
12864
|
var PropertyName$5 = LengthShorthand;
|
|
12519
|
-
var PropertyName
|
|
12865
|
+
var PropertyName$6 = SymbolElement;
|
|
12866
|
+
var PropertyName$$ = [PropertyName$0, PropertyName$1, PropertyName$2, PropertyName$3, PropertyName$4, PropertyName$5, PropertyName$6];
|
|
12520
12867
|
function PropertyName(ctx, state2) {
|
|
12521
12868
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "PropertyName", PropertyName$$);
|
|
12522
12869
|
}
|
|
@@ -12778,7 +13125,8 @@ function MethodSignature(ctx, state2) {
|
|
|
12778
13125
|
var ClassElementName$0 = PropertyName;
|
|
12779
13126
|
var ClassElementName$1 = LengthShorthand;
|
|
12780
13127
|
var ClassElementName$2 = PrivateIdentifier;
|
|
12781
|
-
var ClassElementName
|
|
13128
|
+
var ClassElementName$3 = SymbolElement;
|
|
13129
|
+
var ClassElementName$$ = [ClassElementName$0, ClassElementName$1, ClassElementName$2, ClassElementName$3];
|
|
12782
13130
|
function ClassElementName(ctx, state2) {
|
|
12783
13131
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "ClassElementName", ClassElementName$$);
|
|
12784
13132
|
}
|
|
@@ -13395,6 +13743,8 @@ var Statement$2 = (0, import_lib4.$T)((0, import_lib4.$S)(IfStatement, (0, impor
|
|
|
13395
13743
|
var Statement$3 = (0, import_lib4.$TS)((0, import_lib4.$S)(IterationStatement, (0, import_lib4.$N)(ShouldExpressionize)), function($skip, $loc, $0, $1, $2) {
|
|
13396
13744
|
if ($1.generator)
|
|
13397
13745
|
return $skip;
|
|
13746
|
+
if ($1.reduction)
|
|
13747
|
+
return $skip;
|
|
13398
13748
|
return $1;
|
|
13399
13749
|
});
|
|
13400
13750
|
var Statement$4 = (0, import_lib4.$T)((0, import_lib4.$S)(SwitchStatement, (0, import_lib4.$N)(ShouldExpressionize)), function(value) {
|
|
@@ -13440,7 +13790,7 @@ function EmptyStatement(ctx, state2) {
|
|
|
13440
13790
|
return (0, import_lib4.$EVENT)(ctx, state2, "EmptyStatement", EmptyStatement$0);
|
|
13441
13791
|
}
|
|
13442
13792
|
var InsertEmptyStatement$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(InsertSemicolon), function($skip, $loc, $0, $1) {
|
|
13443
|
-
return { type: "EmptyStatement", children: [$1] };
|
|
13793
|
+
return { type: "EmptyStatement", children: [$1], implicit: true };
|
|
13444
13794
|
});
|
|
13445
13795
|
function InsertEmptyStatement(ctx, state2) {
|
|
13446
13796
|
return (0, import_lib4.$EVENT)(ctx, state2, "InsertEmptyStatement", InsertEmptyStatement$0);
|
|
@@ -13735,7 +14085,7 @@ var ForStatement$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(ForClause, BlockOr
|
|
|
13735
14085
|
function ForStatement(ctx, state2) {
|
|
13736
14086
|
return (0, import_lib4.$EVENT)(ctx, state2, "ForStatement", ForStatement$0);
|
|
13737
14087
|
}
|
|
13738
|
-
var ForClause$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(For, (0, import_lib4.$E)((0, import_lib4.$S)((0, import_lib4.$E)(_), Star)), __,
|
|
14088
|
+
var ForClause$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(For, (0, import_lib4.$E)((0, import_lib4.$S)((0, import_lib4.$E)(_), Star)), __, ForStatementControlWithWhen), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
13739
14089
|
var generator = $2;
|
|
13740
14090
|
var c = $4;
|
|
13741
14091
|
const { children, declaration } = c;
|
|
@@ -13746,32 +14096,63 @@ var ForClause$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(For, (0, import_lib4.
|
|
|
13746
14096
|
block: null,
|
|
13747
14097
|
blockPrefix: c.blockPrefix,
|
|
13748
14098
|
hoistDec: c.hoistDec,
|
|
14099
|
+
reduction: c.reduction,
|
|
13749
14100
|
generator
|
|
13750
14101
|
};
|
|
13751
14102
|
});
|
|
13752
14103
|
function ForClause(ctx, state2) {
|
|
13753
14104
|
return (0, import_lib4.$EVENT)(ctx, state2, "ForClause", ForClause$0);
|
|
13754
14105
|
}
|
|
14106
|
+
var ForStatementControlWithWhen$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)(ForReduction), ForStatementControl, (0, import_lib4.$E)(WhenCondition)), function($skip, $loc, $0, $1, $2, $3) {
|
|
14107
|
+
var reduction = $1;
|
|
14108
|
+
var control = $2;
|
|
14109
|
+
var condition = $3;
|
|
14110
|
+
if (reduction)
|
|
14111
|
+
control = { ...control, reduction };
|
|
14112
|
+
if (!condition)
|
|
14113
|
+
return control;
|
|
14114
|
+
const expressions = [["", {
|
|
14115
|
+
type: "ContinueStatement",
|
|
14116
|
+
children: ["continue"]
|
|
14117
|
+
}]];
|
|
14118
|
+
const block = {
|
|
14119
|
+
type: "BlockStatement",
|
|
14120
|
+
expressions,
|
|
14121
|
+
children: [expressions],
|
|
14122
|
+
bare: true
|
|
14123
|
+
};
|
|
14124
|
+
return {
|
|
14125
|
+
...control,
|
|
14126
|
+
blockPrefix: [
|
|
14127
|
+
...control.blockPrefix ?? [],
|
|
14128
|
+
["", {
|
|
14129
|
+
type: "IfStatement",
|
|
14130
|
+
then: block,
|
|
14131
|
+
children: ["if (!", makeLeftHandSideExpression(trimFirstSpace(condition)), ") ", block]
|
|
14132
|
+
}, ";"]
|
|
14133
|
+
]
|
|
14134
|
+
};
|
|
14135
|
+
});
|
|
14136
|
+
function ForStatementControlWithWhen(ctx, state2) {
|
|
14137
|
+
return (0, import_lib4.$EVENT)(ctx, state2, "ForStatementControlWithWhen", ForStatementControlWithWhen$0);
|
|
14138
|
+
}
|
|
14139
|
+
var ForReduction$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L120, 'ForReduction "some"'), (0, import_lib4.$EXPECT)($L121, 'ForReduction "every"'), (0, import_lib4.$EXPECT)($L122, 'ForReduction "count"'), (0, import_lib4.$EXPECT)($L123, 'ForReduction "sum"'), (0, import_lib4.$EXPECT)($L124, 'ForReduction "product"'), (0, import_lib4.$EXPECT)($L125, 'ForReduction "min"'), (0, import_lib4.$EXPECT)($L126, 'ForReduction "max"')), NonIdContinue, __), function($skip, $loc, $0, $1, $2, $3) {
|
|
14140
|
+
var subtype = $1;
|
|
14141
|
+
var ws = $3;
|
|
14142
|
+
return {
|
|
14143
|
+
type: "ForReduction",
|
|
14144
|
+
subtype,
|
|
14145
|
+
children: [ws]
|
|
14146
|
+
};
|
|
14147
|
+
});
|
|
14148
|
+
function ForReduction(ctx, state2) {
|
|
14149
|
+
return (0, import_lib4.$EVENT)(ctx, state2, "ForReduction", ForReduction$0);
|
|
14150
|
+
}
|
|
13755
14151
|
var ForStatementControl$0 = (0, import_lib4.$T)((0, import_lib4.$S)((0, import_lib4.$N)(CoffeeForLoopsEnabled), ForStatementParameters), function(value) {
|
|
13756
14152
|
return value[1];
|
|
13757
14153
|
});
|
|
13758
|
-
var ForStatementControl$1 = (0, import_lib4.$
|
|
13759
|
-
|
|
13760
|
-
if (condition) {
|
|
13761
|
-
const block = "continue";
|
|
13762
|
-
$2 = {
|
|
13763
|
-
...$2,
|
|
13764
|
-
blockPrefix: [
|
|
13765
|
-
...$2.blockPrefix,
|
|
13766
|
-
["", {
|
|
13767
|
-
type: "IfStatement",
|
|
13768
|
-
then: block,
|
|
13769
|
-
children: ["if (!(", trimFirstSpace(condition), ")) ", block]
|
|
13770
|
-
}, ";"]
|
|
13771
|
-
]
|
|
13772
|
-
};
|
|
13773
|
-
}
|
|
13774
|
-
return $2;
|
|
14154
|
+
var ForStatementControl$1 = (0, import_lib4.$T)((0, import_lib4.$S)(CoffeeForLoopsEnabled, CoffeeForStatementParameters), function(value) {
|
|
14155
|
+
return value[1];
|
|
13775
14156
|
});
|
|
13776
14157
|
var ForStatementControl$$ = [ForStatementControl$0, ForStatementControl$1];
|
|
13777
14158
|
function ForStatementControl(ctx, state2) {
|
|
@@ -13820,7 +14201,7 @@ var CoffeeForStatementParameters$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0
|
|
|
13820
14201
|
const counterRef = makeRef("i");
|
|
13821
14202
|
const lenRef = makeRef("len");
|
|
13822
14203
|
if (exp.type === "RangeExpression") {
|
|
13823
|
-
return forRange(open, declaration, exp, step
|
|
14204
|
+
return forRange(open, declaration, exp, step && prepend(trimFirstSpace(step[0]), trimFirstSpace(step[2])), close);
|
|
13824
14205
|
}
|
|
13825
14206
|
const expRef = maybeRef(exp);
|
|
13826
14207
|
const varRef = declaration;
|
|
@@ -13922,10 +14303,10 @@ var ForStatementParameters$1 = (0, import_lib4.$TS)((0, import_lib4.$S)(InsertOp
|
|
|
13922
14303
|
};
|
|
13923
14304
|
});
|
|
13924
14305
|
var ForStatementParameters$2 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)((0, import_lib4.$S)(Await, __)), (0, import_lib4.$E)((0, import_lib4.$S)((0, import_lib4.$C)(Each, Own), __)), (0, import_lib4.$S)(OpenParen, __), ForInOfDeclaration, (0, import_lib4.$E)((0, import_lib4.$S)(__, Comma, __, ForInOfDeclaration)), __, (0, import_lib4.$C)(In, Of), ExpressionWithObjectApplicationForbidden, (0, import_lib4.$E)((0, import_lib4.$S)(__, By, ExpressionWithObjectApplicationForbidden)), (0, import_lib4.$S)(__, CloseParen)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10) {
|
|
13925
|
-
return processForInOf($0
|
|
14306
|
+
return processForInOf($0);
|
|
13926
14307
|
});
|
|
13927
14308
|
var ForStatementParameters$3 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)((0, import_lib4.$S)(Await, __)), (0, import_lib4.$E)((0, import_lib4.$S)((0, import_lib4.$C)(Each, Own), __)), InsertOpenParen, ForInOfDeclaration, (0, import_lib4.$E)((0, import_lib4.$S)(__, Comma, __, ForInOfDeclaration)), __, (0, import_lib4.$C)(In, Of), ExpressionWithObjectApplicationForbidden, (0, import_lib4.$E)((0, import_lib4.$S)(__, By, ExpressionWithObjectApplicationForbidden)), InsertCloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10) {
|
|
13928
|
-
return processForInOf($0
|
|
14309
|
+
return processForInOf($0);
|
|
13929
14310
|
});
|
|
13930
14311
|
var ForStatementParameters$4 = ForRangeParameters;
|
|
13931
14312
|
var ForStatementParameters$$ = [ForStatementParameters$0, ForStatementParameters$1, ForStatementParameters$2, ForStatementParameters$3, ForStatementParameters$4];
|
|
@@ -13962,7 +14343,7 @@ var ForDeclaration$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(LetOrConstOrVar,
|
|
|
13962
14343
|
return {
|
|
13963
14344
|
type: "ForDeclaration",
|
|
13964
14345
|
children: [c, binding],
|
|
13965
|
-
|
|
14346
|
+
decl: c.token,
|
|
13966
14347
|
binding,
|
|
13967
14348
|
names: binding.names
|
|
13968
14349
|
};
|
|
@@ -13973,7 +14354,7 @@ var ForDeclaration$1 = (0, import_lib4.$TS)((0, import_lib4.$S)(InsertConst, (0,
|
|
|
13973
14354
|
return {
|
|
13974
14355
|
type: "ForDeclaration",
|
|
13975
14356
|
children: [c, binding],
|
|
13976
|
-
|
|
14357
|
+
decl: c.token,
|
|
13977
14358
|
binding,
|
|
13978
14359
|
names: binding.names
|
|
13979
14360
|
};
|
|
@@ -14693,19 +15074,19 @@ var ThrowStatement$0 = (0, import_lib4.$T)((0, import_lib4.$S)(Throw, MaybeParen
|
|
|
14693
15074
|
function ThrowStatement(ctx, state2) {
|
|
14694
15075
|
return (0, import_lib4.$EVENT)(ctx, state2, "ThrowStatement", ThrowStatement$0);
|
|
14695
15076
|
}
|
|
14696
|
-
var Break$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
15077
|
+
var Break$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L127, 'Break "break"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
14697
15078
|
return { $loc, token: $1 };
|
|
14698
15079
|
});
|
|
14699
15080
|
function Break(ctx, state2) {
|
|
14700
15081
|
return (0, import_lib4.$EVENT)(ctx, state2, "Break", Break$0);
|
|
14701
15082
|
}
|
|
14702
|
-
var Continue$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
15083
|
+
var Continue$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L128, 'Continue "continue"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
14703
15084
|
return { $loc, token: $1 };
|
|
14704
15085
|
});
|
|
14705
15086
|
function Continue(ctx, state2) {
|
|
14706
15087
|
return (0, import_lib4.$EVENT)(ctx, state2, "Continue", Continue$0);
|
|
14707
15088
|
}
|
|
14708
|
-
var Debugger$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
15089
|
+
var Debugger$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L129, 'Debugger "debugger"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
14709
15090
|
return { $loc, token: $1 };
|
|
14710
15091
|
});
|
|
14711
15092
|
function Debugger(ctx, state2) {
|
|
@@ -14773,7 +15154,7 @@ var MaybeParenNestedExpression$$ = [MaybeParenNestedExpression$0, MaybeParenNest
|
|
|
14773
15154
|
function MaybeParenNestedExpression(ctx, state2) {
|
|
14774
15155
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "MaybeParenNestedExpression", MaybeParenNestedExpression$$);
|
|
14775
15156
|
}
|
|
14776
|
-
var ImportDeclaration$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(Import, _, Identifier, (0, import_lib4.$E)(_), Equals, __, (0, import_lib4.$EXPECT)($
|
|
15157
|
+
var ImportDeclaration$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(Import, _, Identifier, (0, import_lib4.$E)(_), Equals, __, (0, import_lib4.$EXPECT)($L130, 'ImportDeclaration "require"'), NonIdContinue, Arguments), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
|
|
14777
15158
|
const imp = [
|
|
14778
15159
|
{ ...$1, ts: true },
|
|
14779
15160
|
{ ...$1, token: "const", js: true }
|
|
@@ -14963,7 +15344,7 @@ var ImpliedFrom$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L0, 'ImpliedF
|
|
|
14963
15344
|
function ImpliedFrom(ctx, state2) {
|
|
14964
15345
|
return (0, import_lib4.$EVENT)(ctx, state2, "ImpliedFrom", ImpliedFrom$0);
|
|
14965
15346
|
}
|
|
14966
|
-
var ImportAssertion$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)(_), (0, import_lib4.$C)((0, import_lib4.$EXPECT)($
|
|
15347
|
+
var ImportAssertion$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)(_), (0, import_lib4.$C)((0, import_lib4.$EXPECT)($L131, 'ImportAssertion "with"'), (0, import_lib4.$EXPECT)($L132, 'ImportAssertion "assert"')), NonIdContinue, (0, import_lib4.$E)(_), ObjectLiteral), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
14967
15348
|
var keyword = $2;
|
|
14968
15349
|
var object = $5;
|
|
14969
15350
|
return {
|
|
@@ -15282,19 +15663,19 @@ var LexicalDeclaration$$ = [LexicalDeclaration$0, LexicalDeclaration$1];
|
|
|
15282
15663
|
function LexicalDeclaration(ctx, state2) {
|
|
15283
15664
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "LexicalDeclaration", LexicalDeclaration$$);
|
|
15284
15665
|
}
|
|
15285
|
-
var ConstAssignment$0 = (0, import_lib4.$TV)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($
|
|
15666
|
+
var ConstAssignment$0 = (0, import_lib4.$TV)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L133, 'ConstAssignment ":="'), (0, import_lib4.$EXPECT)($L134, 'ConstAssignment "\u2254"')), function($skip, $loc, $0, $1) {
|
|
15286
15667
|
return { $loc, token: "=", decl: "const " };
|
|
15287
15668
|
});
|
|
15288
15669
|
function ConstAssignment(ctx, state2) {
|
|
15289
15670
|
return (0, import_lib4.$EVENT)(ctx, state2, "ConstAssignment", ConstAssignment$0);
|
|
15290
15671
|
}
|
|
15291
|
-
var LetAssignment$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
15672
|
+
var LetAssignment$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L135, 'LetAssignment ".="'), function($skip, $loc, $0, $1) {
|
|
15292
15673
|
return { $loc, token: "=", decl: "let " };
|
|
15293
15674
|
});
|
|
15294
15675
|
function LetAssignment(ctx, state2) {
|
|
15295
15676
|
return (0, import_lib4.$EVENT)(ctx, state2, "LetAssignment", LetAssignment$0);
|
|
15296
15677
|
}
|
|
15297
|
-
var TypeAssignment$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
15678
|
+
var TypeAssignment$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L136, 'TypeAssignment "::="'), function($skip, $loc, $0, $1) {
|
|
15298
15679
|
return { $loc, token: "=" };
|
|
15299
15680
|
});
|
|
15300
15681
|
function TypeAssignment(ctx, state2) {
|
|
@@ -15717,7 +16098,7 @@ var MultiLineComment$$ = [MultiLineComment$0, MultiLineComment$1];
|
|
|
15717
16098
|
function MultiLineComment(ctx, state2) {
|
|
15718
16099
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "MultiLineComment", MultiLineComment$$);
|
|
15719
16100
|
}
|
|
15720
|
-
var JSMultiLineComment$0 = (0, import_lib4.$TV)((0, import_lib4.$TEXT)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16101
|
+
var JSMultiLineComment$0 = (0, import_lib4.$TV)((0, import_lib4.$TEXT)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L137, 'JSMultiLineComment "/*"'), (0, import_lib4.$Q)((0, import_lib4.$S)((0, import_lib4.$N)((0, import_lib4.$EXPECT)($L138, 'JSMultiLineComment "*/"')), (0, import_lib4.$EXPECT)($R67, "JSMultiLineComment /./"))), (0, import_lib4.$EXPECT)($L138, 'JSMultiLineComment "*/"'))), function($skip, $loc, $0, $1) {
|
|
15721
16102
|
return { type: "Comment", $loc, token: $1 };
|
|
15722
16103
|
});
|
|
15723
16104
|
function JSMultiLineComment(ctx, state2) {
|
|
@@ -15763,7 +16144,7 @@ function _(ctx, state2) {
|
|
|
15763
16144
|
var NonNewlineWhitespace$0 = (0, import_lib4.$TR)((0, import_lib4.$EXPECT)($R22, "NonNewlineWhitespace /[ \\t]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
|
|
15764
16145
|
return { $loc, token: $0 };
|
|
15765
16146
|
});
|
|
15766
|
-
var NonNewlineWhitespace$1 = (0, import_lib4.$T)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16147
|
+
var NonNewlineWhitespace$1 = (0, import_lib4.$T)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L139, 'NonNewlineWhitespace "\\\\\\\\"'), CoffeeLineContinuationEnabled, EOL), function(value) {
|
|
15767
16148
|
return " ";
|
|
15768
16149
|
});
|
|
15769
16150
|
var NonNewlineWhitespace$$ = [NonNewlineWhitespace$0, NonNewlineWhitespace$1];
|
|
@@ -15809,7 +16190,7 @@ function SimpleStatementDelimiter(ctx, state2) {
|
|
|
15809
16190
|
}
|
|
15810
16191
|
var StatementDelimiter$0 = (0, import_lib4.$Y)(EOS);
|
|
15811
16192
|
var StatementDelimiter$1 = SemicolonDelimiter;
|
|
15812
|
-
var StatementDelimiter$2 = (0, import_lib4.$Y)((0, import_lib4.$S)((0, import_lib4.$E)(_), (0, import_lib4.$C)((0, import_lib4.$EXPECT)($L37, 'StatementDelimiter "}"'), (0, import_lib4.$EXPECT)($
|
|
16193
|
+
var StatementDelimiter$2 = (0, import_lib4.$Y)((0, import_lib4.$S)((0, import_lib4.$E)(_), (0, import_lib4.$C)((0, import_lib4.$EXPECT)($L37, 'StatementDelimiter "}"'), (0, import_lib4.$EXPECT)($L140, 'StatementDelimiter ")"'), (0, import_lib4.$EXPECT)($L46, 'StatementDelimiter "]"'))));
|
|
15813
16194
|
var StatementDelimiter$$ = [StatementDelimiter$0, StatementDelimiter$1, StatementDelimiter$2];
|
|
15814
16195
|
function StatementDelimiter(ctx, state2) {
|
|
15815
16196
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "StatementDelimiter", StatementDelimiter$$);
|
|
@@ -15833,7 +16214,7 @@ var Loc$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L0, 'Loc ""'), functi
|
|
|
15833
16214
|
function Loc(ctx, state2) {
|
|
15834
16215
|
return (0, import_lib4.$EVENT)(ctx, state2, "Loc", Loc$0);
|
|
15835
16216
|
}
|
|
15836
|
-
var Abstract$0 = (0, import_lib4.$TV)((0, import_lib4.$TEXT)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16217
|
+
var Abstract$0 = (0, import_lib4.$TV)((0, import_lib4.$TEXT)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L141, 'Abstract "abstract"'), NonIdContinue, (0, import_lib4.$E)((0, import_lib4.$EXPECT)($L18, 'Abstract " "')))), function($skip, $loc, $0, $1) {
|
|
15837
16218
|
return { $loc, token: $1, ts: true };
|
|
15838
16219
|
});
|
|
15839
16220
|
function Abstract(ctx, state2) {
|
|
@@ -15845,43 +16226,43 @@ var Ampersand$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L117, 'Ampersan
|
|
|
15845
16226
|
function Ampersand(ctx, state2) {
|
|
15846
16227
|
return (0, import_lib4.$EVENT)(ctx, state2, "Ampersand", Ampersand$0);
|
|
15847
16228
|
}
|
|
15848
|
-
var As$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16229
|
+
var As$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L142, 'As "as"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
15849
16230
|
return { $loc, token: $1 };
|
|
15850
16231
|
});
|
|
15851
16232
|
function As(ctx, state2) {
|
|
15852
16233
|
return (0, import_lib4.$EVENT)(ctx, state2, "As", As$0);
|
|
15853
16234
|
}
|
|
15854
|
-
var At$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16235
|
+
var At$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L143, 'At "@"'), function($skip, $loc, $0, $1) {
|
|
15855
16236
|
return { $loc, token: $1 };
|
|
15856
16237
|
});
|
|
15857
16238
|
function At(ctx, state2) {
|
|
15858
16239
|
return (0, import_lib4.$EVENT)(ctx, state2, "At", At$0);
|
|
15859
16240
|
}
|
|
15860
|
-
var AtAt$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16241
|
+
var AtAt$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L144, 'AtAt "@@"'), function($skip, $loc, $0, $1) {
|
|
15861
16242
|
return { $loc, token: "@" };
|
|
15862
16243
|
});
|
|
15863
16244
|
function AtAt(ctx, state2) {
|
|
15864
16245
|
return (0, import_lib4.$EVENT)(ctx, state2, "AtAt", AtAt$0);
|
|
15865
16246
|
}
|
|
15866
|
-
var Async$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16247
|
+
var Async$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L145, 'Async "async"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
15867
16248
|
return { $loc, token: $1, type: "Async" };
|
|
15868
16249
|
});
|
|
15869
16250
|
function Async(ctx, state2) {
|
|
15870
16251
|
return (0, import_lib4.$EVENT)(ctx, state2, "Async", Async$0);
|
|
15871
16252
|
}
|
|
15872
|
-
var Await$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16253
|
+
var Await$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L146, 'Await "await"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
15873
16254
|
return { $loc, token: $1, type: "Await" };
|
|
15874
16255
|
});
|
|
15875
16256
|
function Await(ctx, state2) {
|
|
15876
16257
|
return (0, import_lib4.$EVENT)(ctx, state2, "Await", Await$0);
|
|
15877
16258
|
}
|
|
15878
|
-
var Backtick$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16259
|
+
var Backtick$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L147, 'Backtick "`"'), function($skip, $loc, $0, $1) {
|
|
15879
16260
|
return { $loc, token: $1 };
|
|
15880
16261
|
});
|
|
15881
16262
|
function Backtick(ctx, state2) {
|
|
15882
16263
|
return (0, import_lib4.$EVENT)(ctx, state2, "Backtick", Backtick$0);
|
|
15883
16264
|
}
|
|
15884
|
-
var By$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16265
|
+
var By$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L148, 'By "by"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
15885
16266
|
return { $loc, token: $1 };
|
|
15886
16267
|
});
|
|
15887
16268
|
function By(ctx, state2) {
|
|
@@ -15893,19 +16274,19 @@ var Caret$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L22, 'Caret "^"'),
|
|
|
15893
16274
|
function Caret(ctx, state2) {
|
|
15894
16275
|
return (0, import_lib4.$EVENT)(ctx, state2, "Caret", Caret$0);
|
|
15895
16276
|
}
|
|
15896
|
-
var Case$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16277
|
+
var Case$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L149, 'Case "case"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
15897
16278
|
return { $loc, token: $1 };
|
|
15898
16279
|
});
|
|
15899
16280
|
function Case(ctx, state2) {
|
|
15900
16281
|
return (0, import_lib4.$EVENT)(ctx, state2, "Case", Case$0);
|
|
15901
16282
|
}
|
|
15902
|
-
var Catch$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16283
|
+
var Catch$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L150, 'Catch "catch"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
15903
16284
|
return { $loc, token: $1 };
|
|
15904
16285
|
});
|
|
15905
16286
|
function Catch(ctx, state2) {
|
|
15906
16287
|
return (0, import_lib4.$EVENT)(ctx, state2, "Catch", Catch$0);
|
|
15907
16288
|
}
|
|
15908
|
-
var Class$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16289
|
+
var Class$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L151, 'Class "class"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
15909
16290
|
return { $loc, token: $1 };
|
|
15910
16291
|
});
|
|
15911
16292
|
function Class(ctx, state2) {
|
|
@@ -15929,13 +16310,13 @@ var CloseBracket$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L46, 'CloseB
|
|
|
15929
16310
|
function CloseBracket(ctx, state2) {
|
|
15930
16311
|
return (0, import_lib4.$EVENT)(ctx, state2, "CloseBracket", CloseBracket$0);
|
|
15931
16312
|
}
|
|
15932
|
-
var CloseParen$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16313
|
+
var CloseParen$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L140, 'CloseParen ")"'), function($skip, $loc, $0, $1) {
|
|
15933
16314
|
return { $loc, token: $1 };
|
|
15934
16315
|
});
|
|
15935
16316
|
function CloseParen(ctx, state2) {
|
|
15936
16317
|
return (0, import_lib4.$EVENT)(ctx, state2, "CloseParen", CloseParen$0);
|
|
15937
16318
|
}
|
|
15938
|
-
var CoffeeSubstitutionStart$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16319
|
+
var CoffeeSubstitutionStart$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L152, 'CoffeeSubstitutionStart "#{"'), function($skip, $loc, $0, $1) {
|
|
15939
16320
|
return { $loc, token: "${" };
|
|
15940
16321
|
});
|
|
15941
16322
|
function CoffeeSubstitutionStart(ctx, state2) {
|
|
@@ -15953,37 +16334,37 @@ var Comma$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L17, 'Comma ","'),
|
|
|
15953
16334
|
function Comma(ctx, state2) {
|
|
15954
16335
|
return (0, import_lib4.$EVENT)(ctx, state2, "Comma", Comma$0);
|
|
15955
16336
|
}
|
|
15956
|
-
var Comptime$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16337
|
+
var Comptime$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L153, 'Comptime "comptime"'), NonIdContinue, (0, import_lib4.$N)((0, import_lib4.$EXPECT)($L16, 'Comptime ":"'))), function($skip, $loc, $0, $1, $2, $3) {
|
|
15957
16338
|
return { $loc, token: $1 };
|
|
15958
16339
|
});
|
|
15959
16340
|
function Comptime(ctx, state2) {
|
|
15960
16341
|
return (0, import_lib4.$EVENT)(ctx, state2, "Comptime", Comptime$0);
|
|
15961
16342
|
}
|
|
15962
|
-
var ConstructorShorthand$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16343
|
+
var ConstructorShorthand$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L143, 'ConstructorShorthand "@"'), function($skip, $loc, $0, $1) {
|
|
15963
16344
|
return { $loc, token: "constructor" };
|
|
15964
16345
|
});
|
|
15965
16346
|
function ConstructorShorthand(ctx, state2) {
|
|
15966
16347
|
return (0, import_lib4.$EVENT)(ctx, state2, "ConstructorShorthand", ConstructorShorthand$0);
|
|
15967
16348
|
}
|
|
15968
|
-
var Declare$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16349
|
+
var Declare$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L154, 'Declare "declare"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
15969
16350
|
return { $loc, token: $1 };
|
|
15970
16351
|
});
|
|
15971
16352
|
function Declare(ctx, state2) {
|
|
15972
16353
|
return (0, import_lib4.$EVENT)(ctx, state2, "Declare", Declare$0);
|
|
15973
16354
|
}
|
|
15974
|
-
var Default$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16355
|
+
var Default$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L155, 'Default "default"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
15975
16356
|
return { $loc, token: $1 };
|
|
15976
16357
|
});
|
|
15977
16358
|
function Default(ctx, state2) {
|
|
15978
16359
|
return (0, import_lib4.$EVENT)(ctx, state2, "Default", Default$0);
|
|
15979
16360
|
}
|
|
15980
|
-
var Delete$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16361
|
+
var Delete$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L156, 'Delete "delete"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
15981
16362
|
return { $loc, token: $1 };
|
|
15982
16363
|
});
|
|
15983
16364
|
function Delete(ctx, state2) {
|
|
15984
16365
|
return (0, import_lib4.$EVENT)(ctx, state2, "Delete", Delete$0);
|
|
15985
16366
|
}
|
|
15986
|
-
var Do$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16367
|
+
var Do$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L157, 'Do "do"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
15987
16368
|
return { $loc, token: $1 };
|
|
15988
16369
|
});
|
|
15989
16370
|
function Do(ctx, state2) {
|
|
@@ -16003,51 +16384,51 @@ var Dot$$ = [Dot$0, Dot$1];
|
|
|
16003
16384
|
function Dot(ctx, state2) {
|
|
16004
16385
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "Dot", Dot$$);
|
|
16005
16386
|
}
|
|
16006
|
-
var DotDot$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16387
|
+
var DotDot$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L158, 'DotDot ".."'), (0, import_lib4.$N)((0, import_lib4.$EXPECT)($L7, 'DotDot "."'))), function($skip, $loc, $0, $1, $2) {
|
|
16007
16388
|
return { $loc, token: $1 };
|
|
16008
16389
|
});
|
|
16009
|
-
var DotDot$1 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16390
|
+
var DotDot$1 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L159, 'DotDot "\u2025"'), function($skip, $loc, $0, $1) {
|
|
16010
16391
|
return { $loc, token: ".." };
|
|
16011
16392
|
});
|
|
16012
16393
|
var DotDot$$ = [DotDot$0, DotDot$1];
|
|
16013
16394
|
function DotDot(ctx, state2) {
|
|
16014
16395
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "DotDot", DotDot$$);
|
|
16015
16396
|
}
|
|
16016
|
-
var DotDotDot$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16397
|
+
var DotDotDot$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L160, 'DotDotDot "..."'), function($skip, $loc, $0, $1) {
|
|
16017
16398
|
return { $loc, token: $1 };
|
|
16018
16399
|
});
|
|
16019
|
-
var DotDotDot$1 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16400
|
+
var DotDotDot$1 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L161, 'DotDotDot "\u2026"'), function($skip, $loc, $0, $1) {
|
|
16020
16401
|
return { $loc, token: "..." };
|
|
16021
16402
|
});
|
|
16022
16403
|
var DotDotDot$$ = [DotDotDot$0, DotDotDot$1];
|
|
16023
16404
|
function DotDotDot(ctx, state2) {
|
|
16024
16405
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "DotDotDot", DotDotDot$$);
|
|
16025
16406
|
}
|
|
16026
|
-
var DoubleColon$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16407
|
+
var DoubleColon$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L162, 'DoubleColon "::"'), function($skip, $loc, $0, $1) {
|
|
16027
16408
|
return { $loc, token: $1 };
|
|
16028
16409
|
});
|
|
16029
16410
|
function DoubleColon(ctx, state2) {
|
|
16030
16411
|
return (0, import_lib4.$EVENT)(ctx, state2, "DoubleColon", DoubleColon$0);
|
|
16031
16412
|
}
|
|
16032
|
-
var DoubleColonAsColon$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16413
|
+
var DoubleColonAsColon$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L162, 'DoubleColonAsColon "::"'), function($skip, $loc, $0, $1) {
|
|
16033
16414
|
return { $loc, token: ":" };
|
|
16034
16415
|
});
|
|
16035
16416
|
function DoubleColonAsColon(ctx, state2) {
|
|
16036
16417
|
return (0, import_lib4.$EVENT)(ctx, state2, "DoubleColonAsColon", DoubleColonAsColon$0);
|
|
16037
16418
|
}
|
|
16038
|
-
var DoubleQuote$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16419
|
+
var DoubleQuote$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L163, 'DoubleQuote "\\\\\\""'), function($skip, $loc, $0, $1) {
|
|
16039
16420
|
return { $loc, token: $1 };
|
|
16040
16421
|
});
|
|
16041
16422
|
function DoubleQuote(ctx, state2) {
|
|
16042
16423
|
return (0, import_lib4.$EVENT)(ctx, state2, "DoubleQuote", DoubleQuote$0);
|
|
16043
16424
|
}
|
|
16044
|
-
var Each$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16425
|
+
var Each$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L164, 'Each "each"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16045
16426
|
return { $loc, token: $1 };
|
|
16046
16427
|
});
|
|
16047
16428
|
function Each(ctx, state2) {
|
|
16048
16429
|
return (0, import_lib4.$EVENT)(ctx, state2, "Each", Each$0);
|
|
16049
16430
|
}
|
|
16050
|
-
var Else$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16431
|
+
var Else$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L165, 'Else "else"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16051
16432
|
return { $loc, token: $1 };
|
|
16052
16433
|
});
|
|
16053
16434
|
function Else(ctx, state2) {
|
|
@@ -16059,61 +16440,61 @@ var Equals$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L3, 'Equals "="'),
|
|
|
16059
16440
|
function Equals(ctx, state2) {
|
|
16060
16441
|
return (0, import_lib4.$EVENT)(ctx, state2, "Equals", Equals$0);
|
|
16061
16442
|
}
|
|
16062
|
-
var ExclamationPoint$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16443
|
+
var ExclamationPoint$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L166, 'ExclamationPoint "!"'), function($skip, $loc, $0, $1) {
|
|
16063
16444
|
return { $loc, token: $1 };
|
|
16064
16445
|
});
|
|
16065
16446
|
function ExclamationPoint(ctx, state2) {
|
|
16066
16447
|
return (0, import_lib4.$EVENT)(ctx, state2, "ExclamationPoint", ExclamationPoint$0);
|
|
16067
16448
|
}
|
|
16068
|
-
var Export$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16449
|
+
var Export$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L167, 'Export "export"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16069
16450
|
return { $loc, token: $1 };
|
|
16070
16451
|
});
|
|
16071
16452
|
function Export(ctx, state2) {
|
|
16072
16453
|
return (0, import_lib4.$EVENT)(ctx, state2, "Export", Export$0);
|
|
16073
16454
|
}
|
|
16074
|
-
var Extends$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16455
|
+
var Extends$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L168, 'Extends "extends"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16075
16456
|
return { $loc, token: $1 };
|
|
16076
16457
|
});
|
|
16077
16458
|
function Extends(ctx, state2) {
|
|
16078
16459
|
return (0, import_lib4.$EVENT)(ctx, state2, "Extends", Extends$0);
|
|
16079
16460
|
}
|
|
16080
|
-
var Finally$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16461
|
+
var Finally$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L169, 'Finally "finally"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16081
16462
|
return { $loc, token: $1 };
|
|
16082
16463
|
});
|
|
16083
16464
|
function Finally(ctx, state2) {
|
|
16084
16465
|
return (0, import_lib4.$EVENT)(ctx, state2, "Finally", Finally$0);
|
|
16085
16466
|
}
|
|
16086
|
-
var For$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16467
|
+
var For$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L170, 'For "for"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16087
16468
|
return { $loc, token: $1 };
|
|
16088
16469
|
});
|
|
16089
16470
|
function For(ctx, state2) {
|
|
16090
16471
|
return (0, import_lib4.$EVENT)(ctx, state2, "For", For$0);
|
|
16091
16472
|
}
|
|
16092
|
-
var From$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16473
|
+
var From$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L171, 'From "from"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16093
16474
|
return { $loc, token: $1 };
|
|
16094
16475
|
});
|
|
16095
16476
|
function From(ctx, state2) {
|
|
16096
16477
|
return (0, import_lib4.$EVENT)(ctx, state2, "From", From$0);
|
|
16097
16478
|
}
|
|
16098
|
-
var Function$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16479
|
+
var Function$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L172, 'Function "function"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16099
16480
|
return { $loc, token: $1 };
|
|
16100
16481
|
});
|
|
16101
16482
|
function Function2(ctx, state2) {
|
|
16102
16483
|
return (0, import_lib4.$EVENT)(ctx, state2, "Function", Function$0);
|
|
16103
16484
|
}
|
|
16104
|
-
var GetOrSet$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($
|
|
16485
|
+
var GetOrSet$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L173, 'GetOrSet "get"'), (0, import_lib4.$EXPECT)($L174, 'GetOrSet "set"')), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16105
16486
|
return { $loc, token: $1, type: "GetOrSet" };
|
|
16106
16487
|
});
|
|
16107
16488
|
function GetOrSet(ctx, state2) {
|
|
16108
16489
|
return (0, import_lib4.$EVENT)(ctx, state2, "GetOrSet", GetOrSet$0);
|
|
16109
16490
|
}
|
|
16110
|
-
var Hash$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16491
|
+
var Hash$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L175, 'Hash "#"'), function($skip, $loc, $0, $1) {
|
|
16111
16492
|
return { $loc, token: $1 };
|
|
16112
16493
|
});
|
|
16113
16494
|
function Hash(ctx, state2) {
|
|
16114
16495
|
return (0, import_lib4.$EVENT)(ctx, state2, "Hash", Hash$0);
|
|
16115
16496
|
}
|
|
16116
|
-
var If$0 = (0, import_lib4.$TV)((0, import_lib4.$TEXT)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16497
|
+
var If$0 = (0, import_lib4.$TV)((0, import_lib4.$TEXT)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L176, 'If "if"'), NonIdContinue, (0, import_lib4.$E)((0, import_lib4.$EXPECT)($L18, 'If " "')))), function($skip, $loc, $0, $1) {
|
|
16117
16498
|
return { $loc, token: $1 };
|
|
16118
16499
|
});
|
|
16119
16500
|
function If(ctx, state2) {
|
|
@@ -16125,67 +16506,67 @@ var Import$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)
|
|
|
16125
16506
|
function Import(ctx, state2) {
|
|
16126
16507
|
return (0, import_lib4.$EVENT)(ctx, state2, "Import", Import$0);
|
|
16127
16508
|
}
|
|
16128
|
-
var In$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16509
|
+
var In$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L177, 'In "in"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16129
16510
|
return { $loc, token: $1 };
|
|
16130
16511
|
});
|
|
16131
16512
|
function In(ctx, state2) {
|
|
16132
16513
|
return (0, import_lib4.$EVENT)(ctx, state2, "In", In$0);
|
|
16133
16514
|
}
|
|
16134
|
-
var Infer$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16515
|
+
var Infer$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L178, 'Infer "infer"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16135
16516
|
return { $loc, token: $1 };
|
|
16136
16517
|
});
|
|
16137
16518
|
function Infer(ctx, state2) {
|
|
16138
16519
|
return (0, import_lib4.$EVENT)(ctx, state2, "Infer", Infer$0);
|
|
16139
16520
|
}
|
|
16140
|
-
var LetOrConst$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($
|
|
16521
|
+
var LetOrConst$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L179, 'LetOrConst "let"'), (0, import_lib4.$EXPECT)($L180, 'LetOrConst "const"')), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16141
16522
|
return { $loc, token: $1 };
|
|
16142
16523
|
});
|
|
16143
16524
|
function LetOrConst(ctx, state2) {
|
|
16144
16525
|
return (0, import_lib4.$EVENT)(ctx, state2, "LetOrConst", LetOrConst$0);
|
|
16145
16526
|
}
|
|
16146
|
-
var Const$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16527
|
+
var Const$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L180, 'Const "const"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16147
16528
|
return { $loc, token: $1 };
|
|
16148
16529
|
});
|
|
16149
16530
|
function Const(ctx, state2) {
|
|
16150
16531
|
return (0, import_lib4.$EVENT)(ctx, state2, "Const", Const$0);
|
|
16151
16532
|
}
|
|
16152
|
-
var Is$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16533
|
+
var Is$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L181, 'Is "is"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16153
16534
|
return { $loc, token: $1 };
|
|
16154
16535
|
});
|
|
16155
16536
|
function Is(ctx, state2) {
|
|
16156
16537
|
return (0, import_lib4.$EVENT)(ctx, state2, "Is", Is$0);
|
|
16157
16538
|
}
|
|
16158
|
-
var LetOrConstOrVar$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($
|
|
16539
|
+
var LetOrConstOrVar$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L179, 'LetOrConstOrVar "let"'), (0, import_lib4.$EXPECT)($L180, 'LetOrConstOrVar "const"'), (0, import_lib4.$EXPECT)($L182, 'LetOrConstOrVar "var"')), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16159
16540
|
return { $loc, token: $1 };
|
|
16160
16541
|
});
|
|
16161
16542
|
function LetOrConstOrVar(ctx, state2) {
|
|
16162
16543
|
return (0, import_lib4.$EVENT)(ctx, state2, "LetOrConstOrVar", LetOrConstOrVar$0);
|
|
16163
16544
|
}
|
|
16164
|
-
var Like$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16545
|
+
var Like$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L183, 'Like "like"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16165
16546
|
return { $loc, token: $1 };
|
|
16166
16547
|
});
|
|
16167
16548
|
function Like(ctx, state2) {
|
|
16168
16549
|
return (0, import_lib4.$EVENT)(ctx, state2, "Like", Like$0);
|
|
16169
16550
|
}
|
|
16170
|
-
var Loop$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16551
|
+
var Loop$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L184, 'Loop "loop"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16171
16552
|
return { $loc, token: "while" };
|
|
16172
16553
|
});
|
|
16173
16554
|
function Loop(ctx, state2) {
|
|
16174
16555
|
return (0, import_lib4.$EVENT)(ctx, state2, "Loop", Loop$0);
|
|
16175
16556
|
}
|
|
16176
|
-
var New$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16557
|
+
var New$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L185, 'New "new"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16177
16558
|
return { $loc, token: $1 };
|
|
16178
16559
|
});
|
|
16179
16560
|
function New(ctx, state2) {
|
|
16180
16561
|
return (0, import_lib4.$EVENT)(ctx, state2, "New", New$0);
|
|
16181
16562
|
}
|
|
16182
|
-
var Not$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16563
|
+
var Not$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L186, 'Not "not"'), NonIdContinue, (0, import_lib4.$N)((0, import_lib4.$S)((0, import_lib4.$E)(_), (0, import_lib4.$EXPECT)($L16, 'Not ":"')))), function($skip, $loc, $0, $1, $2, $3) {
|
|
16183
16564
|
return { $loc, token: "!" };
|
|
16184
16565
|
});
|
|
16185
16566
|
function Not(ctx, state2) {
|
|
16186
16567
|
return (0, import_lib4.$EVENT)(ctx, state2, "Not", Not$0);
|
|
16187
16568
|
}
|
|
16188
|
-
var Of$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16569
|
+
var Of$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L187, 'Of "of"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16189
16570
|
return { $loc, token: $1 };
|
|
16190
16571
|
});
|
|
16191
16572
|
function Of(ctx, state2) {
|
|
@@ -16203,7 +16584,7 @@ var OpenBrace$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L1, 'OpenBrace
|
|
|
16203
16584
|
function OpenBrace(ctx, state2) {
|
|
16204
16585
|
return (0, import_lib4.$EVENT)(ctx, state2, "OpenBrace", OpenBrace$0);
|
|
16205
16586
|
}
|
|
16206
|
-
var OpenBracket$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16587
|
+
var OpenBracket$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L188, 'OpenBracket "["'), function($skip, $loc, $0, $1) {
|
|
16207
16588
|
return { $loc, token: $1 };
|
|
16208
16589
|
});
|
|
16209
16590
|
function OpenBracket(ctx, state2) {
|
|
@@ -16215,49 +16596,49 @@ var OpenParen$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L4, 'OpenParen
|
|
|
16215
16596
|
function OpenParen(ctx, state2) {
|
|
16216
16597
|
return (0, import_lib4.$EVENT)(ctx, state2, "OpenParen", OpenParen$0);
|
|
16217
16598
|
}
|
|
16218
|
-
var Operator$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16599
|
+
var Operator$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L189, 'Operator "operator"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16219
16600
|
return { $loc, token: $1 };
|
|
16220
16601
|
});
|
|
16221
16602
|
function Operator(ctx, state2) {
|
|
16222
16603
|
return (0, import_lib4.$EVENT)(ctx, state2, "Operator", Operator$0);
|
|
16223
16604
|
}
|
|
16224
|
-
var Override$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16605
|
+
var Override$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L190, 'Override "override"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16225
16606
|
return { $loc, token: $1, ts: true };
|
|
16226
16607
|
});
|
|
16227
16608
|
function Override(ctx, state2) {
|
|
16228
16609
|
return (0, import_lib4.$EVENT)(ctx, state2, "Override", Override$0);
|
|
16229
16610
|
}
|
|
16230
|
-
var Own$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16611
|
+
var Own$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L191, 'Own "own"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16231
16612
|
return { $loc, token: $1 };
|
|
16232
16613
|
});
|
|
16233
16614
|
function Own(ctx, state2) {
|
|
16234
16615
|
return (0, import_lib4.$EVENT)(ctx, state2, "Own", Own$0);
|
|
16235
16616
|
}
|
|
16236
|
-
var Public$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16617
|
+
var Public$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L192, 'Public "public"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16237
16618
|
return { $loc, token: $1 };
|
|
16238
16619
|
});
|
|
16239
16620
|
function Public(ctx, state2) {
|
|
16240
16621
|
return (0, import_lib4.$EVENT)(ctx, state2, "Public", Public$0);
|
|
16241
16622
|
}
|
|
16242
|
-
var Private$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16623
|
+
var Private$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L193, 'Private "private"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16243
16624
|
return { $loc, token: $1 };
|
|
16244
16625
|
});
|
|
16245
16626
|
function Private(ctx, state2) {
|
|
16246
16627
|
return (0, import_lib4.$EVENT)(ctx, state2, "Private", Private$0);
|
|
16247
16628
|
}
|
|
16248
|
-
var Protected$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16629
|
+
var Protected$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L194, 'Protected "protected"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16249
16630
|
return { $loc, token: $1 };
|
|
16250
16631
|
});
|
|
16251
16632
|
function Protected(ctx, state2) {
|
|
16252
16633
|
return (0, import_lib4.$EVENT)(ctx, state2, "Protected", Protected$0);
|
|
16253
16634
|
}
|
|
16254
|
-
var Pipe$0 = (0, import_lib4.$TV)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($
|
|
16635
|
+
var Pipe$0 = (0, import_lib4.$TV)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L195, 'Pipe "||>"'), (0, import_lib4.$EXPECT)($L196, 'Pipe "|\u25B7"')), function($skip, $loc, $0, $1) {
|
|
16255
16636
|
return { $loc, token: "||>" };
|
|
16256
16637
|
});
|
|
16257
|
-
var Pipe$1 = (0, import_lib4.$TV)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($
|
|
16638
|
+
var Pipe$1 = (0, import_lib4.$TV)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L197, 'Pipe "|>="'), (0, import_lib4.$EXPECT)($L198, 'Pipe "\u25B7="')), function($skip, $loc, $0, $1) {
|
|
16258
16639
|
return { $loc, token: "|>=" };
|
|
16259
16640
|
});
|
|
16260
|
-
var Pipe$2 = (0, import_lib4.$TV)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($
|
|
16641
|
+
var Pipe$2 = (0, import_lib4.$TV)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L199, 'Pipe "|>"'), (0, import_lib4.$EXPECT)($L200, 'Pipe "\u25B7"')), function($skip, $loc, $0, $1) {
|
|
16261
16642
|
return { $loc, token: "|>" };
|
|
16262
16643
|
});
|
|
16263
16644
|
var Pipe$$ = [Pipe$0, Pipe$1, Pipe$2];
|
|
@@ -16270,19 +16651,19 @@ var QuestionMark$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L6, 'Questio
|
|
|
16270
16651
|
function QuestionMark(ctx, state2) {
|
|
16271
16652
|
return (0, import_lib4.$EVENT)(ctx, state2, "QuestionMark", QuestionMark$0);
|
|
16272
16653
|
}
|
|
16273
|
-
var Readonly$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16654
|
+
var Readonly$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L201, 'Readonly "readonly"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16274
16655
|
return { $loc, token: $1, ts: true };
|
|
16275
16656
|
});
|
|
16276
16657
|
function Readonly(ctx, state2) {
|
|
16277
16658
|
return (0, import_lib4.$EVENT)(ctx, state2, "Readonly", Readonly$0);
|
|
16278
16659
|
}
|
|
16279
|
-
var Return$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16660
|
+
var Return$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L202, 'Return "return"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16280
16661
|
return { $loc, token: $1 };
|
|
16281
16662
|
});
|
|
16282
16663
|
function Return(ctx, state2) {
|
|
16283
16664
|
return (0, import_lib4.$EVENT)(ctx, state2, "Return", Return$0);
|
|
16284
16665
|
}
|
|
16285
|
-
var Satisfies$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16666
|
+
var Satisfies$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L203, 'Satisfies "satisfies"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16286
16667
|
return { $loc, token: $1 };
|
|
16287
16668
|
});
|
|
16288
16669
|
function Satisfies(ctx, state2) {
|
|
@@ -16294,7 +16675,7 @@ var Semicolon$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L119, 'Semicolo
|
|
|
16294
16675
|
function Semicolon(ctx, state2) {
|
|
16295
16676
|
return (0, import_lib4.$EVENT)(ctx, state2, "Semicolon", Semicolon$0);
|
|
16296
16677
|
}
|
|
16297
|
-
var SingleQuote$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16678
|
+
var SingleQuote$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L204, `SingleQuote "'"`), function($skip, $loc, $0, $1) {
|
|
16298
16679
|
return { $loc, token: $1 };
|
|
16299
16680
|
});
|
|
16300
16681
|
function SingleQuote(ctx, state2) {
|
|
@@ -16306,149 +16687,149 @@ var Star$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L75, 'Star "*"'), fu
|
|
|
16306
16687
|
function Star(ctx, state2) {
|
|
16307
16688
|
return (0, import_lib4.$EVENT)(ctx, state2, "Star", Star$0);
|
|
16308
16689
|
}
|
|
16309
|
-
var Static$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16690
|
+
var Static$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L205, 'Static "static"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16310
16691
|
return { $loc, token: $1 };
|
|
16311
16692
|
});
|
|
16312
|
-
var Static$1 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16693
|
+
var Static$1 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L143, 'Static "@"'), (0, import_lib4.$N)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L4, 'Static "("'), (0, import_lib4.$EXPECT)($L143, 'Static "@"')))), function($skip, $loc, $0, $1, $2) {
|
|
16313
16694
|
return { $loc, token: "static " };
|
|
16314
16695
|
});
|
|
16315
16696
|
var Static$$ = [Static$0, Static$1];
|
|
16316
16697
|
function Static(ctx, state2) {
|
|
16317
16698
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "Static", Static$$);
|
|
16318
16699
|
}
|
|
16319
|
-
var SubstitutionStart$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16700
|
+
var SubstitutionStart$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L206, 'SubstitutionStart "${"'), function($skip, $loc, $0, $1) {
|
|
16320
16701
|
return { $loc, token: $1 };
|
|
16321
16702
|
});
|
|
16322
16703
|
function SubstitutionStart(ctx, state2) {
|
|
16323
16704
|
return (0, import_lib4.$EVENT)(ctx, state2, "SubstitutionStart", SubstitutionStart$0);
|
|
16324
16705
|
}
|
|
16325
|
-
var Super$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16706
|
+
var Super$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L207, 'Super "super"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16326
16707
|
return { $loc, token: $1 };
|
|
16327
16708
|
});
|
|
16328
16709
|
function Super(ctx, state2) {
|
|
16329
16710
|
return (0, import_lib4.$EVENT)(ctx, state2, "Super", Super$0);
|
|
16330
16711
|
}
|
|
16331
|
-
var Switch$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16712
|
+
var Switch$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L208, 'Switch "switch"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16332
16713
|
return { $loc, token: $1 };
|
|
16333
16714
|
});
|
|
16334
16715
|
function Switch(ctx, state2) {
|
|
16335
16716
|
return (0, import_lib4.$EVENT)(ctx, state2, "Switch", Switch$0);
|
|
16336
16717
|
}
|
|
16337
|
-
var Target$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16718
|
+
var Target$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L209, 'Target "target"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16338
16719
|
return { $loc, token: $1 };
|
|
16339
16720
|
});
|
|
16340
16721
|
function Target(ctx, state2) {
|
|
16341
16722
|
return (0, import_lib4.$EVENT)(ctx, state2, "Target", Target$0);
|
|
16342
16723
|
}
|
|
16343
|
-
var Then$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(__, (0, import_lib4.$EXPECT)($
|
|
16724
|
+
var Then$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(__, (0, import_lib4.$EXPECT)($L210, 'Then "then"'), NonIdContinue), function($skip, $loc, $0, $1, $2, $3) {
|
|
16344
16725
|
return { $loc, token: "" };
|
|
16345
16726
|
});
|
|
16346
16727
|
function Then(ctx, state2) {
|
|
16347
16728
|
return (0, import_lib4.$EVENT)(ctx, state2, "Then", Then$0);
|
|
16348
16729
|
}
|
|
16349
|
-
var This$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16730
|
+
var This$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L211, 'This "this"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16350
16731
|
return { $loc, token: $1 };
|
|
16351
16732
|
});
|
|
16352
16733
|
function This(ctx, state2) {
|
|
16353
16734
|
return (0, import_lib4.$EVENT)(ctx, state2, "This", This$0);
|
|
16354
16735
|
}
|
|
16355
|
-
var Throw$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16736
|
+
var Throw$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L212, 'Throw "throw"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16356
16737
|
return { $loc, token: $1 };
|
|
16357
16738
|
});
|
|
16358
16739
|
function Throw(ctx, state2) {
|
|
16359
16740
|
return (0, import_lib4.$EVENT)(ctx, state2, "Throw", Throw$0);
|
|
16360
16741
|
}
|
|
16361
|
-
var TripleDoubleQuote$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16742
|
+
var TripleDoubleQuote$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L213, 'TripleDoubleQuote "\\\\\\"\\\\\\"\\\\\\""'), function($skip, $loc, $0, $1) {
|
|
16362
16743
|
return { $loc, token: "`" };
|
|
16363
16744
|
});
|
|
16364
16745
|
function TripleDoubleQuote(ctx, state2) {
|
|
16365
16746
|
return (0, import_lib4.$EVENT)(ctx, state2, "TripleDoubleQuote", TripleDoubleQuote$0);
|
|
16366
16747
|
}
|
|
16367
|
-
var TripleSingleQuote$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16748
|
+
var TripleSingleQuote$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L214, `TripleSingleQuote "'''"`), function($skip, $loc, $0, $1) {
|
|
16368
16749
|
return { $loc, token: "`" };
|
|
16369
16750
|
});
|
|
16370
16751
|
function TripleSingleQuote(ctx, state2) {
|
|
16371
16752
|
return (0, import_lib4.$EVENT)(ctx, state2, "TripleSingleQuote", TripleSingleQuote$0);
|
|
16372
16753
|
}
|
|
16373
|
-
var TripleSlash$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16754
|
+
var TripleSlash$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L215, 'TripleSlash "///"'), function($skip, $loc, $0, $1) {
|
|
16374
16755
|
return { $loc, token: "/" };
|
|
16375
16756
|
});
|
|
16376
16757
|
function TripleSlash(ctx, state2) {
|
|
16377
16758
|
return (0, import_lib4.$EVENT)(ctx, state2, "TripleSlash", TripleSlash$0);
|
|
16378
16759
|
}
|
|
16379
|
-
var TripleTick$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16760
|
+
var TripleTick$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L216, 'TripleTick "```"'), function($skip, $loc, $0, $1) {
|
|
16380
16761
|
return { $loc, token: "`" };
|
|
16381
16762
|
});
|
|
16382
16763
|
function TripleTick(ctx, state2) {
|
|
16383
16764
|
return (0, import_lib4.$EVENT)(ctx, state2, "TripleTick", TripleTick$0);
|
|
16384
16765
|
}
|
|
16385
|
-
var Try$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16766
|
+
var Try$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L217, 'Try "try"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16386
16767
|
return { $loc, token: $1 };
|
|
16387
16768
|
});
|
|
16388
16769
|
function Try(ctx, state2) {
|
|
16389
16770
|
return (0, import_lib4.$EVENT)(ctx, state2, "Try", Try$0);
|
|
16390
16771
|
}
|
|
16391
|
-
var Typeof$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16772
|
+
var Typeof$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L218, 'Typeof "typeof"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16392
16773
|
return { $loc, token: $1 };
|
|
16393
16774
|
});
|
|
16394
16775
|
function Typeof(ctx, state2) {
|
|
16395
16776
|
return (0, import_lib4.$EVENT)(ctx, state2, "Typeof", Typeof$0);
|
|
16396
16777
|
}
|
|
16397
|
-
var Undefined$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16778
|
+
var Undefined$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L219, 'Undefined "undefined"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16398
16779
|
return { $loc, token: $1 };
|
|
16399
16780
|
});
|
|
16400
16781
|
function Undefined(ctx, state2) {
|
|
16401
16782
|
return (0, import_lib4.$EVENT)(ctx, state2, "Undefined", Undefined$0);
|
|
16402
16783
|
}
|
|
16403
|
-
var Unless$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16784
|
+
var Unless$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L220, 'Unless "unless"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16404
16785
|
return { $loc, token: $1, negated: true };
|
|
16405
16786
|
});
|
|
16406
16787
|
function Unless(ctx, state2) {
|
|
16407
16788
|
return (0, import_lib4.$EVENT)(ctx, state2, "Unless", Unless$0);
|
|
16408
16789
|
}
|
|
16409
|
-
var Until$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16790
|
+
var Until$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L221, 'Until "until"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16410
16791
|
return { $loc, token: $1, negated: true };
|
|
16411
16792
|
});
|
|
16412
16793
|
function Until(ctx, state2) {
|
|
16413
16794
|
return (0, import_lib4.$EVENT)(ctx, state2, "Until", Until$0);
|
|
16414
16795
|
}
|
|
16415
|
-
var Using$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16796
|
+
var Using$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L222, 'Using "using"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16416
16797
|
return { $loc, token: $1 };
|
|
16417
16798
|
});
|
|
16418
16799
|
function Using(ctx, state2) {
|
|
16419
16800
|
return (0, import_lib4.$EVENT)(ctx, state2, "Using", Using$0);
|
|
16420
16801
|
}
|
|
16421
|
-
var Var$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16802
|
+
var Var$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L182, 'Var "var"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16422
16803
|
return { $loc, token: $1 };
|
|
16423
16804
|
});
|
|
16424
16805
|
function Var(ctx, state2) {
|
|
16425
16806
|
return (0, import_lib4.$EVENT)(ctx, state2, "Var", Var$0);
|
|
16426
16807
|
}
|
|
16427
|
-
var Void$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16808
|
+
var Void$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L223, 'Void "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16428
16809
|
return { $loc, token: $1 };
|
|
16429
16810
|
});
|
|
16430
16811
|
function Void(ctx, state2) {
|
|
16431
16812
|
return (0, import_lib4.$EVENT)(ctx, state2, "Void", Void$0);
|
|
16432
16813
|
}
|
|
16433
|
-
var When$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16814
|
+
var When$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L224, 'When "when"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16434
16815
|
return { $loc, token: "case" };
|
|
16435
16816
|
});
|
|
16436
16817
|
function When(ctx, state2) {
|
|
16437
16818
|
return (0, import_lib4.$EVENT)(ctx, state2, "When", When$0);
|
|
16438
16819
|
}
|
|
16439
|
-
var While$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16820
|
+
var While$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L225, 'While "while"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16440
16821
|
return { $loc, token: $1 };
|
|
16441
16822
|
});
|
|
16442
16823
|
function While(ctx, state2) {
|
|
16443
16824
|
return (0, import_lib4.$EVENT)(ctx, state2, "While", While$0);
|
|
16444
16825
|
}
|
|
16445
|
-
var With$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16826
|
+
var With$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L131, 'With "with"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16446
16827
|
return { $loc, token: $1 };
|
|
16447
16828
|
});
|
|
16448
16829
|
function With(ctx, state2) {
|
|
16449
16830
|
return (0, import_lib4.$EVENT)(ctx, state2, "With", With$0);
|
|
16450
16831
|
}
|
|
16451
|
-
var Yield$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16832
|
+
var Yield$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L226, 'Yield "yield"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16452
16833
|
return { $loc, token: $1, type: "Yield" };
|
|
16453
16834
|
});
|
|
16454
16835
|
function Yield(ctx, state2) {
|
|
@@ -16467,7 +16848,7 @@ var JSXImplicitFragment$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(JSXTag, (0,
|
|
|
16467
16848
|
],
|
|
16468
16849
|
jsxChildren: [$1].concat($2.map(([, tag]) => tag))
|
|
16469
16850
|
};
|
|
16470
|
-
const type = typeOfJSX(jsx, config
|
|
16851
|
+
const type = typeOfJSX(jsx, config);
|
|
16471
16852
|
return type ? [
|
|
16472
16853
|
{ ts: true, children: ["("] },
|
|
16473
16854
|
jsx,
|
|
@@ -16527,7 +16908,7 @@ var JSXElement$$ = [JSXElement$0, JSXElement$1, JSXElement$2];
|
|
|
16527
16908
|
function JSXElement(ctx, state2) {
|
|
16528
16909
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "JSXElement", JSXElement$$);
|
|
16529
16910
|
}
|
|
16530
|
-
var JSXSelfClosingElement$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L19, 'JSXSelfClosingElement "<"'), JSXElementName, (0, import_lib4.$E)(TypeArguments), (0, import_lib4.$E)(JSXAttributes), (0, import_lib4.$E)(Whitespace), (0, import_lib4.$EXPECT)($
|
|
16911
|
+
var JSXSelfClosingElement$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L19, 'JSXSelfClosingElement "<"'), JSXElementName, (0, import_lib4.$E)(TypeArguments), (0, import_lib4.$E)(JSXAttributes), (0, import_lib4.$E)(Whitespace), (0, import_lib4.$EXPECT)($L227, 'JSXSelfClosingElement "/>"')), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
16531
16912
|
return { type: "JSXElement", children: $0, tag: $2 };
|
|
16532
16913
|
});
|
|
16533
16914
|
function JSXSelfClosingElement(ctx, state2) {
|
|
@@ -16561,7 +16942,7 @@ var JSXOptionalClosingElement$$ = [JSXOptionalClosingElement$0, JSXOptionalClosi
|
|
|
16561
16942
|
function JSXOptionalClosingElement(ctx, state2) {
|
|
16562
16943
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "JSXOptionalClosingElement", JSXOptionalClosingElement$$);
|
|
16563
16944
|
}
|
|
16564
|
-
var JSXClosingElement$0 = (0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16945
|
+
var JSXClosingElement$0 = (0, import_lib4.$S)((0, import_lib4.$EXPECT)($L228, 'JSXClosingElement "</"'), (0, import_lib4.$E)(Whitespace), JSXElementName, (0, import_lib4.$E)(Whitespace), (0, import_lib4.$EXPECT)($L45, 'JSXClosingElement ">"'));
|
|
16565
16946
|
function JSXClosingElement(ctx, state2) {
|
|
16566
16947
|
return (0, import_lib4.$EVENT)(ctx, state2, "JSXClosingElement", JSXClosingElement$0);
|
|
16567
16948
|
}
|
|
@@ -16582,7 +16963,7 @@ var JSXFragment$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$N)
|
|
|
16582
16963
|
];
|
|
16583
16964
|
return { type: "JSXFragment", children: parts, jsxChildren: children.jsxChildren };
|
|
16584
16965
|
});
|
|
16585
|
-
var JSXFragment$1 = (0, import_lib4.$TS)((0, import_lib4.$S)(CoffeeJSXEnabled, (0, import_lib4.$EXPECT)($
|
|
16966
|
+
var JSXFragment$1 = (0, import_lib4.$TS)((0, import_lib4.$S)(CoffeeJSXEnabled, (0, import_lib4.$EXPECT)($L229, 'JSXFragment "<>"'), (0, import_lib4.$E)(JSXChildren), (0, import_lib4.$E)(Whitespace), JSXClosingFragment), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
16586
16967
|
var children = $3;
|
|
16587
16968
|
$0 = $0.slice(1);
|
|
16588
16969
|
return {
|
|
@@ -16595,7 +16976,7 @@ var JSXFragment$$ = [JSXFragment$0, JSXFragment$1];
|
|
|
16595
16976
|
function JSXFragment(ctx, state2) {
|
|
16596
16977
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "JSXFragment", JSXFragment$$);
|
|
16597
16978
|
}
|
|
16598
|
-
var PushJSXOpeningFragment$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16979
|
+
var PushJSXOpeningFragment$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L229, 'PushJSXOpeningFragment "<>"'), function($skip, $loc, $0, $1) {
|
|
16599
16980
|
state.JSXTagStack.push("");
|
|
16600
16981
|
return $1;
|
|
16601
16982
|
});
|
|
@@ -16612,11 +16993,11 @@ var JSXOptionalClosingFragment$$ = [JSXOptionalClosingFragment$0, JSXOptionalClo
|
|
|
16612
16993
|
function JSXOptionalClosingFragment(ctx, state2) {
|
|
16613
16994
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "JSXOptionalClosingFragment", JSXOptionalClosingFragment$$);
|
|
16614
16995
|
}
|
|
16615
|
-
var JSXClosingFragment$0 = (0, import_lib4.$EXPECT)($
|
|
16996
|
+
var JSXClosingFragment$0 = (0, import_lib4.$EXPECT)($L230, 'JSXClosingFragment "</>"');
|
|
16616
16997
|
function JSXClosingFragment(ctx, state2) {
|
|
16617
16998
|
return (0, import_lib4.$EVENT)(ctx, state2, "JSXClosingFragment", JSXClosingFragment$0);
|
|
16618
16999
|
}
|
|
16619
|
-
var JSXElementName$0 = (0, import_lib4.$TV)((0, import_lib4.$Y)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($
|
|
17000
|
+
var JSXElementName$0 = (0, import_lib4.$TV)((0, import_lib4.$Y)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L175, 'JSXElementName "#"'), Dot), JSXShorthandString)), function($skip, $loc, $0, $1) {
|
|
16620
17001
|
return config.defaultElement;
|
|
16621
17002
|
});
|
|
16622
17003
|
var JSXElementName$1 = (0, import_lib4.$TEXT)((0, import_lib4.$S)(JSXIdentifierName, (0, import_lib4.$C)((0, import_lib4.$S)(Colon, JSXIdentifierName), (0, import_lib4.$Q)((0, import_lib4.$S)(Dot, JSXIdentifierName)))));
|
|
@@ -16794,7 +17175,7 @@ var JSXAttribute$4 = (0, import_lib4.$TS)((0, import_lib4.$S)(Identifier, (0, im
|
|
|
16794
17175
|
}
|
|
16795
17176
|
return $skip;
|
|
16796
17177
|
});
|
|
16797
|
-
var JSXAttribute$5 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
17178
|
+
var JSXAttribute$5 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L175, 'JSXAttribute "#"'), JSXShorthandString), function($skip, $loc, $0, $1, $2) {
|
|
16798
17179
|
return [" ", "id=", $2];
|
|
16799
17180
|
});
|
|
16800
17181
|
var JSXAttribute$6 = (0, import_lib4.$TS)((0, import_lib4.$S)(Dot, JSXShorthandString), function($skip, $loc, $0, $1, $2) {
|
|
@@ -17139,7 +17520,7 @@ var JSXChildGeneral$$ = [JSXChildGeneral$0, JSXChildGeneral$1, JSXChildGeneral$2
|
|
|
17139
17520
|
function JSXChildGeneral(ctx, state2) {
|
|
17140
17521
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "JSXChildGeneral", JSXChildGeneral$$);
|
|
17141
17522
|
}
|
|
17142
|
-
var JSXComment$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
17523
|
+
var JSXComment$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L231, 'JSXComment "<!--"'), JSXCommentContent, (0, import_lib4.$EXPECT)($L232, 'JSXComment "-->"')), function($skip, $loc, $0, $1, $2, $3) {
|
|
17143
17524
|
return ["{/*", $2, "*/}"];
|
|
17144
17525
|
});
|
|
17145
17526
|
function JSXComment(ctx, state2) {
|
|
@@ -17427,37 +17808,37 @@ var InterfaceExtendsTarget$0 = ImplementsTarget;
|
|
|
17427
17808
|
function InterfaceExtendsTarget(ctx, state2) {
|
|
17428
17809
|
return (0, import_lib4.$EVENT)(ctx, state2, "InterfaceExtendsTarget", InterfaceExtendsTarget$0);
|
|
17429
17810
|
}
|
|
17430
|
-
var TypeKeyword$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
17811
|
+
var TypeKeyword$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L233, 'TypeKeyword "type"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
17431
17812
|
return { $loc, token: $1 };
|
|
17432
17813
|
});
|
|
17433
17814
|
function TypeKeyword(ctx, state2) {
|
|
17434
17815
|
return (0, import_lib4.$EVENT)(ctx, state2, "TypeKeyword", TypeKeyword$0);
|
|
17435
17816
|
}
|
|
17436
|
-
var Enum$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
17817
|
+
var Enum$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L234, 'Enum "enum"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
17437
17818
|
return { $loc, token: $1 };
|
|
17438
17819
|
});
|
|
17439
17820
|
function Enum(ctx, state2) {
|
|
17440
17821
|
return (0, import_lib4.$EVENT)(ctx, state2, "Enum", Enum$0);
|
|
17441
17822
|
}
|
|
17442
|
-
var Interface$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
17823
|
+
var Interface$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L235, 'Interface "interface"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
17443
17824
|
return { $loc, token: $1 };
|
|
17444
17825
|
});
|
|
17445
17826
|
function Interface(ctx, state2) {
|
|
17446
17827
|
return (0, import_lib4.$EVENT)(ctx, state2, "Interface", Interface$0);
|
|
17447
17828
|
}
|
|
17448
|
-
var Global$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
17829
|
+
var Global$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L236, 'Global "global"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
17449
17830
|
return { $loc, token: $1 };
|
|
17450
17831
|
});
|
|
17451
17832
|
function Global(ctx, state2) {
|
|
17452
17833
|
return (0, import_lib4.$EVENT)(ctx, state2, "Global", Global$0);
|
|
17453
17834
|
}
|
|
17454
|
-
var Module$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
17835
|
+
var Module$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L237, 'Module "module"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
17455
17836
|
return { $loc, token: $1 };
|
|
17456
17837
|
});
|
|
17457
17838
|
function Module(ctx, state2) {
|
|
17458
17839
|
return (0, import_lib4.$EVENT)(ctx, state2, "Module", Module$0);
|
|
17459
17840
|
}
|
|
17460
|
-
var Namespace$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
17841
|
+
var Namespace$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L238, 'Namespace "namespace"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
17461
17842
|
return { $loc, token: $1 };
|
|
17462
17843
|
});
|
|
17463
17844
|
function Namespace(ctx, state2) {
|
|
@@ -17771,14 +18152,14 @@ var ReturnTypeSuffix$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib
|
|
|
17771
18152
|
function ReturnTypeSuffix(ctx, state2) {
|
|
17772
18153
|
return (0, import_lib4.$EVENT)(ctx, state2, "ReturnTypeSuffix", ReturnTypeSuffix$0);
|
|
17773
18154
|
}
|
|
17774
|
-
var ReturnType$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)((0, import_lib4.$S)(__, (0, import_lib4.$EXPECT)($
|
|
18155
|
+
var ReturnType$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)((0, import_lib4.$S)(__, (0, import_lib4.$EXPECT)($L239, 'ReturnType "asserts"'), NonIdContinue)), ForbidIndentedApplication, (0, import_lib4.$E)(TypePredicate), RestoreIndentedApplication), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
17775
18156
|
var asserts = $1;
|
|
17776
18157
|
var t = $3;
|
|
17777
18158
|
if (!t)
|
|
17778
18159
|
return $skip;
|
|
17779
18160
|
if (asserts) {
|
|
17780
18161
|
t = {
|
|
17781
|
-
type: "
|
|
18162
|
+
type: "TypeAsserts",
|
|
17782
18163
|
t,
|
|
17783
18164
|
children: [asserts[0], asserts[1], t],
|
|
17784
18165
|
ts: true
|
|
@@ -17872,8 +18253,8 @@ var TypeUnarySuffix$$ = [TypeUnarySuffix$0, TypeUnarySuffix$1, TypeUnarySuffix$2
|
|
|
17872
18253
|
function TypeUnarySuffix(ctx, state2) {
|
|
17873
18254
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "TypeUnarySuffix", TypeUnarySuffix$$);
|
|
17874
18255
|
}
|
|
17875
|
-
var TypeUnaryOp$0 = (0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
17876
|
-
var TypeUnaryOp$1 = (0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
18256
|
+
var TypeUnaryOp$0 = (0, import_lib4.$S)((0, import_lib4.$EXPECT)($L240, 'TypeUnaryOp "keyof"'), NonIdContinue);
|
|
18257
|
+
var TypeUnaryOp$1 = (0, import_lib4.$S)((0, import_lib4.$EXPECT)($L201, 'TypeUnaryOp "readonly"'), NonIdContinue);
|
|
17877
18258
|
var TypeUnaryOp$$ = [TypeUnaryOp$0, TypeUnaryOp$1];
|
|
17878
18259
|
function TypeUnaryOp(ctx, state2) {
|
|
17879
18260
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "TypeUnaryOp", TypeUnaryOp$$);
|
|
@@ -17903,7 +18284,7 @@ var TypeIndexedAccess$$ = [TypeIndexedAccess$0, TypeIndexedAccess$1, TypeIndexed
|
|
|
17903
18284
|
function TypeIndexedAccess(ctx, state2) {
|
|
17904
18285
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "TypeIndexedAccess", TypeIndexedAccess$$);
|
|
17905
18286
|
}
|
|
17906
|
-
var UnknownAlias$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
18287
|
+
var UnknownAlias$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L241, 'UnknownAlias "???"'), function($skip, $loc, $0, $1) {
|
|
17907
18288
|
return { $loc, token: "unknown" };
|
|
17908
18289
|
});
|
|
17909
18290
|
function UnknownAlias(ctx, state2) {
|
|
@@ -17974,12 +18355,17 @@ var ImportType$$ = [ImportType$0, ImportType$1];
|
|
|
17974
18355
|
function ImportType(ctx, state2) {
|
|
17975
18356
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "ImportType", ImportType$$);
|
|
17976
18357
|
}
|
|
17977
|
-
var TypeTuple$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(OpenBracket, AllowAll, (0, import_lib4.$E)(
|
|
17978
|
-
|
|
18358
|
+
var TypeTuple$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(OpenBracket, AllowAll, (0, import_lib4.$E)(TypeTupleContent), RestoreAll, __, CloseBracket), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
18359
|
+
var open = $1;
|
|
18360
|
+
var elements = $3;
|
|
18361
|
+
var ws = $5;
|
|
18362
|
+
var close = $6;
|
|
18363
|
+
if (!elements)
|
|
17979
18364
|
return $skip;
|
|
17980
18365
|
return {
|
|
17981
18366
|
type: "TypeTuple",
|
|
17982
|
-
|
|
18367
|
+
elements,
|
|
18368
|
+
children: [open, elements, ws, close]
|
|
17983
18369
|
};
|
|
17984
18370
|
});
|
|
17985
18371
|
function TypeTuple(ctx, state2) {
|
|
@@ -18041,19 +18427,28 @@ var TypeElement$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(__, (0, import_lib4
|
|
|
18041
18427
|
message: "... both before and after identifier"
|
|
18042
18428
|
}];
|
|
18043
18429
|
}
|
|
18044
|
-
return
|
|
18430
|
+
return {
|
|
18431
|
+
type: "TypeElement",
|
|
18432
|
+
name,
|
|
18433
|
+
t: type,
|
|
18434
|
+
children: [ws, dots, name, colon, type]
|
|
18435
|
+
};
|
|
18045
18436
|
});
|
|
18046
18437
|
var TypeElement$1 = (0, import_lib4.$S)(__, DotDotDot, __, Type);
|
|
18047
18438
|
var TypeElement$2 = (0, import_lib4.$TS)((0, import_lib4.$S)(Type, (0, import_lib4.$E)((0, import_lib4.$S)((0, import_lib4.$E)(_), DotDotDot))), function($skip, $loc, $0, $1, $2) {
|
|
18048
18439
|
var type = $1;
|
|
18049
18440
|
var spaceDots = $2;
|
|
18050
|
-
if (
|
|
18051
|
-
|
|
18052
|
-
|
|
18053
|
-
|
|
18054
|
-
|
|
18055
|
-
|
|
18056
|
-
return
|
|
18441
|
+
if (spaceDots) {
|
|
18442
|
+
const [space, dots] = spaceDots;
|
|
18443
|
+
const ws = getTrimmingSpace(type);
|
|
18444
|
+
spaceDots = [ws, dots, space];
|
|
18445
|
+
type = trimFirstSpace(type);
|
|
18446
|
+
}
|
|
18447
|
+
return {
|
|
18448
|
+
type: "TypeElement",
|
|
18449
|
+
t: type,
|
|
18450
|
+
children: [spaceDots, type]
|
|
18451
|
+
};
|
|
18057
18452
|
});
|
|
18058
18453
|
var TypeElement$$ = [TypeElement$0, TypeElement$1, TypeElement$2];
|
|
18059
18454
|
function TypeElement(ctx, state2) {
|
|
@@ -18282,13 +18677,13 @@ var TypeLiteral$2 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EX
|
|
|
18282
18677
|
return num;
|
|
18283
18678
|
return $0;
|
|
18284
18679
|
});
|
|
18285
|
-
var TypeLiteral$3 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
18680
|
+
var TypeLiteral$3 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L223, 'TypeLiteral "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
18286
18681
|
return { type: "VoidType", $loc, token: $1 };
|
|
18287
18682
|
});
|
|
18288
|
-
var TypeLiteral$4 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
18683
|
+
var TypeLiteral$4 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L242, 'TypeLiteral "unique"'), _, (0, import_lib4.$EXPECT)($L243, 'TypeLiteral "symbol"'), NonIdContinue), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
18289
18684
|
return { type: "UniqueSymbolType", children: $0 };
|
|
18290
18685
|
});
|
|
18291
|
-
var TypeLiteral$5 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
18686
|
+
var TypeLiteral$5 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L244, 'TypeLiteral "[]"'), function($skip, $loc, $0, $1) {
|
|
18292
18687
|
return { $loc, token: "[]" };
|
|
18293
18688
|
});
|
|
18294
18689
|
var TypeLiteral$$ = [TypeLiteral$0, TypeLiteral$1, TypeLiteral$2, TypeLiteral$3, TypeLiteral$4, TypeLiteral$5];
|
|
@@ -18307,7 +18702,7 @@ var InlineInterfacePropertyDelimiter$0 = (0, import_lib4.$C)((0, import_lib4.$S)
|
|
|
18307
18702
|
var InlineInterfacePropertyDelimiter$1 = (0, import_lib4.$T)((0, import_lib4.$S)((0, import_lib4.$Y)((0, import_lib4.$S)(SameLineOrIndentedFurther, InlineBasicInterfaceProperty)), InsertComma), function(value) {
|
|
18308
18703
|
return value[1];
|
|
18309
18704
|
});
|
|
18310
|
-
var InlineInterfacePropertyDelimiter$2 = (0, import_lib4.$Y)((0, import_lib4.$S)(__, (0, import_lib4.$C)((0, import_lib4.$EXPECT)($L16, 'InlineInterfacePropertyDelimiter ":"'), (0, import_lib4.$EXPECT)($
|
|
18705
|
+
var InlineInterfacePropertyDelimiter$2 = (0, import_lib4.$Y)((0, import_lib4.$S)(__, (0, import_lib4.$C)((0, import_lib4.$EXPECT)($L16, 'InlineInterfacePropertyDelimiter ":"'), (0, import_lib4.$EXPECT)($L140, 'InlineInterfacePropertyDelimiter ")"'), (0, import_lib4.$EXPECT)($L46, 'InlineInterfacePropertyDelimiter "]"'), (0, import_lib4.$EXPECT)($L37, 'InlineInterfacePropertyDelimiter "}"'))));
|
|
18311
18706
|
var InlineInterfacePropertyDelimiter$3 = (0, import_lib4.$Y)(EOS);
|
|
18312
18707
|
var InlineInterfacePropertyDelimiter$$ = [InlineInterfacePropertyDelimiter$0, InlineInterfacePropertyDelimiter$1, InlineInterfacePropertyDelimiter$2, InlineInterfacePropertyDelimiter$3];
|
|
18313
18708
|
function InlineInterfacePropertyDelimiter(ctx, state2) {
|
|
@@ -18323,31 +18718,54 @@ var TypeBinaryOp$$ = [TypeBinaryOp$0, TypeBinaryOp$1];
|
|
|
18323
18718
|
function TypeBinaryOp(ctx, state2) {
|
|
18324
18719
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "TypeBinaryOp", TypeBinaryOp$$);
|
|
18325
18720
|
}
|
|
18326
|
-
var TypeFunction$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)((0, import_lib4.$S)(Abstract, (0, import_lib4.$E)(_))), (0, import_lib4.$E)((0, import_lib4.$S)(New, (0, import_lib4.$E)(_))), Parameters, __,
|
|
18327
|
-
var
|
|
18328
|
-
|
|
18329
|
-
|
|
18721
|
+
var TypeFunction$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)((0, import_lib4.$S)(Abstract, (0, import_lib4.$E)(_))), (0, import_lib4.$E)((0, import_lib4.$S)(Async, (0, import_lib4.$E)(_))), (0, import_lib4.$E)((0, import_lib4.$S)(New, (0, import_lib4.$E)(_))), Parameters, __, TypeFunctionArrow, (0, import_lib4.$C)(ReturnType, Loc)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
|
|
18722
|
+
var abstract = $1;
|
|
18723
|
+
var async = $2;
|
|
18724
|
+
var new_ = $3;
|
|
18725
|
+
var returnType = $7;
|
|
18726
|
+
const children = [abstract, ...$0.slice(2)];
|
|
18727
|
+
if (abstract && !new_) {
|
|
18330
18728
|
children[1] = {
|
|
18331
18729
|
type: "Error",
|
|
18332
18730
|
message: "abstract function types must be constructors (abstract new)"
|
|
18333
18731
|
};
|
|
18334
18732
|
}
|
|
18335
|
-
if (
|
|
18336
|
-
|
|
18733
|
+
if (returnType.$loc && returnType.token === "") {
|
|
18734
|
+
const t = {
|
|
18735
|
+
type: "VoidType",
|
|
18736
|
+
$loc: returnType.$loc,
|
|
18737
|
+
token: "void"
|
|
18738
|
+
};
|
|
18739
|
+
children[children.length - 1] = returnType = {
|
|
18740
|
+
type: "ReturnTypeAnnotation",
|
|
18741
|
+
ts: true,
|
|
18742
|
+
t,
|
|
18743
|
+
children: [t]
|
|
18744
|
+
};
|
|
18745
|
+
}
|
|
18746
|
+
if (async) {
|
|
18747
|
+
const t = wrapTypeInPromise(returnType.t);
|
|
18748
|
+
children[children.length - 1] = returnType = {
|
|
18749
|
+
...returnType,
|
|
18750
|
+
t,
|
|
18751
|
+
children: returnType.children.map(($) => $ === returnType.t ? t : $)
|
|
18752
|
+
};
|
|
18753
|
+
}
|
|
18337
18754
|
return {
|
|
18338
18755
|
type: "TypeFunction",
|
|
18339
18756
|
children,
|
|
18340
|
-
ts: true
|
|
18757
|
+
ts: true,
|
|
18758
|
+
returnType
|
|
18341
18759
|
};
|
|
18342
18760
|
});
|
|
18343
18761
|
function TypeFunction(ctx, state2) {
|
|
18344
18762
|
return (0, import_lib4.$EVENT)(ctx, state2, "TypeFunction", TypeFunction$0);
|
|
18345
18763
|
}
|
|
18346
|
-
var
|
|
18764
|
+
var TypeFunctionArrow$0 = (0, import_lib4.$TV)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L13, 'TypeFunctionArrow "=>"'), (0, import_lib4.$EXPECT)($L14, 'TypeFunctionArrow "\u21D2"'), (0, import_lib4.$EXPECT)($L35, 'TypeFunctionArrow "->"'), (0, import_lib4.$EXPECT)($L36, 'TypeFunctionArrow "\u2192"')), function($skip, $loc, $0, $1) {
|
|
18347
18765
|
return { $loc, token: "=>" };
|
|
18348
18766
|
});
|
|
18349
|
-
function
|
|
18350
|
-
return (0, import_lib4.$EVENT)(ctx, state2, "
|
|
18767
|
+
function TypeFunctionArrow(ctx, state2) {
|
|
18768
|
+
return (0, import_lib4.$EVENT)(ctx, state2, "TypeFunctionArrow", TypeFunctionArrow$0);
|
|
18351
18769
|
}
|
|
18352
18770
|
var TypeArguments$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(OpenAngleBracket, (0, import_lib4.$P)((0, import_lib4.$S)(__, TypeArgumentDelimited)), __, CloseAngleBracket), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
18353
18771
|
var args = $2;
|
|
@@ -18523,7 +18941,7 @@ var CivetPrologue$$ = [CivetPrologue$0, CivetPrologue$1];
|
|
|
18523
18941
|
function CivetPrologue(ctx, state2) {
|
|
18524
18942
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "CivetPrologue", CivetPrologue$$);
|
|
18525
18943
|
}
|
|
18526
|
-
var CivetPrologueContent$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
18944
|
+
var CivetPrologueContent$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L245, 'CivetPrologueContent "civet"'), NonIdContinue, (0, import_lib4.$Q)(CivetOption), (0, import_lib4.$EXPECT)($R95, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
18527
18945
|
var options = $3;
|
|
18528
18946
|
return {
|
|
18529
18947
|
type: "CivetPrologue",
|
|
@@ -18548,6 +18966,7 @@ var CivetOption$0 = (0, import_lib4.$TR)((0, import_lib4.$EXPECT)($R96, "CivetOp
|
|
|
18548
18966
|
value = 0;
|
|
18549
18967
|
break;
|
|
18550
18968
|
case "globals":
|
|
18969
|
+
case "symbols":
|
|
18551
18970
|
value = value.split(",").filter(Boolean);
|
|
18552
18971
|
break;
|
|
18553
18972
|
}
|
|
@@ -18923,6 +19342,7 @@ var Reset$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L0, 'Reset ""'), fu
|
|
|
18923
19342
|
repl: false,
|
|
18924
19343
|
rewriteTsImports: true,
|
|
18925
19344
|
server: false,
|
|
19345
|
+
symbols: wellKnownSymbols,
|
|
18926
19346
|
tab: void 0,
|
|
18927
19347
|
// default behavior = same as space
|
|
18928
19348
|
verbose: false
|
|
@@ -19219,6 +19639,21 @@ function parseProgram(input, options) {
|
|
|
19219
19639
|
});
|
|
19220
19640
|
}
|
|
19221
19641
|
}
|
|
19642
|
+
var wellKnownSymbols = [
|
|
19643
|
+
"asyncIterator",
|
|
19644
|
+
"hasInstance",
|
|
19645
|
+
"isConcatSpreadable",
|
|
19646
|
+
"iterator",
|
|
19647
|
+
"match",
|
|
19648
|
+
"matchAll",
|
|
19649
|
+
"replace",
|
|
19650
|
+
"search",
|
|
19651
|
+
"species",
|
|
19652
|
+
"split",
|
|
19653
|
+
"toPrimitive",
|
|
19654
|
+
"toStringTag",
|
|
19655
|
+
"unscopables"
|
|
19656
|
+
];
|
|
19222
19657
|
|
|
19223
19658
|
// source/sourcemap.civet
|
|
19224
19659
|
var sourcemap_exports = {};
|