@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.mjs
CHANGED
|
@@ -56,7 +56,7 @@ var require_machine = __commonJS({
|
|
|
56
56
|
$EVENT: () => $EVENT2,
|
|
57
57
|
$EVENT_C: () => $EVENT_C2,
|
|
58
58
|
$EXPECT: () => $EXPECT2,
|
|
59
|
-
$L: () => $
|
|
59
|
+
$L: () => $L246,
|
|
60
60
|
$N: () => $N2,
|
|
61
61
|
$P: () => $P2,
|
|
62
62
|
$Q: () => $Q2,
|
|
@@ -81,7 +81,7 @@ var require_machine = __commonJS({
|
|
|
81
81
|
return result;
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
|
-
function $
|
|
84
|
+
function $L246(str) {
|
|
85
85
|
return function(_ctx, state2) {
|
|
86
86
|
const { input, pos } = state2, { length } = str, end = pos + length;
|
|
87
87
|
if (input.substring(pos, end) === str) {
|
|
@@ -556,7 +556,8 @@ __export(lib_exports, {
|
|
|
556
556
|
stripTrailingImplicitComma: () => stripTrailingImplicitComma,
|
|
557
557
|
trimFirstSpace: () => trimFirstSpace,
|
|
558
558
|
typeOfJSX: () => typeOfJSX,
|
|
559
|
-
wrapIIFE: () => wrapIIFE
|
|
559
|
+
wrapIIFE: () => wrapIIFE,
|
|
560
|
+
wrapTypeInPromise: () => wrapTypeInPromise
|
|
560
561
|
});
|
|
561
562
|
|
|
562
563
|
// source/parser/util.civet
|
|
@@ -896,32 +897,54 @@ function literalValue(literal) {
|
|
|
896
897
|
case "false":
|
|
897
898
|
return false;
|
|
898
899
|
}
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
900
|
+
let ref3;
|
|
901
|
+
switch (literal.subtype) {
|
|
902
|
+
case "StringLiteral": {
|
|
903
|
+
assert.equal(
|
|
904
|
+
raw.startsWith('"') && raw.endsWith('"') || raw.startsWith("'") && raw.endsWith("'"),
|
|
905
|
+
true,
|
|
906
|
+
"String literal should begin and end in single or double quotes"
|
|
907
|
+
);
|
|
908
|
+
return raw.slice(1, -1);
|
|
909
|
+
}
|
|
910
|
+
case "NumericLiteral": {
|
|
911
|
+
raw = raw.replace(/_/g, "");
|
|
912
|
+
if (raw.endsWith("n")) {
|
|
913
|
+
return BigInt(raw.slice(0, -1));
|
|
914
|
+
} else if (raw.match(/[\.eE]/)) {
|
|
915
|
+
return parseFloat(raw);
|
|
916
|
+
} else if ((ref3 = raw.match(/^[+-]?0(.)/)) && Array.isArray(ref3) && len(ref3, 2)) {
|
|
917
|
+
const [, base] = ref3;
|
|
918
|
+
switch (base.toLowerCase()) {
|
|
919
|
+
case "x":
|
|
920
|
+
return parseInt(raw.replace(/0[xX]/, ""), 16);
|
|
921
|
+
case "b":
|
|
922
|
+
return parseInt(raw.replace(/0[bB]/, ""), 2);
|
|
923
|
+
case "o":
|
|
924
|
+
return parseInt(raw.replace(/0[oO]/, ""), 8);
|
|
925
|
+
}
|
|
920
926
|
}
|
|
927
|
+
return parseInt(raw, 10);
|
|
928
|
+
}
|
|
929
|
+
default: {
|
|
930
|
+
throw new Error("Unrecognized literal " + JSON.stringify(literal));
|
|
921
931
|
}
|
|
922
|
-
return parseInt(raw, 10);
|
|
923
932
|
}
|
|
924
|
-
|
|
933
|
+
}
|
|
934
|
+
function makeNumericLiteral(n) {
|
|
935
|
+
const s = n.toString();
|
|
936
|
+
return {
|
|
937
|
+
type: "Literal",
|
|
938
|
+
subtype: "NumericLiteral",
|
|
939
|
+
raw: s,
|
|
940
|
+
children: [
|
|
941
|
+
{
|
|
942
|
+
type: "NumericLiteral",
|
|
943
|
+
token: s
|
|
944
|
+
}
|
|
945
|
+
// missing $loc
|
|
946
|
+
]
|
|
947
|
+
};
|
|
925
948
|
}
|
|
926
949
|
function startsWith(target, value) {
|
|
927
950
|
if (!target)
|
|
@@ -982,21 +1005,39 @@ function hasImportDeclaration(exp) {
|
|
|
982
1005
|
function hasExportDeclaration(exp) {
|
|
983
1006
|
return gatherRecursiveWithinFunction(exp, ($4) => $4.type === "ExportDeclaration").length > 0;
|
|
984
1007
|
}
|
|
985
|
-
function deepCopy(
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
1008
|
+
function deepCopy(root) {
|
|
1009
|
+
const copied = /* @__PURE__ */ new Map();
|
|
1010
|
+
return recurse(root);
|
|
1011
|
+
function recurse(node) {
|
|
1012
|
+
if (!(node != null && typeof node === "object")) {
|
|
1013
|
+
return node;
|
|
1014
|
+
}
|
|
1015
|
+
if (!copied.has(node)) {
|
|
1016
|
+
if (Array.isArray(node)) {
|
|
1017
|
+
const array = new Array(node.length);
|
|
1018
|
+
copied.set(node, array);
|
|
1019
|
+
for (let i4 = 0, len4 = node.length; i4 < len4; i4++) {
|
|
1020
|
+
const i = i4;
|
|
1021
|
+
const item = node[i4];
|
|
1022
|
+
array[i] = recurse(item);
|
|
1023
|
+
}
|
|
1024
|
+
} else if (node?.type === "Ref") {
|
|
1025
|
+
copied.set(node, node);
|
|
1026
|
+
} else {
|
|
1027
|
+
const obj = {};
|
|
1028
|
+
copied.set(node, obj);
|
|
1029
|
+
for (const key in node) {
|
|
1030
|
+
const value = node[key];
|
|
1031
|
+
if (key === "parent") {
|
|
1032
|
+
obj.parent = copied.get(value) ?? value;
|
|
1033
|
+
} else {
|
|
1034
|
+
obj[key] = recurse(value);
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
return copied.get(node);
|
|
992
1040
|
}
|
|
993
|
-
if (node?.type === "Ref")
|
|
994
|
-
return node;
|
|
995
|
-
return Object.fromEntries(
|
|
996
|
-
Object.entries(node).map(([key, value]) => {
|
|
997
|
-
return [key, deepCopy(value)];
|
|
998
|
-
})
|
|
999
|
-
);
|
|
1000
1041
|
}
|
|
1001
1042
|
function removeHoistDecs(node) {
|
|
1002
1043
|
if (node == null)
|
|
@@ -1070,8 +1111,8 @@ function updateParentPointers(node, parent, depth = 1) {
|
|
|
1070
1111
|
return;
|
|
1071
1112
|
}
|
|
1072
1113
|
if (Array.isArray(node)) {
|
|
1073
|
-
for (let
|
|
1074
|
-
const child = node[
|
|
1114
|
+
for (let i5 = 0, len5 = node.length; i5 < len5; i5++) {
|
|
1115
|
+
const child = node[i5];
|
|
1075
1116
|
updateParentPointers(child, parent, depth);
|
|
1076
1117
|
}
|
|
1077
1118
|
return;
|
|
@@ -1081,8 +1122,8 @@ function updateParentPointers(node, parent, depth = 1) {
|
|
|
1081
1122
|
node.parent = parent;
|
|
1082
1123
|
}
|
|
1083
1124
|
if (depth && isParent(node)) {
|
|
1084
|
-
for (let
|
|
1085
|
-
const child =
|
|
1125
|
+
for (let ref4 = node.children, i6 = 0, len6 = ref4.length; i6 < len6; i6++) {
|
|
1126
|
+
const child = ref4[i6];
|
|
1086
1127
|
updateParentPointers(child, node, depth - 1);
|
|
1087
1128
|
}
|
|
1088
1129
|
}
|
|
@@ -1119,7 +1160,7 @@ function spliceChild(node, child, del, ...replacements) {
|
|
|
1119
1160
|
return children.splice(index, del, ...replacements);
|
|
1120
1161
|
}
|
|
1121
1162
|
function convertOptionalType(suffix) {
|
|
1122
|
-
if (suffix.t.type === "
|
|
1163
|
+
if (suffix.t.type === "TypeAsserts") {
|
|
1123
1164
|
spliceChild(suffix, suffix.optional, 1, suffix.optional = {
|
|
1124
1165
|
type: "Error",
|
|
1125
1166
|
message: "Can't use optional ?: syntax with asserts type"
|
|
@@ -1141,7 +1182,7 @@ var typeNeedsNoParens = /* @__PURE__ */ new Set([
|
|
|
1141
1182
|
"TypeIdentifier",
|
|
1142
1183
|
"ImportType",
|
|
1143
1184
|
"TypeLiteral",
|
|
1144
|
-
"
|
|
1185
|
+
"TypeTuple",
|
|
1145
1186
|
"TypeParenthesized"
|
|
1146
1187
|
]);
|
|
1147
1188
|
function parenthesizeType(type) {
|
|
@@ -1219,8 +1260,8 @@ function wrapIIFE(expressions, asyncFlag, generator) {
|
|
|
1219
1260
|
children.splice(1, 0, ".bind(this)");
|
|
1220
1261
|
}
|
|
1221
1262
|
if (gatherRecursiveWithinFunction(block, (a2) => typeof a2 === "object" && a2 != null && "token" in a2 && a2.token === "arguments").length) {
|
|
1222
|
-
let
|
|
1223
|
-
children[children.length - 1] = (
|
|
1263
|
+
let ref5;
|
|
1264
|
+
children[children.length - 1] = (ref5 = parameters.children)[ref5.length - 1] = "(arguments)";
|
|
1224
1265
|
}
|
|
1225
1266
|
}
|
|
1226
1267
|
let exp = makeNode({
|
|
@@ -1258,9 +1299,9 @@ function wrapWithReturn(expression) {
|
|
|
1258
1299
|
}
|
|
1259
1300
|
function flatJoin(array, separator) {
|
|
1260
1301
|
const result = [];
|
|
1261
|
-
for (let
|
|
1262
|
-
const i =
|
|
1263
|
-
const items = array[
|
|
1302
|
+
for (let i7 = 0, len7 = array.length; i7 < len7; i7++) {
|
|
1303
|
+
const i = i7;
|
|
1304
|
+
const items = array[i7];
|
|
1264
1305
|
if (i) {
|
|
1265
1306
|
result.push(separator);
|
|
1266
1307
|
}
|
|
@@ -1831,6 +1872,13 @@ var declareHelper = {
|
|
|
1831
1872
|
").push(rhs), lhs);\n"
|
|
1832
1873
|
]]);
|
|
1833
1874
|
},
|
|
1875
|
+
AutoPromise(ref) {
|
|
1876
|
+
state.prelude.push([
|
|
1877
|
+
"",
|
|
1878
|
+
ts(["type ", ref, "<T> = T extends Promise<unknown> ? T : Promise<T>"]),
|
|
1879
|
+
";\n"
|
|
1880
|
+
]);
|
|
1881
|
+
},
|
|
1834
1882
|
JSX(jsxRef) {
|
|
1835
1883
|
state.prelude.push([
|
|
1836
1884
|
"",
|
|
@@ -1936,12 +1984,17 @@ function gen(root, options) {
|
|
|
1936
1984
|
));
|
|
1937
1985
|
return "";
|
|
1938
1986
|
}
|
|
1939
|
-
if (
|
|
1987
|
+
if ("$loc" in node) {
|
|
1940
1988
|
const { token, $loc } = node;
|
|
1941
|
-
|
|
1989
|
+
if ($loc != null) {
|
|
1990
|
+
updateSourceMap?.(token, $loc.pos);
|
|
1991
|
+
}
|
|
1942
1992
|
return token;
|
|
1943
1993
|
}
|
|
1944
1994
|
if (!node.children) {
|
|
1995
|
+
if (node.token != null) {
|
|
1996
|
+
return node.token;
|
|
1997
|
+
}
|
|
1945
1998
|
switch (node.type) {
|
|
1946
1999
|
case "Ref": {
|
|
1947
2000
|
throw new Error(`Unpopulated ref ${stringify(node)}`);
|
|
@@ -2121,6 +2174,9 @@ function serialize(value, context) {
|
|
|
2121
2174
|
throw new TypeError("cannot serialize native function");
|
|
2122
2175
|
}
|
|
2123
2176
|
if (/^class[\s{]/u.test(string)) {
|
|
2177
|
+
if (!Object.isExtensible(val)) {
|
|
2178
|
+
string = `Object.preventExtensions(${string})`;
|
|
2179
|
+
}
|
|
2124
2180
|
return string;
|
|
2125
2181
|
}
|
|
2126
2182
|
if (stack.has(val)) {
|
|
@@ -2148,6 +2204,9 @@ function serialize(value, context) {
|
|
|
2148
2204
|
}
|
|
2149
2205
|
string = `Object.defineProperties(${string},${recurse(props)})`;
|
|
2150
2206
|
}
|
|
2207
|
+
if (!Object.isExtensible(val)) {
|
|
2208
|
+
string = `Object.preventExtensions(${string})`;
|
|
2209
|
+
}
|
|
2151
2210
|
stack.delete(val);
|
|
2152
2211
|
return string;
|
|
2153
2212
|
} else if (typeof val === "symbol") {
|
|
@@ -2313,9 +2372,49 @@ function getTypeArguments(args) {
|
|
|
2313
2372
|
function isVoidType(t) {
|
|
2314
2373
|
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";
|
|
2315
2374
|
}
|
|
2375
|
+
function isPromiseType(t) {
|
|
2376
|
+
return typeof t === "object" && t != null && "type" in t && t.type === "TypeIdentifier" && "raw" in t && t.raw === "Promise";
|
|
2377
|
+
}
|
|
2316
2378
|
function isPromiseVoidType(t) {
|
|
2317
|
-
|
|
2318
|
-
|
|
2379
|
+
if (!isPromiseType(t)) {
|
|
2380
|
+
return false;
|
|
2381
|
+
}
|
|
2382
|
+
const args = getTypeArguments(t.args?.args);
|
|
2383
|
+
return args.length === 1 && isVoidType(args[0].t);
|
|
2384
|
+
}
|
|
2385
|
+
function wrapTypeInPromise(t) {
|
|
2386
|
+
if (isPromiseType(t)) {
|
|
2387
|
+
return t;
|
|
2388
|
+
}
|
|
2389
|
+
return wrapTypeInApplication(t, getHelperRef("AutoPromise"), "Promise");
|
|
2390
|
+
}
|
|
2391
|
+
function wrapTypeInApplication(t, id, raw) {
|
|
2392
|
+
const ws = getTrimmingSpace(t);
|
|
2393
|
+
t = trimFirstSpace(t);
|
|
2394
|
+
const innerArgs = [{
|
|
2395
|
+
type: "TypeArgument",
|
|
2396
|
+
ts: true,
|
|
2397
|
+
t,
|
|
2398
|
+
children: [t]
|
|
2399
|
+
}];
|
|
2400
|
+
const args = {
|
|
2401
|
+
type: "TypeArguments",
|
|
2402
|
+
ts: true,
|
|
2403
|
+
args: innerArgs,
|
|
2404
|
+
children: ["<", innerArgs, ">"]
|
|
2405
|
+
};
|
|
2406
|
+
if (!(raw != null)) {
|
|
2407
|
+
if (!(typeof id === "string")) {
|
|
2408
|
+
throw new Error("wrapTypeInApplication requires string id or raw argument");
|
|
2409
|
+
}
|
|
2410
|
+
raw = id;
|
|
2411
|
+
}
|
|
2412
|
+
return {
|
|
2413
|
+
type: "TypeIdentifier",
|
|
2414
|
+
raw,
|
|
2415
|
+
args,
|
|
2416
|
+
children: [ws, id, args]
|
|
2417
|
+
};
|
|
2319
2418
|
}
|
|
2320
2419
|
function implicitFunctionBlock(f) {
|
|
2321
2420
|
if (f.abstract || f.block || f.signature?.optional)
|
|
@@ -2376,7 +2475,8 @@ function processReturnValue(func) {
|
|
|
2376
2475
|
}
|
|
2377
2476
|
const ref = makeRef("ret");
|
|
2378
2477
|
let declaration;
|
|
2379
|
-
values.
|
|
2478
|
+
for (let i1 = 0, len3 = values.length; i1 < len3; i1++) {
|
|
2479
|
+
const value = values[i1];
|
|
2380
2480
|
value.children = [ref];
|
|
2381
2481
|
const { ancestor, child } = findAncestor(
|
|
2382
2482
|
value,
|
|
@@ -2384,21 +2484,41 @@ function processReturnValue(func) {
|
|
|
2384
2484
|
isFunction
|
|
2385
2485
|
);
|
|
2386
2486
|
if (ancestor) {
|
|
2387
|
-
|
|
2487
|
+
declaration ??= child;
|
|
2388
2488
|
}
|
|
2389
|
-
|
|
2390
|
-
return;
|
|
2391
|
-
});
|
|
2489
|
+
}
|
|
2392
2490
|
let returnType = func.returnType ?? func.signature?.returnType;
|
|
2393
2491
|
if (returnType) {
|
|
2394
2492
|
const { t } = returnType;
|
|
2395
2493
|
let m;
|
|
2396
2494
|
if (m = t.type, m === "TypePredicate") {
|
|
2397
|
-
|
|
2398
|
-
|
|
2495
|
+
const token = { token: "boolean" };
|
|
2496
|
+
const literal = {
|
|
2497
|
+
type: "TypeLiteral",
|
|
2498
|
+
t: token,
|
|
2499
|
+
children: [token]
|
|
2500
|
+
};
|
|
2501
|
+
returnType = {
|
|
2502
|
+
type: "ReturnTypeAnnotation",
|
|
2503
|
+
ts: true,
|
|
2504
|
+
t: literal,
|
|
2505
|
+
children: [": ", literal]
|
|
2506
|
+
};
|
|
2507
|
+
} else if (m === "TypeAsserts") {
|
|
2399
2508
|
returnType = void 0;
|
|
2400
2509
|
}
|
|
2401
2510
|
}
|
|
2511
|
+
if (returnType) {
|
|
2512
|
+
returnType = deepCopy(returnType);
|
|
2513
|
+
addParentPointers(returnType);
|
|
2514
|
+
if (func.signature.modifier.async) {
|
|
2515
|
+
replaceNode(
|
|
2516
|
+
returnType.t,
|
|
2517
|
+
makeNode(wrapTypeInApplication(returnType.t, "Awaited")),
|
|
2518
|
+
returnType
|
|
2519
|
+
);
|
|
2520
|
+
}
|
|
2521
|
+
}
|
|
2402
2522
|
if (declaration) {
|
|
2403
2523
|
if (!(declaration.typeSuffix != null)) {
|
|
2404
2524
|
declaration.children[1] = declaration.typeSuffix = returnType;
|
|
@@ -2406,11 +2526,11 @@ function processReturnValue(func) {
|
|
|
2406
2526
|
} else {
|
|
2407
2527
|
block.expressions.unshift([
|
|
2408
2528
|
getIndent(block.expressions[0]),
|
|
2409
|
-
{
|
|
2529
|
+
makeNode({
|
|
2410
2530
|
type: "Declaration",
|
|
2411
2531
|
children: ["let ", ref, returnType],
|
|
2412
2532
|
names: []
|
|
2413
|
-
},
|
|
2533
|
+
}),
|
|
2414
2534
|
";"
|
|
2415
2535
|
]);
|
|
2416
2536
|
}
|
|
@@ -2828,19 +2948,15 @@ function wrapIterationReturningResults(statement, collect) {
|
|
|
2828
2948
|
"wrapIterationReturningResults should not be called twice on the same statement"
|
|
2829
2949
|
);
|
|
2830
2950
|
const resultsRef = statement.resultsRef = makeRef("results");
|
|
2831
|
-
const
|
|
2951
|
+
const declaration = iterationDeclaration(statement);
|
|
2832
2952
|
const { ancestor, child } = findAncestor(statement, ($4) => $4.type === "BlockStatement");
|
|
2833
2953
|
assert.notNull(ancestor, `Could not find block containing ${statement.type}`);
|
|
2834
2954
|
const index = findChildIndex(ancestor.expressions, child);
|
|
2955
|
+
assert.notEqual(index, -1, `Could not find ${statement.type} in containing block`);
|
|
2835
2956
|
const iterationTuple = ancestor.expressions[index];
|
|
2836
2957
|
ancestor.expressions.splice(index, 0, [iterationTuple[0], declaration, ";"]);
|
|
2837
2958
|
iterationTuple[0] = "";
|
|
2838
2959
|
braceBlock(ancestor);
|
|
2839
|
-
if (!breakWithOnly) {
|
|
2840
|
-
assignResults(statement.block, (node) => {
|
|
2841
|
-
return [resultsRef, ".push(", node, ")"];
|
|
2842
|
-
});
|
|
2843
|
-
}
|
|
2844
2960
|
if (collect) {
|
|
2845
2961
|
statement.children.push(collect(resultsRef));
|
|
2846
2962
|
} else {
|
|
@@ -2848,15 +2964,16 @@ function wrapIterationReturningResults(statement, collect) {
|
|
|
2848
2964
|
}
|
|
2849
2965
|
}
|
|
2850
2966
|
function iterationDeclaration(statement) {
|
|
2851
|
-
const { resultsRef } = statement;
|
|
2852
|
-
|
|
2967
|
+
const { resultsRef, block } = statement;
|
|
2968
|
+
const reduction = statement.type === "ForStatement" && statement.reduction;
|
|
2969
|
+
let decl = reduction ? "let" : "const";
|
|
2853
2970
|
if (statement.type === "IterationStatement" || statement.type === "ForStatement") {
|
|
2854
2971
|
if (processBreakContinueWith(statement)) {
|
|
2855
2972
|
decl = "let";
|
|
2856
2973
|
}
|
|
2857
2974
|
}
|
|
2858
2975
|
const breakWithOnly = decl === "let" && isLoopStatement(statement) && gatherRecursive(
|
|
2859
|
-
|
|
2976
|
+
block,
|
|
2860
2977
|
(s) => s.type === "BreakStatement" && !s.with,
|
|
2861
2978
|
(s) => isFunction(s) || s.type === "IterationStatement"
|
|
2862
2979
|
).length === 0;
|
|
@@ -2867,14 +2984,124 @@ function iterationDeclaration(statement) {
|
|
|
2867
2984
|
names: [],
|
|
2868
2985
|
bindings: []
|
|
2869
2986
|
};
|
|
2870
|
-
if (
|
|
2871
|
-
declaration.children.push("=
|
|
2987
|
+
if (reduction) {
|
|
2988
|
+
declaration.children.push("=" + (() => {
|
|
2989
|
+
switch (reduction.subtype) {
|
|
2990
|
+
case "some": {
|
|
2991
|
+
return "false";
|
|
2992
|
+
}
|
|
2993
|
+
case "every": {
|
|
2994
|
+
return "true";
|
|
2995
|
+
}
|
|
2996
|
+
case "min": {
|
|
2997
|
+
return "Infinity";
|
|
2998
|
+
}
|
|
2999
|
+
case "max": {
|
|
3000
|
+
return "-Infinity";
|
|
3001
|
+
}
|
|
3002
|
+
case "product": {
|
|
3003
|
+
return "1";
|
|
3004
|
+
}
|
|
3005
|
+
default: {
|
|
3006
|
+
return "0";
|
|
3007
|
+
}
|
|
3008
|
+
}
|
|
3009
|
+
})());
|
|
2872
3010
|
} else {
|
|
2873
|
-
if (
|
|
2874
|
-
declaration.children.push("
|
|
3011
|
+
if (decl === "const") {
|
|
3012
|
+
declaration.children.push("=[]");
|
|
3013
|
+
} else {
|
|
3014
|
+
if (!breakWithOnly) {
|
|
3015
|
+
declaration.children.push(";", resultsRef, "=[]");
|
|
3016
|
+
}
|
|
3017
|
+
}
|
|
3018
|
+
}
|
|
3019
|
+
if (!breakWithOnly) {
|
|
3020
|
+
if (iterationDefaultBody(statement)) {
|
|
3021
|
+
return declaration;
|
|
3022
|
+
}
|
|
3023
|
+
if (!block.empty) {
|
|
3024
|
+
assignResults(block, (node) => {
|
|
3025
|
+
if (!reduction) {
|
|
3026
|
+
return [resultsRef, ".push(", node, ")"];
|
|
3027
|
+
}
|
|
3028
|
+
switch (reduction.subtype) {
|
|
3029
|
+
case "some": {
|
|
3030
|
+
return ["if (", node, ") {", resultsRef, " = true; break}"];
|
|
3031
|
+
}
|
|
3032
|
+
case "every": {
|
|
3033
|
+
return [
|
|
3034
|
+
"if (!",
|
|
3035
|
+
makeLeftHandSideExpression(node),
|
|
3036
|
+
") {",
|
|
3037
|
+
resultsRef,
|
|
3038
|
+
" = false; break}"
|
|
3039
|
+
];
|
|
3040
|
+
}
|
|
3041
|
+
case "count": {
|
|
3042
|
+
return ["if (", node, ") ++", resultsRef];
|
|
3043
|
+
}
|
|
3044
|
+
case "sum": {
|
|
3045
|
+
return [resultsRef, " += ", node];
|
|
3046
|
+
}
|
|
3047
|
+
case "product": {
|
|
3048
|
+
return [resultsRef, " *= ", node];
|
|
3049
|
+
}
|
|
3050
|
+
case "min": {
|
|
3051
|
+
return [resultsRef, " = Math.min(", resultsRef, ", ", node, ")"];
|
|
3052
|
+
}
|
|
3053
|
+
case "max": {
|
|
3054
|
+
return [resultsRef, " = Math.max(", resultsRef, ", ", node, ")"];
|
|
3055
|
+
}
|
|
3056
|
+
}
|
|
3057
|
+
});
|
|
2875
3058
|
}
|
|
2876
3059
|
}
|
|
2877
|
-
return
|
|
3060
|
+
return declaration;
|
|
3061
|
+
}
|
|
3062
|
+
function iterationDefaultBody(statement) {
|
|
3063
|
+
const { block, resultsRef } = statement;
|
|
3064
|
+
if (!block.empty) {
|
|
3065
|
+
return false;
|
|
3066
|
+
}
|
|
3067
|
+
const reduction = statement.type === "ForStatement" && statement.reduction;
|
|
3068
|
+
function fillBlock(expression) {
|
|
3069
|
+
let ref8;
|
|
3070
|
+
let m2;
|
|
3071
|
+
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) {
|
|
3072
|
+
block.expressions.pop();
|
|
3073
|
+
}
|
|
3074
|
+
block.expressions.push(expression);
|
|
3075
|
+
block.empty = false;
|
|
3076
|
+
return braceBlock(block);
|
|
3077
|
+
}
|
|
3078
|
+
if (reduction) {
|
|
3079
|
+
switch (reduction.subtype) {
|
|
3080
|
+
case "some": {
|
|
3081
|
+
fillBlock(["", [resultsRef, " = true; break"]]);
|
|
3082
|
+
block.empty = false;
|
|
3083
|
+
braceBlock(block);
|
|
3084
|
+
return true;
|
|
3085
|
+
}
|
|
3086
|
+
case "every": {
|
|
3087
|
+
fillBlock(["", [resultsRef, " = false; break"]]);
|
|
3088
|
+
block.empty = false;
|
|
3089
|
+
braceBlock(block);
|
|
3090
|
+
return true;
|
|
3091
|
+
}
|
|
3092
|
+
case "count": {
|
|
3093
|
+
fillBlock(["", ["++", resultsRef]]);
|
|
3094
|
+
block.empty = false;
|
|
3095
|
+
braceBlock(block);
|
|
3096
|
+
return true;
|
|
3097
|
+
}
|
|
3098
|
+
}
|
|
3099
|
+
}
|
|
3100
|
+
if (statement.type === "ForStatement" && statement.declaration?.type === "ForDeclaration") {
|
|
3101
|
+
fillBlock(["", patternAsValue(statement.declaration.binding)]);
|
|
3102
|
+
block.empty = false;
|
|
3103
|
+
}
|
|
3104
|
+
return false;
|
|
2878
3105
|
}
|
|
2879
3106
|
function processParams(f) {
|
|
2880
3107
|
const { type, parameters, block } = f;
|
|
@@ -2905,18 +3132,18 @@ function processParams(f) {
|
|
|
2905
3132
|
const classExpressions = ancestor.body.expressions;
|
|
2906
3133
|
let index = findChildIndex(classExpressions, f);
|
|
2907
3134
|
assert.notEqual(index, -1, "Could not find constructor in class");
|
|
2908
|
-
let
|
|
2909
|
-
while (
|
|
3135
|
+
let m3;
|
|
3136
|
+
while (m3 = classExpressions[index - 1]?.[1], typeof m3 === "object" && m3 != null && "type" in m3 && m3.type === "MethodDefinition" && "name" in m3 && m3.name === "constructor") {
|
|
2910
3137
|
index--;
|
|
2911
3138
|
}
|
|
2912
3139
|
const fStatement = classExpressions[index];
|
|
2913
|
-
for (let
|
|
2914
|
-
const parameter =
|
|
3140
|
+
for (let ref9 = gatherRecursive(parameters, ($9) => $9.type === "Parameter"), i2 = 0, len1 = ref9.length; i2 < len1; i2++) {
|
|
3141
|
+
const parameter = ref9[i2];
|
|
2915
3142
|
if (!parameter.typeSuffix) {
|
|
2916
3143
|
continue;
|
|
2917
3144
|
}
|
|
2918
|
-
for (let
|
|
2919
|
-
const binding =
|
|
3145
|
+
for (let ref10 = gatherRecursive(parameter, ($10) => $10.type === "AtBinding"), i3 = 0, len22 = ref10.length; i3 < len22; i3++) {
|
|
3146
|
+
const binding = ref10[i3];
|
|
2920
3147
|
const typeSuffix = binding.parent?.typeSuffix;
|
|
2921
3148
|
if (!typeSuffix) {
|
|
2922
3149
|
continue;
|
|
@@ -2970,11 +3197,11 @@ function processParams(f) {
|
|
|
2970
3197
|
}
|
|
2971
3198
|
function processSignature(f) {
|
|
2972
3199
|
const { block, signature } = f;
|
|
2973
|
-
if (
|
|
3200
|
+
if (!f.async?.length && hasAwait(block)) {
|
|
2974
3201
|
f.async.push("async ");
|
|
2975
3202
|
signature.modifier.async = true;
|
|
2976
3203
|
}
|
|
2977
|
-
if (
|
|
3204
|
+
if (!f.generator?.length && hasYield(block)) {
|
|
2978
3205
|
if (f.type === "ArrowFunction") {
|
|
2979
3206
|
gatherRecursiveWithinFunction(block, ($11) => $11.type === "YieldExpression").forEach((y) => {
|
|
2980
3207
|
const i = y.children.findIndex(($12) => $12.type === "Yield");
|
|
@@ -2988,21 +3215,26 @@ function processSignature(f) {
|
|
|
2988
3215
|
signature.modifier.generator = true;
|
|
2989
3216
|
}
|
|
2990
3217
|
}
|
|
3218
|
+
if (signature.modifier.async && !signature.modifier.generator && signature.returnType && !isPromiseType(signature.returnType.t)) {
|
|
3219
|
+
replaceNode(signature.returnType.t, wrapTypeInPromise(signature.returnType.t));
|
|
3220
|
+
}
|
|
2991
3221
|
}
|
|
2992
3222
|
function processFunctions(statements, config2) {
|
|
2993
|
-
gatherRecursiveAll(statements, (
|
|
3223
|
+
for (let ref11 = gatherRecursiveAll(statements, ($13) => $13.type === "FunctionExpression" || $13.type === "ArrowFunction"), i4 = 0, len3 = ref11.length; i4 < len3; i4++) {
|
|
3224
|
+
const f = ref11[i4];
|
|
2994
3225
|
if (f.type === "FunctionExpression") {
|
|
2995
3226
|
implicitFunctionBlock(f);
|
|
2996
3227
|
}
|
|
2997
3228
|
processSignature(f);
|
|
2998
3229
|
processParams(f);
|
|
2999
|
-
|
|
3000
|
-
}
|
|
3001
|
-
gatherRecursiveAll(statements, (
|
|
3230
|
+
processReturn(f, config2.implicitReturns);
|
|
3231
|
+
}
|
|
3232
|
+
for (let ref12 = gatherRecursiveAll(statements, ($14) => $14.type === "MethodDefinition"), i5 = 0, len4 = ref12.length; i5 < len4; i5++) {
|
|
3233
|
+
const f = ref12[i5];
|
|
3002
3234
|
implicitFunctionBlock(f);
|
|
3003
3235
|
processParams(f);
|
|
3004
|
-
|
|
3005
|
-
}
|
|
3236
|
+
processReturn(f, config2.implicitReturns);
|
|
3237
|
+
}
|
|
3006
3238
|
}
|
|
3007
3239
|
function expressionizeIteration(exp) {
|
|
3008
3240
|
let { async, generator, block, children, statement } = exp;
|
|
@@ -3015,47 +3247,65 @@ function expressionizeIteration(exp) {
|
|
|
3015
3247
|
updateParentPointers(exp);
|
|
3016
3248
|
return;
|
|
3017
3249
|
}
|
|
3250
|
+
let statements;
|
|
3018
3251
|
if (generator) {
|
|
3252
|
+
if (statement.reduction) {
|
|
3253
|
+
children.unshift({
|
|
3254
|
+
type: "Error",
|
|
3255
|
+
message: `Cannot use reduction (${statement.reduction.subtype}) with generators`
|
|
3256
|
+
});
|
|
3257
|
+
}
|
|
3258
|
+
iterationDefaultBody(statement);
|
|
3019
3259
|
assignResults(block, (node) => {
|
|
3020
3260
|
return {
|
|
3021
3261
|
type: "YieldExpression",
|
|
3022
3262
|
expression: node,
|
|
3023
|
-
children: [
|
|
3263
|
+
children: [
|
|
3264
|
+
{
|
|
3265
|
+
type: "Yield",
|
|
3266
|
+
token: "yield "
|
|
3267
|
+
},
|
|
3268
|
+
node
|
|
3269
|
+
]
|
|
3024
3270
|
};
|
|
3025
3271
|
});
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
wrapIIFE([
|
|
3030
|
-
["", statement, void 0],
|
|
3031
|
-
// Prevent implicit return in generator, by adding an explicit return
|
|
3032
|
-
["", {
|
|
3033
|
-
type: "ReturnStatement",
|
|
3034
|
-
expression: void 0,
|
|
3035
|
-
children: [";return"]
|
|
3036
|
-
}, void 0]
|
|
3037
|
-
], async, generator)
|
|
3038
|
-
);
|
|
3272
|
+
statements = [
|
|
3273
|
+
["", statement]
|
|
3274
|
+
];
|
|
3039
3275
|
} else {
|
|
3040
3276
|
const resultsRef = statement.resultsRef ??= makeRef("results");
|
|
3041
|
-
const
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3277
|
+
const declaration = iterationDeclaration(statement);
|
|
3278
|
+
statements = [
|
|
3279
|
+
["", declaration, ";"],
|
|
3280
|
+
["", statement, statement.block.bare ? ";" : void 0],
|
|
3281
|
+
["", resultsRef]
|
|
3282
|
+
];
|
|
3283
|
+
}
|
|
3284
|
+
let done;
|
|
3285
|
+
if (!async) {
|
|
3286
|
+
let ref13;
|
|
3287
|
+
if ((ref13 = blockContainingStatement(exp)) && typeof ref13 === "object" && "block" in ref13 && "index" in ref13) {
|
|
3288
|
+
const { block: parentBlock, index } = ref13;
|
|
3289
|
+
statements[0][0] = parentBlock.expressions[index][0];
|
|
3290
|
+
parentBlock.expressions.splice(index, index + 1 - index, ...statements);
|
|
3291
|
+
updateParentPointers(parentBlock);
|
|
3292
|
+
braceBlock(parentBlock);
|
|
3293
|
+
done = true;
|
|
3047
3294
|
}
|
|
3048
|
-
children.splice(
|
|
3049
|
-
i,
|
|
3050
|
-
1,
|
|
3051
|
-
wrapIIFE([
|
|
3052
|
-
["", declaration, ";"],
|
|
3053
|
-
["", statement, void 0],
|
|
3054
|
-
["", wrapWithReturn(resultsRef)]
|
|
3055
|
-
], async)
|
|
3056
|
-
);
|
|
3057
3295
|
}
|
|
3058
|
-
|
|
3296
|
+
if (!done) {
|
|
3297
|
+
if (!generator) {
|
|
3298
|
+
statements[statements.length - 1][1] = wrapWithReturn(statements[statements.length - 1][1]);
|
|
3299
|
+
}
|
|
3300
|
+
children.splice(i, 1, wrapIIFE(statements, async, generator));
|
|
3301
|
+
updateParentPointers(exp);
|
|
3302
|
+
}
|
|
3303
|
+
}
|
|
3304
|
+
function processIterationExpressions(statements) {
|
|
3305
|
+
for (let ref14 = gatherRecursiveAll(statements, ($15) => $15.type === "IterationExpression"), i6 = 0, len5 = ref14.length; i6 < len5; i6++) {
|
|
3306
|
+
const s = ref14[i6];
|
|
3307
|
+
expressionizeIteration(s);
|
|
3308
|
+
}
|
|
3059
3309
|
}
|
|
3060
3310
|
function skipImplicitArguments(args) {
|
|
3061
3311
|
if (args.length === 1) {
|
|
@@ -3079,12 +3329,12 @@ function processCoffeeDo(ws, expression) {
|
|
|
3079
3329
|
...parameters,
|
|
3080
3330
|
children: (() => {
|
|
3081
3331
|
const results1 = [];
|
|
3082
|
-
for (let
|
|
3083
|
-
let parameter =
|
|
3332
|
+
for (let ref15 = parameters.children, i7 = 0, len6 = ref15.length; i7 < len6; i7++) {
|
|
3333
|
+
let parameter = ref15[i7];
|
|
3084
3334
|
if (typeof parameter === "object" && parameter != null && "type" in parameter && parameter.type === "Parameter") {
|
|
3085
|
-
let
|
|
3086
|
-
if (
|
|
3087
|
-
const initializer =
|
|
3335
|
+
let ref16;
|
|
3336
|
+
if (ref16 = parameter.initializer) {
|
|
3337
|
+
const initializer = ref16;
|
|
3088
3338
|
args.push(initializer.expression, parameter.delim);
|
|
3089
3339
|
parameter = {
|
|
3090
3340
|
...parameter,
|
|
@@ -3105,7 +3355,7 @@ function processCoffeeDo(ws, expression) {
|
|
|
3105
3355
|
expression = {
|
|
3106
3356
|
...expression,
|
|
3107
3357
|
parameters: newParameters,
|
|
3108
|
-
children: expression.children.map(($
|
|
3358
|
+
children: expression.children.map(($16) => $16 === parameters ? newParameters : $16)
|
|
3109
3359
|
};
|
|
3110
3360
|
}
|
|
3111
3361
|
return {
|
|
@@ -3127,7 +3377,7 @@ function makeAmpersandFunction(rhs) {
|
|
|
3127
3377
|
ref = makeRef("$");
|
|
3128
3378
|
inplacePrepend(ref, body);
|
|
3129
3379
|
}
|
|
3130
|
-
if (startsWithPredicate(body, ($
|
|
3380
|
+
if (startsWithPredicate(body, ($17) => $17.type === "ObjectExpression")) {
|
|
3131
3381
|
body = makeLeftHandSideExpression(body);
|
|
3132
3382
|
}
|
|
3133
3383
|
const parameters = makeNode({
|
|
@@ -3367,6 +3617,28 @@ function needsPrecedingSemicolon(exp) {
|
|
|
3367
3617
|
}
|
|
3368
3618
|
}
|
|
3369
3619
|
}
|
|
3620
|
+
function blockContainingStatement(exp) {
|
|
3621
|
+
let child = exp;
|
|
3622
|
+
let parent = exp.parent;
|
|
3623
|
+
let m;
|
|
3624
|
+
while (parent != null && (m = parent.type, m === "StatementExpression" || m === "PipelineExpression" || m === "UnwrappedExpression")) {
|
|
3625
|
+
child = parent;
|
|
3626
|
+
parent = parent.parent;
|
|
3627
|
+
}
|
|
3628
|
+
if (!(parent?.type === "BlockStatement")) {
|
|
3629
|
+
return;
|
|
3630
|
+
}
|
|
3631
|
+
const index = findChildIndex(parent.expressions, child);
|
|
3632
|
+
assert.notEqual(index, -1, "Could not find statement in parent block");
|
|
3633
|
+
if (!(parent.expressions[index][1] === child)) {
|
|
3634
|
+
return;
|
|
3635
|
+
}
|
|
3636
|
+
return {
|
|
3637
|
+
block: parent,
|
|
3638
|
+
index,
|
|
3639
|
+
child
|
|
3640
|
+
};
|
|
3641
|
+
}
|
|
3370
3642
|
|
|
3371
3643
|
// source/parser/op.civet
|
|
3372
3644
|
var precedenceOrder = [
|
|
@@ -4628,8 +4900,9 @@ function convertWithClause(withClause, extendsClause) {
|
|
|
4628
4900
|
|
|
4629
4901
|
// source/parser/unary.civet
|
|
4630
4902
|
function processUnaryExpression(pre, exp, post) {
|
|
4631
|
-
if (!(pre.length || post))
|
|
4903
|
+
if (!(pre.length || post)) {
|
|
4632
4904
|
return exp;
|
|
4905
|
+
}
|
|
4633
4906
|
if (post?.token === "?") {
|
|
4634
4907
|
post = {
|
|
4635
4908
|
$loc: post.$loc,
|
|
@@ -4660,29 +4933,25 @@ function processUnaryExpression(pre, exp, post) {
|
|
|
4660
4933
|
}
|
|
4661
4934
|
return exp;
|
|
4662
4935
|
}
|
|
4663
|
-
if (exp
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
children: [literal, post]
|
|
4677
|
-
};
|
|
4678
|
-
}
|
|
4679
|
-
return literal;
|
|
4936
|
+
if (exp?.type === "Literal" && pre.length) {
|
|
4937
|
+
let [...ref] = pre, [last] = ref.splice(-1);
|
|
4938
|
+
let m;
|
|
4939
|
+
if (m = last?.token, m === "+" || m === "-") {
|
|
4940
|
+
last = last;
|
|
4941
|
+
exp = {
|
|
4942
|
+
...exp,
|
|
4943
|
+
children: [last, ...exp.children],
|
|
4944
|
+
raw: `${last.token}${exp.raw}`
|
|
4945
|
+
};
|
|
4946
|
+
pre = pre.slice(0, -1);
|
|
4947
|
+
if (!(pre.length || post)) {
|
|
4948
|
+
return exp;
|
|
4680
4949
|
}
|
|
4681
4950
|
}
|
|
4682
4951
|
}
|
|
4683
|
-
let
|
|
4684
|
-
while (
|
|
4685
|
-
const l =
|
|
4952
|
+
let ref1;
|
|
4953
|
+
while (ref1 = pre.length) {
|
|
4954
|
+
const l = ref1;
|
|
4686
4955
|
const last = pre[l - 1];
|
|
4687
4956
|
if (last.type === "Await") {
|
|
4688
4957
|
if (last.op) {
|
|
@@ -4695,8 +4964,8 @@ function processUnaryExpression(pre, exp, post) {
|
|
|
4695
4964
|
};
|
|
4696
4965
|
pre = pre.slice(0, -1);
|
|
4697
4966
|
} else {
|
|
4698
|
-
let
|
|
4699
|
-
if (
|
|
4967
|
+
let m1;
|
|
4968
|
+
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)) {
|
|
4700
4969
|
exp = parenthesizeExpression(exp);
|
|
4701
4970
|
}
|
|
4702
4971
|
exp = {
|
|
@@ -4800,6 +5069,7 @@ function constructInvocation(fn, arg) {
|
|
|
4800
5069
|
updateParentPointers(ref);
|
|
4801
5070
|
return makeNode({
|
|
4802
5071
|
type: "UnwrappedExpression",
|
|
5072
|
+
expression: body,
|
|
4803
5073
|
children: [skipIfOnlyWS(fn.leadingComment), body, skipIfOnlyWS(fn.trailingComment)]
|
|
4804
5074
|
});
|
|
4805
5075
|
}
|
|
@@ -4836,6 +5106,17 @@ function constructPipeStep(fn, arg, returning) {
|
|
|
4836
5106
|
returning
|
|
4837
5107
|
];
|
|
4838
5108
|
}
|
|
5109
|
+
case "throw": {
|
|
5110
|
+
const statement = { type: "ThrowStatement", children };
|
|
5111
|
+
return [
|
|
5112
|
+
{
|
|
5113
|
+
type: "StatementExpression",
|
|
5114
|
+
statement,
|
|
5115
|
+
children: [statement]
|
|
5116
|
+
},
|
|
5117
|
+
null
|
|
5118
|
+
];
|
|
5119
|
+
}
|
|
4839
5120
|
case "return": {
|
|
4840
5121
|
return [{
|
|
4841
5122
|
type: "ReturnStatement",
|
|
@@ -5120,25 +5401,40 @@ function forRange(open, forDeclaration, range, stepExp, close) {
|
|
|
5120
5401
|
const infinite = typeof end === "object" && end != null && "type" in end && end.type === "Identifier" && "name" in end && end.name === "Infinity";
|
|
5121
5402
|
let stepRef, asc;
|
|
5122
5403
|
if (stepExp) {
|
|
5123
|
-
stepExp =
|
|
5404
|
+
stepExp = trimFirstSpace(stepExp);
|
|
5124
5405
|
stepRef = maybeRef(stepExp, "step");
|
|
5125
5406
|
} else if (infinite) {
|
|
5126
|
-
stepExp = stepRef =
|
|
5407
|
+
stepExp = stepRef = makeNumericLiteral(1);
|
|
5127
5408
|
} else if (increasing != null) {
|
|
5128
5409
|
if (increasing) {
|
|
5129
|
-
stepExp = stepRef =
|
|
5410
|
+
stepExp = stepRef = makeNumericLiteral(1);
|
|
5130
5411
|
asc = true;
|
|
5131
5412
|
} else {
|
|
5132
|
-
stepExp = stepRef =
|
|
5413
|
+
stepExp = stepRef = makeNumericLiteral(-1);
|
|
5133
5414
|
asc = false;
|
|
5134
5415
|
}
|
|
5135
5416
|
}
|
|
5136
5417
|
let ref2;
|
|
5418
|
+
if (stepExp?.type === "Literal") {
|
|
5419
|
+
try {
|
|
5420
|
+
ref2 = literalValue(stepExp);
|
|
5421
|
+
} catch (e) {
|
|
5422
|
+
ref2 = void 0;
|
|
5423
|
+
}
|
|
5424
|
+
} else {
|
|
5425
|
+
ref2 = void 0;
|
|
5426
|
+
}
|
|
5427
|
+
;
|
|
5428
|
+
const stepValue = ref2;
|
|
5429
|
+
if (typeof stepValue === "number") {
|
|
5430
|
+
asc = stepValue > 0;
|
|
5431
|
+
}
|
|
5432
|
+
let ref3;
|
|
5137
5433
|
if (stepRef)
|
|
5138
|
-
|
|
5434
|
+
ref3 = start;
|
|
5139
5435
|
else
|
|
5140
|
-
|
|
5141
|
-
let startRef =
|
|
5436
|
+
ref3 = maybeRef(start, "start");
|
|
5437
|
+
let startRef = ref3;
|
|
5142
5438
|
let endRef = maybeRef(end, "end");
|
|
5143
5439
|
const startRefDec = startRef !== start ? [startRef, " = ", start, ", "] : [];
|
|
5144
5440
|
const endRefDec = endRef !== end ? [endRef, " = ", end, ", "] : [];
|
|
@@ -5150,11 +5446,11 @@ function forRange(open, forDeclaration, range, stepExp, close) {
|
|
|
5150
5446
|
];
|
|
5151
5447
|
}
|
|
5152
5448
|
let ascDec = [], ascRef;
|
|
5153
|
-
if (
|
|
5449
|
+
if (stepExp) {
|
|
5154
5450
|
if (!(stepRef === stepExp)) {
|
|
5155
5451
|
ascDec = [", ", stepRef, " = ", stepExp];
|
|
5156
5452
|
}
|
|
5157
|
-
} else if ("Literal"
|
|
5453
|
+
} else if (start?.type === "Literal" && "Literal" === end?.type) {
|
|
5158
5454
|
asc = literalValue(start) <= literalValue(end);
|
|
5159
5455
|
if ("StringLiteral" === start.subtype && start.subtype === end.subtype) {
|
|
5160
5456
|
startRef = literalValue(start).charCodeAt(0).toString();
|
|
@@ -5165,10 +5461,11 @@ function forRange(open, forDeclaration, range, stepExp, close) {
|
|
|
5165
5461
|
ascDec = [", ", ascRef, " = ", startRef, " <= ", endRef];
|
|
5166
5462
|
}
|
|
5167
5463
|
let varAssign = [], varLetAssign = varAssign, varLet = varAssign, blockPrefix;
|
|
5168
|
-
|
|
5169
|
-
|
|
5464
|
+
let names = forDeclaration?.names;
|
|
5465
|
+
if (forDeclaration?.decl) {
|
|
5466
|
+
if (forDeclaration.decl === "let") {
|
|
5170
5467
|
const varName = forDeclaration.children.splice(1);
|
|
5171
|
-
varAssign = [...
|
|
5468
|
+
varAssign = [...trimFirstSpace(varName), " = "];
|
|
5172
5469
|
varLet = [",", ...varName, " = ", counterRef];
|
|
5173
5470
|
} else {
|
|
5174
5471
|
const value = "StringLiteral" === start.subtype ? ["String.fromCharCode(", counterRef, ")"] : counterRef;
|
|
@@ -5177,26 +5474,41 @@ function forRange(open, forDeclaration, range, stepExp, close) {
|
|
|
5177
5474
|
];
|
|
5178
5475
|
}
|
|
5179
5476
|
} else if (forDeclaration) {
|
|
5477
|
+
assert.equal(
|
|
5478
|
+
forDeclaration.type,
|
|
5479
|
+
"AssignmentExpression",
|
|
5480
|
+
"Internal error: Coffee-style for loop must be an assignment expression"
|
|
5481
|
+
);
|
|
5180
5482
|
varAssign = varLetAssign = [forDeclaration, " = "];
|
|
5483
|
+
names = [];
|
|
5181
5484
|
}
|
|
5182
5485
|
const declaration = {
|
|
5183
5486
|
type: "Declaration",
|
|
5184
5487
|
children: ["let ", ...startRefDec, ...endRefDec, counterRef, " = ", ...varLetAssign, startRef, ...varLet, ...ascDec],
|
|
5185
|
-
names
|
|
5488
|
+
names
|
|
5186
5489
|
};
|
|
5187
5490
|
const counterPart = right.inclusive ? [counterRef, " <= ", endRef, " : ", counterRef, " >= ", endRef] : [counterRef, " < ", endRef, " : ", counterRef, " > ", endRef];
|
|
5188
|
-
const condition = infinite ? [] : asc != null ? asc ? counterPart.slice(0, 3) : counterPart.slice(4) : stepRef ? [stepRef, " !== 0 && (", stepRef, " > 0 ? ", ...counterPart, ")"] : [ascRef, " ? ", ...counterPart];
|
|
5189
|
-
const increment =
|
|
5491
|
+
const condition = infinite || stepValue === 0 ? [] : asc != null ? asc ? counterPart.slice(0, 3) : counterPart.slice(4) : stepRef ? [stepRef, " !== 0 && (", stepRef, " > 0 ? ", ...counterPart, ")"] : [ascRef, " ? ", ...counterPart];
|
|
5492
|
+
const increment = stepValue === 1 ? [...varAssign, "++", counterRef] : stepValue === -1 ? [...varAssign, "--", counterRef] : stepRef ? [...varAssign, counterRef, " += ", stepRef] : ascRef ? [...varAssign, ascRef, " ? ++", counterRef, " : --", counterRef] : [...varAssign, asc ? "++" : "--", counterRef];
|
|
5190
5493
|
return {
|
|
5191
|
-
declaration,
|
|
5494
|
+
// This declaration doesn't always appear in the output,
|
|
5495
|
+
// but it's still helpful for determining the primary loop variable
|
|
5496
|
+
declaration: forDeclaration,
|
|
5192
5497
|
children: [range.error, open, declaration, "; ", ...condition, "; ", ...increment, close],
|
|
5193
5498
|
blockPrefix
|
|
5194
5499
|
};
|
|
5195
5500
|
}
|
|
5196
|
-
function processForInOf($0
|
|
5501
|
+
function processForInOf($0) {
|
|
5197
5502
|
let [awaits, eachOwn, open, declaration, declaration2, ws, inOf, exp, step, close] = $0;
|
|
5198
5503
|
if (exp.type === "RangeExpression" && inOf.token === "of" && !declaration2) {
|
|
5199
|
-
return forRange(
|
|
5504
|
+
return forRange(
|
|
5505
|
+
open,
|
|
5506
|
+
declaration,
|
|
5507
|
+
exp,
|
|
5508
|
+
step && prepend(trimFirstSpace(step[0]), trimFirstSpace(step[2])),
|
|
5509
|
+
// omit "by" token
|
|
5510
|
+
close
|
|
5511
|
+
);
|
|
5200
5512
|
} else if (step) {
|
|
5201
5513
|
throw new Error("for..of/in cannot use 'by' except with range literals");
|
|
5202
5514
|
}
|
|
@@ -5212,22 +5524,22 @@ function processForInOf($0, getRef) {
|
|
|
5212
5524
|
if (declaration2) {
|
|
5213
5525
|
const [, , ws22, decl22] = declaration2;
|
|
5214
5526
|
blockPrefix.push(["", [
|
|
5215
|
-
|
|
5527
|
+
trimFirstSpace(ws22),
|
|
5216
5528
|
decl22,
|
|
5217
5529
|
" = ",
|
|
5218
5530
|
counterRef
|
|
5219
5531
|
], ";"]);
|
|
5220
5532
|
assignmentNames.push(...decl22.names);
|
|
5221
5533
|
}
|
|
5222
|
-
const expRefDec = expRef2 !== exp ? [
|
|
5534
|
+
const expRefDec = expRef2 !== exp ? [trimFirstSpace(expRef2), " = ", trimFirstSpace(exp), ", "] : [];
|
|
5223
5535
|
blockPrefix.push(["", {
|
|
5224
5536
|
type: "Declaration",
|
|
5225
|
-
children: [declaration, " = ",
|
|
5537
|
+
children: [declaration, " = ", trimFirstSpace(expRef2), "[", counterRef, "]"],
|
|
5226
5538
|
names: assignmentNames
|
|
5227
5539
|
}, ";"]);
|
|
5228
5540
|
declaration = {
|
|
5229
5541
|
type: "Declaration",
|
|
5230
|
-
children: ["let ", ...expRefDec, counterRef, " = 0, ", lenRef, " = ",
|
|
5542
|
+
children: ["let ", ...expRefDec, counterRef, " = 0, ", lenRef, " = ", trimFirstSpace(expRef2), ".length"],
|
|
5231
5543
|
names: []
|
|
5232
5544
|
};
|
|
5233
5545
|
const condition = [counterRef, " < ", lenRef, "; "];
|
|
@@ -5275,7 +5587,7 @@ function processForInOf($0, getRef) {
|
|
|
5275
5587
|
return {
|
|
5276
5588
|
declaration,
|
|
5277
5589
|
blockPrefix,
|
|
5278
|
-
children: [awaits, eachOwnError, open, declaration, ws, inOf, expRef ?? exp,
|
|
5590
|
+
children: [awaits, eachOwnError, open, declaration, ws, inOf, expRef ?? exp, close]
|
|
5279
5591
|
// omit declaration2, replace eachOwn with eachOwnError, replace exp with expRef
|
|
5280
5592
|
};
|
|
5281
5593
|
}
|
|
@@ -5292,7 +5604,7 @@ function processForInOf($0, getRef) {
|
|
|
5292
5604
|
};
|
|
5293
5605
|
blockPrefix.push(["", {
|
|
5294
5606
|
type: "Declaration",
|
|
5295
|
-
children: [
|
|
5607
|
+
children: [trimFirstSpace(ws2), decl2, " = ", counterRef, "++"],
|
|
5296
5608
|
names: decl2.names
|
|
5297
5609
|
}, ";"]);
|
|
5298
5610
|
break;
|
|
@@ -5311,13 +5623,13 @@ function processForInOf($0, getRef) {
|
|
|
5311
5623
|
};
|
|
5312
5624
|
}
|
|
5313
5625
|
if (own) {
|
|
5314
|
-
const hasPropRef =
|
|
5315
|
-
blockPrefix.push(["", ["if (!", hasPropRef, "(",
|
|
5626
|
+
const hasPropRef = getHelperRef("hasProp");
|
|
5627
|
+
blockPrefix.push(["", ["if (!", hasPropRef, "(", trimFirstSpace(expRef2), ", ", trimFirstSpace(pattern), ")) continue"], ";"]);
|
|
5316
5628
|
}
|
|
5317
5629
|
if (decl2) {
|
|
5318
5630
|
blockPrefix.push(["", {
|
|
5319
5631
|
type: "Declaration",
|
|
5320
|
-
children: [
|
|
5632
|
+
children: [trimFirstSpace(ws2), decl2, " = ", trimFirstSpace(expRef2), "[", trimFirstSpace(pattern), "]"],
|
|
5321
5633
|
names: decl2.names
|
|
5322
5634
|
}, ";"]);
|
|
5323
5635
|
}
|
|
@@ -5330,7 +5642,7 @@ function processForInOf($0, getRef) {
|
|
|
5330
5642
|
}
|
|
5331
5643
|
return {
|
|
5332
5644
|
declaration,
|
|
5333
|
-
children: [awaits, eachOwnError, open, declaration, ws, inOf, exp,
|
|
5645
|
+
children: [awaits, eachOwnError, open, declaration, ws, inOf, exp, close],
|
|
5334
5646
|
// omit declaration2, replace each with eachOwnError
|
|
5335
5647
|
blockPrefix,
|
|
5336
5648
|
hoistDec
|
|
@@ -5463,7 +5775,7 @@ function createVarDecs(block, scopes, pushVar) {
|
|
|
5463
5775
|
return createVarDecs(block2, scopes, pushVar);
|
|
5464
5776
|
});
|
|
5465
5777
|
forNodes.forEach(({ block: block2, declaration }) => {
|
|
5466
|
-
scopes.push(new Set(declaration
|
|
5778
|
+
scopes.push(new Set(declaration?.names));
|
|
5467
5779
|
createVarDecs(block2, scopes, pushVar);
|
|
5468
5780
|
return scopes.pop();
|
|
5469
5781
|
});
|
|
@@ -6427,8 +6739,8 @@ function processBindingPatternLHS(lhs, tail) {
|
|
|
6427
6739
|
tail.push(...splices.map((s) => [", ", s]), ...thisAssignments.map((a) => [", ", a]));
|
|
6428
6740
|
}
|
|
6429
6741
|
function processAssignments(statements) {
|
|
6430
|
-
gatherRecursiveAll(statements, (
|
|
6431
|
-
function
|
|
6742
|
+
for (let ref6 = gatherRecursiveAll(statements, ($3) => $3.type === "AssignmentExpression" || $3.type === "UpdateExpression"), i5 = 0, len4 = ref6.length; i5 < len4; i5++) {
|
|
6743
|
+
let extractAssignment2 = function(lhs) {
|
|
6432
6744
|
let expr = lhs;
|
|
6433
6745
|
while (expr.type === "ParenthesizedExpression") {
|
|
6434
6746
|
expr = expr.expression;
|
|
@@ -6446,17 +6758,20 @@ function processAssignments(statements) {
|
|
|
6446
6758
|
}
|
|
6447
6759
|
;
|
|
6448
6760
|
return;
|
|
6449
|
-
}
|
|
6761
|
+
};
|
|
6762
|
+
var extractAssignment = extractAssignment2;
|
|
6763
|
+
const exp = ref6[i5];
|
|
6450
6764
|
const pre = [], post = [];
|
|
6451
|
-
let
|
|
6765
|
+
let ref7;
|
|
6452
6766
|
switch (exp.type) {
|
|
6453
6767
|
case "AssignmentExpression": {
|
|
6454
|
-
if (!exp.lhs)
|
|
6455
|
-
|
|
6768
|
+
if (!exp.lhs) {
|
|
6769
|
+
continue;
|
|
6770
|
+
}
|
|
6456
6771
|
exp.lhs.forEach((lhsPart, i) => {
|
|
6457
|
-
let
|
|
6458
|
-
if (
|
|
6459
|
-
const newLhs =
|
|
6772
|
+
let ref8;
|
|
6773
|
+
if (ref8 = extractAssignment2(lhsPart[1])) {
|
|
6774
|
+
const newLhs = ref8;
|
|
6460
6775
|
return lhsPart[1] = newLhs;
|
|
6461
6776
|
}
|
|
6462
6777
|
;
|
|
@@ -6465,8 +6780,8 @@ function processAssignments(statements) {
|
|
|
6465
6780
|
break;
|
|
6466
6781
|
}
|
|
6467
6782
|
case "UpdateExpression": {
|
|
6468
|
-
if (
|
|
6469
|
-
const newLhs =
|
|
6783
|
+
if (ref7 = extractAssignment2(exp.assigned)) {
|
|
6784
|
+
const newLhs = ref7;
|
|
6470
6785
|
const i = exp.children.indexOf(exp.assigned);
|
|
6471
6786
|
exp.assigned = exp.children[i] = newLhs;
|
|
6472
6787
|
}
|
|
@@ -6474,15 +6789,17 @@ function processAssignments(statements) {
|
|
|
6474
6789
|
break;
|
|
6475
6790
|
}
|
|
6476
6791
|
}
|
|
6477
|
-
if (pre.length)
|
|
6792
|
+
if (pre.length) {
|
|
6478
6793
|
exp.children.unshift(...pre);
|
|
6479
|
-
|
|
6794
|
+
}
|
|
6795
|
+
if (post.length) {
|
|
6480
6796
|
exp.children.push(...post);
|
|
6797
|
+
}
|
|
6481
6798
|
if (exp.type === "UpdateExpression") {
|
|
6482
6799
|
const { assigned } = exp;
|
|
6483
6800
|
const ref = makeRef();
|
|
6484
6801
|
const newMemberExp = unchainOptionalMemberExpression(assigned, ref, (children) => {
|
|
6485
|
-
return exp.children.map(($
|
|
6802
|
+
return exp.children.map(($4) => $4 === assigned ? children : $4);
|
|
6486
6803
|
});
|
|
6487
6804
|
if (newMemberExp !== assigned) {
|
|
6488
6805
|
if (newMemberExp.usesRef) {
|
|
@@ -6492,169 +6809,163 @@ function processAssignments(statements) {
|
|
|
6492
6809
|
names: []
|
|
6493
6810
|
};
|
|
6494
6811
|
}
|
|
6495
|
-
|
|
6812
|
+
replaceNode(exp, newMemberExp);
|
|
6496
6813
|
}
|
|
6497
|
-
;
|
|
6498
|
-
return;
|
|
6499
6814
|
}
|
|
6500
|
-
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
|
|
6506
|
-
|
|
6507
|
-
|
|
6508
|
-
|
|
6509
|
-
|
|
6510
|
-
|
|
6511
|
-
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
|
|
6515
|
-
|
|
6516
|
-
|
|
6517
|
-
|
|
6518
|
-
|
|
6519
|
-
|
|
6520
|
-
|
|
6521
|
-
block = void 0;
|
|
6522
|
-
}
|
|
6815
|
+
}
|
|
6816
|
+
for (let ref9 = gatherRecursiveAll(statements, ($5) => $5.type === "AssignmentExpression"), i6 = 0, len5 = ref9.length; i6 < len5; i6++) {
|
|
6817
|
+
const exp = ref9[i6];
|
|
6818
|
+
if (!(exp.names === null)) {
|
|
6819
|
+
continue;
|
|
6820
|
+
}
|
|
6821
|
+
let { lhs: $1, expression: $2 } = exp, tail = [], len3 = $1.length;
|
|
6822
|
+
let block;
|
|
6823
|
+
let ref10;
|
|
6824
|
+
if (exp.parent?.type === "BlockStatement" && !(ref10 = $1[$1.length - 1])?.[ref10.length - 1]?.special) {
|
|
6825
|
+
block = makeBlockFragment();
|
|
6826
|
+
let ref11;
|
|
6827
|
+
if (ref11 = prependStatementExpressionBlock(
|
|
6828
|
+
{ type: "Initializer", expression: $2, children: [void 0, void 0, $2] },
|
|
6829
|
+
block
|
|
6830
|
+
)) {
|
|
6831
|
+
const ref = ref11;
|
|
6832
|
+
exp.children = exp.children.map(($6) => $6 === $2 ? ref : $6);
|
|
6833
|
+
$2 = ref;
|
|
6834
|
+
} else {
|
|
6835
|
+
block = void 0;
|
|
6523
6836
|
}
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
exp
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
|
|
6537
|
-
)
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6837
|
+
}
|
|
6838
|
+
let ref12;
|
|
6839
|
+
if ($1.some(($7) => (ref12 = $7)[ref12.length - 1].special)) {
|
|
6840
|
+
if ($1.length !== 1)
|
|
6841
|
+
throw new Error("Only one assignment with id= is allowed");
|
|
6842
|
+
const [, lhs, , op] = $1[0];
|
|
6843
|
+
const { call, omitLhs } = op;
|
|
6844
|
+
const index = exp.children.indexOf($2);
|
|
6845
|
+
if (index < 0)
|
|
6846
|
+
throw new Error("Assertion error: exp not in AssignmentExpression");
|
|
6847
|
+
exp.children.splice(
|
|
6848
|
+
index,
|
|
6849
|
+
1,
|
|
6850
|
+
exp.expression = $2 = [call, "(", lhs, ", ", $2, ")"]
|
|
6851
|
+
);
|
|
6852
|
+
if (omitLhs) {
|
|
6853
|
+
replaceNode(exp, $2);
|
|
6854
|
+
continue;
|
|
6541
6855
|
}
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
6547
|
-
|
|
6548
|
-
|
|
6549
|
-
|
|
6550
|
-
|
|
6551
|
-
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
|
|
6856
|
+
}
|
|
6857
|
+
let wrapped = false;
|
|
6858
|
+
let i = 0;
|
|
6859
|
+
while (i < len3) {
|
|
6860
|
+
const lastAssignment = $1[i++];
|
|
6861
|
+
const [, lhs, , op] = lastAssignment;
|
|
6862
|
+
if (!(op.token === "=")) {
|
|
6863
|
+
continue;
|
|
6864
|
+
}
|
|
6865
|
+
let m2;
|
|
6866
|
+
if (m2 = lhs.type, m2 === "ObjectExpression" || m2 === "ObjectBindingPattern") {
|
|
6867
|
+
if (!wrapped) {
|
|
6868
|
+
wrapped = true;
|
|
6869
|
+
lhs.children.splice(0, 0, "(");
|
|
6870
|
+
tail.push(")");
|
|
6557
6871
|
}
|
|
6558
6872
|
}
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
|
|
6873
|
+
}
|
|
6874
|
+
const refsToDeclare = /* @__PURE__ */ new Set();
|
|
6875
|
+
i = len3 - 1;
|
|
6876
|
+
while (i >= 0) {
|
|
6877
|
+
const lastAssignment = $1[i];
|
|
6878
|
+
if (lastAssignment[3].token === "=") {
|
|
6879
|
+
const lhs = lastAssignment[1];
|
|
6880
|
+
let m3;
|
|
6881
|
+
if (lhs.type === "MemberExpression") {
|
|
6882
|
+
const members = lhs.children;
|
|
6883
|
+
const lastMember = members[members.length - 1];
|
|
6884
|
+
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")) {
|
|
6885
|
+
lastMember.children.push({
|
|
6886
|
+
type: "Error",
|
|
6887
|
+
message: "Slice range cannot be decreasing in assignment"
|
|
6888
|
+
});
|
|
6889
|
+
break;
|
|
6890
|
+
}
|
|
6891
|
+
if (lastMember.type === "SliceExpression") {
|
|
6892
|
+
const { start, end, children: c } = lastMember;
|
|
6893
|
+
c[0].token = ".splice(";
|
|
6894
|
+
c[1] = start;
|
|
6895
|
+
c[2] = ", ";
|
|
6896
|
+
if (end) {
|
|
6897
|
+
c[3] = [end, " - ", start];
|
|
6898
|
+
} else {
|
|
6899
|
+
c[3] = ["1/0"];
|
|
6575
6900
|
}
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
|
|
6580
|
-
c[2] = ", ";
|
|
6581
|
-
if (end) {
|
|
6582
|
-
c[3] = [end, " - ", start];
|
|
6583
|
-
} else {
|
|
6584
|
-
c[3] = ["1/0"];
|
|
6585
|
-
}
|
|
6586
|
-
c[4] = [", ...", $2];
|
|
6587
|
-
c[5] = ")";
|
|
6901
|
+
c[4] = [", ...", $2];
|
|
6902
|
+
c[5] = ")";
|
|
6903
|
+
lastAssignment.pop();
|
|
6904
|
+
if (isWhitespaceOrEmpty(lastAssignment[2]))
|
|
6588
6905
|
lastAssignment.pop();
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
if ($1.length > 1) {
|
|
6592
|
-
throw new Error("Not implemented yet! TODO: Handle multiple splice assignments");
|
|
6593
|
-
}
|
|
6594
|
-
exp.children = [$1];
|
|
6595
|
-
exp.names = [];
|
|
6596
|
-
break;
|
|
6906
|
+
if ($1.length > 1) {
|
|
6907
|
+
throw new Error("Not implemented yet! TODO: Handle multiple splice assignments");
|
|
6597
6908
|
}
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
|
|
6909
|
+
exp.children = [$1];
|
|
6910
|
+
exp.names = [];
|
|
6911
|
+
break;
|
|
6601
6912
|
}
|
|
6913
|
+
} else if (m3 = lhs.type, m3 === "ObjectBindingPattern" || m3 === "ArrayBindingPattern") {
|
|
6914
|
+
processBindingPatternLHS(lhs, tail);
|
|
6915
|
+
gatherRecursiveAll(lhs, ($8) => $8.type === "Ref").forEach(refsToDeclare.add.bind(refsToDeclare));
|
|
6602
6916
|
}
|
|
6603
|
-
i--;
|
|
6604
6917
|
}
|
|
6605
|
-
i
|
|
6606
|
-
|
|
6607
|
-
|
|
6608
|
-
|
|
6609
|
-
|
|
6610
|
-
|
|
6611
|
-
|
|
6612
|
-
|
|
6613
|
-
|
|
6614
|
-
|
|
6615
|
-
|
|
6616
|
-
|
|
6617
|
-
|
|
6618
|
-
|
|
6619
|
-
|
|
6620
|
-
|
|
6621
|
-
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
newMemberExp.parent = exp;
|
|
6626
|
-
$2 = newMemberExp;
|
|
6918
|
+
i--;
|
|
6919
|
+
}
|
|
6920
|
+
i = len3 - 1;
|
|
6921
|
+
const optionalChainRef = makeRef();
|
|
6922
|
+
while (i >= 0) {
|
|
6923
|
+
const assignment = $1[i];
|
|
6924
|
+
const [ws1, lhs, ws2, op] = assignment;
|
|
6925
|
+
if (lhs.type === "MemberExpression" || lhs.type === "CallExpression") {
|
|
6926
|
+
const newMemberExp = unchainOptionalMemberExpression(lhs, optionalChainRef, (children) => {
|
|
6927
|
+
const assigns = $1.splice(i + 1, len3 - 1 - i);
|
|
6928
|
+
$1.pop();
|
|
6929
|
+
return [ws1, ...children, ws2, op, ...assigns, $2];
|
|
6930
|
+
});
|
|
6931
|
+
if (newMemberExp !== lhs) {
|
|
6932
|
+
if (newMemberExp.usesRef) {
|
|
6933
|
+
exp.hoistDec = {
|
|
6934
|
+
type: "Declaration",
|
|
6935
|
+
children: ["let ", optionalChainRef],
|
|
6936
|
+
names: []
|
|
6937
|
+
};
|
|
6627
6938
|
}
|
|
6939
|
+
replaceNode($2, newMemberExp);
|
|
6940
|
+
$2 = newMemberExp;
|
|
6628
6941
|
}
|
|
6629
|
-
i--;
|
|
6630
|
-
}
|
|
6631
|
-
if (refsToDeclare.size) {
|
|
6632
|
-
if (exp.hoistDec) {
|
|
6633
|
-
exp.hoistDec.children.push([...refsToDeclare].map(($7) => [",", $7]));
|
|
6634
|
-
} else {
|
|
6635
|
-
exp.hoistDec = {
|
|
6636
|
-
type: "Declaration",
|
|
6637
|
-
children: ["let ", [...refsToDeclare].map((r, i2) => i2 ? [",", r] : r)],
|
|
6638
|
-
names: []
|
|
6639
|
-
};
|
|
6640
|
-
}
|
|
6641
|
-
}
|
|
6642
|
-
exp.names = $1.flatMap(([, l]) => l.names || []);
|
|
6643
|
-
if (tail.length) {
|
|
6644
|
-
const index = exp.children.indexOf($2);
|
|
6645
|
-
if (index < 0)
|
|
6646
|
-
throw new Error("Assertion error: exp not in AssignmentExpression");
|
|
6647
|
-
exp.children.splice(index + 1, 0, ...tail);
|
|
6648
6942
|
}
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
|
|
6943
|
+
i--;
|
|
6944
|
+
}
|
|
6945
|
+
if (refsToDeclare.size) {
|
|
6946
|
+
if (exp.hoistDec) {
|
|
6947
|
+
exp.hoistDec.children.push([...refsToDeclare].map(($9) => [",", $9]));
|
|
6948
|
+
} else {
|
|
6949
|
+
exp.hoistDec = {
|
|
6950
|
+
type: "Declaration",
|
|
6951
|
+
children: ["let ", [...refsToDeclare].map((r, i2) => i2 ? [",", r] : r)],
|
|
6952
|
+
names: []
|
|
6953
|
+
};
|
|
6654
6954
|
}
|
|
6655
|
-
return exp;
|
|
6656
6955
|
}
|
|
6657
|
-
|
|
6956
|
+
exp.names = $1.flatMap(([, l]) => l.names || []);
|
|
6957
|
+
if (tail.length) {
|
|
6958
|
+
const index = exp.children.indexOf($2);
|
|
6959
|
+
if (index < 0)
|
|
6960
|
+
throw new Error("Assertion error: exp not in AssignmentExpression");
|
|
6961
|
+
exp.children.splice(index + 1, 0, ...tail);
|
|
6962
|
+
}
|
|
6963
|
+
if (block) {
|
|
6964
|
+
replaceNode(exp, block);
|
|
6965
|
+
block.expressions.push(["", exp]);
|
|
6966
|
+
exp.parent = block;
|
|
6967
|
+
}
|
|
6968
|
+
}
|
|
6658
6969
|
}
|
|
6659
6970
|
function unchainOptionalMemberExpression(exp, ref, innerExp) {
|
|
6660
6971
|
let j = 0;
|
|
@@ -6704,9 +7015,9 @@ function unchainOptionalMemberExpression(exp, ref, innerExp) {
|
|
|
6704
7015
|
}
|
|
6705
7016
|
j++;
|
|
6706
7017
|
}
|
|
6707
|
-
let
|
|
6708
|
-
if (
|
|
6709
|
-
const l =
|
|
7018
|
+
let ref13;
|
|
7019
|
+
if (ref13 = conditions.length) {
|
|
7020
|
+
const l = ref13;
|
|
6710
7021
|
const cs = flatJoin(conditions, " && ");
|
|
6711
7022
|
return {
|
|
6712
7023
|
...exp,
|
|
@@ -6745,28 +7056,28 @@ function processTypes(node) {
|
|
|
6745
7056
|
if (!unary.suffix.length) {
|
|
6746
7057
|
return;
|
|
6747
7058
|
}
|
|
6748
|
-
let
|
|
7059
|
+
let ref14;
|
|
6749
7060
|
let m4;
|
|
6750
|
-
if (m4 = (
|
|
7061
|
+
if (m4 = (ref14 = unary.suffix)[ref14.length - 1], typeof m4 === "object" && m4 != null && "token" in m4 && m4.token === "?") {
|
|
6751
7062
|
const { token } = m4;
|
|
6752
7063
|
let last;
|
|
6753
7064
|
let count = 0;
|
|
6754
|
-
let
|
|
6755
|
-
while (unary.suffix.length && (
|
|
7065
|
+
let ref15;
|
|
7066
|
+
while (unary.suffix.length && (ref15 = unary.suffix)[ref15.length - 1]?.token === "?") {
|
|
6756
7067
|
last = unary.suffix.pop();
|
|
6757
7068
|
count++;
|
|
6758
7069
|
}
|
|
6759
|
-
let
|
|
6760
|
-
while (unary.suffix.length && (
|
|
7070
|
+
let ref16;
|
|
7071
|
+
while (unary.suffix.length && (ref16 = unary.suffix)[ref16.length - 1]?.type === "NonNullAssertion") {
|
|
6761
7072
|
unary.suffix.pop();
|
|
6762
7073
|
}
|
|
6763
|
-
let
|
|
7074
|
+
let ref17;
|
|
6764
7075
|
if (unary.suffix.length || unary.prefix.length)
|
|
6765
|
-
|
|
7076
|
+
ref17 = unary;
|
|
6766
7077
|
else
|
|
6767
|
-
|
|
6768
|
-
const t =
|
|
6769
|
-
if (unary.parent?.type === "
|
|
7078
|
+
ref17 = unary.t;
|
|
7079
|
+
const t = ref17;
|
|
7080
|
+
if (unary.parent?.type === "TypeElement" && !unary.parent.name) {
|
|
6770
7081
|
if (count === 1) {
|
|
6771
7082
|
unary.suffix.push(last);
|
|
6772
7083
|
return;
|
|
@@ -6793,12 +7104,12 @@ function processTypes(node) {
|
|
|
6793
7104
|
}
|
|
6794
7105
|
} else if (typeof m4 === "object" && m4 != null && "type" in m4 && m4.type === "NonNullAssertion") {
|
|
6795
7106
|
const { type } = m4;
|
|
6796
|
-
let
|
|
6797
|
-
while (unary.suffix.length && (
|
|
7107
|
+
let ref18;
|
|
7108
|
+
while (unary.suffix.length && (ref18 = unary.suffix)[ref18.length - 1]?.type === "NonNullAssertion") {
|
|
6798
7109
|
unary.suffix.pop();
|
|
6799
7110
|
}
|
|
6800
|
-
let
|
|
6801
|
-
while (unary.suffix.length && (
|
|
7111
|
+
let ref19;
|
|
7112
|
+
while (unary.suffix.length && (ref19 = unary.suffix)[ref19.length - 1]?.token === "?") {
|
|
6802
7113
|
unary.suffix.pop();
|
|
6803
7114
|
}
|
|
6804
7115
|
const t = trimFirstSpace(
|
|
@@ -6824,35 +7135,41 @@ function processTypes(node) {
|
|
|
6824
7135
|
});
|
|
6825
7136
|
}
|
|
6826
7137
|
function processStatementExpressions(statements) {
|
|
6827
|
-
gatherRecursiveAll(statements, ($
|
|
6828
|
-
const exp =
|
|
6829
|
-
const { statement } = exp;
|
|
6830
|
-
|
|
7138
|
+
for (let ref20 = gatherRecursiveAll(statements, ($10) => $10.type === "StatementExpression"), i7 = 0, len6 = ref20.length; i7 < len6; i7++) {
|
|
7139
|
+
const exp = ref20[i7];
|
|
7140
|
+
const { maybe, statement } = exp;
|
|
7141
|
+
if ((maybe || statement.type === "ThrowStatement") && blockContainingStatement(exp)) {
|
|
7142
|
+
replaceNode(exp, statement);
|
|
7143
|
+
continue;
|
|
7144
|
+
}
|
|
7145
|
+
let ref21;
|
|
6831
7146
|
switch (statement.type) {
|
|
6832
7147
|
case "IfStatement": {
|
|
6833
|
-
if (
|
|
6834
|
-
const expression =
|
|
6835
|
-
|
|
7148
|
+
if (ref21 = expressionizeIfStatement(statement)) {
|
|
7149
|
+
const expression = ref21;
|
|
7150
|
+
replaceNode(statement, expression, exp);
|
|
6836
7151
|
} else {
|
|
6837
|
-
|
|
7152
|
+
replaceNode(statement, wrapIIFE([["", statement]]), exp);
|
|
6838
7153
|
}
|
|
7154
|
+
;
|
|
7155
|
+
break;
|
|
6839
7156
|
}
|
|
6840
7157
|
case "IterationExpression": {
|
|
6841
7158
|
if (statement.subtype === "ComptimeStatement") {
|
|
6842
|
-
|
|
7159
|
+
replaceNode(
|
|
6843
7160
|
statement,
|
|
6844
7161
|
expressionizeComptime(statement.statement),
|
|
6845
7162
|
exp
|
|
6846
7163
|
);
|
|
6847
7164
|
}
|
|
6848
7165
|
;
|
|
6849
|
-
|
|
7166
|
+
break;
|
|
6850
7167
|
}
|
|
6851
7168
|
default: {
|
|
6852
|
-
|
|
7169
|
+
replaceNode(statement, wrapIIFE([["", statement]]), exp);
|
|
6853
7170
|
}
|
|
6854
7171
|
}
|
|
6855
|
-
}
|
|
7172
|
+
}
|
|
6856
7173
|
}
|
|
6857
7174
|
function processNegativeIndexAccess(statements) {
|
|
6858
7175
|
gatherRecursiveAll(statements, (n) => n.type === "NegativeIndex").forEach((exp) => {
|
|
@@ -6900,7 +7217,7 @@ function processProgram(root) {
|
|
|
6900
7217
|
if (config2.iife || config2.repl) {
|
|
6901
7218
|
rootIIFE = wrapIIFE(root.expressions, root.topLevelAwait);
|
|
6902
7219
|
const newExpressions = [["", rootIIFE]];
|
|
6903
|
-
root.children = root.children.map(($
|
|
7220
|
+
root.children = root.children.map(($11) => $11 === root.expressions ? newExpressions : $11);
|
|
6904
7221
|
root.expressions = newExpressions;
|
|
6905
7222
|
}
|
|
6906
7223
|
addParentPointers(root);
|
|
@@ -6914,7 +7231,7 @@ function processProgram(root) {
|
|
|
6914
7231
|
processAssignments(statements);
|
|
6915
7232
|
processStatementExpressions(statements);
|
|
6916
7233
|
processPatternMatching(statements);
|
|
6917
|
-
|
|
7234
|
+
processIterationExpressions(statements);
|
|
6918
7235
|
hoistRefDecs(statements);
|
|
6919
7236
|
processFunctions(statements, config2);
|
|
6920
7237
|
statements.unshift(...state2.prelude);
|
|
@@ -6940,17 +7257,17 @@ async function processProgramAsync(root) {
|
|
|
6940
7257
|
await processComptime(statements);
|
|
6941
7258
|
}
|
|
6942
7259
|
function processRepl(root, rootIIFE) {
|
|
6943
|
-
const topBlock = gatherRecursive(rootIIFE, ($
|
|
7260
|
+
const topBlock = gatherRecursive(rootIIFE, ($12) => $12.type === "BlockStatement")[0];
|
|
6944
7261
|
let i = 0;
|
|
6945
|
-
for (let
|
|
6946
|
-
const decl =
|
|
7262
|
+
for (let ref22 = gatherRecursiveWithinFunction(topBlock, ($13) => $13.type === "Declaration"), i8 = 0, len7 = ref22.length; i8 < len7; i8++) {
|
|
7263
|
+
const decl = ref22[i8];
|
|
6947
7264
|
if (decl.parent === topBlock || decl.decl === "var") {
|
|
6948
7265
|
decl.children.shift();
|
|
6949
7266
|
root.expressions.splice(i++, 0, ["", `var ${decl.names.join(",")};`]);
|
|
6950
7267
|
}
|
|
6951
7268
|
}
|
|
6952
|
-
for (let
|
|
6953
|
-
const func =
|
|
7269
|
+
for (let ref23 = gatherRecursive(topBlock, ($14) => $14.type === "FunctionExpression"), i9 = 0, len8 = ref23.length; i9 < len8; i9++) {
|
|
7270
|
+
const func = ref23[i9];
|
|
6954
7271
|
if (func.name && func.parent?.type === "BlockStatement") {
|
|
6955
7272
|
if (func.parent === topBlock) {
|
|
6956
7273
|
replaceNode(func, void 0);
|
|
@@ -6962,8 +7279,8 @@ function processRepl(root, rootIIFE) {
|
|
|
6962
7279
|
}
|
|
6963
7280
|
}
|
|
6964
7281
|
}
|
|
6965
|
-
for (let
|
|
6966
|
-
const classExp =
|
|
7282
|
+
for (let ref24 = gatherRecursiveWithinFunction(topBlock, ($15) => $15.type === "ClassExpression"), i10 = 0, len9 = ref24.length; i10 < len9; i10++) {
|
|
7283
|
+
const classExp = ref24[i10];
|
|
6967
7284
|
let m5;
|
|
6968
7285
|
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)) {
|
|
6969
7286
|
classExp.children.unshift(classExp.name, "=");
|
|
@@ -6972,7 +7289,7 @@ function processRepl(root, rootIIFE) {
|
|
|
6972
7289
|
}
|
|
6973
7290
|
}
|
|
6974
7291
|
function populateRefs(statements) {
|
|
6975
|
-
const refNodes = gatherRecursive(statements, ($
|
|
7292
|
+
const refNodes = gatherRecursive(statements, ($16) => $16.type === "Ref");
|
|
6976
7293
|
if (refNodes.length) {
|
|
6977
7294
|
const ids = gatherRecursive(statements, (s) => s.type === "Identifier");
|
|
6978
7295
|
const names = new Set(ids.flatMap(({ names: names2 }) => names2 || []));
|
|
@@ -6995,13 +7312,14 @@ function populateRefs(statements) {
|
|
|
6995
7312
|
function processPlaceholders(statements) {
|
|
6996
7313
|
const placeholderMap = /* @__PURE__ */ new Map();
|
|
6997
7314
|
const liftedIfs = /* @__PURE__ */ new Set();
|
|
6998
|
-
gatherRecursiveAll(statements, ($
|
|
7315
|
+
gatherRecursiveAll(statements, ($17) => $17.type === "Placeholder").forEach((_exp) => {
|
|
6999
7316
|
const exp = _exp;
|
|
7000
7317
|
let ancestor;
|
|
7001
7318
|
if (exp.subtype === ".") {
|
|
7002
|
-
({ ancestor } = findAncestor(exp, ($
|
|
7319
|
+
({ ancestor } = findAncestor(exp, ($18) => $18.type === "Call"));
|
|
7003
7320
|
ancestor = ancestor?.parent;
|
|
7004
|
-
|
|
7321
|
+
let m6;
|
|
7322
|
+
while (ancestor?.parent != null && (m6 = ancestor.parent.type, m6 === "UnaryExpression" || m6 === "NewExpression" || m6 === "AwaitExpression" || m6 === "ThrowStatement" || m6 === "StatementExpression")) {
|
|
7005
7323
|
ancestor = ancestor.parent;
|
|
7006
7324
|
}
|
|
7007
7325
|
if (!ancestor) {
|
|
@@ -7018,10 +7336,10 @@ function processPlaceholders(statements) {
|
|
|
7018
7336
|
if (type === "IfStatement") {
|
|
7019
7337
|
liftedIfs.add(ancestor2);
|
|
7020
7338
|
}
|
|
7021
|
-
let m6;
|
|
7022
7339
|
let m7;
|
|
7340
|
+
let m8;
|
|
7023
7341
|
return type === "Call" || // Block, except for if/else blocks when condition already lifted
|
|
7024
|
-
type === "BlockStatement" && !((
|
|
7342
|
+
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
|
|
7025
7343
|
type === "Initializer" || // Right-hand side of assignment
|
|
7026
7344
|
type === "AssignmentExpression" && findChildIndex(ancestor2, child2) === ancestor2.children.indexOf(ancestor2.expression) || type === "ReturnStatement" || type === "YieldExpression";
|
|
7027
7345
|
}));
|
|
@@ -7097,11 +7415,11 @@ function processPlaceholders(statements) {
|
|
|
7097
7415
|
for (const [ancestor, placeholders] of placeholderMap) {
|
|
7098
7416
|
let ref = makeRef("$");
|
|
7099
7417
|
let typeSuffix;
|
|
7100
|
-
for (let
|
|
7101
|
-
const placeholder = placeholders[
|
|
7418
|
+
for (let i11 = 0, len10 = placeholders.length; i11 < len10; i11++) {
|
|
7419
|
+
const placeholder = placeholders[i11];
|
|
7102
7420
|
typeSuffix ??= placeholder.typeSuffix;
|
|
7103
|
-
let
|
|
7104
|
-
replaceNode((
|
|
7421
|
+
let ref25;
|
|
7422
|
+
replaceNode((ref25 = placeholder.children)[ref25.length - 1], ref);
|
|
7105
7423
|
}
|
|
7106
7424
|
const { parent } = ancestor;
|
|
7107
7425
|
const body = maybeUnwrap(ancestor);
|
|
@@ -7122,16 +7440,16 @@ function processPlaceholders(statements) {
|
|
|
7122
7440
|
}
|
|
7123
7441
|
case "PipelineExpression": {
|
|
7124
7442
|
const i = findChildIndex(parent, ancestor);
|
|
7125
|
-
let
|
|
7443
|
+
let ref26;
|
|
7126
7444
|
if (i === 1) {
|
|
7127
|
-
|
|
7445
|
+
ref26 = ancestor === parent.children[i];
|
|
7128
7446
|
} else if (i === 2) {
|
|
7129
|
-
|
|
7447
|
+
ref26 = ancestor === parent.children[i][findChildIndex(parent.children[i], ancestor)][3];
|
|
7130
7448
|
} else {
|
|
7131
|
-
|
|
7449
|
+
ref26 = void 0;
|
|
7132
7450
|
}
|
|
7133
7451
|
;
|
|
7134
|
-
outer =
|
|
7452
|
+
outer = ref26;
|
|
7135
7453
|
break;
|
|
7136
7454
|
}
|
|
7137
7455
|
case "AssignmentExpression":
|
|
@@ -7146,9 +7464,9 @@ function processPlaceholders(statements) {
|
|
|
7146
7464
|
fnExp = makeLeftHandSideExpression(fnExp);
|
|
7147
7465
|
}
|
|
7148
7466
|
replaceNode(ancestor, fnExp, parent);
|
|
7149
|
-
let
|
|
7150
|
-
if (
|
|
7151
|
-
const ws =
|
|
7467
|
+
let ref27;
|
|
7468
|
+
if (ref27 = getTrimmingSpace(body)) {
|
|
7469
|
+
const ws = ref27;
|
|
7152
7470
|
inplaceInsertTrimmingSpace(body, "");
|
|
7153
7471
|
inplacePrepend(ws, fnExp);
|
|
7154
7472
|
}
|
|
@@ -7193,8 +7511,8 @@ function reorderBindingRestProperty(props) {
|
|
|
7193
7511
|
}
|
|
7194
7512
|
];
|
|
7195
7513
|
}
|
|
7196
|
-
let
|
|
7197
|
-
if (Array.isArray(rest.delim) && (
|
|
7514
|
+
let ref28;
|
|
7515
|
+
if (Array.isArray(rest.delim) && (ref28 = rest.delim)[ref28.length - 1]?.token === ",") {
|
|
7198
7516
|
rest.delim = rest.delim.slice(0, -1);
|
|
7199
7517
|
rest.children = [...rest.children.slice(0, -1), rest.delim];
|
|
7200
7518
|
}
|
|
@@ -7219,9 +7537,9 @@ function replaceNodes(root, predicate, replacer) {
|
|
|
7219
7537
|
return root;
|
|
7220
7538
|
}
|
|
7221
7539
|
}
|
|
7222
|
-
for (let
|
|
7223
|
-
const i =
|
|
7224
|
-
const node = array[
|
|
7540
|
+
for (let i12 = 0, len11 = array.length; i12 < len11; i12++) {
|
|
7541
|
+
const i = i12;
|
|
7542
|
+
const node = array[i12];
|
|
7225
7543
|
if (!(node != null)) {
|
|
7226
7544
|
return;
|
|
7227
7545
|
}
|
|
@@ -7233,34 +7551,6 @@ function replaceNodes(root, predicate, replacer) {
|
|
|
7233
7551
|
}
|
|
7234
7552
|
return root;
|
|
7235
7553
|
}
|
|
7236
|
-
function replaceNodesRecursive(root, predicate, replacer) {
|
|
7237
|
-
if (!(root != null)) {
|
|
7238
|
-
return root;
|
|
7239
|
-
}
|
|
7240
|
-
const array = Array.isArray(root) ? root : root.children;
|
|
7241
|
-
if (!array) {
|
|
7242
|
-
if (predicate(root)) {
|
|
7243
|
-
return replacer(root, root);
|
|
7244
|
-
} else {
|
|
7245
|
-
return root;
|
|
7246
|
-
}
|
|
7247
|
-
}
|
|
7248
|
-
for (let i10 = 0, len9 = array.length; i10 < len9; i10++) {
|
|
7249
|
-
const i = i10;
|
|
7250
|
-
const node = array[i10];
|
|
7251
|
-
if (!(node != null)) {
|
|
7252
|
-
continue;
|
|
7253
|
-
}
|
|
7254
|
-
if (predicate(node)) {
|
|
7255
|
-
const ret = replacer(node, root);
|
|
7256
|
-
replaceNodesRecursive(ret, predicate, replacer);
|
|
7257
|
-
array[i] = ret;
|
|
7258
|
-
} else {
|
|
7259
|
-
replaceNodesRecursive(node, predicate, replacer);
|
|
7260
|
-
}
|
|
7261
|
-
}
|
|
7262
|
-
return root;
|
|
7263
|
-
}
|
|
7264
7554
|
function typeOfJSX(node, config2) {
|
|
7265
7555
|
switch (node.type) {
|
|
7266
7556
|
case "JSXElement":
|
|
@@ -7541,6 +7831,8 @@ var grammar = {
|
|
|
7541
7831
|
BooleanLiteral,
|
|
7542
7832
|
_BooleanLiteral,
|
|
7543
7833
|
CoffeeScriptBooleanLiteral,
|
|
7834
|
+
SymbolLiteral,
|
|
7835
|
+
SymbolElement,
|
|
7544
7836
|
Identifier,
|
|
7545
7837
|
IdentifierName,
|
|
7546
7838
|
IdentifierReference,
|
|
@@ -7641,6 +7933,8 @@ var grammar = {
|
|
|
7641
7933
|
WhileClause,
|
|
7642
7934
|
ForStatement,
|
|
7643
7935
|
ForClause,
|
|
7936
|
+
ForStatementControlWithWhen,
|
|
7937
|
+
ForReduction,
|
|
7644
7938
|
ForStatementControl,
|
|
7645
7939
|
WhenCondition,
|
|
7646
7940
|
CoffeeForStatementParameters,
|
|
@@ -8054,7 +8348,7 @@ var grammar = {
|
|
|
8054
8348
|
InlineInterfacePropertyDelimiter,
|
|
8055
8349
|
TypeBinaryOp,
|
|
8056
8350
|
TypeFunction,
|
|
8057
|
-
|
|
8351
|
+
TypeFunctionArrow,
|
|
8058
8352
|
TypeArguments,
|
|
8059
8353
|
ImplicitTypeArguments,
|
|
8060
8354
|
TypeApplicationStart,
|
|
@@ -8261,128 +8555,135 @@ var $L116 = (0, import_lib4.$L)("\u2209");
|
|
|
8261
8555
|
var $L117 = (0, import_lib4.$L)("&");
|
|
8262
8556
|
var $L118 = (0, import_lib4.$L)("|");
|
|
8263
8557
|
var $L119 = (0, import_lib4.$L)(";");
|
|
8264
|
-
var $L120 = (0, import_lib4.$L)("
|
|
8265
|
-
var $L121 = (0, import_lib4.$L)("
|
|
8266
|
-
var $L122 = (0, import_lib4.$L)("
|
|
8267
|
-
var $L123 = (0, import_lib4.$L)("
|
|
8268
|
-
var $L124 = (0, import_lib4.$L)("
|
|
8269
|
-
var $L125 = (0, import_lib4.$L)("
|
|
8270
|
-
var $L126 = (0, import_lib4.$L)("
|
|
8271
|
-
var $L127 = (0, import_lib4.$L)("
|
|
8272
|
-
var $L128 = (0, import_lib4.$L)("
|
|
8273
|
-
var $L129 = (0, import_lib4.$L)("
|
|
8274
|
-
var $L130 = (0, import_lib4.$L)("
|
|
8275
|
-
var $L131 = (0, import_lib4.$L)("
|
|
8276
|
-
var $L132 = (0, import_lib4.$L)("
|
|
8277
|
-
var $L133 = (0, import_lib4.$L)("
|
|
8278
|
-
var $L134 = (0, import_lib4.$L)("
|
|
8279
|
-
var $L135 = (0, import_lib4.$L)("
|
|
8280
|
-
var $L136 = (0, import_lib4.$L)("
|
|
8281
|
-
var $L137 = (0, import_lib4.$L)("
|
|
8282
|
-
var $L138 = (0, import_lib4.$L)("
|
|
8283
|
-
var $L139 = (0, import_lib4.$L)("
|
|
8284
|
-
var $L140 = (0, import_lib4.$L)("
|
|
8285
|
-
var $L141 = (0, import_lib4.$L)("
|
|
8286
|
-
var $L142 = (0, import_lib4.$L)("
|
|
8287
|
-
var $L143 = (0, import_lib4.$L)("
|
|
8288
|
-
var $L144 = (0, import_lib4.$L)("
|
|
8289
|
-
var $L145 = (0, import_lib4.$L)("
|
|
8290
|
-
var $L146 = (0, import_lib4.$L)("
|
|
8291
|
-
var $L147 = (0, import_lib4.$L)("
|
|
8292
|
-
var $L148 = (0, import_lib4.$L)("
|
|
8293
|
-
var $L149 = (0, import_lib4.$L)("
|
|
8294
|
-
var $L150 = (0, import_lib4.$L)("
|
|
8295
|
-
var $L151 = (0, import_lib4.$L)("
|
|
8296
|
-
var $L152 = (0, import_lib4.$L)("
|
|
8297
|
-
var $L153 = (0, import_lib4.$L)("
|
|
8298
|
-
var $L154 = (0, import_lib4.$L)("
|
|
8299
|
-
var $L155 = (0, import_lib4.$L)("
|
|
8300
|
-
var $L156 = (0, import_lib4.$L)(
|
|
8301
|
-
var $L157 = (0, import_lib4.$L)("
|
|
8302
|
-
var $L158 = (0, import_lib4.$L)("
|
|
8303
|
-
var $L159 = (0, import_lib4.$L)("
|
|
8304
|
-
var $L160 = (0, import_lib4.$L)("
|
|
8305
|
-
var $L161 = (0, import_lib4.$L)("
|
|
8306
|
-
var $L162 = (0, import_lib4.$L)("
|
|
8307
|
-
var $L163 = (0, import_lib4.$L)("
|
|
8308
|
-
var $L164 = (0, import_lib4.$L)("
|
|
8309
|
-
var $L165 = (0, import_lib4.$L)("
|
|
8310
|
-
var $L166 = (0, import_lib4.$L)("
|
|
8311
|
-
var $L167 = (0, import_lib4.$L)("
|
|
8312
|
-
var $L168 = (0, import_lib4.$L)("
|
|
8313
|
-
var $L169 = (0, import_lib4.$L)("
|
|
8314
|
-
var $L170 = (0, import_lib4.$L)("
|
|
8315
|
-
var $L171 = (0, import_lib4.$L)("
|
|
8316
|
-
var $L172 = (0, import_lib4.$L)("
|
|
8317
|
-
var $L173 = (0, import_lib4.$L)("
|
|
8318
|
-
var $L174 = (0, import_lib4.$L)("
|
|
8319
|
-
var $L175 = (0, import_lib4.$L)("
|
|
8320
|
-
var $L176 = (0, import_lib4.$L)("
|
|
8321
|
-
var $L177 = (0, import_lib4.$L)("
|
|
8322
|
-
var $L178 = (0, import_lib4.$L)("
|
|
8323
|
-
var $L179 = (0, import_lib4.$L)("
|
|
8324
|
-
var $L180 = (0, import_lib4.$L)("
|
|
8325
|
-
var $L181 = (0, import_lib4.$L)("
|
|
8326
|
-
var $L182 = (0, import_lib4.$L)("
|
|
8327
|
-
var $L183 = (0, import_lib4.$L)("
|
|
8328
|
-
var $L184 = (0, import_lib4.$L)("
|
|
8329
|
-
var $L185 = (0, import_lib4.$L)("
|
|
8330
|
-
var $L186 = (0, import_lib4.$L)("
|
|
8331
|
-
var $L187 = (0, import_lib4.$L)("
|
|
8332
|
-
var $L188 = (0, import_lib4.$L)("
|
|
8333
|
-
var $L189 = (0, import_lib4.$L)("
|
|
8334
|
-
var $L190 = (0, import_lib4.$L)("
|
|
8335
|
-
var $L191 = (0, import_lib4.$L)("
|
|
8336
|
-
var $L192 = (0, import_lib4.$L)("
|
|
8337
|
-
var $L193 = (0, import_lib4.$L)("
|
|
8338
|
-
var $L194 = (0, import_lib4.$L)("
|
|
8339
|
-
var $L195 = (0, import_lib4.$L)("
|
|
8340
|
-
var $L196 = (0, import_lib4.$L)("
|
|
8341
|
-
var $L197 = (0, import_lib4.$L)("
|
|
8342
|
-
var $L198 = (0, import_lib4.$L)("
|
|
8343
|
-
var $L199 = (0, import_lib4.$L)("
|
|
8344
|
-
var $L200 = (0, import_lib4.$L)("
|
|
8345
|
-
var $L201 = (0, import_lib4.$L)("
|
|
8346
|
-
var $L202 = (0, import_lib4.$L)("
|
|
8347
|
-
var $L203 = (0, import_lib4.$L)("
|
|
8348
|
-
var $L204 = (0, import_lib4.$L)("
|
|
8349
|
-
var $L205 = (0, import_lib4.$L)("
|
|
8350
|
-
var $L206 = (0, import_lib4.$L)(
|
|
8351
|
-
var $L207 = (0, import_lib4.$L)("
|
|
8352
|
-
var $L208 = (0, import_lib4.$L)("
|
|
8353
|
-
var $L209 = (0, import_lib4.$L)("
|
|
8354
|
-
var $L210 = (0, import_lib4.$L)("
|
|
8355
|
-
var $L211 = (0, import_lib4.$L)("
|
|
8356
|
-
var $L212 = (0, import_lib4.$L)("
|
|
8357
|
-
var $L213 = (0, import_lib4.$L)("
|
|
8358
|
-
var $L214 = (0, import_lib4.$L)("
|
|
8359
|
-
var $L215 = (0, import_lib4.$L)("
|
|
8360
|
-
var $L216 = (0, import_lib4.$L)("
|
|
8361
|
-
var $L217 = (0, import_lib4.$L)("
|
|
8362
|
-
var $L218 = (0, import_lib4.$L)("
|
|
8363
|
-
var $L219 = (0, import_lib4.$L)("
|
|
8364
|
-
var $L220 = (0, import_lib4.$L)("
|
|
8365
|
-
var $L221 = (0, import_lib4.$L)("
|
|
8366
|
-
var $L222 = (0, import_lib4.$L)("
|
|
8367
|
-
var $L223 = (0, import_lib4.$L)("
|
|
8368
|
-
var $L224 = (0, import_lib4.$L)("
|
|
8369
|
-
var $L225 = (0, import_lib4.$L)("
|
|
8370
|
-
var $L226 = (0, import_lib4.$L)("
|
|
8371
|
-
var $L227 = (0, import_lib4.$L)("
|
|
8372
|
-
var $L228 = (0, import_lib4.$L)("
|
|
8373
|
-
var $L229 = (0, import_lib4.$L)("
|
|
8374
|
-
var $L230 = (0, import_lib4.$L)("
|
|
8375
|
-
var $L231 = (0, import_lib4.$L)("
|
|
8376
|
-
var $L232 = (0, import_lib4.$L)("
|
|
8377
|
-
var $L233 = (0, import_lib4.$L)("
|
|
8378
|
-
var $L234 = (0, import_lib4.$L)("
|
|
8379
|
-
var $L235 = (0, import_lib4.$L)("
|
|
8380
|
-
var $L236 = (0, import_lib4.$L)("
|
|
8381
|
-
var $L237 = (0, import_lib4.$L)("
|
|
8382
|
-
var $L238 = (0, import_lib4.$L)("
|
|
8558
|
+
var $L120 = (0, import_lib4.$L)("some");
|
|
8559
|
+
var $L121 = (0, import_lib4.$L)("every");
|
|
8560
|
+
var $L122 = (0, import_lib4.$L)("count");
|
|
8561
|
+
var $L123 = (0, import_lib4.$L)("sum");
|
|
8562
|
+
var $L124 = (0, import_lib4.$L)("product");
|
|
8563
|
+
var $L125 = (0, import_lib4.$L)("min");
|
|
8564
|
+
var $L126 = (0, import_lib4.$L)("max");
|
|
8565
|
+
var $L127 = (0, import_lib4.$L)("break");
|
|
8566
|
+
var $L128 = (0, import_lib4.$L)("continue");
|
|
8567
|
+
var $L129 = (0, import_lib4.$L)("debugger");
|
|
8568
|
+
var $L130 = (0, import_lib4.$L)("require");
|
|
8569
|
+
var $L131 = (0, import_lib4.$L)("with");
|
|
8570
|
+
var $L132 = (0, import_lib4.$L)("assert");
|
|
8571
|
+
var $L133 = (0, import_lib4.$L)(":=");
|
|
8572
|
+
var $L134 = (0, import_lib4.$L)("\u2254");
|
|
8573
|
+
var $L135 = (0, import_lib4.$L)(".=");
|
|
8574
|
+
var $L136 = (0, import_lib4.$L)("::=");
|
|
8575
|
+
var $L137 = (0, import_lib4.$L)("/*");
|
|
8576
|
+
var $L138 = (0, import_lib4.$L)("*/");
|
|
8577
|
+
var $L139 = (0, import_lib4.$L)("\\");
|
|
8578
|
+
var $L140 = (0, import_lib4.$L)(")");
|
|
8579
|
+
var $L141 = (0, import_lib4.$L)("abstract");
|
|
8580
|
+
var $L142 = (0, import_lib4.$L)("as");
|
|
8581
|
+
var $L143 = (0, import_lib4.$L)("@");
|
|
8582
|
+
var $L144 = (0, import_lib4.$L)("@@");
|
|
8583
|
+
var $L145 = (0, import_lib4.$L)("async");
|
|
8584
|
+
var $L146 = (0, import_lib4.$L)("await");
|
|
8585
|
+
var $L147 = (0, import_lib4.$L)("`");
|
|
8586
|
+
var $L148 = (0, import_lib4.$L)("by");
|
|
8587
|
+
var $L149 = (0, import_lib4.$L)("case");
|
|
8588
|
+
var $L150 = (0, import_lib4.$L)("catch");
|
|
8589
|
+
var $L151 = (0, import_lib4.$L)("class");
|
|
8590
|
+
var $L152 = (0, import_lib4.$L)("#{");
|
|
8591
|
+
var $L153 = (0, import_lib4.$L)("comptime");
|
|
8592
|
+
var $L154 = (0, import_lib4.$L)("declare");
|
|
8593
|
+
var $L155 = (0, import_lib4.$L)("default");
|
|
8594
|
+
var $L156 = (0, import_lib4.$L)("delete");
|
|
8595
|
+
var $L157 = (0, import_lib4.$L)("do");
|
|
8596
|
+
var $L158 = (0, import_lib4.$L)("..");
|
|
8597
|
+
var $L159 = (0, import_lib4.$L)("\u2025");
|
|
8598
|
+
var $L160 = (0, import_lib4.$L)("...");
|
|
8599
|
+
var $L161 = (0, import_lib4.$L)("\u2026");
|
|
8600
|
+
var $L162 = (0, import_lib4.$L)("::");
|
|
8601
|
+
var $L163 = (0, import_lib4.$L)('"');
|
|
8602
|
+
var $L164 = (0, import_lib4.$L)("each");
|
|
8603
|
+
var $L165 = (0, import_lib4.$L)("else");
|
|
8604
|
+
var $L166 = (0, import_lib4.$L)("!");
|
|
8605
|
+
var $L167 = (0, import_lib4.$L)("export");
|
|
8606
|
+
var $L168 = (0, import_lib4.$L)("extends");
|
|
8607
|
+
var $L169 = (0, import_lib4.$L)("finally");
|
|
8608
|
+
var $L170 = (0, import_lib4.$L)("for");
|
|
8609
|
+
var $L171 = (0, import_lib4.$L)("from");
|
|
8610
|
+
var $L172 = (0, import_lib4.$L)("function");
|
|
8611
|
+
var $L173 = (0, import_lib4.$L)("get");
|
|
8612
|
+
var $L174 = (0, import_lib4.$L)("set");
|
|
8613
|
+
var $L175 = (0, import_lib4.$L)("#");
|
|
8614
|
+
var $L176 = (0, import_lib4.$L)("if");
|
|
8615
|
+
var $L177 = (0, import_lib4.$L)("in");
|
|
8616
|
+
var $L178 = (0, import_lib4.$L)("infer");
|
|
8617
|
+
var $L179 = (0, import_lib4.$L)("let");
|
|
8618
|
+
var $L180 = (0, import_lib4.$L)("const");
|
|
8619
|
+
var $L181 = (0, import_lib4.$L)("is");
|
|
8620
|
+
var $L182 = (0, import_lib4.$L)("var");
|
|
8621
|
+
var $L183 = (0, import_lib4.$L)("like");
|
|
8622
|
+
var $L184 = (0, import_lib4.$L)("loop");
|
|
8623
|
+
var $L185 = (0, import_lib4.$L)("new");
|
|
8624
|
+
var $L186 = (0, import_lib4.$L)("not");
|
|
8625
|
+
var $L187 = (0, import_lib4.$L)("of");
|
|
8626
|
+
var $L188 = (0, import_lib4.$L)("[");
|
|
8627
|
+
var $L189 = (0, import_lib4.$L)("operator");
|
|
8628
|
+
var $L190 = (0, import_lib4.$L)("override");
|
|
8629
|
+
var $L191 = (0, import_lib4.$L)("own");
|
|
8630
|
+
var $L192 = (0, import_lib4.$L)("public");
|
|
8631
|
+
var $L193 = (0, import_lib4.$L)("private");
|
|
8632
|
+
var $L194 = (0, import_lib4.$L)("protected");
|
|
8633
|
+
var $L195 = (0, import_lib4.$L)("||>");
|
|
8634
|
+
var $L196 = (0, import_lib4.$L)("|\u25B7");
|
|
8635
|
+
var $L197 = (0, import_lib4.$L)("|>=");
|
|
8636
|
+
var $L198 = (0, import_lib4.$L)("\u25B7=");
|
|
8637
|
+
var $L199 = (0, import_lib4.$L)("|>");
|
|
8638
|
+
var $L200 = (0, import_lib4.$L)("\u25B7");
|
|
8639
|
+
var $L201 = (0, import_lib4.$L)("readonly");
|
|
8640
|
+
var $L202 = (0, import_lib4.$L)("return");
|
|
8641
|
+
var $L203 = (0, import_lib4.$L)("satisfies");
|
|
8642
|
+
var $L204 = (0, import_lib4.$L)("'");
|
|
8643
|
+
var $L205 = (0, import_lib4.$L)("static");
|
|
8644
|
+
var $L206 = (0, import_lib4.$L)("${");
|
|
8645
|
+
var $L207 = (0, import_lib4.$L)("super");
|
|
8646
|
+
var $L208 = (0, import_lib4.$L)("switch");
|
|
8647
|
+
var $L209 = (0, import_lib4.$L)("target");
|
|
8648
|
+
var $L210 = (0, import_lib4.$L)("then");
|
|
8649
|
+
var $L211 = (0, import_lib4.$L)("this");
|
|
8650
|
+
var $L212 = (0, import_lib4.$L)("throw");
|
|
8651
|
+
var $L213 = (0, import_lib4.$L)('"""');
|
|
8652
|
+
var $L214 = (0, import_lib4.$L)("'''");
|
|
8653
|
+
var $L215 = (0, import_lib4.$L)("///");
|
|
8654
|
+
var $L216 = (0, import_lib4.$L)("```");
|
|
8655
|
+
var $L217 = (0, import_lib4.$L)("try");
|
|
8656
|
+
var $L218 = (0, import_lib4.$L)("typeof");
|
|
8657
|
+
var $L219 = (0, import_lib4.$L)("undefined");
|
|
8658
|
+
var $L220 = (0, import_lib4.$L)("unless");
|
|
8659
|
+
var $L221 = (0, import_lib4.$L)("until");
|
|
8660
|
+
var $L222 = (0, import_lib4.$L)("using");
|
|
8661
|
+
var $L223 = (0, import_lib4.$L)("void");
|
|
8662
|
+
var $L224 = (0, import_lib4.$L)("when");
|
|
8663
|
+
var $L225 = (0, import_lib4.$L)("while");
|
|
8664
|
+
var $L226 = (0, import_lib4.$L)("yield");
|
|
8665
|
+
var $L227 = (0, import_lib4.$L)("/>");
|
|
8666
|
+
var $L228 = (0, import_lib4.$L)("</");
|
|
8667
|
+
var $L229 = (0, import_lib4.$L)("<>");
|
|
8668
|
+
var $L230 = (0, import_lib4.$L)("</>");
|
|
8669
|
+
var $L231 = (0, import_lib4.$L)("<!--");
|
|
8670
|
+
var $L232 = (0, import_lib4.$L)("-->");
|
|
8671
|
+
var $L233 = (0, import_lib4.$L)("type");
|
|
8672
|
+
var $L234 = (0, import_lib4.$L)("enum");
|
|
8673
|
+
var $L235 = (0, import_lib4.$L)("interface");
|
|
8674
|
+
var $L236 = (0, import_lib4.$L)("global");
|
|
8675
|
+
var $L237 = (0, import_lib4.$L)("module");
|
|
8676
|
+
var $L238 = (0, import_lib4.$L)("namespace");
|
|
8677
|
+
var $L239 = (0, import_lib4.$L)("asserts");
|
|
8678
|
+
var $L240 = (0, import_lib4.$L)("keyof");
|
|
8679
|
+
var $L241 = (0, import_lib4.$L)("???");
|
|
8680
|
+
var $L242 = (0, import_lib4.$L)("unique");
|
|
8681
|
+
var $L243 = (0, import_lib4.$L)("symbol");
|
|
8682
|
+
var $L244 = (0, import_lib4.$L)("[]");
|
|
8683
|
+
var $L245 = (0, import_lib4.$L)("civet");
|
|
8383
8684
|
var $R0 = (0, import_lib4.$R)(new RegExp("(?=async|debugger|if|unless|comptime|do|for|loop|until|while|switch|throw|try)", "suy"));
|
|
8384
8685
|
var $R1 = (0, import_lib4.$R)(new RegExp("&(?=\\s)", "suy"));
|
|
8385
|
-
var $R2 = (0, import_lib4.$R)(new RegExp("(as|of|satisfies|then|when|implements|xor|xnor)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
|
|
8686
|
+
var $R2 = (0, import_lib4.$R)(new RegExp("(as|of|by|satisfies|then|when|implements|xor|xnor)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
|
|
8386
8687
|
var $R3 = (0, import_lib4.$R)(new RegExp("[0-9]", "suy"));
|
|
8387
8688
|
var $R4 = (0, import_lib4.$R)(new RegExp("(?!\\p{ID_Start}|[_$0-9(\\[{])", "suy"));
|
|
8388
8689
|
var $R5 = (0, import_lib4.$R)(new RegExp("[ \\t]", "suy"));
|
|
@@ -8609,12 +8910,7 @@ var StatementExpression$1 = (0, import_lib4.$TS)((0, import_lib4.$S)(IfStatement
|
|
|
8609
8910
|
return $skip;
|
|
8610
8911
|
return $1;
|
|
8611
8912
|
});
|
|
8612
|
-
var StatementExpression$2 =
|
|
8613
|
-
if ($1.block.implicit && $1.subtype !== "DoStatement" && $1.subtype !== "ComptimeStatement") {
|
|
8614
|
-
return $skip;
|
|
8615
|
-
}
|
|
8616
|
-
return $1;
|
|
8617
|
-
});
|
|
8913
|
+
var StatementExpression$2 = IterationExpression;
|
|
8618
8914
|
var StatementExpression$3 = SwitchStatement;
|
|
8619
8915
|
var StatementExpression$4 = ThrowStatement;
|
|
8620
8916
|
var StatementExpression$5 = TryStatement;
|
|
@@ -8712,7 +9008,7 @@ var ForbiddenImplicitCalls$$ = [ForbiddenImplicitCalls$0, ForbiddenImplicitCalls
|
|
|
8712
9008
|
function ForbiddenImplicitCalls(ctx, state2) {
|
|
8713
9009
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "ForbiddenImplicitCalls", ForbiddenImplicitCalls$$);
|
|
8714
9010
|
}
|
|
8715
|
-
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$])/"));
|
|
9011
|
+
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$])/"));
|
|
8716
9012
|
function ReservedBinary(ctx, state2) {
|
|
8717
9013
|
return (0, import_lib4.$EVENT)(ctx, state2, "ReservedBinary", ReservedBinary$0);
|
|
8718
9014
|
}
|
|
@@ -9343,7 +9639,7 @@ var PipelineHeadItem$$ = [PipelineHeadItem$0, PipelineHeadItem$1];
|
|
|
9343
9639
|
function PipelineHeadItem(ctx, state2) {
|
|
9344
9640
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "PipelineHeadItem", PipelineHeadItem$$);
|
|
9345
9641
|
}
|
|
9346
|
-
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) {
|
|
9642
|
+
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) {
|
|
9347
9643
|
return value[0];
|
|
9348
9644
|
});
|
|
9349
9645
|
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) {
|
|
@@ -9375,8 +9671,9 @@ var PrimaryExpression$7 = ClassExpression;
|
|
|
9375
9671
|
var PrimaryExpression$8 = RegularExpressionLiteral;
|
|
9376
9672
|
var PrimaryExpression$9 = ParenthesizedExpression;
|
|
9377
9673
|
var PrimaryExpression$10 = Placeholder;
|
|
9378
|
-
var PrimaryExpression$11 =
|
|
9379
|
-
var PrimaryExpression
|
|
9674
|
+
var PrimaryExpression$11 = SymbolLiteral;
|
|
9675
|
+
var PrimaryExpression$12 = JSXImplicitFragment;
|
|
9676
|
+
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];
|
|
9380
9677
|
function PrimaryExpression(ctx, state2) {
|
|
9381
9678
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "PrimaryExpression", PrimaryExpression$$);
|
|
9382
9679
|
}
|
|
@@ -10205,7 +10502,7 @@ var PropertyAccessModifier$$ = [PropertyAccessModifier$0, PropertyAccessModifier
|
|
|
10205
10502
|
function PropertyAccessModifier(ctx, state2) {
|
|
10206
10503
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "PropertyAccessModifier", PropertyAccessModifier$$);
|
|
10207
10504
|
}
|
|
10208
|
-
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) {
|
|
10505
|
+
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) {
|
|
10209
10506
|
var dot = $1;
|
|
10210
10507
|
var literal = $2;
|
|
10211
10508
|
return {
|
|
@@ -11749,6 +12046,55 @@ var CoffeeScriptBooleanLiteral$$ = [CoffeeScriptBooleanLiteral$0, CoffeeScriptBo
|
|
|
11749
12046
|
function CoffeeScriptBooleanLiteral(ctx, state2) {
|
|
11750
12047
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "CoffeeScriptBooleanLiteral", CoffeeScriptBooleanLiteral$$);
|
|
11751
12048
|
}
|
|
12049
|
+
var SymbolLiteral$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(Colon, (0, import_lib4.$C)(IdentifierName, StringLiteral)), function($skip, $loc, $0, $1, $2) {
|
|
12050
|
+
var colon = $1;
|
|
12051
|
+
var id = $2;
|
|
12052
|
+
let name, token;
|
|
12053
|
+
if (id.type === "Identifier") {
|
|
12054
|
+
({ name, children: [token] } = id);
|
|
12055
|
+
} else {
|
|
12056
|
+
name = literalValue({
|
|
12057
|
+
type: "Literal",
|
|
12058
|
+
subtype: "StringLiteral",
|
|
12059
|
+
raw: id.token,
|
|
12060
|
+
children: [id]
|
|
12061
|
+
});
|
|
12062
|
+
token = id;
|
|
12063
|
+
}
|
|
12064
|
+
if (config.symbols.includes(name)) {
|
|
12065
|
+
return {
|
|
12066
|
+
type: "SymbolLiteral",
|
|
12067
|
+
children: id.type === "Identifier" ? [
|
|
12068
|
+
{ ...colon, token: "Symbol." },
|
|
12069
|
+
token
|
|
12070
|
+
] : [
|
|
12071
|
+
{ ...colon, token: "Symbol[" },
|
|
12072
|
+
token,
|
|
12073
|
+
"]"
|
|
12074
|
+
],
|
|
12075
|
+
name
|
|
12076
|
+
};
|
|
12077
|
+
} else {
|
|
12078
|
+
return {
|
|
12079
|
+
type: "SymbolLiteral",
|
|
12080
|
+
children: [
|
|
12081
|
+
{ ...colon, token: "Symbol.for(" },
|
|
12082
|
+
id.type === "Identifier" ? ['"', token, '"'] : token,
|
|
12083
|
+
")"
|
|
12084
|
+
],
|
|
12085
|
+
name
|
|
12086
|
+
};
|
|
12087
|
+
}
|
|
12088
|
+
});
|
|
12089
|
+
function SymbolLiteral(ctx, state2) {
|
|
12090
|
+
return (0, import_lib4.$EVENT)(ctx, state2, "SymbolLiteral", SymbolLiteral$0);
|
|
12091
|
+
}
|
|
12092
|
+
var SymbolElement$0 = (0, import_lib4.$T)((0, import_lib4.$S)(SymbolLiteral), function(value) {
|
|
12093
|
+
return ["[", value[0], "]"];
|
|
12094
|
+
});
|
|
12095
|
+
function SymbolElement(ctx, state2) {
|
|
12096
|
+
return (0, import_lib4.$EVENT)(ctx, state2, "SymbolElement", SymbolElement$0);
|
|
12097
|
+
}
|
|
11752
12098
|
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) {
|
|
11753
12099
|
var id = value[2];
|
|
11754
12100
|
return id;
|
|
@@ -12496,7 +12842,8 @@ var PropertyName$3 = (0, import_lib4.$TV)((0, import_lib4.$TEXT)((0, import_lib4
|
|
|
12496
12842
|
});
|
|
12497
12843
|
var PropertyName$4 = IdentifierName;
|
|
12498
12844
|
var PropertyName$5 = LengthShorthand;
|
|
12499
|
-
var PropertyName
|
|
12845
|
+
var PropertyName$6 = SymbolElement;
|
|
12846
|
+
var PropertyName$$ = [PropertyName$0, PropertyName$1, PropertyName$2, PropertyName$3, PropertyName$4, PropertyName$5, PropertyName$6];
|
|
12500
12847
|
function PropertyName(ctx, state2) {
|
|
12501
12848
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "PropertyName", PropertyName$$);
|
|
12502
12849
|
}
|
|
@@ -12758,7 +13105,8 @@ function MethodSignature(ctx, state2) {
|
|
|
12758
13105
|
var ClassElementName$0 = PropertyName;
|
|
12759
13106
|
var ClassElementName$1 = LengthShorthand;
|
|
12760
13107
|
var ClassElementName$2 = PrivateIdentifier;
|
|
12761
|
-
var ClassElementName
|
|
13108
|
+
var ClassElementName$3 = SymbolElement;
|
|
13109
|
+
var ClassElementName$$ = [ClassElementName$0, ClassElementName$1, ClassElementName$2, ClassElementName$3];
|
|
12762
13110
|
function ClassElementName(ctx, state2) {
|
|
12763
13111
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "ClassElementName", ClassElementName$$);
|
|
12764
13112
|
}
|
|
@@ -13375,6 +13723,8 @@ var Statement$2 = (0, import_lib4.$T)((0, import_lib4.$S)(IfStatement, (0, impor
|
|
|
13375
13723
|
var Statement$3 = (0, import_lib4.$TS)((0, import_lib4.$S)(IterationStatement, (0, import_lib4.$N)(ShouldExpressionize)), function($skip, $loc, $0, $1, $2) {
|
|
13376
13724
|
if ($1.generator)
|
|
13377
13725
|
return $skip;
|
|
13726
|
+
if ($1.reduction)
|
|
13727
|
+
return $skip;
|
|
13378
13728
|
return $1;
|
|
13379
13729
|
});
|
|
13380
13730
|
var Statement$4 = (0, import_lib4.$T)((0, import_lib4.$S)(SwitchStatement, (0, import_lib4.$N)(ShouldExpressionize)), function(value) {
|
|
@@ -13420,7 +13770,7 @@ function EmptyStatement(ctx, state2) {
|
|
|
13420
13770
|
return (0, import_lib4.$EVENT)(ctx, state2, "EmptyStatement", EmptyStatement$0);
|
|
13421
13771
|
}
|
|
13422
13772
|
var InsertEmptyStatement$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(InsertSemicolon), function($skip, $loc, $0, $1) {
|
|
13423
|
-
return { type: "EmptyStatement", children: [$1] };
|
|
13773
|
+
return { type: "EmptyStatement", children: [$1], implicit: true };
|
|
13424
13774
|
});
|
|
13425
13775
|
function InsertEmptyStatement(ctx, state2) {
|
|
13426
13776
|
return (0, import_lib4.$EVENT)(ctx, state2, "InsertEmptyStatement", InsertEmptyStatement$0);
|
|
@@ -13715,7 +14065,7 @@ var ForStatement$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(ForClause, BlockOr
|
|
|
13715
14065
|
function ForStatement(ctx, state2) {
|
|
13716
14066
|
return (0, import_lib4.$EVENT)(ctx, state2, "ForStatement", ForStatement$0);
|
|
13717
14067
|
}
|
|
13718
|
-
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)), __,
|
|
14068
|
+
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) {
|
|
13719
14069
|
var generator = $2;
|
|
13720
14070
|
var c = $4;
|
|
13721
14071
|
const { children, declaration } = c;
|
|
@@ -13726,32 +14076,63 @@ var ForClause$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(For, (0, import_lib4.
|
|
|
13726
14076
|
block: null,
|
|
13727
14077
|
blockPrefix: c.blockPrefix,
|
|
13728
14078
|
hoistDec: c.hoistDec,
|
|
14079
|
+
reduction: c.reduction,
|
|
13729
14080
|
generator
|
|
13730
14081
|
};
|
|
13731
14082
|
});
|
|
13732
14083
|
function ForClause(ctx, state2) {
|
|
13733
14084
|
return (0, import_lib4.$EVENT)(ctx, state2, "ForClause", ForClause$0);
|
|
13734
14085
|
}
|
|
14086
|
+
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) {
|
|
14087
|
+
var reduction = $1;
|
|
14088
|
+
var control = $2;
|
|
14089
|
+
var condition = $3;
|
|
14090
|
+
if (reduction)
|
|
14091
|
+
control = { ...control, reduction };
|
|
14092
|
+
if (!condition)
|
|
14093
|
+
return control;
|
|
14094
|
+
const expressions = [["", {
|
|
14095
|
+
type: "ContinueStatement",
|
|
14096
|
+
children: ["continue"]
|
|
14097
|
+
}]];
|
|
14098
|
+
const block = {
|
|
14099
|
+
type: "BlockStatement",
|
|
14100
|
+
expressions,
|
|
14101
|
+
children: [expressions],
|
|
14102
|
+
bare: true
|
|
14103
|
+
};
|
|
14104
|
+
return {
|
|
14105
|
+
...control,
|
|
14106
|
+
blockPrefix: [
|
|
14107
|
+
...control.blockPrefix ?? [],
|
|
14108
|
+
["", {
|
|
14109
|
+
type: "IfStatement",
|
|
14110
|
+
then: block,
|
|
14111
|
+
children: ["if (!", makeLeftHandSideExpression(trimFirstSpace(condition)), ") ", block]
|
|
14112
|
+
}, ";"]
|
|
14113
|
+
]
|
|
14114
|
+
};
|
|
14115
|
+
});
|
|
14116
|
+
function ForStatementControlWithWhen(ctx, state2) {
|
|
14117
|
+
return (0, import_lib4.$EVENT)(ctx, state2, "ForStatementControlWithWhen", ForStatementControlWithWhen$0);
|
|
14118
|
+
}
|
|
14119
|
+
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) {
|
|
14120
|
+
var subtype = $1;
|
|
14121
|
+
var ws = $3;
|
|
14122
|
+
return {
|
|
14123
|
+
type: "ForReduction",
|
|
14124
|
+
subtype,
|
|
14125
|
+
children: [ws]
|
|
14126
|
+
};
|
|
14127
|
+
});
|
|
14128
|
+
function ForReduction(ctx, state2) {
|
|
14129
|
+
return (0, import_lib4.$EVENT)(ctx, state2, "ForReduction", ForReduction$0);
|
|
14130
|
+
}
|
|
13735
14131
|
var ForStatementControl$0 = (0, import_lib4.$T)((0, import_lib4.$S)((0, import_lib4.$N)(CoffeeForLoopsEnabled), ForStatementParameters), function(value) {
|
|
13736
14132
|
return value[1];
|
|
13737
14133
|
});
|
|
13738
|
-
var ForStatementControl$1 = (0, import_lib4.$
|
|
13739
|
-
|
|
13740
|
-
if (condition) {
|
|
13741
|
-
const block = "continue";
|
|
13742
|
-
$2 = {
|
|
13743
|
-
...$2,
|
|
13744
|
-
blockPrefix: [
|
|
13745
|
-
...$2.blockPrefix,
|
|
13746
|
-
["", {
|
|
13747
|
-
type: "IfStatement",
|
|
13748
|
-
then: block,
|
|
13749
|
-
children: ["if (!(", trimFirstSpace(condition), ")) ", block]
|
|
13750
|
-
}, ";"]
|
|
13751
|
-
]
|
|
13752
|
-
};
|
|
13753
|
-
}
|
|
13754
|
-
return $2;
|
|
14134
|
+
var ForStatementControl$1 = (0, import_lib4.$T)((0, import_lib4.$S)(CoffeeForLoopsEnabled, CoffeeForStatementParameters), function(value) {
|
|
14135
|
+
return value[1];
|
|
13755
14136
|
});
|
|
13756
14137
|
var ForStatementControl$$ = [ForStatementControl$0, ForStatementControl$1];
|
|
13757
14138
|
function ForStatementControl(ctx, state2) {
|
|
@@ -13800,7 +14181,7 @@ var CoffeeForStatementParameters$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0
|
|
|
13800
14181
|
const counterRef = makeRef("i");
|
|
13801
14182
|
const lenRef = makeRef("len");
|
|
13802
14183
|
if (exp.type === "RangeExpression") {
|
|
13803
|
-
return forRange(open, declaration, exp, step
|
|
14184
|
+
return forRange(open, declaration, exp, step && prepend(trimFirstSpace(step[0]), trimFirstSpace(step[2])), close);
|
|
13804
14185
|
}
|
|
13805
14186
|
const expRef = maybeRef(exp);
|
|
13806
14187
|
const varRef = declaration;
|
|
@@ -13902,10 +14283,10 @@ var ForStatementParameters$1 = (0, import_lib4.$TS)((0, import_lib4.$S)(InsertOp
|
|
|
13902
14283
|
};
|
|
13903
14284
|
});
|
|
13904
14285
|
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) {
|
|
13905
|
-
return processForInOf($0
|
|
14286
|
+
return processForInOf($0);
|
|
13906
14287
|
});
|
|
13907
14288
|
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) {
|
|
13908
|
-
return processForInOf($0
|
|
14289
|
+
return processForInOf($0);
|
|
13909
14290
|
});
|
|
13910
14291
|
var ForStatementParameters$4 = ForRangeParameters;
|
|
13911
14292
|
var ForStatementParameters$$ = [ForStatementParameters$0, ForStatementParameters$1, ForStatementParameters$2, ForStatementParameters$3, ForStatementParameters$4];
|
|
@@ -13942,7 +14323,7 @@ var ForDeclaration$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(LetOrConstOrVar,
|
|
|
13942
14323
|
return {
|
|
13943
14324
|
type: "ForDeclaration",
|
|
13944
14325
|
children: [c, binding],
|
|
13945
|
-
|
|
14326
|
+
decl: c.token,
|
|
13946
14327
|
binding,
|
|
13947
14328
|
names: binding.names
|
|
13948
14329
|
};
|
|
@@ -13953,7 +14334,7 @@ var ForDeclaration$1 = (0, import_lib4.$TS)((0, import_lib4.$S)(InsertConst, (0,
|
|
|
13953
14334
|
return {
|
|
13954
14335
|
type: "ForDeclaration",
|
|
13955
14336
|
children: [c, binding],
|
|
13956
|
-
|
|
14337
|
+
decl: c.token,
|
|
13957
14338
|
binding,
|
|
13958
14339
|
names: binding.names
|
|
13959
14340
|
};
|
|
@@ -14673,19 +15054,19 @@ var ThrowStatement$0 = (0, import_lib4.$T)((0, import_lib4.$S)(Throw, MaybeParen
|
|
|
14673
15054
|
function ThrowStatement(ctx, state2) {
|
|
14674
15055
|
return (0, import_lib4.$EVENT)(ctx, state2, "ThrowStatement", ThrowStatement$0);
|
|
14675
15056
|
}
|
|
14676
|
-
var Break$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
15057
|
+
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) {
|
|
14677
15058
|
return { $loc, token: $1 };
|
|
14678
15059
|
});
|
|
14679
15060
|
function Break(ctx, state2) {
|
|
14680
15061
|
return (0, import_lib4.$EVENT)(ctx, state2, "Break", Break$0);
|
|
14681
15062
|
}
|
|
14682
|
-
var Continue$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
15063
|
+
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) {
|
|
14683
15064
|
return { $loc, token: $1 };
|
|
14684
15065
|
});
|
|
14685
15066
|
function Continue(ctx, state2) {
|
|
14686
15067
|
return (0, import_lib4.$EVENT)(ctx, state2, "Continue", Continue$0);
|
|
14687
15068
|
}
|
|
14688
|
-
var Debugger$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
15069
|
+
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) {
|
|
14689
15070
|
return { $loc, token: $1 };
|
|
14690
15071
|
});
|
|
14691
15072
|
function Debugger(ctx, state2) {
|
|
@@ -14753,7 +15134,7 @@ var MaybeParenNestedExpression$$ = [MaybeParenNestedExpression$0, MaybeParenNest
|
|
|
14753
15134
|
function MaybeParenNestedExpression(ctx, state2) {
|
|
14754
15135
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "MaybeParenNestedExpression", MaybeParenNestedExpression$$);
|
|
14755
15136
|
}
|
|
14756
|
-
var ImportDeclaration$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(Import, _, Identifier, (0, import_lib4.$E)(_), Equals, __, (0, import_lib4.$EXPECT)($
|
|
15137
|
+
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) {
|
|
14757
15138
|
const imp = [
|
|
14758
15139
|
{ ...$1, ts: true },
|
|
14759
15140
|
{ ...$1, token: "const", js: true }
|
|
@@ -14943,7 +15324,7 @@ var ImpliedFrom$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L0, 'ImpliedF
|
|
|
14943
15324
|
function ImpliedFrom(ctx, state2) {
|
|
14944
15325
|
return (0, import_lib4.$EVENT)(ctx, state2, "ImpliedFrom", ImpliedFrom$0);
|
|
14945
15326
|
}
|
|
14946
|
-
var ImportAssertion$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)(_), (0, import_lib4.$C)((0, import_lib4.$EXPECT)($
|
|
15327
|
+
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) {
|
|
14947
15328
|
var keyword = $2;
|
|
14948
15329
|
var object = $5;
|
|
14949
15330
|
return {
|
|
@@ -15262,19 +15643,19 @@ var LexicalDeclaration$$ = [LexicalDeclaration$0, LexicalDeclaration$1];
|
|
|
15262
15643
|
function LexicalDeclaration(ctx, state2) {
|
|
15263
15644
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "LexicalDeclaration", LexicalDeclaration$$);
|
|
15264
15645
|
}
|
|
15265
|
-
var ConstAssignment$0 = (0, import_lib4.$TV)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($
|
|
15646
|
+
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) {
|
|
15266
15647
|
return { $loc, token: "=", decl: "const " };
|
|
15267
15648
|
});
|
|
15268
15649
|
function ConstAssignment(ctx, state2) {
|
|
15269
15650
|
return (0, import_lib4.$EVENT)(ctx, state2, "ConstAssignment", ConstAssignment$0);
|
|
15270
15651
|
}
|
|
15271
|
-
var LetAssignment$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
15652
|
+
var LetAssignment$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L135, 'LetAssignment ".="'), function($skip, $loc, $0, $1) {
|
|
15272
15653
|
return { $loc, token: "=", decl: "let " };
|
|
15273
15654
|
});
|
|
15274
15655
|
function LetAssignment(ctx, state2) {
|
|
15275
15656
|
return (0, import_lib4.$EVENT)(ctx, state2, "LetAssignment", LetAssignment$0);
|
|
15276
15657
|
}
|
|
15277
|
-
var TypeAssignment$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
15658
|
+
var TypeAssignment$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L136, 'TypeAssignment "::="'), function($skip, $loc, $0, $1) {
|
|
15278
15659
|
return { $loc, token: "=" };
|
|
15279
15660
|
});
|
|
15280
15661
|
function TypeAssignment(ctx, state2) {
|
|
@@ -15697,7 +16078,7 @@ var MultiLineComment$$ = [MultiLineComment$0, MultiLineComment$1];
|
|
|
15697
16078
|
function MultiLineComment(ctx, state2) {
|
|
15698
16079
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "MultiLineComment", MultiLineComment$$);
|
|
15699
16080
|
}
|
|
15700
|
-
var JSMultiLineComment$0 = (0, import_lib4.$TV)((0, import_lib4.$TEXT)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16081
|
+
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) {
|
|
15701
16082
|
return { type: "Comment", $loc, token: $1 };
|
|
15702
16083
|
});
|
|
15703
16084
|
function JSMultiLineComment(ctx, state2) {
|
|
@@ -15743,7 +16124,7 @@ function _(ctx, state2) {
|
|
|
15743
16124
|
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) {
|
|
15744
16125
|
return { $loc, token: $0 };
|
|
15745
16126
|
});
|
|
15746
|
-
var NonNewlineWhitespace$1 = (0, import_lib4.$T)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16127
|
+
var NonNewlineWhitespace$1 = (0, import_lib4.$T)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L139, 'NonNewlineWhitespace "\\\\\\\\"'), CoffeeLineContinuationEnabled, EOL), function(value) {
|
|
15747
16128
|
return " ";
|
|
15748
16129
|
});
|
|
15749
16130
|
var NonNewlineWhitespace$$ = [NonNewlineWhitespace$0, NonNewlineWhitespace$1];
|
|
@@ -15789,7 +16170,7 @@ function SimpleStatementDelimiter(ctx, state2) {
|
|
|
15789
16170
|
}
|
|
15790
16171
|
var StatementDelimiter$0 = (0, import_lib4.$Y)(EOS);
|
|
15791
16172
|
var StatementDelimiter$1 = SemicolonDelimiter;
|
|
15792
|
-
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)($
|
|
16173
|
+
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 "]"'))));
|
|
15793
16174
|
var StatementDelimiter$$ = [StatementDelimiter$0, StatementDelimiter$1, StatementDelimiter$2];
|
|
15794
16175
|
function StatementDelimiter(ctx, state2) {
|
|
15795
16176
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "StatementDelimiter", StatementDelimiter$$);
|
|
@@ -15813,7 +16194,7 @@ var Loc$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L0, 'Loc ""'), functi
|
|
|
15813
16194
|
function Loc(ctx, state2) {
|
|
15814
16195
|
return (0, import_lib4.$EVENT)(ctx, state2, "Loc", Loc$0);
|
|
15815
16196
|
}
|
|
15816
|
-
var Abstract$0 = (0, import_lib4.$TV)((0, import_lib4.$TEXT)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16197
|
+
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) {
|
|
15817
16198
|
return { $loc, token: $1, ts: true };
|
|
15818
16199
|
});
|
|
15819
16200
|
function Abstract(ctx, state2) {
|
|
@@ -15825,43 +16206,43 @@ var Ampersand$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L117, 'Ampersan
|
|
|
15825
16206
|
function Ampersand(ctx, state2) {
|
|
15826
16207
|
return (0, import_lib4.$EVENT)(ctx, state2, "Ampersand", Ampersand$0);
|
|
15827
16208
|
}
|
|
15828
|
-
var As$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16209
|
+
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) {
|
|
15829
16210
|
return { $loc, token: $1 };
|
|
15830
16211
|
});
|
|
15831
16212
|
function As(ctx, state2) {
|
|
15832
16213
|
return (0, import_lib4.$EVENT)(ctx, state2, "As", As$0);
|
|
15833
16214
|
}
|
|
15834
|
-
var At$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16215
|
+
var At$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L143, 'At "@"'), function($skip, $loc, $0, $1) {
|
|
15835
16216
|
return { $loc, token: $1 };
|
|
15836
16217
|
});
|
|
15837
16218
|
function At(ctx, state2) {
|
|
15838
16219
|
return (0, import_lib4.$EVENT)(ctx, state2, "At", At$0);
|
|
15839
16220
|
}
|
|
15840
|
-
var AtAt$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16221
|
+
var AtAt$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L144, 'AtAt "@@"'), function($skip, $loc, $0, $1) {
|
|
15841
16222
|
return { $loc, token: "@" };
|
|
15842
16223
|
});
|
|
15843
16224
|
function AtAt(ctx, state2) {
|
|
15844
16225
|
return (0, import_lib4.$EVENT)(ctx, state2, "AtAt", AtAt$0);
|
|
15845
16226
|
}
|
|
15846
|
-
var Async$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16227
|
+
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) {
|
|
15847
16228
|
return { $loc, token: $1, type: "Async" };
|
|
15848
16229
|
});
|
|
15849
16230
|
function Async(ctx, state2) {
|
|
15850
16231
|
return (0, import_lib4.$EVENT)(ctx, state2, "Async", Async$0);
|
|
15851
16232
|
}
|
|
15852
|
-
var Await$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16233
|
+
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) {
|
|
15853
16234
|
return { $loc, token: $1, type: "Await" };
|
|
15854
16235
|
});
|
|
15855
16236
|
function Await(ctx, state2) {
|
|
15856
16237
|
return (0, import_lib4.$EVENT)(ctx, state2, "Await", Await$0);
|
|
15857
16238
|
}
|
|
15858
|
-
var Backtick$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16239
|
+
var Backtick$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L147, 'Backtick "`"'), function($skip, $loc, $0, $1) {
|
|
15859
16240
|
return { $loc, token: $1 };
|
|
15860
16241
|
});
|
|
15861
16242
|
function Backtick(ctx, state2) {
|
|
15862
16243
|
return (0, import_lib4.$EVENT)(ctx, state2, "Backtick", Backtick$0);
|
|
15863
16244
|
}
|
|
15864
|
-
var By$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16245
|
+
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) {
|
|
15865
16246
|
return { $loc, token: $1 };
|
|
15866
16247
|
});
|
|
15867
16248
|
function By(ctx, state2) {
|
|
@@ -15873,19 +16254,19 @@ var Caret$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L22, 'Caret "^"'),
|
|
|
15873
16254
|
function Caret(ctx, state2) {
|
|
15874
16255
|
return (0, import_lib4.$EVENT)(ctx, state2, "Caret", Caret$0);
|
|
15875
16256
|
}
|
|
15876
|
-
var Case$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16257
|
+
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) {
|
|
15877
16258
|
return { $loc, token: $1 };
|
|
15878
16259
|
});
|
|
15879
16260
|
function Case(ctx, state2) {
|
|
15880
16261
|
return (0, import_lib4.$EVENT)(ctx, state2, "Case", Case$0);
|
|
15881
16262
|
}
|
|
15882
|
-
var Catch$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16263
|
+
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) {
|
|
15883
16264
|
return { $loc, token: $1 };
|
|
15884
16265
|
});
|
|
15885
16266
|
function Catch(ctx, state2) {
|
|
15886
16267
|
return (0, import_lib4.$EVENT)(ctx, state2, "Catch", Catch$0);
|
|
15887
16268
|
}
|
|
15888
|
-
var Class$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16269
|
+
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) {
|
|
15889
16270
|
return { $loc, token: $1 };
|
|
15890
16271
|
});
|
|
15891
16272
|
function Class(ctx, state2) {
|
|
@@ -15909,13 +16290,13 @@ var CloseBracket$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L46, 'CloseB
|
|
|
15909
16290
|
function CloseBracket(ctx, state2) {
|
|
15910
16291
|
return (0, import_lib4.$EVENT)(ctx, state2, "CloseBracket", CloseBracket$0);
|
|
15911
16292
|
}
|
|
15912
|
-
var CloseParen$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16293
|
+
var CloseParen$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L140, 'CloseParen ")"'), function($skip, $loc, $0, $1) {
|
|
15913
16294
|
return { $loc, token: $1 };
|
|
15914
16295
|
});
|
|
15915
16296
|
function CloseParen(ctx, state2) {
|
|
15916
16297
|
return (0, import_lib4.$EVENT)(ctx, state2, "CloseParen", CloseParen$0);
|
|
15917
16298
|
}
|
|
15918
|
-
var CoffeeSubstitutionStart$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16299
|
+
var CoffeeSubstitutionStart$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L152, 'CoffeeSubstitutionStart "#{"'), function($skip, $loc, $0, $1) {
|
|
15919
16300
|
return { $loc, token: "${" };
|
|
15920
16301
|
});
|
|
15921
16302
|
function CoffeeSubstitutionStart(ctx, state2) {
|
|
@@ -15933,37 +16314,37 @@ var Comma$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L17, 'Comma ","'),
|
|
|
15933
16314
|
function Comma(ctx, state2) {
|
|
15934
16315
|
return (0, import_lib4.$EVENT)(ctx, state2, "Comma", Comma$0);
|
|
15935
16316
|
}
|
|
15936
|
-
var Comptime$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16317
|
+
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) {
|
|
15937
16318
|
return { $loc, token: $1 };
|
|
15938
16319
|
});
|
|
15939
16320
|
function Comptime(ctx, state2) {
|
|
15940
16321
|
return (0, import_lib4.$EVENT)(ctx, state2, "Comptime", Comptime$0);
|
|
15941
16322
|
}
|
|
15942
|
-
var ConstructorShorthand$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16323
|
+
var ConstructorShorthand$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L143, 'ConstructorShorthand "@"'), function($skip, $loc, $0, $1) {
|
|
15943
16324
|
return { $loc, token: "constructor" };
|
|
15944
16325
|
});
|
|
15945
16326
|
function ConstructorShorthand(ctx, state2) {
|
|
15946
16327
|
return (0, import_lib4.$EVENT)(ctx, state2, "ConstructorShorthand", ConstructorShorthand$0);
|
|
15947
16328
|
}
|
|
15948
|
-
var Declare$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16329
|
+
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) {
|
|
15949
16330
|
return { $loc, token: $1 };
|
|
15950
16331
|
});
|
|
15951
16332
|
function Declare(ctx, state2) {
|
|
15952
16333
|
return (0, import_lib4.$EVENT)(ctx, state2, "Declare", Declare$0);
|
|
15953
16334
|
}
|
|
15954
|
-
var Default$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16335
|
+
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) {
|
|
15955
16336
|
return { $loc, token: $1 };
|
|
15956
16337
|
});
|
|
15957
16338
|
function Default(ctx, state2) {
|
|
15958
16339
|
return (0, import_lib4.$EVENT)(ctx, state2, "Default", Default$0);
|
|
15959
16340
|
}
|
|
15960
|
-
var Delete$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16341
|
+
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) {
|
|
15961
16342
|
return { $loc, token: $1 };
|
|
15962
16343
|
});
|
|
15963
16344
|
function Delete(ctx, state2) {
|
|
15964
16345
|
return (0, import_lib4.$EVENT)(ctx, state2, "Delete", Delete$0);
|
|
15965
16346
|
}
|
|
15966
|
-
var Do$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16347
|
+
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) {
|
|
15967
16348
|
return { $loc, token: $1 };
|
|
15968
16349
|
});
|
|
15969
16350
|
function Do(ctx, state2) {
|
|
@@ -15983,51 +16364,51 @@ var Dot$$ = [Dot$0, Dot$1];
|
|
|
15983
16364
|
function Dot(ctx, state2) {
|
|
15984
16365
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "Dot", Dot$$);
|
|
15985
16366
|
}
|
|
15986
|
-
var DotDot$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16367
|
+
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) {
|
|
15987
16368
|
return { $loc, token: $1 };
|
|
15988
16369
|
});
|
|
15989
|
-
var DotDot$1 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16370
|
+
var DotDot$1 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L159, 'DotDot "\u2025"'), function($skip, $loc, $0, $1) {
|
|
15990
16371
|
return { $loc, token: ".." };
|
|
15991
16372
|
});
|
|
15992
16373
|
var DotDot$$ = [DotDot$0, DotDot$1];
|
|
15993
16374
|
function DotDot(ctx, state2) {
|
|
15994
16375
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "DotDot", DotDot$$);
|
|
15995
16376
|
}
|
|
15996
|
-
var DotDotDot$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16377
|
+
var DotDotDot$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L160, 'DotDotDot "..."'), function($skip, $loc, $0, $1) {
|
|
15997
16378
|
return { $loc, token: $1 };
|
|
15998
16379
|
});
|
|
15999
|
-
var DotDotDot$1 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16380
|
+
var DotDotDot$1 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L161, 'DotDotDot "\u2026"'), function($skip, $loc, $0, $1) {
|
|
16000
16381
|
return { $loc, token: "..." };
|
|
16001
16382
|
});
|
|
16002
16383
|
var DotDotDot$$ = [DotDotDot$0, DotDotDot$1];
|
|
16003
16384
|
function DotDotDot(ctx, state2) {
|
|
16004
16385
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "DotDotDot", DotDotDot$$);
|
|
16005
16386
|
}
|
|
16006
|
-
var DoubleColon$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16387
|
+
var DoubleColon$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L162, 'DoubleColon "::"'), function($skip, $loc, $0, $1) {
|
|
16007
16388
|
return { $loc, token: $1 };
|
|
16008
16389
|
});
|
|
16009
16390
|
function DoubleColon(ctx, state2) {
|
|
16010
16391
|
return (0, import_lib4.$EVENT)(ctx, state2, "DoubleColon", DoubleColon$0);
|
|
16011
16392
|
}
|
|
16012
|
-
var DoubleColonAsColon$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16393
|
+
var DoubleColonAsColon$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L162, 'DoubleColonAsColon "::"'), function($skip, $loc, $0, $1) {
|
|
16013
16394
|
return { $loc, token: ":" };
|
|
16014
16395
|
});
|
|
16015
16396
|
function DoubleColonAsColon(ctx, state2) {
|
|
16016
16397
|
return (0, import_lib4.$EVENT)(ctx, state2, "DoubleColonAsColon", DoubleColonAsColon$0);
|
|
16017
16398
|
}
|
|
16018
|
-
var DoubleQuote$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16399
|
+
var DoubleQuote$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L163, 'DoubleQuote "\\\\\\""'), function($skip, $loc, $0, $1) {
|
|
16019
16400
|
return { $loc, token: $1 };
|
|
16020
16401
|
});
|
|
16021
16402
|
function DoubleQuote(ctx, state2) {
|
|
16022
16403
|
return (0, import_lib4.$EVENT)(ctx, state2, "DoubleQuote", DoubleQuote$0);
|
|
16023
16404
|
}
|
|
16024
|
-
var Each$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16405
|
+
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) {
|
|
16025
16406
|
return { $loc, token: $1 };
|
|
16026
16407
|
});
|
|
16027
16408
|
function Each(ctx, state2) {
|
|
16028
16409
|
return (0, import_lib4.$EVENT)(ctx, state2, "Each", Each$0);
|
|
16029
16410
|
}
|
|
16030
|
-
var Else$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16411
|
+
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) {
|
|
16031
16412
|
return { $loc, token: $1 };
|
|
16032
16413
|
});
|
|
16033
16414
|
function Else(ctx, state2) {
|
|
@@ -16039,61 +16420,61 @@ var Equals$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L3, 'Equals "="'),
|
|
|
16039
16420
|
function Equals(ctx, state2) {
|
|
16040
16421
|
return (0, import_lib4.$EVENT)(ctx, state2, "Equals", Equals$0);
|
|
16041
16422
|
}
|
|
16042
|
-
var ExclamationPoint$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16423
|
+
var ExclamationPoint$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L166, 'ExclamationPoint "!"'), function($skip, $loc, $0, $1) {
|
|
16043
16424
|
return { $loc, token: $1 };
|
|
16044
16425
|
});
|
|
16045
16426
|
function ExclamationPoint(ctx, state2) {
|
|
16046
16427
|
return (0, import_lib4.$EVENT)(ctx, state2, "ExclamationPoint", ExclamationPoint$0);
|
|
16047
16428
|
}
|
|
16048
|
-
var Export$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16429
|
+
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) {
|
|
16049
16430
|
return { $loc, token: $1 };
|
|
16050
16431
|
});
|
|
16051
16432
|
function Export(ctx, state2) {
|
|
16052
16433
|
return (0, import_lib4.$EVENT)(ctx, state2, "Export", Export$0);
|
|
16053
16434
|
}
|
|
16054
|
-
var Extends$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16435
|
+
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) {
|
|
16055
16436
|
return { $loc, token: $1 };
|
|
16056
16437
|
});
|
|
16057
16438
|
function Extends(ctx, state2) {
|
|
16058
16439
|
return (0, import_lib4.$EVENT)(ctx, state2, "Extends", Extends$0);
|
|
16059
16440
|
}
|
|
16060
|
-
var Finally$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16441
|
+
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) {
|
|
16061
16442
|
return { $loc, token: $1 };
|
|
16062
16443
|
});
|
|
16063
16444
|
function Finally(ctx, state2) {
|
|
16064
16445
|
return (0, import_lib4.$EVENT)(ctx, state2, "Finally", Finally$0);
|
|
16065
16446
|
}
|
|
16066
|
-
var For$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16447
|
+
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) {
|
|
16067
16448
|
return { $loc, token: $1 };
|
|
16068
16449
|
});
|
|
16069
16450
|
function For(ctx, state2) {
|
|
16070
16451
|
return (0, import_lib4.$EVENT)(ctx, state2, "For", For$0);
|
|
16071
16452
|
}
|
|
16072
|
-
var From$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16453
|
+
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) {
|
|
16073
16454
|
return { $loc, token: $1 };
|
|
16074
16455
|
});
|
|
16075
16456
|
function From(ctx, state2) {
|
|
16076
16457
|
return (0, import_lib4.$EVENT)(ctx, state2, "From", From$0);
|
|
16077
16458
|
}
|
|
16078
|
-
var Function$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16459
|
+
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) {
|
|
16079
16460
|
return { $loc, token: $1 };
|
|
16080
16461
|
});
|
|
16081
16462
|
function Function2(ctx, state2) {
|
|
16082
16463
|
return (0, import_lib4.$EVENT)(ctx, state2, "Function", Function$0);
|
|
16083
16464
|
}
|
|
16084
|
-
var GetOrSet$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($
|
|
16465
|
+
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) {
|
|
16085
16466
|
return { $loc, token: $1, type: "GetOrSet" };
|
|
16086
16467
|
});
|
|
16087
16468
|
function GetOrSet(ctx, state2) {
|
|
16088
16469
|
return (0, import_lib4.$EVENT)(ctx, state2, "GetOrSet", GetOrSet$0);
|
|
16089
16470
|
}
|
|
16090
|
-
var Hash$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16471
|
+
var Hash$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L175, 'Hash "#"'), function($skip, $loc, $0, $1) {
|
|
16091
16472
|
return { $loc, token: $1 };
|
|
16092
16473
|
});
|
|
16093
16474
|
function Hash(ctx, state2) {
|
|
16094
16475
|
return (0, import_lib4.$EVENT)(ctx, state2, "Hash", Hash$0);
|
|
16095
16476
|
}
|
|
16096
|
-
var If$0 = (0, import_lib4.$TV)((0, import_lib4.$TEXT)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16477
|
+
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) {
|
|
16097
16478
|
return { $loc, token: $1 };
|
|
16098
16479
|
});
|
|
16099
16480
|
function If(ctx, state2) {
|
|
@@ -16105,67 +16486,67 @@ var Import$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)
|
|
|
16105
16486
|
function Import(ctx, state2) {
|
|
16106
16487
|
return (0, import_lib4.$EVENT)(ctx, state2, "Import", Import$0);
|
|
16107
16488
|
}
|
|
16108
|
-
var In$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16489
|
+
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) {
|
|
16109
16490
|
return { $loc, token: $1 };
|
|
16110
16491
|
});
|
|
16111
16492
|
function In(ctx, state2) {
|
|
16112
16493
|
return (0, import_lib4.$EVENT)(ctx, state2, "In", In$0);
|
|
16113
16494
|
}
|
|
16114
|
-
var Infer$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16495
|
+
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) {
|
|
16115
16496
|
return { $loc, token: $1 };
|
|
16116
16497
|
});
|
|
16117
16498
|
function Infer(ctx, state2) {
|
|
16118
16499
|
return (0, import_lib4.$EVENT)(ctx, state2, "Infer", Infer$0);
|
|
16119
16500
|
}
|
|
16120
|
-
var LetOrConst$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($
|
|
16501
|
+
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) {
|
|
16121
16502
|
return { $loc, token: $1 };
|
|
16122
16503
|
});
|
|
16123
16504
|
function LetOrConst(ctx, state2) {
|
|
16124
16505
|
return (0, import_lib4.$EVENT)(ctx, state2, "LetOrConst", LetOrConst$0);
|
|
16125
16506
|
}
|
|
16126
|
-
var Const$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16507
|
+
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) {
|
|
16127
16508
|
return { $loc, token: $1 };
|
|
16128
16509
|
});
|
|
16129
16510
|
function Const(ctx, state2) {
|
|
16130
16511
|
return (0, import_lib4.$EVENT)(ctx, state2, "Const", Const$0);
|
|
16131
16512
|
}
|
|
16132
|
-
var Is$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16513
|
+
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) {
|
|
16133
16514
|
return { $loc, token: $1 };
|
|
16134
16515
|
});
|
|
16135
16516
|
function Is(ctx, state2) {
|
|
16136
16517
|
return (0, import_lib4.$EVENT)(ctx, state2, "Is", Is$0);
|
|
16137
16518
|
}
|
|
16138
|
-
var LetOrConstOrVar$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($
|
|
16519
|
+
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) {
|
|
16139
16520
|
return { $loc, token: $1 };
|
|
16140
16521
|
});
|
|
16141
16522
|
function LetOrConstOrVar(ctx, state2) {
|
|
16142
16523
|
return (0, import_lib4.$EVENT)(ctx, state2, "LetOrConstOrVar", LetOrConstOrVar$0);
|
|
16143
16524
|
}
|
|
16144
|
-
var Like$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16525
|
+
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) {
|
|
16145
16526
|
return { $loc, token: $1 };
|
|
16146
16527
|
});
|
|
16147
16528
|
function Like(ctx, state2) {
|
|
16148
16529
|
return (0, import_lib4.$EVENT)(ctx, state2, "Like", Like$0);
|
|
16149
16530
|
}
|
|
16150
|
-
var Loop$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16531
|
+
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) {
|
|
16151
16532
|
return { $loc, token: "while" };
|
|
16152
16533
|
});
|
|
16153
16534
|
function Loop(ctx, state2) {
|
|
16154
16535
|
return (0, import_lib4.$EVENT)(ctx, state2, "Loop", Loop$0);
|
|
16155
16536
|
}
|
|
16156
|
-
var New$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16537
|
+
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) {
|
|
16157
16538
|
return { $loc, token: $1 };
|
|
16158
16539
|
});
|
|
16159
16540
|
function New(ctx, state2) {
|
|
16160
16541
|
return (0, import_lib4.$EVENT)(ctx, state2, "New", New$0);
|
|
16161
16542
|
}
|
|
16162
|
-
var Not$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16543
|
+
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) {
|
|
16163
16544
|
return { $loc, token: "!" };
|
|
16164
16545
|
});
|
|
16165
16546
|
function Not(ctx, state2) {
|
|
16166
16547
|
return (0, import_lib4.$EVENT)(ctx, state2, "Not", Not$0);
|
|
16167
16548
|
}
|
|
16168
|
-
var Of$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16549
|
+
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) {
|
|
16169
16550
|
return { $loc, token: $1 };
|
|
16170
16551
|
});
|
|
16171
16552
|
function Of(ctx, state2) {
|
|
@@ -16183,7 +16564,7 @@ var OpenBrace$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L1, 'OpenBrace
|
|
|
16183
16564
|
function OpenBrace(ctx, state2) {
|
|
16184
16565
|
return (0, import_lib4.$EVENT)(ctx, state2, "OpenBrace", OpenBrace$0);
|
|
16185
16566
|
}
|
|
16186
|
-
var OpenBracket$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16567
|
+
var OpenBracket$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L188, 'OpenBracket "["'), function($skip, $loc, $0, $1) {
|
|
16187
16568
|
return { $loc, token: $1 };
|
|
16188
16569
|
});
|
|
16189
16570
|
function OpenBracket(ctx, state2) {
|
|
@@ -16195,49 +16576,49 @@ var OpenParen$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L4, 'OpenParen
|
|
|
16195
16576
|
function OpenParen(ctx, state2) {
|
|
16196
16577
|
return (0, import_lib4.$EVENT)(ctx, state2, "OpenParen", OpenParen$0);
|
|
16197
16578
|
}
|
|
16198
|
-
var Operator$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16579
|
+
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) {
|
|
16199
16580
|
return { $loc, token: $1 };
|
|
16200
16581
|
});
|
|
16201
16582
|
function Operator(ctx, state2) {
|
|
16202
16583
|
return (0, import_lib4.$EVENT)(ctx, state2, "Operator", Operator$0);
|
|
16203
16584
|
}
|
|
16204
|
-
var Override$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16585
|
+
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) {
|
|
16205
16586
|
return { $loc, token: $1, ts: true };
|
|
16206
16587
|
});
|
|
16207
16588
|
function Override(ctx, state2) {
|
|
16208
16589
|
return (0, import_lib4.$EVENT)(ctx, state2, "Override", Override$0);
|
|
16209
16590
|
}
|
|
16210
|
-
var Own$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16591
|
+
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) {
|
|
16211
16592
|
return { $loc, token: $1 };
|
|
16212
16593
|
});
|
|
16213
16594
|
function Own(ctx, state2) {
|
|
16214
16595
|
return (0, import_lib4.$EVENT)(ctx, state2, "Own", Own$0);
|
|
16215
16596
|
}
|
|
16216
|
-
var Public$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16597
|
+
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) {
|
|
16217
16598
|
return { $loc, token: $1 };
|
|
16218
16599
|
});
|
|
16219
16600
|
function Public(ctx, state2) {
|
|
16220
16601
|
return (0, import_lib4.$EVENT)(ctx, state2, "Public", Public$0);
|
|
16221
16602
|
}
|
|
16222
|
-
var Private$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16603
|
+
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) {
|
|
16223
16604
|
return { $loc, token: $1 };
|
|
16224
16605
|
});
|
|
16225
16606
|
function Private(ctx, state2) {
|
|
16226
16607
|
return (0, import_lib4.$EVENT)(ctx, state2, "Private", Private$0);
|
|
16227
16608
|
}
|
|
16228
|
-
var Protected$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16609
|
+
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) {
|
|
16229
16610
|
return { $loc, token: $1 };
|
|
16230
16611
|
});
|
|
16231
16612
|
function Protected(ctx, state2) {
|
|
16232
16613
|
return (0, import_lib4.$EVENT)(ctx, state2, "Protected", Protected$0);
|
|
16233
16614
|
}
|
|
16234
|
-
var Pipe$0 = (0, import_lib4.$TV)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($
|
|
16615
|
+
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) {
|
|
16235
16616
|
return { $loc, token: "||>" };
|
|
16236
16617
|
});
|
|
16237
|
-
var Pipe$1 = (0, import_lib4.$TV)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($
|
|
16618
|
+
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) {
|
|
16238
16619
|
return { $loc, token: "|>=" };
|
|
16239
16620
|
});
|
|
16240
|
-
var Pipe$2 = (0, import_lib4.$TV)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($
|
|
16621
|
+
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) {
|
|
16241
16622
|
return { $loc, token: "|>" };
|
|
16242
16623
|
});
|
|
16243
16624
|
var Pipe$$ = [Pipe$0, Pipe$1, Pipe$2];
|
|
@@ -16250,19 +16631,19 @@ var QuestionMark$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L6, 'Questio
|
|
|
16250
16631
|
function QuestionMark(ctx, state2) {
|
|
16251
16632
|
return (0, import_lib4.$EVENT)(ctx, state2, "QuestionMark", QuestionMark$0);
|
|
16252
16633
|
}
|
|
16253
|
-
var Readonly$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16634
|
+
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) {
|
|
16254
16635
|
return { $loc, token: $1, ts: true };
|
|
16255
16636
|
});
|
|
16256
16637
|
function Readonly(ctx, state2) {
|
|
16257
16638
|
return (0, import_lib4.$EVENT)(ctx, state2, "Readonly", Readonly$0);
|
|
16258
16639
|
}
|
|
16259
|
-
var Return$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16640
|
+
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) {
|
|
16260
16641
|
return { $loc, token: $1 };
|
|
16261
16642
|
});
|
|
16262
16643
|
function Return(ctx, state2) {
|
|
16263
16644
|
return (0, import_lib4.$EVENT)(ctx, state2, "Return", Return$0);
|
|
16264
16645
|
}
|
|
16265
|
-
var Satisfies$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16646
|
+
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) {
|
|
16266
16647
|
return { $loc, token: $1 };
|
|
16267
16648
|
});
|
|
16268
16649
|
function Satisfies(ctx, state2) {
|
|
@@ -16274,7 +16655,7 @@ var Semicolon$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L119, 'Semicolo
|
|
|
16274
16655
|
function Semicolon(ctx, state2) {
|
|
16275
16656
|
return (0, import_lib4.$EVENT)(ctx, state2, "Semicolon", Semicolon$0);
|
|
16276
16657
|
}
|
|
16277
|
-
var SingleQuote$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16658
|
+
var SingleQuote$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L204, `SingleQuote "'"`), function($skip, $loc, $0, $1) {
|
|
16278
16659
|
return { $loc, token: $1 };
|
|
16279
16660
|
});
|
|
16280
16661
|
function SingleQuote(ctx, state2) {
|
|
@@ -16286,149 +16667,149 @@ var Star$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L75, 'Star "*"'), fu
|
|
|
16286
16667
|
function Star(ctx, state2) {
|
|
16287
16668
|
return (0, import_lib4.$EVENT)(ctx, state2, "Star", Star$0);
|
|
16288
16669
|
}
|
|
16289
|
-
var Static$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16670
|
+
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) {
|
|
16290
16671
|
return { $loc, token: $1 };
|
|
16291
16672
|
});
|
|
16292
|
-
var Static$1 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16673
|
+
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) {
|
|
16293
16674
|
return { $loc, token: "static " };
|
|
16294
16675
|
});
|
|
16295
16676
|
var Static$$ = [Static$0, Static$1];
|
|
16296
16677
|
function Static(ctx, state2) {
|
|
16297
16678
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "Static", Static$$);
|
|
16298
16679
|
}
|
|
16299
|
-
var SubstitutionStart$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16680
|
+
var SubstitutionStart$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L206, 'SubstitutionStart "${"'), function($skip, $loc, $0, $1) {
|
|
16300
16681
|
return { $loc, token: $1 };
|
|
16301
16682
|
});
|
|
16302
16683
|
function SubstitutionStart(ctx, state2) {
|
|
16303
16684
|
return (0, import_lib4.$EVENT)(ctx, state2, "SubstitutionStart", SubstitutionStart$0);
|
|
16304
16685
|
}
|
|
16305
|
-
var Super$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16686
|
+
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) {
|
|
16306
16687
|
return { $loc, token: $1 };
|
|
16307
16688
|
});
|
|
16308
16689
|
function Super(ctx, state2) {
|
|
16309
16690
|
return (0, import_lib4.$EVENT)(ctx, state2, "Super", Super$0);
|
|
16310
16691
|
}
|
|
16311
|
-
var Switch$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16692
|
+
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) {
|
|
16312
16693
|
return { $loc, token: $1 };
|
|
16313
16694
|
});
|
|
16314
16695
|
function Switch(ctx, state2) {
|
|
16315
16696
|
return (0, import_lib4.$EVENT)(ctx, state2, "Switch", Switch$0);
|
|
16316
16697
|
}
|
|
16317
|
-
var Target$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16698
|
+
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) {
|
|
16318
16699
|
return { $loc, token: $1 };
|
|
16319
16700
|
});
|
|
16320
16701
|
function Target(ctx, state2) {
|
|
16321
16702
|
return (0, import_lib4.$EVENT)(ctx, state2, "Target", Target$0);
|
|
16322
16703
|
}
|
|
16323
|
-
var Then$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(__, (0, import_lib4.$EXPECT)($
|
|
16704
|
+
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) {
|
|
16324
16705
|
return { $loc, token: "" };
|
|
16325
16706
|
});
|
|
16326
16707
|
function Then(ctx, state2) {
|
|
16327
16708
|
return (0, import_lib4.$EVENT)(ctx, state2, "Then", Then$0);
|
|
16328
16709
|
}
|
|
16329
|
-
var This$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16710
|
+
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) {
|
|
16330
16711
|
return { $loc, token: $1 };
|
|
16331
16712
|
});
|
|
16332
16713
|
function This(ctx, state2) {
|
|
16333
16714
|
return (0, import_lib4.$EVENT)(ctx, state2, "This", This$0);
|
|
16334
16715
|
}
|
|
16335
|
-
var Throw$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16716
|
+
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) {
|
|
16336
16717
|
return { $loc, token: $1 };
|
|
16337
16718
|
});
|
|
16338
16719
|
function Throw(ctx, state2) {
|
|
16339
16720
|
return (0, import_lib4.$EVENT)(ctx, state2, "Throw", Throw$0);
|
|
16340
16721
|
}
|
|
16341
|
-
var TripleDoubleQuote$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16722
|
+
var TripleDoubleQuote$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L213, 'TripleDoubleQuote "\\\\\\"\\\\\\"\\\\\\""'), function($skip, $loc, $0, $1) {
|
|
16342
16723
|
return { $loc, token: "`" };
|
|
16343
16724
|
});
|
|
16344
16725
|
function TripleDoubleQuote(ctx, state2) {
|
|
16345
16726
|
return (0, import_lib4.$EVENT)(ctx, state2, "TripleDoubleQuote", TripleDoubleQuote$0);
|
|
16346
16727
|
}
|
|
16347
|
-
var TripleSingleQuote$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16728
|
+
var TripleSingleQuote$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L214, `TripleSingleQuote "'''"`), function($skip, $loc, $0, $1) {
|
|
16348
16729
|
return { $loc, token: "`" };
|
|
16349
16730
|
});
|
|
16350
16731
|
function TripleSingleQuote(ctx, state2) {
|
|
16351
16732
|
return (0, import_lib4.$EVENT)(ctx, state2, "TripleSingleQuote", TripleSingleQuote$0);
|
|
16352
16733
|
}
|
|
16353
|
-
var TripleSlash$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16734
|
+
var TripleSlash$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L215, 'TripleSlash "///"'), function($skip, $loc, $0, $1) {
|
|
16354
16735
|
return { $loc, token: "/" };
|
|
16355
16736
|
});
|
|
16356
16737
|
function TripleSlash(ctx, state2) {
|
|
16357
16738
|
return (0, import_lib4.$EVENT)(ctx, state2, "TripleSlash", TripleSlash$0);
|
|
16358
16739
|
}
|
|
16359
|
-
var TripleTick$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16740
|
+
var TripleTick$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L216, 'TripleTick "```"'), function($skip, $loc, $0, $1) {
|
|
16360
16741
|
return { $loc, token: "`" };
|
|
16361
16742
|
});
|
|
16362
16743
|
function TripleTick(ctx, state2) {
|
|
16363
16744
|
return (0, import_lib4.$EVENT)(ctx, state2, "TripleTick", TripleTick$0);
|
|
16364
16745
|
}
|
|
16365
|
-
var Try$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16746
|
+
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) {
|
|
16366
16747
|
return { $loc, token: $1 };
|
|
16367
16748
|
});
|
|
16368
16749
|
function Try(ctx, state2) {
|
|
16369
16750
|
return (0, import_lib4.$EVENT)(ctx, state2, "Try", Try$0);
|
|
16370
16751
|
}
|
|
16371
|
-
var Typeof$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16752
|
+
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) {
|
|
16372
16753
|
return { $loc, token: $1 };
|
|
16373
16754
|
});
|
|
16374
16755
|
function Typeof(ctx, state2) {
|
|
16375
16756
|
return (0, import_lib4.$EVENT)(ctx, state2, "Typeof", Typeof$0);
|
|
16376
16757
|
}
|
|
16377
|
-
var Undefined$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16758
|
+
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) {
|
|
16378
16759
|
return { $loc, token: $1 };
|
|
16379
16760
|
});
|
|
16380
16761
|
function Undefined(ctx, state2) {
|
|
16381
16762
|
return (0, import_lib4.$EVENT)(ctx, state2, "Undefined", Undefined$0);
|
|
16382
16763
|
}
|
|
16383
|
-
var Unless$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16764
|
+
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) {
|
|
16384
16765
|
return { $loc, token: $1, negated: true };
|
|
16385
16766
|
});
|
|
16386
16767
|
function Unless(ctx, state2) {
|
|
16387
16768
|
return (0, import_lib4.$EVENT)(ctx, state2, "Unless", Unless$0);
|
|
16388
16769
|
}
|
|
16389
|
-
var Until$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16770
|
+
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) {
|
|
16390
16771
|
return { $loc, token: $1, negated: true };
|
|
16391
16772
|
});
|
|
16392
16773
|
function Until(ctx, state2) {
|
|
16393
16774
|
return (0, import_lib4.$EVENT)(ctx, state2, "Until", Until$0);
|
|
16394
16775
|
}
|
|
16395
|
-
var Using$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16776
|
+
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) {
|
|
16396
16777
|
return { $loc, token: $1 };
|
|
16397
16778
|
});
|
|
16398
16779
|
function Using(ctx, state2) {
|
|
16399
16780
|
return (0, import_lib4.$EVENT)(ctx, state2, "Using", Using$0);
|
|
16400
16781
|
}
|
|
16401
|
-
var Var$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16782
|
+
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) {
|
|
16402
16783
|
return { $loc, token: $1 };
|
|
16403
16784
|
});
|
|
16404
16785
|
function Var(ctx, state2) {
|
|
16405
16786
|
return (0, import_lib4.$EVENT)(ctx, state2, "Var", Var$0);
|
|
16406
16787
|
}
|
|
16407
|
-
var Void$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16788
|
+
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) {
|
|
16408
16789
|
return { $loc, token: $1 };
|
|
16409
16790
|
});
|
|
16410
16791
|
function Void(ctx, state2) {
|
|
16411
16792
|
return (0, import_lib4.$EVENT)(ctx, state2, "Void", Void$0);
|
|
16412
16793
|
}
|
|
16413
|
-
var When$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16794
|
+
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) {
|
|
16414
16795
|
return { $loc, token: "case" };
|
|
16415
16796
|
});
|
|
16416
16797
|
function When(ctx, state2) {
|
|
16417
16798
|
return (0, import_lib4.$EVENT)(ctx, state2, "When", When$0);
|
|
16418
16799
|
}
|
|
16419
|
-
var While$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16800
|
+
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) {
|
|
16420
16801
|
return { $loc, token: $1 };
|
|
16421
16802
|
});
|
|
16422
16803
|
function While(ctx, state2) {
|
|
16423
16804
|
return (0, import_lib4.$EVENT)(ctx, state2, "While", While$0);
|
|
16424
16805
|
}
|
|
16425
|
-
var With$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16806
|
+
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) {
|
|
16426
16807
|
return { $loc, token: $1 };
|
|
16427
16808
|
});
|
|
16428
16809
|
function With(ctx, state2) {
|
|
16429
16810
|
return (0, import_lib4.$EVENT)(ctx, state2, "With", With$0);
|
|
16430
16811
|
}
|
|
16431
|
-
var Yield$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16812
|
+
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) {
|
|
16432
16813
|
return { $loc, token: $1, type: "Yield" };
|
|
16433
16814
|
});
|
|
16434
16815
|
function Yield(ctx, state2) {
|
|
@@ -16447,7 +16828,7 @@ var JSXImplicitFragment$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(JSXTag, (0,
|
|
|
16447
16828
|
],
|
|
16448
16829
|
jsxChildren: [$1].concat($2.map(([, tag]) => tag))
|
|
16449
16830
|
};
|
|
16450
|
-
const type = typeOfJSX(jsx, config
|
|
16831
|
+
const type = typeOfJSX(jsx, config);
|
|
16451
16832
|
return type ? [
|
|
16452
16833
|
{ ts: true, children: ["("] },
|
|
16453
16834
|
jsx,
|
|
@@ -16507,7 +16888,7 @@ var JSXElement$$ = [JSXElement$0, JSXElement$1, JSXElement$2];
|
|
|
16507
16888
|
function JSXElement(ctx, state2) {
|
|
16508
16889
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "JSXElement", JSXElement$$);
|
|
16509
16890
|
}
|
|
16510
|
-
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)($
|
|
16891
|
+
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) {
|
|
16511
16892
|
return { type: "JSXElement", children: $0, tag: $2 };
|
|
16512
16893
|
});
|
|
16513
16894
|
function JSXSelfClosingElement(ctx, state2) {
|
|
@@ -16541,7 +16922,7 @@ var JSXOptionalClosingElement$$ = [JSXOptionalClosingElement$0, JSXOptionalClosi
|
|
|
16541
16922
|
function JSXOptionalClosingElement(ctx, state2) {
|
|
16542
16923
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "JSXOptionalClosingElement", JSXOptionalClosingElement$$);
|
|
16543
16924
|
}
|
|
16544
|
-
var JSXClosingElement$0 = (0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16925
|
+
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 ">"'));
|
|
16545
16926
|
function JSXClosingElement(ctx, state2) {
|
|
16546
16927
|
return (0, import_lib4.$EVENT)(ctx, state2, "JSXClosingElement", JSXClosingElement$0);
|
|
16547
16928
|
}
|
|
@@ -16562,7 +16943,7 @@ var JSXFragment$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$N)
|
|
|
16562
16943
|
];
|
|
16563
16944
|
return { type: "JSXFragment", children: parts, jsxChildren: children.jsxChildren };
|
|
16564
16945
|
});
|
|
16565
|
-
var JSXFragment$1 = (0, import_lib4.$TS)((0, import_lib4.$S)(CoffeeJSXEnabled, (0, import_lib4.$EXPECT)($
|
|
16946
|
+
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) {
|
|
16566
16947
|
var children = $3;
|
|
16567
16948
|
$0 = $0.slice(1);
|
|
16568
16949
|
return {
|
|
@@ -16575,7 +16956,7 @@ var JSXFragment$$ = [JSXFragment$0, JSXFragment$1];
|
|
|
16575
16956
|
function JSXFragment(ctx, state2) {
|
|
16576
16957
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "JSXFragment", JSXFragment$$);
|
|
16577
16958
|
}
|
|
16578
|
-
var PushJSXOpeningFragment$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16959
|
+
var PushJSXOpeningFragment$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L229, 'PushJSXOpeningFragment "<>"'), function($skip, $loc, $0, $1) {
|
|
16579
16960
|
state.JSXTagStack.push("");
|
|
16580
16961
|
return $1;
|
|
16581
16962
|
});
|
|
@@ -16592,11 +16973,11 @@ var JSXOptionalClosingFragment$$ = [JSXOptionalClosingFragment$0, JSXOptionalClo
|
|
|
16592
16973
|
function JSXOptionalClosingFragment(ctx, state2) {
|
|
16593
16974
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "JSXOptionalClosingFragment", JSXOptionalClosingFragment$$);
|
|
16594
16975
|
}
|
|
16595
|
-
var JSXClosingFragment$0 = (0, import_lib4.$EXPECT)($
|
|
16976
|
+
var JSXClosingFragment$0 = (0, import_lib4.$EXPECT)($L230, 'JSXClosingFragment "</>"');
|
|
16596
16977
|
function JSXClosingFragment(ctx, state2) {
|
|
16597
16978
|
return (0, import_lib4.$EVENT)(ctx, state2, "JSXClosingFragment", JSXClosingFragment$0);
|
|
16598
16979
|
}
|
|
16599
|
-
var JSXElementName$0 = (0, import_lib4.$TV)((0, import_lib4.$Y)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($
|
|
16980
|
+
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) {
|
|
16600
16981
|
return config.defaultElement;
|
|
16601
16982
|
});
|
|
16602
16983
|
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)))));
|
|
@@ -16774,7 +17155,7 @@ var JSXAttribute$4 = (0, import_lib4.$TS)((0, import_lib4.$S)(Identifier, (0, im
|
|
|
16774
17155
|
}
|
|
16775
17156
|
return $skip;
|
|
16776
17157
|
});
|
|
16777
|
-
var JSXAttribute$5 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
17158
|
+
var JSXAttribute$5 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L175, 'JSXAttribute "#"'), JSXShorthandString), function($skip, $loc, $0, $1, $2) {
|
|
16778
17159
|
return [" ", "id=", $2];
|
|
16779
17160
|
});
|
|
16780
17161
|
var JSXAttribute$6 = (0, import_lib4.$TS)((0, import_lib4.$S)(Dot, JSXShorthandString), function($skip, $loc, $0, $1, $2) {
|
|
@@ -17119,7 +17500,7 @@ var JSXChildGeneral$$ = [JSXChildGeneral$0, JSXChildGeneral$1, JSXChildGeneral$2
|
|
|
17119
17500
|
function JSXChildGeneral(ctx, state2) {
|
|
17120
17501
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "JSXChildGeneral", JSXChildGeneral$$);
|
|
17121
17502
|
}
|
|
17122
|
-
var JSXComment$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
17503
|
+
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) {
|
|
17123
17504
|
return ["{/*", $2, "*/}"];
|
|
17124
17505
|
});
|
|
17125
17506
|
function JSXComment(ctx, state2) {
|
|
@@ -17407,37 +17788,37 @@ var InterfaceExtendsTarget$0 = ImplementsTarget;
|
|
|
17407
17788
|
function InterfaceExtendsTarget(ctx, state2) {
|
|
17408
17789
|
return (0, import_lib4.$EVENT)(ctx, state2, "InterfaceExtendsTarget", InterfaceExtendsTarget$0);
|
|
17409
17790
|
}
|
|
17410
|
-
var TypeKeyword$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
17791
|
+
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) {
|
|
17411
17792
|
return { $loc, token: $1 };
|
|
17412
17793
|
});
|
|
17413
17794
|
function TypeKeyword(ctx, state2) {
|
|
17414
17795
|
return (0, import_lib4.$EVENT)(ctx, state2, "TypeKeyword", TypeKeyword$0);
|
|
17415
17796
|
}
|
|
17416
|
-
var Enum$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
17797
|
+
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) {
|
|
17417
17798
|
return { $loc, token: $1 };
|
|
17418
17799
|
});
|
|
17419
17800
|
function Enum(ctx, state2) {
|
|
17420
17801
|
return (0, import_lib4.$EVENT)(ctx, state2, "Enum", Enum$0);
|
|
17421
17802
|
}
|
|
17422
|
-
var Interface$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
17803
|
+
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) {
|
|
17423
17804
|
return { $loc, token: $1 };
|
|
17424
17805
|
});
|
|
17425
17806
|
function Interface(ctx, state2) {
|
|
17426
17807
|
return (0, import_lib4.$EVENT)(ctx, state2, "Interface", Interface$0);
|
|
17427
17808
|
}
|
|
17428
|
-
var Global$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
17809
|
+
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) {
|
|
17429
17810
|
return { $loc, token: $1 };
|
|
17430
17811
|
});
|
|
17431
17812
|
function Global(ctx, state2) {
|
|
17432
17813
|
return (0, import_lib4.$EVENT)(ctx, state2, "Global", Global$0);
|
|
17433
17814
|
}
|
|
17434
|
-
var Module$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
17815
|
+
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) {
|
|
17435
17816
|
return { $loc, token: $1 };
|
|
17436
17817
|
});
|
|
17437
17818
|
function Module(ctx, state2) {
|
|
17438
17819
|
return (0, import_lib4.$EVENT)(ctx, state2, "Module", Module$0);
|
|
17439
17820
|
}
|
|
17440
|
-
var Namespace$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
17821
|
+
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) {
|
|
17441
17822
|
return { $loc, token: $1 };
|
|
17442
17823
|
});
|
|
17443
17824
|
function Namespace(ctx, state2) {
|
|
@@ -17751,14 +18132,14 @@ var ReturnTypeSuffix$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib
|
|
|
17751
18132
|
function ReturnTypeSuffix(ctx, state2) {
|
|
17752
18133
|
return (0, import_lib4.$EVENT)(ctx, state2, "ReturnTypeSuffix", ReturnTypeSuffix$0);
|
|
17753
18134
|
}
|
|
17754
|
-
var ReturnType$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)((0, import_lib4.$S)(__, (0, import_lib4.$EXPECT)($
|
|
18135
|
+
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) {
|
|
17755
18136
|
var asserts = $1;
|
|
17756
18137
|
var t = $3;
|
|
17757
18138
|
if (!t)
|
|
17758
18139
|
return $skip;
|
|
17759
18140
|
if (asserts) {
|
|
17760
18141
|
t = {
|
|
17761
|
-
type: "
|
|
18142
|
+
type: "TypeAsserts",
|
|
17762
18143
|
t,
|
|
17763
18144
|
children: [asserts[0], asserts[1], t],
|
|
17764
18145
|
ts: true
|
|
@@ -17852,8 +18233,8 @@ var TypeUnarySuffix$$ = [TypeUnarySuffix$0, TypeUnarySuffix$1, TypeUnarySuffix$2
|
|
|
17852
18233
|
function TypeUnarySuffix(ctx, state2) {
|
|
17853
18234
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "TypeUnarySuffix", TypeUnarySuffix$$);
|
|
17854
18235
|
}
|
|
17855
|
-
var TypeUnaryOp$0 = (0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
17856
|
-
var TypeUnaryOp$1 = (0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
18236
|
+
var TypeUnaryOp$0 = (0, import_lib4.$S)((0, import_lib4.$EXPECT)($L240, 'TypeUnaryOp "keyof"'), NonIdContinue);
|
|
18237
|
+
var TypeUnaryOp$1 = (0, import_lib4.$S)((0, import_lib4.$EXPECT)($L201, 'TypeUnaryOp "readonly"'), NonIdContinue);
|
|
17857
18238
|
var TypeUnaryOp$$ = [TypeUnaryOp$0, TypeUnaryOp$1];
|
|
17858
18239
|
function TypeUnaryOp(ctx, state2) {
|
|
17859
18240
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "TypeUnaryOp", TypeUnaryOp$$);
|
|
@@ -17883,7 +18264,7 @@ var TypeIndexedAccess$$ = [TypeIndexedAccess$0, TypeIndexedAccess$1, TypeIndexed
|
|
|
17883
18264
|
function TypeIndexedAccess(ctx, state2) {
|
|
17884
18265
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "TypeIndexedAccess", TypeIndexedAccess$$);
|
|
17885
18266
|
}
|
|
17886
|
-
var UnknownAlias$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
18267
|
+
var UnknownAlias$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L241, 'UnknownAlias "???"'), function($skip, $loc, $0, $1) {
|
|
17887
18268
|
return { $loc, token: "unknown" };
|
|
17888
18269
|
});
|
|
17889
18270
|
function UnknownAlias(ctx, state2) {
|
|
@@ -17954,12 +18335,17 @@ var ImportType$$ = [ImportType$0, ImportType$1];
|
|
|
17954
18335
|
function ImportType(ctx, state2) {
|
|
17955
18336
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "ImportType", ImportType$$);
|
|
17956
18337
|
}
|
|
17957
|
-
var TypeTuple$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(OpenBracket, AllowAll, (0, import_lib4.$E)(
|
|
17958
|
-
|
|
18338
|
+
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) {
|
|
18339
|
+
var open = $1;
|
|
18340
|
+
var elements = $3;
|
|
18341
|
+
var ws = $5;
|
|
18342
|
+
var close = $6;
|
|
18343
|
+
if (!elements)
|
|
17959
18344
|
return $skip;
|
|
17960
18345
|
return {
|
|
17961
18346
|
type: "TypeTuple",
|
|
17962
|
-
|
|
18347
|
+
elements,
|
|
18348
|
+
children: [open, elements, ws, close]
|
|
17963
18349
|
};
|
|
17964
18350
|
});
|
|
17965
18351
|
function TypeTuple(ctx, state2) {
|
|
@@ -18021,19 +18407,28 @@ var TypeElement$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(__, (0, import_lib4
|
|
|
18021
18407
|
message: "... both before and after identifier"
|
|
18022
18408
|
}];
|
|
18023
18409
|
}
|
|
18024
|
-
return
|
|
18410
|
+
return {
|
|
18411
|
+
type: "TypeElement",
|
|
18412
|
+
name,
|
|
18413
|
+
t: type,
|
|
18414
|
+
children: [ws, dots, name, colon, type]
|
|
18415
|
+
};
|
|
18025
18416
|
});
|
|
18026
18417
|
var TypeElement$1 = (0, import_lib4.$S)(__, DotDotDot, __, Type);
|
|
18027
18418
|
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) {
|
|
18028
18419
|
var type = $1;
|
|
18029
18420
|
var spaceDots = $2;
|
|
18030
|
-
if (
|
|
18031
|
-
|
|
18032
|
-
|
|
18033
|
-
|
|
18034
|
-
|
|
18035
|
-
|
|
18036
|
-
return
|
|
18421
|
+
if (spaceDots) {
|
|
18422
|
+
const [space, dots] = spaceDots;
|
|
18423
|
+
const ws = getTrimmingSpace(type);
|
|
18424
|
+
spaceDots = [ws, dots, space];
|
|
18425
|
+
type = trimFirstSpace(type);
|
|
18426
|
+
}
|
|
18427
|
+
return {
|
|
18428
|
+
type: "TypeElement",
|
|
18429
|
+
t: type,
|
|
18430
|
+
children: [spaceDots, type]
|
|
18431
|
+
};
|
|
18037
18432
|
});
|
|
18038
18433
|
var TypeElement$$ = [TypeElement$0, TypeElement$1, TypeElement$2];
|
|
18039
18434
|
function TypeElement(ctx, state2) {
|
|
@@ -18262,13 +18657,13 @@ var TypeLiteral$2 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EX
|
|
|
18262
18657
|
return num;
|
|
18263
18658
|
return $0;
|
|
18264
18659
|
});
|
|
18265
|
-
var TypeLiteral$3 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
18660
|
+
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) {
|
|
18266
18661
|
return { type: "VoidType", $loc, token: $1 };
|
|
18267
18662
|
});
|
|
18268
|
-
var TypeLiteral$4 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
18663
|
+
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) {
|
|
18269
18664
|
return { type: "UniqueSymbolType", children: $0 };
|
|
18270
18665
|
});
|
|
18271
|
-
var TypeLiteral$5 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
18666
|
+
var TypeLiteral$5 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L244, 'TypeLiteral "[]"'), function($skip, $loc, $0, $1) {
|
|
18272
18667
|
return { $loc, token: "[]" };
|
|
18273
18668
|
});
|
|
18274
18669
|
var TypeLiteral$$ = [TypeLiteral$0, TypeLiteral$1, TypeLiteral$2, TypeLiteral$3, TypeLiteral$4, TypeLiteral$5];
|
|
@@ -18287,7 +18682,7 @@ var InlineInterfacePropertyDelimiter$0 = (0, import_lib4.$C)((0, import_lib4.$S)
|
|
|
18287
18682
|
var InlineInterfacePropertyDelimiter$1 = (0, import_lib4.$T)((0, import_lib4.$S)((0, import_lib4.$Y)((0, import_lib4.$S)(SameLineOrIndentedFurther, InlineBasicInterfaceProperty)), InsertComma), function(value) {
|
|
18288
18683
|
return value[1];
|
|
18289
18684
|
});
|
|
18290
|
-
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)($
|
|
18685
|
+
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 "}"'))));
|
|
18291
18686
|
var InlineInterfacePropertyDelimiter$3 = (0, import_lib4.$Y)(EOS);
|
|
18292
18687
|
var InlineInterfacePropertyDelimiter$$ = [InlineInterfacePropertyDelimiter$0, InlineInterfacePropertyDelimiter$1, InlineInterfacePropertyDelimiter$2, InlineInterfacePropertyDelimiter$3];
|
|
18293
18688
|
function InlineInterfacePropertyDelimiter(ctx, state2) {
|
|
@@ -18303,31 +18698,54 @@ var TypeBinaryOp$$ = [TypeBinaryOp$0, TypeBinaryOp$1];
|
|
|
18303
18698
|
function TypeBinaryOp(ctx, state2) {
|
|
18304
18699
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "TypeBinaryOp", TypeBinaryOp$$);
|
|
18305
18700
|
}
|
|
18306
|
-
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, __,
|
|
18307
|
-
var
|
|
18308
|
-
|
|
18309
|
-
|
|
18701
|
+
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) {
|
|
18702
|
+
var abstract = $1;
|
|
18703
|
+
var async = $2;
|
|
18704
|
+
var new_ = $3;
|
|
18705
|
+
var returnType = $7;
|
|
18706
|
+
const children = [abstract, ...$0.slice(2)];
|
|
18707
|
+
if (abstract && !new_) {
|
|
18310
18708
|
children[1] = {
|
|
18311
18709
|
type: "Error",
|
|
18312
18710
|
message: "abstract function types must be constructors (abstract new)"
|
|
18313
18711
|
};
|
|
18314
18712
|
}
|
|
18315
|
-
if (
|
|
18316
|
-
|
|
18713
|
+
if (returnType.$loc && returnType.token === "") {
|
|
18714
|
+
const t = {
|
|
18715
|
+
type: "VoidType",
|
|
18716
|
+
$loc: returnType.$loc,
|
|
18717
|
+
token: "void"
|
|
18718
|
+
};
|
|
18719
|
+
children[children.length - 1] = returnType = {
|
|
18720
|
+
type: "ReturnTypeAnnotation",
|
|
18721
|
+
ts: true,
|
|
18722
|
+
t,
|
|
18723
|
+
children: [t]
|
|
18724
|
+
};
|
|
18725
|
+
}
|
|
18726
|
+
if (async) {
|
|
18727
|
+
const t = wrapTypeInPromise(returnType.t);
|
|
18728
|
+
children[children.length - 1] = returnType = {
|
|
18729
|
+
...returnType,
|
|
18730
|
+
t,
|
|
18731
|
+
children: returnType.children.map(($) => $ === returnType.t ? t : $)
|
|
18732
|
+
};
|
|
18733
|
+
}
|
|
18317
18734
|
return {
|
|
18318
18735
|
type: "TypeFunction",
|
|
18319
18736
|
children,
|
|
18320
|
-
ts: true
|
|
18737
|
+
ts: true,
|
|
18738
|
+
returnType
|
|
18321
18739
|
};
|
|
18322
18740
|
});
|
|
18323
18741
|
function TypeFunction(ctx, state2) {
|
|
18324
18742
|
return (0, import_lib4.$EVENT)(ctx, state2, "TypeFunction", TypeFunction$0);
|
|
18325
18743
|
}
|
|
18326
|
-
var
|
|
18744
|
+
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) {
|
|
18327
18745
|
return { $loc, token: "=>" };
|
|
18328
18746
|
});
|
|
18329
|
-
function
|
|
18330
|
-
return (0, import_lib4.$EVENT)(ctx, state2, "
|
|
18747
|
+
function TypeFunctionArrow(ctx, state2) {
|
|
18748
|
+
return (0, import_lib4.$EVENT)(ctx, state2, "TypeFunctionArrow", TypeFunctionArrow$0);
|
|
18331
18749
|
}
|
|
18332
18750
|
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) {
|
|
18333
18751
|
var args = $2;
|
|
@@ -18503,7 +18921,7 @@ var CivetPrologue$$ = [CivetPrologue$0, CivetPrologue$1];
|
|
|
18503
18921
|
function CivetPrologue(ctx, state2) {
|
|
18504
18922
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "CivetPrologue", CivetPrologue$$);
|
|
18505
18923
|
}
|
|
18506
|
-
var CivetPrologueContent$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
18924
|
+
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) {
|
|
18507
18925
|
var options = $3;
|
|
18508
18926
|
return {
|
|
18509
18927
|
type: "CivetPrologue",
|
|
@@ -18528,6 +18946,7 @@ var CivetOption$0 = (0, import_lib4.$TR)((0, import_lib4.$EXPECT)($R96, "CivetOp
|
|
|
18528
18946
|
value = 0;
|
|
18529
18947
|
break;
|
|
18530
18948
|
case "globals":
|
|
18949
|
+
case "symbols":
|
|
18531
18950
|
value = value.split(",").filter(Boolean);
|
|
18532
18951
|
break;
|
|
18533
18952
|
}
|
|
@@ -18903,6 +19322,7 @@ var Reset$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L0, 'Reset ""'), fu
|
|
|
18903
19322
|
repl: false,
|
|
18904
19323
|
rewriteTsImports: true,
|
|
18905
19324
|
server: false,
|
|
19325
|
+
symbols: wellKnownSymbols,
|
|
18906
19326
|
tab: void 0,
|
|
18907
19327
|
// default behavior = same as space
|
|
18908
19328
|
verbose: false
|
|
@@ -19199,6 +19619,21 @@ function parseProgram(input, options) {
|
|
|
19199
19619
|
});
|
|
19200
19620
|
}
|
|
19201
19621
|
}
|
|
19622
|
+
var wellKnownSymbols = [
|
|
19623
|
+
"asyncIterator",
|
|
19624
|
+
"hasInstance",
|
|
19625
|
+
"isConcatSpreadable",
|
|
19626
|
+
"iterator",
|
|
19627
|
+
"match",
|
|
19628
|
+
"matchAll",
|
|
19629
|
+
"replace",
|
|
19630
|
+
"search",
|
|
19631
|
+
"species",
|
|
19632
|
+
"split",
|
|
19633
|
+
"toPrimitive",
|
|
19634
|
+
"toStringTag",
|
|
19635
|
+
"unscopables"
|
|
19636
|
+
];
|
|
19202
19637
|
|
|
19203
19638
|
// source/sourcemap.civet
|
|
19204
19639
|
var sourcemap_exports = {};
|