@danielx/civet 0.8.8 → 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 +21 -7
- package/dist/browser.js +1078 -721
- package/dist/main.js +1078 -721
- package/dist/main.mjs +1078 -721
- 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)}`);
|
|
@@ -2319,9 +2372,49 @@ function getTypeArguments(args) {
|
|
|
2319
2372
|
function isVoidType(t) {
|
|
2320
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";
|
|
2321
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
|
+
}
|
|
2322
2378
|
function isPromiseVoidType(t) {
|
|
2323
|
-
|
|
2324
|
-
|
|
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
|
+
};
|
|
2325
2418
|
}
|
|
2326
2419
|
function implicitFunctionBlock(f) {
|
|
2327
2420
|
if (f.abstract || f.block || f.signature?.optional)
|
|
@@ -2382,7 +2475,8 @@ function processReturnValue(func) {
|
|
|
2382
2475
|
}
|
|
2383
2476
|
const ref = makeRef("ret");
|
|
2384
2477
|
let declaration;
|
|
2385
|
-
values.
|
|
2478
|
+
for (let i1 = 0, len3 = values.length; i1 < len3; i1++) {
|
|
2479
|
+
const value = values[i1];
|
|
2386
2480
|
value.children = [ref];
|
|
2387
2481
|
const { ancestor, child } = findAncestor(
|
|
2388
2482
|
value,
|
|
@@ -2390,21 +2484,41 @@ function processReturnValue(func) {
|
|
|
2390
2484
|
isFunction
|
|
2391
2485
|
);
|
|
2392
2486
|
if (ancestor) {
|
|
2393
|
-
|
|
2487
|
+
declaration ??= child;
|
|
2394
2488
|
}
|
|
2395
|
-
|
|
2396
|
-
return;
|
|
2397
|
-
});
|
|
2489
|
+
}
|
|
2398
2490
|
let returnType = func.returnType ?? func.signature?.returnType;
|
|
2399
2491
|
if (returnType) {
|
|
2400
2492
|
const { t } = returnType;
|
|
2401
2493
|
let m;
|
|
2402
2494
|
if (m = t.type, m === "TypePredicate") {
|
|
2403
|
-
|
|
2404
|
-
|
|
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") {
|
|
2405
2508
|
returnType = void 0;
|
|
2406
2509
|
}
|
|
2407
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
|
+
}
|
|
2408
2522
|
if (declaration) {
|
|
2409
2523
|
if (!(declaration.typeSuffix != null)) {
|
|
2410
2524
|
declaration.children[1] = declaration.typeSuffix = returnType;
|
|
@@ -2412,11 +2526,11 @@ function processReturnValue(func) {
|
|
|
2412
2526
|
} else {
|
|
2413
2527
|
block.expressions.unshift([
|
|
2414
2528
|
getIndent(block.expressions[0]),
|
|
2415
|
-
{
|
|
2529
|
+
makeNode({
|
|
2416
2530
|
type: "Declaration",
|
|
2417
2531
|
children: ["let ", ref, returnType],
|
|
2418
2532
|
names: []
|
|
2419
|
-
},
|
|
2533
|
+
}),
|
|
2420
2534
|
";"
|
|
2421
2535
|
]);
|
|
2422
2536
|
}
|
|
@@ -2834,19 +2948,15 @@ function wrapIterationReturningResults(statement, collect) {
|
|
|
2834
2948
|
"wrapIterationReturningResults should not be called twice on the same statement"
|
|
2835
2949
|
);
|
|
2836
2950
|
const resultsRef = statement.resultsRef = makeRef("results");
|
|
2837
|
-
const
|
|
2951
|
+
const declaration = iterationDeclaration(statement);
|
|
2838
2952
|
const { ancestor, child } = findAncestor(statement, ($4) => $4.type === "BlockStatement");
|
|
2839
2953
|
assert.notNull(ancestor, `Could not find block containing ${statement.type}`);
|
|
2840
2954
|
const index = findChildIndex(ancestor.expressions, child);
|
|
2955
|
+
assert.notEqual(index, -1, `Could not find ${statement.type} in containing block`);
|
|
2841
2956
|
const iterationTuple = ancestor.expressions[index];
|
|
2842
2957
|
ancestor.expressions.splice(index, 0, [iterationTuple[0], declaration, ";"]);
|
|
2843
2958
|
iterationTuple[0] = "";
|
|
2844
2959
|
braceBlock(ancestor);
|
|
2845
|
-
if (!breakWithOnly) {
|
|
2846
|
-
assignResults(statement.block, (node) => {
|
|
2847
|
-
return [resultsRef, ".push(", node, ")"];
|
|
2848
|
-
});
|
|
2849
|
-
}
|
|
2850
2960
|
if (collect) {
|
|
2851
2961
|
statement.children.push(collect(resultsRef));
|
|
2852
2962
|
} else {
|
|
@@ -2854,15 +2964,16 @@ function wrapIterationReturningResults(statement, collect) {
|
|
|
2854
2964
|
}
|
|
2855
2965
|
}
|
|
2856
2966
|
function iterationDeclaration(statement) {
|
|
2857
|
-
const { resultsRef } = statement;
|
|
2858
|
-
|
|
2967
|
+
const { resultsRef, block } = statement;
|
|
2968
|
+
const reduction = statement.type === "ForStatement" && statement.reduction;
|
|
2969
|
+
let decl = reduction ? "let" : "const";
|
|
2859
2970
|
if (statement.type === "IterationStatement" || statement.type === "ForStatement") {
|
|
2860
2971
|
if (processBreakContinueWith(statement)) {
|
|
2861
2972
|
decl = "let";
|
|
2862
2973
|
}
|
|
2863
2974
|
}
|
|
2864
2975
|
const breakWithOnly = decl === "let" && isLoopStatement(statement) && gatherRecursive(
|
|
2865
|
-
|
|
2976
|
+
block,
|
|
2866
2977
|
(s) => s.type === "BreakStatement" && !s.with,
|
|
2867
2978
|
(s) => isFunction(s) || s.type === "IterationStatement"
|
|
2868
2979
|
).length === 0;
|
|
@@ -2873,14 +2984,124 @@ function iterationDeclaration(statement) {
|
|
|
2873
2984
|
names: [],
|
|
2874
2985
|
bindings: []
|
|
2875
2986
|
};
|
|
2876
|
-
if (
|
|
2877
|
-
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
|
+
})());
|
|
2878
3010
|
} else {
|
|
2879
|
-
if (
|
|
2880
|
-
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
|
+
});
|
|
2881
3058
|
}
|
|
2882
3059
|
}
|
|
2883
|
-
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;
|
|
2884
3105
|
}
|
|
2885
3106
|
function processParams(f) {
|
|
2886
3107
|
const { type, parameters, block } = f;
|
|
@@ -2911,18 +3132,18 @@ function processParams(f) {
|
|
|
2911
3132
|
const classExpressions = ancestor.body.expressions;
|
|
2912
3133
|
let index = findChildIndex(classExpressions, f);
|
|
2913
3134
|
assert.notEqual(index, -1, "Could not find constructor in class");
|
|
2914
|
-
let
|
|
2915
|
-
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") {
|
|
2916
3137
|
index--;
|
|
2917
3138
|
}
|
|
2918
3139
|
const fStatement = classExpressions[index];
|
|
2919
|
-
for (let
|
|
2920
|
-
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];
|
|
2921
3142
|
if (!parameter.typeSuffix) {
|
|
2922
3143
|
continue;
|
|
2923
3144
|
}
|
|
2924
|
-
for (let
|
|
2925
|
-
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];
|
|
2926
3147
|
const typeSuffix = binding.parent?.typeSuffix;
|
|
2927
3148
|
if (!typeSuffix) {
|
|
2928
3149
|
continue;
|
|
@@ -2976,11 +3197,11 @@ function processParams(f) {
|
|
|
2976
3197
|
}
|
|
2977
3198
|
function processSignature(f) {
|
|
2978
3199
|
const { block, signature } = f;
|
|
2979
|
-
if (
|
|
3200
|
+
if (!f.async?.length && hasAwait(block)) {
|
|
2980
3201
|
f.async.push("async ");
|
|
2981
3202
|
signature.modifier.async = true;
|
|
2982
3203
|
}
|
|
2983
|
-
if (
|
|
3204
|
+
if (!f.generator?.length && hasYield(block)) {
|
|
2984
3205
|
if (f.type === "ArrowFunction") {
|
|
2985
3206
|
gatherRecursiveWithinFunction(block, ($11) => $11.type === "YieldExpression").forEach((y) => {
|
|
2986
3207
|
const i = y.children.findIndex(($12) => $12.type === "Yield");
|
|
@@ -2994,21 +3215,26 @@ function processSignature(f) {
|
|
|
2994
3215
|
signature.modifier.generator = true;
|
|
2995
3216
|
}
|
|
2996
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
|
+
}
|
|
2997
3221
|
}
|
|
2998
3222
|
function processFunctions(statements, config2) {
|
|
2999
|
-
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];
|
|
3000
3225
|
if (f.type === "FunctionExpression") {
|
|
3001
3226
|
implicitFunctionBlock(f);
|
|
3002
3227
|
}
|
|
3003
3228
|
processSignature(f);
|
|
3004
3229
|
processParams(f);
|
|
3005
|
-
|
|
3006
|
-
}
|
|
3007
|
-
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];
|
|
3008
3234
|
implicitFunctionBlock(f);
|
|
3009
3235
|
processParams(f);
|
|
3010
|
-
|
|
3011
|
-
}
|
|
3236
|
+
processReturn(f, config2.implicitReturns);
|
|
3237
|
+
}
|
|
3012
3238
|
}
|
|
3013
3239
|
function expressionizeIteration(exp) {
|
|
3014
3240
|
let { async, generator, block, children, statement } = exp;
|
|
@@ -3021,47 +3247,65 @@ function expressionizeIteration(exp) {
|
|
|
3021
3247
|
updateParentPointers(exp);
|
|
3022
3248
|
return;
|
|
3023
3249
|
}
|
|
3250
|
+
let statements;
|
|
3024
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);
|
|
3025
3259
|
assignResults(block, (node) => {
|
|
3026
3260
|
return {
|
|
3027
3261
|
type: "YieldExpression",
|
|
3028
3262
|
expression: node,
|
|
3029
|
-
children: [
|
|
3263
|
+
children: [
|
|
3264
|
+
{
|
|
3265
|
+
type: "Yield",
|
|
3266
|
+
token: "yield "
|
|
3267
|
+
},
|
|
3268
|
+
node
|
|
3269
|
+
]
|
|
3030
3270
|
};
|
|
3031
3271
|
});
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
wrapIIFE([
|
|
3036
|
-
["", statement, void 0],
|
|
3037
|
-
// Prevent implicit return in generator, by adding an explicit return
|
|
3038
|
-
["", {
|
|
3039
|
-
type: "ReturnStatement",
|
|
3040
|
-
expression: void 0,
|
|
3041
|
-
children: [";return"]
|
|
3042
|
-
}, void 0]
|
|
3043
|
-
], async, generator)
|
|
3044
|
-
);
|
|
3272
|
+
statements = [
|
|
3273
|
+
["", statement]
|
|
3274
|
+
];
|
|
3045
3275
|
} else {
|
|
3046
3276
|
const resultsRef = statement.resultsRef ??= makeRef("results");
|
|
3047
|
-
const
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
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;
|
|
3053
3294
|
}
|
|
3054
|
-
children.splice(
|
|
3055
|
-
i,
|
|
3056
|
-
1,
|
|
3057
|
-
wrapIIFE([
|
|
3058
|
-
["", declaration, ";"],
|
|
3059
|
-
["", statement, void 0],
|
|
3060
|
-
["", wrapWithReturn(resultsRef)]
|
|
3061
|
-
], async)
|
|
3062
|
-
);
|
|
3063
3295
|
}
|
|
3064
|
-
|
|
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
|
+
}
|
|
3065
3309
|
}
|
|
3066
3310
|
function skipImplicitArguments(args) {
|
|
3067
3311
|
if (args.length === 1) {
|
|
@@ -3085,12 +3329,12 @@ function processCoffeeDo(ws, expression) {
|
|
|
3085
3329
|
...parameters,
|
|
3086
3330
|
children: (() => {
|
|
3087
3331
|
const results1 = [];
|
|
3088
|
-
for (let
|
|
3089
|
-
let parameter =
|
|
3332
|
+
for (let ref15 = parameters.children, i7 = 0, len6 = ref15.length; i7 < len6; i7++) {
|
|
3333
|
+
let parameter = ref15[i7];
|
|
3090
3334
|
if (typeof parameter === "object" && parameter != null && "type" in parameter && parameter.type === "Parameter") {
|
|
3091
|
-
let
|
|
3092
|
-
if (
|
|
3093
|
-
const initializer =
|
|
3335
|
+
let ref16;
|
|
3336
|
+
if (ref16 = parameter.initializer) {
|
|
3337
|
+
const initializer = ref16;
|
|
3094
3338
|
args.push(initializer.expression, parameter.delim);
|
|
3095
3339
|
parameter = {
|
|
3096
3340
|
...parameter,
|
|
@@ -3111,7 +3355,7 @@ function processCoffeeDo(ws, expression) {
|
|
|
3111
3355
|
expression = {
|
|
3112
3356
|
...expression,
|
|
3113
3357
|
parameters: newParameters,
|
|
3114
|
-
children: expression.children.map(($
|
|
3358
|
+
children: expression.children.map(($16) => $16 === parameters ? newParameters : $16)
|
|
3115
3359
|
};
|
|
3116
3360
|
}
|
|
3117
3361
|
return {
|
|
@@ -3133,7 +3377,7 @@ function makeAmpersandFunction(rhs) {
|
|
|
3133
3377
|
ref = makeRef("$");
|
|
3134
3378
|
inplacePrepend(ref, body);
|
|
3135
3379
|
}
|
|
3136
|
-
if (startsWithPredicate(body, ($
|
|
3380
|
+
if (startsWithPredicate(body, ($17) => $17.type === "ObjectExpression")) {
|
|
3137
3381
|
body = makeLeftHandSideExpression(body);
|
|
3138
3382
|
}
|
|
3139
3383
|
const parameters = makeNode({
|
|
@@ -3373,6 +3617,28 @@ function needsPrecedingSemicolon(exp) {
|
|
|
3373
3617
|
}
|
|
3374
3618
|
}
|
|
3375
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
|
+
}
|
|
3376
3642
|
|
|
3377
3643
|
// source/parser/op.civet
|
|
3378
3644
|
var precedenceOrder = [
|
|
@@ -4634,8 +4900,9 @@ function convertWithClause(withClause, extendsClause) {
|
|
|
4634
4900
|
|
|
4635
4901
|
// source/parser/unary.civet
|
|
4636
4902
|
function processUnaryExpression(pre, exp, post) {
|
|
4637
|
-
if (!(pre.length || post))
|
|
4903
|
+
if (!(pre.length || post)) {
|
|
4638
4904
|
return exp;
|
|
4905
|
+
}
|
|
4639
4906
|
if (post?.token === "?") {
|
|
4640
4907
|
post = {
|
|
4641
4908
|
$loc: post.$loc,
|
|
@@ -4666,29 +4933,25 @@ function processUnaryExpression(pre, exp, post) {
|
|
|
4666
4933
|
}
|
|
4667
4934
|
return exp;
|
|
4668
4935
|
}
|
|
4669
|
-
if (exp
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
children: [literal, post]
|
|
4683
|
-
};
|
|
4684
|
-
}
|
|
4685
|
-
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;
|
|
4686
4949
|
}
|
|
4687
4950
|
}
|
|
4688
4951
|
}
|
|
4689
|
-
let
|
|
4690
|
-
while (
|
|
4691
|
-
const l =
|
|
4952
|
+
let ref1;
|
|
4953
|
+
while (ref1 = pre.length) {
|
|
4954
|
+
const l = ref1;
|
|
4692
4955
|
const last = pre[l - 1];
|
|
4693
4956
|
if (last.type === "Await") {
|
|
4694
4957
|
if (last.op) {
|
|
@@ -4701,8 +4964,8 @@ function processUnaryExpression(pre, exp, post) {
|
|
|
4701
4964
|
};
|
|
4702
4965
|
pre = pre.slice(0, -1);
|
|
4703
4966
|
} else {
|
|
4704
|
-
let
|
|
4705
|
-
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)) {
|
|
4706
4969
|
exp = parenthesizeExpression(exp);
|
|
4707
4970
|
}
|
|
4708
4971
|
exp = {
|
|
@@ -4806,6 +5069,7 @@ function constructInvocation(fn, arg) {
|
|
|
4806
5069
|
updateParentPointers(ref);
|
|
4807
5070
|
return makeNode({
|
|
4808
5071
|
type: "UnwrappedExpression",
|
|
5072
|
+
expression: body,
|
|
4809
5073
|
children: [skipIfOnlyWS(fn.leadingComment), body, skipIfOnlyWS(fn.trailingComment)]
|
|
4810
5074
|
});
|
|
4811
5075
|
}
|
|
@@ -4842,6 +5106,17 @@ function constructPipeStep(fn, arg, returning) {
|
|
|
4842
5106
|
returning
|
|
4843
5107
|
];
|
|
4844
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
|
+
}
|
|
4845
5120
|
case "return": {
|
|
4846
5121
|
return [{
|
|
4847
5122
|
type: "ReturnStatement",
|
|
@@ -5126,25 +5401,40 @@ function forRange(open, forDeclaration, range, stepExp, close) {
|
|
|
5126
5401
|
const infinite = typeof end === "object" && end != null && "type" in end && end.type === "Identifier" && "name" in end && end.name === "Infinity";
|
|
5127
5402
|
let stepRef, asc;
|
|
5128
5403
|
if (stepExp) {
|
|
5129
|
-
stepExp =
|
|
5404
|
+
stepExp = trimFirstSpace(stepExp);
|
|
5130
5405
|
stepRef = maybeRef(stepExp, "step");
|
|
5131
5406
|
} else if (infinite) {
|
|
5132
|
-
stepExp = stepRef =
|
|
5407
|
+
stepExp = stepRef = makeNumericLiteral(1);
|
|
5133
5408
|
} else if (increasing != null) {
|
|
5134
5409
|
if (increasing) {
|
|
5135
|
-
stepExp = stepRef =
|
|
5410
|
+
stepExp = stepRef = makeNumericLiteral(1);
|
|
5136
5411
|
asc = true;
|
|
5137
5412
|
} else {
|
|
5138
|
-
stepExp = stepRef =
|
|
5413
|
+
stepExp = stepRef = makeNumericLiteral(-1);
|
|
5139
5414
|
asc = false;
|
|
5140
5415
|
}
|
|
5141
5416
|
}
|
|
5142
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;
|
|
5143
5433
|
if (stepRef)
|
|
5144
|
-
|
|
5434
|
+
ref3 = start;
|
|
5145
5435
|
else
|
|
5146
|
-
|
|
5147
|
-
let startRef =
|
|
5436
|
+
ref3 = maybeRef(start, "start");
|
|
5437
|
+
let startRef = ref3;
|
|
5148
5438
|
let endRef = maybeRef(end, "end");
|
|
5149
5439
|
const startRefDec = startRef !== start ? [startRef, " = ", start, ", "] : [];
|
|
5150
5440
|
const endRefDec = endRef !== end ? [endRef, " = ", end, ", "] : [];
|
|
@@ -5156,11 +5446,11 @@ function forRange(open, forDeclaration, range, stepExp, close) {
|
|
|
5156
5446
|
];
|
|
5157
5447
|
}
|
|
5158
5448
|
let ascDec = [], ascRef;
|
|
5159
|
-
if (
|
|
5449
|
+
if (stepExp) {
|
|
5160
5450
|
if (!(stepRef === stepExp)) {
|
|
5161
5451
|
ascDec = [", ", stepRef, " = ", stepExp];
|
|
5162
5452
|
}
|
|
5163
|
-
} else if ("Literal"
|
|
5453
|
+
} else if (start?.type === "Literal" && "Literal" === end?.type) {
|
|
5164
5454
|
asc = literalValue(start) <= literalValue(end);
|
|
5165
5455
|
if ("StringLiteral" === start.subtype && start.subtype === end.subtype) {
|
|
5166
5456
|
startRef = literalValue(start).charCodeAt(0).toString();
|
|
@@ -5171,10 +5461,11 @@ function forRange(open, forDeclaration, range, stepExp, close) {
|
|
|
5171
5461
|
ascDec = [", ", ascRef, " = ", startRef, " <= ", endRef];
|
|
5172
5462
|
}
|
|
5173
5463
|
let varAssign = [], varLetAssign = varAssign, varLet = varAssign, blockPrefix;
|
|
5174
|
-
|
|
5175
|
-
|
|
5464
|
+
let names = forDeclaration?.names;
|
|
5465
|
+
if (forDeclaration?.decl) {
|
|
5466
|
+
if (forDeclaration.decl === "let") {
|
|
5176
5467
|
const varName = forDeclaration.children.splice(1);
|
|
5177
|
-
varAssign = [...
|
|
5468
|
+
varAssign = [...trimFirstSpace(varName), " = "];
|
|
5178
5469
|
varLet = [",", ...varName, " = ", counterRef];
|
|
5179
5470
|
} else {
|
|
5180
5471
|
const value = "StringLiteral" === start.subtype ? ["String.fromCharCode(", counterRef, ")"] : counterRef;
|
|
@@ -5183,26 +5474,41 @@ function forRange(open, forDeclaration, range, stepExp, close) {
|
|
|
5183
5474
|
];
|
|
5184
5475
|
}
|
|
5185
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
|
+
);
|
|
5186
5482
|
varAssign = varLetAssign = [forDeclaration, " = "];
|
|
5483
|
+
names = [];
|
|
5187
5484
|
}
|
|
5188
5485
|
const declaration = {
|
|
5189
5486
|
type: "Declaration",
|
|
5190
5487
|
children: ["let ", ...startRefDec, ...endRefDec, counterRef, " = ", ...varLetAssign, startRef, ...varLet, ...ascDec],
|
|
5191
|
-
names
|
|
5488
|
+
names
|
|
5192
5489
|
};
|
|
5193
5490
|
const counterPart = right.inclusive ? [counterRef, " <= ", endRef, " : ", counterRef, " >= ", endRef] : [counterRef, " < ", endRef, " : ", counterRef, " > ", endRef];
|
|
5194
|
-
const condition = infinite ? [] : asc != null ? asc ? counterPart.slice(0, 3) : counterPart.slice(4) : stepRef ? [stepRef, " !== 0 && (", stepRef, " > 0 ? ", ...counterPart, ")"] : [ascRef, " ? ", ...counterPart];
|
|
5195
|
-
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];
|
|
5196
5493
|
return {
|
|
5197
|
-
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,
|
|
5198
5497
|
children: [range.error, open, declaration, "; ", ...condition, "; ", ...increment, close],
|
|
5199
5498
|
blockPrefix
|
|
5200
5499
|
};
|
|
5201
5500
|
}
|
|
5202
|
-
function processForInOf($0
|
|
5501
|
+
function processForInOf($0) {
|
|
5203
5502
|
let [awaits, eachOwn, open, declaration, declaration2, ws, inOf, exp, step, close] = $0;
|
|
5204
5503
|
if (exp.type === "RangeExpression" && inOf.token === "of" && !declaration2) {
|
|
5205
|
-
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
|
+
);
|
|
5206
5512
|
} else if (step) {
|
|
5207
5513
|
throw new Error("for..of/in cannot use 'by' except with range literals");
|
|
5208
5514
|
}
|
|
@@ -5218,22 +5524,22 @@ function processForInOf($0, getRef) {
|
|
|
5218
5524
|
if (declaration2) {
|
|
5219
5525
|
const [, , ws22, decl22] = declaration2;
|
|
5220
5526
|
blockPrefix.push(["", [
|
|
5221
|
-
|
|
5527
|
+
trimFirstSpace(ws22),
|
|
5222
5528
|
decl22,
|
|
5223
5529
|
" = ",
|
|
5224
5530
|
counterRef
|
|
5225
5531
|
], ";"]);
|
|
5226
5532
|
assignmentNames.push(...decl22.names);
|
|
5227
5533
|
}
|
|
5228
|
-
const expRefDec = expRef2 !== exp ? [
|
|
5534
|
+
const expRefDec = expRef2 !== exp ? [trimFirstSpace(expRef2), " = ", trimFirstSpace(exp), ", "] : [];
|
|
5229
5535
|
blockPrefix.push(["", {
|
|
5230
5536
|
type: "Declaration",
|
|
5231
|
-
children: [declaration, " = ",
|
|
5537
|
+
children: [declaration, " = ", trimFirstSpace(expRef2), "[", counterRef, "]"],
|
|
5232
5538
|
names: assignmentNames
|
|
5233
5539
|
}, ";"]);
|
|
5234
5540
|
declaration = {
|
|
5235
5541
|
type: "Declaration",
|
|
5236
|
-
children: ["let ", ...expRefDec, counterRef, " = 0, ", lenRef, " = ",
|
|
5542
|
+
children: ["let ", ...expRefDec, counterRef, " = 0, ", lenRef, " = ", trimFirstSpace(expRef2), ".length"],
|
|
5237
5543
|
names: []
|
|
5238
5544
|
};
|
|
5239
5545
|
const condition = [counterRef, " < ", lenRef, "; "];
|
|
@@ -5281,7 +5587,7 @@ function processForInOf($0, getRef) {
|
|
|
5281
5587
|
return {
|
|
5282
5588
|
declaration,
|
|
5283
5589
|
blockPrefix,
|
|
5284
|
-
children: [awaits, eachOwnError, open, declaration, ws, inOf, expRef ?? exp,
|
|
5590
|
+
children: [awaits, eachOwnError, open, declaration, ws, inOf, expRef ?? exp, close]
|
|
5285
5591
|
// omit declaration2, replace eachOwn with eachOwnError, replace exp with expRef
|
|
5286
5592
|
};
|
|
5287
5593
|
}
|
|
@@ -5298,7 +5604,7 @@ function processForInOf($0, getRef) {
|
|
|
5298
5604
|
};
|
|
5299
5605
|
blockPrefix.push(["", {
|
|
5300
5606
|
type: "Declaration",
|
|
5301
|
-
children: [
|
|
5607
|
+
children: [trimFirstSpace(ws2), decl2, " = ", counterRef, "++"],
|
|
5302
5608
|
names: decl2.names
|
|
5303
5609
|
}, ";"]);
|
|
5304
5610
|
break;
|
|
@@ -5317,13 +5623,13 @@ function processForInOf($0, getRef) {
|
|
|
5317
5623
|
};
|
|
5318
5624
|
}
|
|
5319
5625
|
if (own) {
|
|
5320
|
-
const hasPropRef =
|
|
5321
|
-
blockPrefix.push(["", ["if (!", hasPropRef, "(",
|
|
5626
|
+
const hasPropRef = getHelperRef("hasProp");
|
|
5627
|
+
blockPrefix.push(["", ["if (!", hasPropRef, "(", trimFirstSpace(expRef2), ", ", trimFirstSpace(pattern), ")) continue"], ";"]);
|
|
5322
5628
|
}
|
|
5323
5629
|
if (decl2) {
|
|
5324
5630
|
blockPrefix.push(["", {
|
|
5325
5631
|
type: "Declaration",
|
|
5326
|
-
children: [
|
|
5632
|
+
children: [trimFirstSpace(ws2), decl2, " = ", trimFirstSpace(expRef2), "[", trimFirstSpace(pattern), "]"],
|
|
5327
5633
|
names: decl2.names
|
|
5328
5634
|
}, ";"]);
|
|
5329
5635
|
}
|
|
@@ -5336,7 +5642,7 @@ function processForInOf($0, getRef) {
|
|
|
5336
5642
|
}
|
|
5337
5643
|
return {
|
|
5338
5644
|
declaration,
|
|
5339
|
-
children: [awaits, eachOwnError, open, declaration, ws, inOf, exp,
|
|
5645
|
+
children: [awaits, eachOwnError, open, declaration, ws, inOf, exp, close],
|
|
5340
5646
|
// omit declaration2, replace each with eachOwnError
|
|
5341
5647
|
blockPrefix,
|
|
5342
5648
|
hoistDec
|
|
@@ -5469,7 +5775,7 @@ function createVarDecs(block, scopes, pushVar) {
|
|
|
5469
5775
|
return createVarDecs(block2, scopes, pushVar);
|
|
5470
5776
|
});
|
|
5471
5777
|
forNodes.forEach(({ block: block2, declaration }) => {
|
|
5472
|
-
scopes.push(new Set(declaration
|
|
5778
|
+
scopes.push(new Set(declaration?.names));
|
|
5473
5779
|
createVarDecs(block2, scopes, pushVar);
|
|
5474
5780
|
return scopes.pop();
|
|
5475
5781
|
});
|
|
@@ -6433,8 +6739,8 @@ function processBindingPatternLHS(lhs, tail) {
|
|
|
6433
6739
|
tail.push(...splices.map((s) => [", ", s]), ...thisAssignments.map((a) => [", ", a]));
|
|
6434
6740
|
}
|
|
6435
6741
|
function processAssignments(statements) {
|
|
6436
|
-
gatherRecursiveAll(statements, (
|
|
6437
|
-
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) {
|
|
6438
6744
|
let expr = lhs;
|
|
6439
6745
|
while (expr.type === "ParenthesizedExpression") {
|
|
6440
6746
|
expr = expr.expression;
|
|
@@ -6452,17 +6758,20 @@ function processAssignments(statements) {
|
|
|
6452
6758
|
}
|
|
6453
6759
|
;
|
|
6454
6760
|
return;
|
|
6455
|
-
}
|
|
6761
|
+
};
|
|
6762
|
+
var extractAssignment = extractAssignment2;
|
|
6763
|
+
const exp = ref6[i5];
|
|
6456
6764
|
const pre = [], post = [];
|
|
6457
|
-
let
|
|
6765
|
+
let ref7;
|
|
6458
6766
|
switch (exp.type) {
|
|
6459
6767
|
case "AssignmentExpression": {
|
|
6460
|
-
if (!exp.lhs)
|
|
6461
|
-
|
|
6768
|
+
if (!exp.lhs) {
|
|
6769
|
+
continue;
|
|
6770
|
+
}
|
|
6462
6771
|
exp.lhs.forEach((lhsPart, i) => {
|
|
6463
|
-
let
|
|
6464
|
-
if (
|
|
6465
|
-
const newLhs =
|
|
6772
|
+
let ref8;
|
|
6773
|
+
if (ref8 = extractAssignment2(lhsPart[1])) {
|
|
6774
|
+
const newLhs = ref8;
|
|
6466
6775
|
return lhsPart[1] = newLhs;
|
|
6467
6776
|
}
|
|
6468
6777
|
;
|
|
@@ -6471,8 +6780,8 @@ function processAssignments(statements) {
|
|
|
6471
6780
|
break;
|
|
6472
6781
|
}
|
|
6473
6782
|
case "UpdateExpression": {
|
|
6474
|
-
if (
|
|
6475
|
-
const newLhs =
|
|
6783
|
+
if (ref7 = extractAssignment2(exp.assigned)) {
|
|
6784
|
+
const newLhs = ref7;
|
|
6476
6785
|
const i = exp.children.indexOf(exp.assigned);
|
|
6477
6786
|
exp.assigned = exp.children[i] = newLhs;
|
|
6478
6787
|
}
|
|
@@ -6480,15 +6789,17 @@ function processAssignments(statements) {
|
|
|
6480
6789
|
break;
|
|
6481
6790
|
}
|
|
6482
6791
|
}
|
|
6483
|
-
if (pre.length)
|
|
6792
|
+
if (pre.length) {
|
|
6484
6793
|
exp.children.unshift(...pre);
|
|
6485
|
-
|
|
6794
|
+
}
|
|
6795
|
+
if (post.length) {
|
|
6486
6796
|
exp.children.push(...post);
|
|
6797
|
+
}
|
|
6487
6798
|
if (exp.type === "UpdateExpression") {
|
|
6488
6799
|
const { assigned } = exp;
|
|
6489
6800
|
const ref = makeRef();
|
|
6490
6801
|
const newMemberExp = unchainOptionalMemberExpression(assigned, ref, (children) => {
|
|
6491
|
-
return exp.children.map(($
|
|
6802
|
+
return exp.children.map(($4) => $4 === assigned ? children : $4);
|
|
6492
6803
|
});
|
|
6493
6804
|
if (newMemberExp !== assigned) {
|
|
6494
6805
|
if (newMemberExp.usesRef) {
|
|
@@ -6498,169 +6809,163 @@ function processAssignments(statements) {
|
|
|
6498
6809
|
names: []
|
|
6499
6810
|
};
|
|
6500
6811
|
}
|
|
6501
|
-
|
|
6812
|
+
replaceNode(exp, newMemberExp);
|
|
6502
6813
|
}
|
|
6503
|
-
;
|
|
6504
|
-
return;
|
|
6505
6814
|
}
|
|
6506
|
-
|
|
6507
|
-
|
|
6508
|
-
|
|
6509
|
-
|
|
6510
|
-
|
|
6511
|
-
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
|
|
6515
|
-
|
|
6516
|
-
|
|
6517
|
-
|
|
6518
|
-
|
|
6519
|
-
|
|
6520
|
-
|
|
6521
|
-
|
|
6522
|
-
|
|
6523
|
-
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
block = void 0;
|
|
6528
|
-
}
|
|
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;
|
|
6529
6836
|
}
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
exp
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
)
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
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;
|
|
6547
6855
|
}
|
|
6548
|
-
|
|
6549
|
-
|
|
6550
|
-
|
|
6551
|
-
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
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(")");
|
|
6563
6871
|
}
|
|
6564
6872
|
}
|
|
6565
|
-
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
|
|
6580
|
-
|
|
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"];
|
|
6581
6900
|
}
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
c[2] = ", ";
|
|
6587
|
-
if (end) {
|
|
6588
|
-
c[3] = [end, " - ", start];
|
|
6589
|
-
} else {
|
|
6590
|
-
c[3] = ["1/0"];
|
|
6591
|
-
}
|
|
6592
|
-
c[4] = [", ...", $2];
|
|
6593
|
-
c[5] = ")";
|
|
6901
|
+
c[4] = [", ...", $2];
|
|
6902
|
+
c[5] = ")";
|
|
6903
|
+
lastAssignment.pop();
|
|
6904
|
+
if (isWhitespaceOrEmpty(lastAssignment[2]))
|
|
6594
6905
|
lastAssignment.pop();
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
if ($1.length > 1) {
|
|
6598
|
-
throw new Error("Not implemented yet! TODO: Handle multiple splice assignments");
|
|
6599
|
-
}
|
|
6600
|
-
exp.children = [$1];
|
|
6601
|
-
exp.names = [];
|
|
6602
|
-
break;
|
|
6906
|
+
if ($1.length > 1) {
|
|
6907
|
+
throw new Error("Not implemented yet! TODO: Handle multiple splice assignments");
|
|
6603
6908
|
}
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
|
|
6909
|
+
exp.children = [$1];
|
|
6910
|
+
exp.names = [];
|
|
6911
|
+
break;
|
|
6607
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));
|
|
6608
6916
|
}
|
|
6609
|
-
i--;
|
|
6610
6917
|
}
|
|
6611
|
-
i
|
|
6612
|
-
|
|
6613
|
-
|
|
6614
|
-
|
|
6615
|
-
|
|
6616
|
-
|
|
6617
|
-
|
|
6618
|
-
|
|
6619
|
-
|
|
6620
|
-
|
|
6621
|
-
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
|
|
6630
|
-
|
|
6631
|
-
newMemberExp.parent = exp;
|
|
6632
|
-
$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
|
+
};
|
|
6633
6938
|
}
|
|
6939
|
+
replaceNode($2, newMemberExp);
|
|
6940
|
+
$2 = newMemberExp;
|
|
6634
6941
|
}
|
|
6635
|
-
i--;
|
|
6636
6942
|
}
|
|
6637
|
-
|
|
6638
|
-
|
|
6639
|
-
|
|
6640
|
-
|
|
6641
|
-
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
|
|
6645
|
-
|
|
6646
|
-
|
|
6647
|
-
|
|
6648
|
-
exp.names = $1.flatMap(([, l]) => l.names || []);
|
|
6649
|
-
if (tail.length) {
|
|
6650
|
-
const index = exp.children.indexOf($2);
|
|
6651
|
-
if (index < 0)
|
|
6652
|
-
throw new Error("Assertion error: exp not in AssignmentExpression");
|
|
6653
|
-
exp.children.splice(index + 1, 0, ...tail);
|
|
6654
|
-
}
|
|
6655
|
-
if (block) {
|
|
6656
|
-
block.parent = exp.parent;
|
|
6657
|
-
block.expressions.push(["", exp]);
|
|
6658
|
-
exp.parent = block;
|
|
6659
|
-
return block;
|
|
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
|
+
};
|
|
6660
6954
|
}
|
|
6661
|
-
return exp;
|
|
6662
6955
|
}
|
|
6663
|
-
|
|
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
|
+
}
|
|
6664
6969
|
}
|
|
6665
6970
|
function unchainOptionalMemberExpression(exp, ref, innerExp) {
|
|
6666
6971
|
let j = 0;
|
|
@@ -6710,9 +7015,9 @@ function unchainOptionalMemberExpression(exp, ref, innerExp) {
|
|
|
6710
7015
|
}
|
|
6711
7016
|
j++;
|
|
6712
7017
|
}
|
|
6713
|
-
let
|
|
6714
|
-
if (
|
|
6715
|
-
const l =
|
|
7018
|
+
let ref13;
|
|
7019
|
+
if (ref13 = conditions.length) {
|
|
7020
|
+
const l = ref13;
|
|
6716
7021
|
const cs = flatJoin(conditions, " && ");
|
|
6717
7022
|
return {
|
|
6718
7023
|
...exp,
|
|
@@ -6751,28 +7056,28 @@ function processTypes(node) {
|
|
|
6751
7056
|
if (!unary.suffix.length) {
|
|
6752
7057
|
return;
|
|
6753
7058
|
}
|
|
6754
|
-
let
|
|
7059
|
+
let ref14;
|
|
6755
7060
|
let m4;
|
|
6756
|
-
if (m4 = (
|
|
7061
|
+
if (m4 = (ref14 = unary.suffix)[ref14.length - 1], typeof m4 === "object" && m4 != null && "token" in m4 && m4.token === "?") {
|
|
6757
7062
|
const { token } = m4;
|
|
6758
7063
|
let last;
|
|
6759
7064
|
let count = 0;
|
|
6760
|
-
let
|
|
6761
|
-
while (unary.suffix.length && (
|
|
7065
|
+
let ref15;
|
|
7066
|
+
while (unary.suffix.length && (ref15 = unary.suffix)[ref15.length - 1]?.token === "?") {
|
|
6762
7067
|
last = unary.suffix.pop();
|
|
6763
7068
|
count++;
|
|
6764
7069
|
}
|
|
6765
|
-
let
|
|
6766
|
-
while (unary.suffix.length && (
|
|
7070
|
+
let ref16;
|
|
7071
|
+
while (unary.suffix.length && (ref16 = unary.suffix)[ref16.length - 1]?.type === "NonNullAssertion") {
|
|
6767
7072
|
unary.suffix.pop();
|
|
6768
7073
|
}
|
|
6769
|
-
let
|
|
7074
|
+
let ref17;
|
|
6770
7075
|
if (unary.suffix.length || unary.prefix.length)
|
|
6771
|
-
|
|
7076
|
+
ref17 = unary;
|
|
6772
7077
|
else
|
|
6773
|
-
|
|
6774
|
-
const t =
|
|
6775
|
-
if (unary.parent?.type === "
|
|
7078
|
+
ref17 = unary.t;
|
|
7079
|
+
const t = ref17;
|
|
7080
|
+
if (unary.parent?.type === "TypeElement" && !unary.parent.name) {
|
|
6776
7081
|
if (count === 1) {
|
|
6777
7082
|
unary.suffix.push(last);
|
|
6778
7083
|
return;
|
|
@@ -6799,12 +7104,12 @@ function processTypes(node) {
|
|
|
6799
7104
|
}
|
|
6800
7105
|
} else if (typeof m4 === "object" && m4 != null && "type" in m4 && m4.type === "NonNullAssertion") {
|
|
6801
7106
|
const { type } = m4;
|
|
6802
|
-
let
|
|
6803
|
-
while (unary.suffix.length && (
|
|
7107
|
+
let ref18;
|
|
7108
|
+
while (unary.suffix.length && (ref18 = unary.suffix)[ref18.length - 1]?.type === "NonNullAssertion") {
|
|
6804
7109
|
unary.suffix.pop();
|
|
6805
7110
|
}
|
|
6806
|
-
let
|
|
6807
|
-
while (unary.suffix.length && (
|
|
7111
|
+
let ref19;
|
|
7112
|
+
while (unary.suffix.length && (ref19 = unary.suffix)[ref19.length - 1]?.token === "?") {
|
|
6808
7113
|
unary.suffix.pop();
|
|
6809
7114
|
}
|
|
6810
7115
|
const t = trimFirstSpace(
|
|
@@ -6830,35 +7135,41 @@ function processTypes(node) {
|
|
|
6830
7135
|
});
|
|
6831
7136
|
}
|
|
6832
7137
|
function processStatementExpressions(statements) {
|
|
6833
|
-
gatherRecursiveAll(statements, ($
|
|
6834
|
-
const exp =
|
|
6835
|
-
const { statement } = exp;
|
|
6836
|
-
|
|
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;
|
|
6837
7146
|
switch (statement.type) {
|
|
6838
7147
|
case "IfStatement": {
|
|
6839
|
-
if (
|
|
6840
|
-
const expression =
|
|
6841
|
-
|
|
7148
|
+
if (ref21 = expressionizeIfStatement(statement)) {
|
|
7149
|
+
const expression = ref21;
|
|
7150
|
+
replaceNode(statement, expression, exp);
|
|
6842
7151
|
} else {
|
|
6843
|
-
|
|
7152
|
+
replaceNode(statement, wrapIIFE([["", statement]]), exp);
|
|
6844
7153
|
}
|
|
7154
|
+
;
|
|
7155
|
+
break;
|
|
6845
7156
|
}
|
|
6846
7157
|
case "IterationExpression": {
|
|
6847
7158
|
if (statement.subtype === "ComptimeStatement") {
|
|
6848
|
-
|
|
7159
|
+
replaceNode(
|
|
6849
7160
|
statement,
|
|
6850
7161
|
expressionizeComptime(statement.statement),
|
|
6851
7162
|
exp
|
|
6852
7163
|
);
|
|
6853
7164
|
}
|
|
6854
7165
|
;
|
|
6855
|
-
|
|
7166
|
+
break;
|
|
6856
7167
|
}
|
|
6857
7168
|
default: {
|
|
6858
|
-
|
|
7169
|
+
replaceNode(statement, wrapIIFE([["", statement]]), exp);
|
|
6859
7170
|
}
|
|
6860
7171
|
}
|
|
6861
|
-
}
|
|
7172
|
+
}
|
|
6862
7173
|
}
|
|
6863
7174
|
function processNegativeIndexAccess(statements) {
|
|
6864
7175
|
gatherRecursiveAll(statements, (n) => n.type === "NegativeIndex").forEach((exp) => {
|
|
@@ -6906,7 +7217,7 @@ function processProgram(root) {
|
|
|
6906
7217
|
if (config2.iife || config2.repl) {
|
|
6907
7218
|
rootIIFE = wrapIIFE(root.expressions, root.topLevelAwait);
|
|
6908
7219
|
const newExpressions = [["", rootIIFE]];
|
|
6909
|
-
root.children = root.children.map(($
|
|
7220
|
+
root.children = root.children.map(($11) => $11 === root.expressions ? newExpressions : $11);
|
|
6910
7221
|
root.expressions = newExpressions;
|
|
6911
7222
|
}
|
|
6912
7223
|
addParentPointers(root);
|
|
@@ -6920,7 +7231,7 @@ function processProgram(root) {
|
|
|
6920
7231
|
processAssignments(statements);
|
|
6921
7232
|
processStatementExpressions(statements);
|
|
6922
7233
|
processPatternMatching(statements);
|
|
6923
|
-
|
|
7234
|
+
processIterationExpressions(statements);
|
|
6924
7235
|
hoistRefDecs(statements);
|
|
6925
7236
|
processFunctions(statements, config2);
|
|
6926
7237
|
statements.unshift(...state2.prelude);
|
|
@@ -6946,17 +7257,17 @@ async function processProgramAsync(root) {
|
|
|
6946
7257
|
await processComptime(statements);
|
|
6947
7258
|
}
|
|
6948
7259
|
function processRepl(root, rootIIFE) {
|
|
6949
|
-
const topBlock = gatherRecursive(rootIIFE, ($
|
|
7260
|
+
const topBlock = gatherRecursive(rootIIFE, ($12) => $12.type === "BlockStatement")[0];
|
|
6950
7261
|
let i = 0;
|
|
6951
|
-
for (let
|
|
6952
|
-
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];
|
|
6953
7264
|
if (decl.parent === topBlock || decl.decl === "var") {
|
|
6954
7265
|
decl.children.shift();
|
|
6955
7266
|
root.expressions.splice(i++, 0, ["", `var ${decl.names.join(",")};`]);
|
|
6956
7267
|
}
|
|
6957
7268
|
}
|
|
6958
|
-
for (let
|
|
6959
|
-
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];
|
|
6960
7271
|
if (func.name && func.parent?.type === "BlockStatement") {
|
|
6961
7272
|
if (func.parent === topBlock) {
|
|
6962
7273
|
replaceNode(func, void 0);
|
|
@@ -6968,8 +7279,8 @@ function processRepl(root, rootIIFE) {
|
|
|
6968
7279
|
}
|
|
6969
7280
|
}
|
|
6970
7281
|
}
|
|
6971
|
-
for (let
|
|
6972
|
-
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];
|
|
6973
7284
|
let m5;
|
|
6974
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)) {
|
|
6975
7286
|
classExp.children.unshift(classExp.name, "=");
|
|
@@ -6978,7 +7289,7 @@ function processRepl(root, rootIIFE) {
|
|
|
6978
7289
|
}
|
|
6979
7290
|
}
|
|
6980
7291
|
function populateRefs(statements) {
|
|
6981
|
-
const refNodes = gatherRecursive(statements, ($
|
|
7292
|
+
const refNodes = gatherRecursive(statements, ($16) => $16.type === "Ref");
|
|
6982
7293
|
if (refNodes.length) {
|
|
6983
7294
|
const ids = gatherRecursive(statements, (s) => s.type === "Identifier");
|
|
6984
7295
|
const names = new Set(ids.flatMap(({ names: names2 }) => names2 || []));
|
|
@@ -7001,13 +7312,14 @@ function populateRefs(statements) {
|
|
|
7001
7312
|
function processPlaceholders(statements) {
|
|
7002
7313
|
const placeholderMap = /* @__PURE__ */ new Map();
|
|
7003
7314
|
const liftedIfs = /* @__PURE__ */ new Set();
|
|
7004
|
-
gatherRecursiveAll(statements, ($
|
|
7315
|
+
gatherRecursiveAll(statements, ($17) => $17.type === "Placeholder").forEach((_exp) => {
|
|
7005
7316
|
const exp = _exp;
|
|
7006
7317
|
let ancestor;
|
|
7007
7318
|
if (exp.subtype === ".") {
|
|
7008
|
-
({ ancestor } = findAncestor(exp, ($
|
|
7319
|
+
({ ancestor } = findAncestor(exp, ($18) => $18.type === "Call"));
|
|
7009
7320
|
ancestor = ancestor?.parent;
|
|
7010
|
-
|
|
7321
|
+
let m6;
|
|
7322
|
+
while (ancestor?.parent != null && (m6 = ancestor.parent.type, m6 === "UnaryExpression" || m6 === "NewExpression" || m6 === "AwaitExpression" || m6 === "ThrowStatement" || m6 === "StatementExpression")) {
|
|
7011
7323
|
ancestor = ancestor.parent;
|
|
7012
7324
|
}
|
|
7013
7325
|
if (!ancestor) {
|
|
@@ -7024,10 +7336,10 @@ function processPlaceholders(statements) {
|
|
|
7024
7336
|
if (type === "IfStatement") {
|
|
7025
7337
|
liftedIfs.add(ancestor2);
|
|
7026
7338
|
}
|
|
7027
|
-
let m6;
|
|
7028
7339
|
let m7;
|
|
7340
|
+
let m8;
|
|
7029
7341
|
return type === "Call" || // Block, except for if/else blocks when condition already lifted
|
|
7030
|
-
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
|
|
7031
7343
|
type === "Initializer" || // Right-hand side of assignment
|
|
7032
7344
|
type === "AssignmentExpression" && findChildIndex(ancestor2, child2) === ancestor2.children.indexOf(ancestor2.expression) || type === "ReturnStatement" || type === "YieldExpression";
|
|
7033
7345
|
}));
|
|
@@ -7103,11 +7415,11 @@ function processPlaceholders(statements) {
|
|
|
7103
7415
|
for (const [ancestor, placeholders] of placeholderMap) {
|
|
7104
7416
|
let ref = makeRef("$");
|
|
7105
7417
|
let typeSuffix;
|
|
7106
|
-
for (let
|
|
7107
|
-
const placeholder = placeholders[
|
|
7418
|
+
for (let i11 = 0, len10 = placeholders.length; i11 < len10; i11++) {
|
|
7419
|
+
const placeholder = placeholders[i11];
|
|
7108
7420
|
typeSuffix ??= placeholder.typeSuffix;
|
|
7109
|
-
let
|
|
7110
|
-
replaceNode((
|
|
7421
|
+
let ref25;
|
|
7422
|
+
replaceNode((ref25 = placeholder.children)[ref25.length - 1], ref);
|
|
7111
7423
|
}
|
|
7112
7424
|
const { parent } = ancestor;
|
|
7113
7425
|
const body = maybeUnwrap(ancestor);
|
|
@@ -7128,16 +7440,16 @@ function processPlaceholders(statements) {
|
|
|
7128
7440
|
}
|
|
7129
7441
|
case "PipelineExpression": {
|
|
7130
7442
|
const i = findChildIndex(parent, ancestor);
|
|
7131
|
-
let
|
|
7443
|
+
let ref26;
|
|
7132
7444
|
if (i === 1) {
|
|
7133
|
-
|
|
7445
|
+
ref26 = ancestor === parent.children[i];
|
|
7134
7446
|
} else if (i === 2) {
|
|
7135
|
-
|
|
7447
|
+
ref26 = ancestor === parent.children[i][findChildIndex(parent.children[i], ancestor)][3];
|
|
7136
7448
|
} else {
|
|
7137
|
-
|
|
7449
|
+
ref26 = void 0;
|
|
7138
7450
|
}
|
|
7139
7451
|
;
|
|
7140
|
-
outer =
|
|
7452
|
+
outer = ref26;
|
|
7141
7453
|
break;
|
|
7142
7454
|
}
|
|
7143
7455
|
case "AssignmentExpression":
|
|
@@ -7152,9 +7464,9 @@ function processPlaceholders(statements) {
|
|
|
7152
7464
|
fnExp = makeLeftHandSideExpression(fnExp);
|
|
7153
7465
|
}
|
|
7154
7466
|
replaceNode(ancestor, fnExp, parent);
|
|
7155
|
-
let
|
|
7156
|
-
if (
|
|
7157
|
-
const ws =
|
|
7467
|
+
let ref27;
|
|
7468
|
+
if (ref27 = getTrimmingSpace(body)) {
|
|
7469
|
+
const ws = ref27;
|
|
7158
7470
|
inplaceInsertTrimmingSpace(body, "");
|
|
7159
7471
|
inplacePrepend(ws, fnExp);
|
|
7160
7472
|
}
|
|
@@ -7199,8 +7511,8 @@ function reorderBindingRestProperty(props) {
|
|
|
7199
7511
|
}
|
|
7200
7512
|
];
|
|
7201
7513
|
}
|
|
7202
|
-
let
|
|
7203
|
-
if (Array.isArray(rest.delim) && (
|
|
7514
|
+
let ref28;
|
|
7515
|
+
if (Array.isArray(rest.delim) && (ref28 = rest.delim)[ref28.length - 1]?.token === ",") {
|
|
7204
7516
|
rest.delim = rest.delim.slice(0, -1);
|
|
7205
7517
|
rest.children = [...rest.children.slice(0, -1), rest.delim];
|
|
7206
7518
|
}
|
|
@@ -7225,9 +7537,9 @@ function replaceNodes(root, predicate, replacer) {
|
|
|
7225
7537
|
return root;
|
|
7226
7538
|
}
|
|
7227
7539
|
}
|
|
7228
|
-
for (let
|
|
7229
|
-
const i =
|
|
7230
|
-
const node = array[
|
|
7540
|
+
for (let i12 = 0, len11 = array.length; i12 < len11; i12++) {
|
|
7541
|
+
const i = i12;
|
|
7542
|
+
const node = array[i12];
|
|
7231
7543
|
if (!(node != null)) {
|
|
7232
7544
|
return;
|
|
7233
7545
|
}
|
|
@@ -7239,34 +7551,6 @@ function replaceNodes(root, predicate, replacer) {
|
|
|
7239
7551
|
}
|
|
7240
7552
|
return root;
|
|
7241
7553
|
}
|
|
7242
|
-
function replaceNodesRecursive(root, predicate, replacer) {
|
|
7243
|
-
if (!(root != null)) {
|
|
7244
|
-
return root;
|
|
7245
|
-
}
|
|
7246
|
-
const array = Array.isArray(root) ? root : root.children;
|
|
7247
|
-
if (!array) {
|
|
7248
|
-
if (predicate(root)) {
|
|
7249
|
-
return replacer(root, root);
|
|
7250
|
-
} else {
|
|
7251
|
-
return root;
|
|
7252
|
-
}
|
|
7253
|
-
}
|
|
7254
|
-
for (let i10 = 0, len9 = array.length; i10 < len9; i10++) {
|
|
7255
|
-
const i = i10;
|
|
7256
|
-
const node = array[i10];
|
|
7257
|
-
if (!(node != null)) {
|
|
7258
|
-
continue;
|
|
7259
|
-
}
|
|
7260
|
-
if (predicate(node)) {
|
|
7261
|
-
const ret = replacer(node, root);
|
|
7262
|
-
replaceNodesRecursive(ret, predicate, replacer);
|
|
7263
|
-
array[i] = ret;
|
|
7264
|
-
} else {
|
|
7265
|
-
replaceNodesRecursive(node, predicate, replacer);
|
|
7266
|
-
}
|
|
7267
|
-
}
|
|
7268
|
-
return root;
|
|
7269
|
-
}
|
|
7270
7554
|
function typeOfJSX(node, config2) {
|
|
7271
7555
|
switch (node.type) {
|
|
7272
7556
|
case "JSXElement":
|
|
@@ -7650,6 +7934,7 @@ var grammar = {
|
|
|
7650
7934
|
ForStatement,
|
|
7651
7935
|
ForClause,
|
|
7652
7936
|
ForStatementControlWithWhen,
|
|
7937
|
+
ForReduction,
|
|
7653
7938
|
ForStatementControl,
|
|
7654
7939
|
WhenCondition,
|
|
7655
7940
|
CoffeeForStatementParameters,
|
|
@@ -8063,7 +8348,7 @@ var grammar = {
|
|
|
8063
8348
|
InlineInterfacePropertyDelimiter,
|
|
8064
8349
|
TypeBinaryOp,
|
|
8065
8350
|
TypeFunction,
|
|
8066
|
-
|
|
8351
|
+
TypeFunctionArrow,
|
|
8067
8352
|
TypeArguments,
|
|
8068
8353
|
ImplicitTypeArguments,
|
|
8069
8354
|
TypeApplicationStart,
|
|
@@ -8270,128 +8555,135 @@ var $L116 = (0, import_lib4.$L)("\u2209");
|
|
|
8270
8555
|
var $L117 = (0, import_lib4.$L)("&");
|
|
8271
8556
|
var $L118 = (0, import_lib4.$L)("|");
|
|
8272
8557
|
var $L119 = (0, import_lib4.$L)(";");
|
|
8273
|
-
var $L120 = (0, import_lib4.$L)("
|
|
8274
|
-
var $L121 = (0, import_lib4.$L)("
|
|
8275
|
-
var $L122 = (0, import_lib4.$L)("
|
|
8276
|
-
var $L123 = (0, import_lib4.$L)("
|
|
8277
|
-
var $L124 = (0, import_lib4.$L)("
|
|
8278
|
-
var $L125 = (0, import_lib4.$L)("
|
|
8279
|
-
var $L126 = (0, import_lib4.$L)("
|
|
8280
|
-
var $L127 = (0, import_lib4.$L)("
|
|
8281
|
-
var $L128 = (0, import_lib4.$L)("
|
|
8282
|
-
var $L129 = (0, import_lib4.$L)("
|
|
8283
|
-
var $L130 = (0, import_lib4.$L)("
|
|
8284
|
-
var $L131 = (0, import_lib4.$L)("
|
|
8285
|
-
var $L132 = (0, import_lib4.$L)("
|
|
8286
|
-
var $L133 = (0, import_lib4.$L)("
|
|
8287
|
-
var $L134 = (0, import_lib4.$L)("
|
|
8288
|
-
var $L135 = (0, import_lib4.$L)("
|
|
8289
|
-
var $L136 = (0, import_lib4.$L)("
|
|
8290
|
-
var $L137 = (0, import_lib4.$L)("
|
|
8291
|
-
var $L138 = (0, import_lib4.$L)("
|
|
8292
|
-
var $L139 = (0, import_lib4.$L)("
|
|
8293
|
-
var $L140 = (0, import_lib4.$L)("
|
|
8294
|
-
var $L141 = (0, import_lib4.$L)("
|
|
8295
|
-
var $L142 = (0, import_lib4.$L)("
|
|
8296
|
-
var $L143 = (0, import_lib4.$L)("
|
|
8297
|
-
var $L144 = (0, import_lib4.$L)("
|
|
8298
|
-
var $L145 = (0, import_lib4.$L)("
|
|
8299
|
-
var $L146 = (0, import_lib4.$L)("
|
|
8300
|
-
var $L147 = (0, import_lib4.$L)("
|
|
8301
|
-
var $L148 = (0, import_lib4.$L)("
|
|
8302
|
-
var $L149 = (0, import_lib4.$L)("
|
|
8303
|
-
var $L150 = (0, import_lib4.$L)("
|
|
8304
|
-
var $L151 = (0, import_lib4.$L)("
|
|
8305
|
-
var $L152 = (0, import_lib4.$L)("
|
|
8306
|
-
var $L153 = (0, import_lib4.$L)("
|
|
8307
|
-
var $L154 = (0, import_lib4.$L)("
|
|
8308
|
-
var $L155 = (0, import_lib4.$L)("
|
|
8309
|
-
var $L156 = (0, import_lib4.$L)(
|
|
8310
|
-
var $L157 = (0, import_lib4.$L)("
|
|
8311
|
-
var $L158 = (0, import_lib4.$L)("
|
|
8312
|
-
var $L159 = (0, import_lib4.$L)("
|
|
8313
|
-
var $L160 = (0, import_lib4.$L)("
|
|
8314
|
-
var $L161 = (0, import_lib4.$L)("
|
|
8315
|
-
var $L162 = (0, import_lib4.$L)("
|
|
8316
|
-
var $L163 = (0, import_lib4.$L)("
|
|
8317
|
-
var $L164 = (0, import_lib4.$L)("
|
|
8318
|
-
var $L165 = (0, import_lib4.$L)("
|
|
8319
|
-
var $L166 = (0, import_lib4.$L)("
|
|
8320
|
-
var $L167 = (0, import_lib4.$L)("
|
|
8321
|
-
var $L168 = (0, import_lib4.$L)("
|
|
8322
|
-
var $L169 = (0, import_lib4.$L)("
|
|
8323
|
-
var $L170 = (0, import_lib4.$L)("
|
|
8324
|
-
var $L171 = (0, import_lib4.$L)("
|
|
8325
|
-
var $L172 = (0, import_lib4.$L)("
|
|
8326
|
-
var $L173 = (0, import_lib4.$L)("
|
|
8327
|
-
var $L174 = (0, import_lib4.$L)("
|
|
8328
|
-
var $L175 = (0, import_lib4.$L)("
|
|
8329
|
-
var $L176 = (0, import_lib4.$L)("
|
|
8330
|
-
var $L177 = (0, import_lib4.$L)("
|
|
8331
|
-
var $L178 = (0, import_lib4.$L)("
|
|
8332
|
-
var $L179 = (0, import_lib4.$L)("
|
|
8333
|
-
var $L180 = (0, import_lib4.$L)("
|
|
8334
|
-
var $L181 = (0, import_lib4.$L)("
|
|
8335
|
-
var $L182 = (0, import_lib4.$L)("
|
|
8336
|
-
var $L183 = (0, import_lib4.$L)("
|
|
8337
|
-
var $L184 = (0, import_lib4.$L)("
|
|
8338
|
-
var $L185 = (0, import_lib4.$L)("
|
|
8339
|
-
var $L186 = (0, import_lib4.$L)("
|
|
8340
|
-
var $L187 = (0, import_lib4.$L)("
|
|
8341
|
-
var $L188 = (0, import_lib4.$L)("
|
|
8342
|
-
var $L189 = (0, import_lib4.$L)("
|
|
8343
|
-
var $L190 = (0, import_lib4.$L)("
|
|
8344
|
-
var $L191 = (0, import_lib4.$L)("
|
|
8345
|
-
var $L192 = (0, import_lib4.$L)("
|
|
8346
|
-
var $L193 = (0, import_lib4.$L)("
|
|
8347
|
-
var $L194 = (0, import_lib4.$L)("
|
|
8348
|
-
var $L195 = (0, import_lib4.$L)("
|
|
8349
|
-
var $L196 = (0, import_lib4.$L)("
|
|
8350
|
-
var $L197 = (0, import_lib4.$L)("
|
|
8351
|
-
var $L198 = (0, import_lib4.$L)("
|
|
8352
|
-
var $L199 = (0, import_lib4.$L)("
|
|
8353
|
-
var $L200 = (0, import_lib4.$L)("
|
|
8354
|
-
var $L201 = (0, import_lib4.$L)("
|
|
8355
|
-
var $L202 = (0, import_lib4.$L)("
|
|
8356
|
-
var $L203 = (0, import_lib4.$L)("
|
|
8357
|
-
var $L204 = (0, import_lib4.$L)("
|
|
8358
|
-
var $L205 = (0, import_lib4.$L)("
|
|
8359
|
-
var $L206 = (0, import_lib4.$L)(
|
|
8360
|
-
var $L207 = (0, import_lib4.$L)("
|
|
8361
|
-
var $L208 = (0, import_lib4.$L)("
|
|
8362
|
-
var $L209 = (0, import_lib4.$L)("
|
|
8363
|
-
var $L210 = (0, import_lib4.$L)("
|
|
8364
|
-
var $L211 = (0, import_lib4.$L)("
|
|
8365
|
-
var $L212 = (0, import_lib4.$L)("
|
|
8366
|
-
var $L213 = (0, import_lib4.$L)("
|
|
8367
|
-
var $L214 = (0, import_lib4.$L)("
|
|
8368
|
-
var $L215 = (0, import_lib4.$L)("
|
|
8369
|
-
var $L216 = (0, import_lib4.$L)("
|
|
8370
|
-
var $L217 = (0, import_lib4.$L)("
|
|
8371
|
-
var $L218 = (0, import_lib4.$L)("
|
|
8372
|
-
var $L219 = (0, import_lib4.$L)("
|
|
8373
|
-
var $L220 = (0, import_lib4.$L)("
|
|
8374
|
-
var $L221 = (0, import_lib4.$L)("
|
|
8375
|
-
var $L222 = (0, import_lib4.$L)("
|
|
8376
|
-
var $L223 = (0, import_lib4.$L)("
|
|
8377
|
-
var $L224 = (0, import_lib4.$L)("
|
|
8378
|
-
var $L225 = (0, import_lib4.$L)("
|
|
8379
|
-
var $L226 = (0, import_lib4.$L)("
|
|
8380
|
-
var $L227 = (0, import_lib4.$L)("
|
|
8381
|
-
var $L228 = (0, import_lib4.$L)("
|
|
8382
|
-
var $L229 = (0, import_lib4.$L)("
|
|
8383
|
-
var $L230 = (0, import_lib4.$L)("
|
|
8384
|
-
var $L231 = (0, import_lib4.$L)("
|
|
8385
|
-
var $L232 = (0, import_lib4.$L)("
|
|
8386
|
-
var $L233 = (0, import_lib4.$L)("
|
|
8387
|
-
var $L234 = (0, import_lib4.$L)("
|
|
8388
|
-
var $L235 = (0, import_lib4.$L)("
|
|
8389
|
-
var $L236 = (0, import_lib4.$L)("
|
|
8390
|
-
var $L237 = (0, import_lib4.$L)("
|
|
8391
|
-
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");
|
|
8392
8684
|
var $R0 = (0, import_lib4.$R)(new RegExp("(?=async|debugger|if|unless|comptime|do|for|loop|until|while|switch|throw|try)", "suy"));
|
|
8393
8685
|
var $R1 = (0, import_lib4.$R)(new RegExp("&(?=\\s)", "suy"));
|
|
8394
|
-
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"));
|
|
8395
8687
|
var $R3 = (0, import_lib4.$R)(new RegExp("[0-9]", "suy"));
|
|
8396
8688
|
var $R4 = (0, import_lib4.$R)(new RegExp("(?!\\p{ID_Start}|[_$0-9(\\[{])", "suy"));
|
|
8397
8689
|
var $R5 = (0, import_lib4.$R)(new RegExp("[ \\t]", "suy"));
|
|
@@ -8618,12 +8910,7 @@ var StatementExpression$1 = (0, import_lib4.$TS)((0, import_lib4.$S)(IfStatement
|
|
|
8618
8910
|
return $skip;
|
|
8619
8911
|
return $1;
|
|
8620
8912
|
});
|
|
8621
|
-
var StatementExpression$2 =
|
|
8622
|
-
if ($1.block.implicit && $1.subtype !== "DoStatement" && $1.subtype !== "ComptimeStatement") {
|
|
8623
|
-
return $skip;
|
|
8624
|
-
}
|
|
8625
|
-
return $1;
|
|
8626
|
-
});
|
|
8913
|
+
var StatementExpression$2 = IterationExpression;
|
|
8627
8914
|
var StatementExpression$3 = SwitchStatement;
|
|
8628
8915
|
var StatementExpression$4 = ThrowStatement;
|
|
8629
8916
|
var StatementExpression$5 = TryStatement;
|
|
@@ -8721,7 +9008,7 @@ var ForbiddenImplicitCalls$$ = [ForbiddenImplicitCalls$0, ForbiddenImplicitCalls
|
|
|
8721
9008
|
function ForbiddenImplicitCalls(ctx, state2) {
|
|
8722
9009
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "ForbiddenImplicitCalls", ForbiddenImplicitCalls$$);
|
|
8723
9010
|
}
|
|
8724
|
-
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$])/"));
|
|
8725
9012
|
function ReservedBinary(ctx, state2) {
|
|
8726
9013
|
return (0, import_lib4.$EVENT)(ctx, state2, "ReservedBinary", ReservedBinary$0);
|
|
8727
9014
|
}
|
|
@@ -9352,7 +9639,7 @@ var PipelineHeadItem$$ = [PipelineHeadItem$0, PipelineHeadItem$1];
|
|
|
9352
9639
|
function PipelineHeadItem(ctx, state2) {
|
|
9353
9640
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "PipelineHeadItem", PipelineHeadItem$$);
|
|
9354
9641
|
}
|
|
9355
|
-
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) {
|
|
9356
9643
|
return value[0];
|
|
9357
9644
|
});
|
|
9358
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) {
|
|
@@ -11759,16 +12046,31 @@ var CoffeeScriptBooleanLiteral$$ = [CoffeeScriptBooleanLiteral$0, CoffeeScriptBo
|
|
|
11759
12046
|
function CoffeeScriptBooleanLiteral(ctx, state2) {
|
|
11760
12047
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "CoffeeScriptBooleanLiteral", CoffeeScriptBooleanLiteral$$);
|
|
11761
12048
|
}
|
|
11762
|
-
var SymbolLiteral$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(Colon, IdentifierName), function($skip, $loc, $0, $1, $2) {
|
|
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) {
|
|
11763
12050
|
var colon = $1;
|
|
11764
12051
|
var id = $2;
|
|
11765
|
-
|
|
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
|
+
}
|
|
11766
12064
|
if (config.symbols.includes(name)) {
|
|
11767
12065
|
return {
|
|
11768
12066
|
type: "SymbolLiteral",
|
|
11769
|
-
children: [
|
|
12067
|
+
children: id.type === "Identifier" ? [
|
|
11770
12068
|
{ ...colon, token: "Symbol." },
|
|
11771
12069
|
token
|
|
12070
|
+
] : [
|
|
12071
|
+
{ ...colon, token: "Symbol[" },
|
|
12072
|
+
token,
|
|
12073
|
+
"]"
|
|
11772
12074
|
],
|
|
11773
12075
|
name
|
|
11774
12076
|
};
|
|
@@ -11776,9 +12078,9 @@ var SymbolLiteral$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(Colon, Identifier
|
|
|
11776
12078
|
return {
|
|
11777
12079
|
type: "SymbolLiteral",
|
|
11778
12080
|
children: [
|
|
11779
|
-
{ ...colon, token:
|
|
11780
|
-
token,
|
|
11781
|
-
|
|
12081
|
+
{ ...colon, token: "Symbol.for(" },
|
|
12082
|
+
id.type === "Identifier" ? ['"', token, '"'] : token,
|
|
12083
|
+
")"
|
|
11782
12084
|
],
|
|
11783
12085
|
name
|
|
11784
12086
|
};
|
|
@@ -13421,6 +13723,8 @@ var Statement$2 = (0, import_lib4.$T)((0, import_lib4.$S)(IfStatement, (0, impor
|
|
|
13421
13723
|
var Statement$3 = (0, import_lib4.$TS)((0, import_lib4.$S)(IterationStatement, (0, import_lib4.$N)(ShouldExpressionize)), function($skip, $loc, $0, $1, $2) {
|
|
13422
13724
|
if ($1.generator)
|
|
13423
13725
|
return $skip;
|
|
13726
|
+
if ($1.reduction)
|
|
13727
|
+
return $skip;
|
|
13424
13728
|
return $1;
|
|
13425
13729
|
});
|
|
13426
13730
|
var Statement$4 = (0, import_lib4.$T)((0, import_lib4.$S)(SwitchStatement, (0, import_lib4.$N)(ShouldExpressionize)), function(value) {
|
|
@@ -13466,7 +13770,7 @@ function EmptyStatement(ctx, state2) {
|
|
|
13466
13770
|
return (0, import_lib4.$EVENT)(ctx, state2, "EmptyStatement", EmptyStatement$0);
|
|
13467
13771
|
}
|
|
13468
13772
|
var InsertEmptyStatement$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(InsertSemicolon), function($skip, $loc, $0, $1) {
|
|
13469
|
-
return { type: "EmptyStatement", children: [$1] };
|
|
13773
|
+
return { type: "EmptyStatement", children: [$1], implicit: true };
|
|
13470
13774
|
});
|
|
13471
13775
|
function InsertEmptyStatement(ctx, state2) {
|
|
13472
13776
|
return (0, import_lib4.$EVENT)(ctx, state2, "InsertEmptyStatement", InsertEmptyStatement$0);
|
|
@@ -13772,15 +14076,19 @@ var ForClause$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(For, (0, import_lib4.
|
|
|
13772
14076
|
block: null,
|
|
13773
14077
|
blockPrefix: c.blockPrefix,
|
|
13774
14078
|
hoistDec: c.hoistDec,
|
|
14079
|
+
reduction: c.reduction,
|
|
13775
14080
|
generator
|
|
13776
14081
|
};
|
|
13777
14082
|
});
|
|
13778
14083
|
function ForClause(ctx, state2) {
|
|
13779
14084
|
return (0, import_lib4.$EVENT)(ctx, state2, "ForClause", ForClause$0);
|
|
13780
14085
|
}
|
|
13781
|
-
var ForStatementControlWithWhen$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(ForStatementControl, (0, import_lib4.$E)(WhenCondition)), function($skip, $loc, $0, $1, $2) {
|
|
13782
|
-
var
|
|
13783
|
-
var
|
|
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 };
|
|
13784
14092
|
if (!condition)
|
|
13785
14093
|
return control;
|
|
13786
14094
|
const expressions = [["", {
|
|
@@ -13796,7 +14104,7 @@ var ForStatementControlWithWhen$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(For
|
|
|
13796
14104
|
return {
|
|
13797
14105
|
...control,
|
|
13798
14106
|
blockPrefix: [
|
|
13799
|
-
...control.blockPrefix,
|
|
14107
|
+
...control.blockPrefix ?? [],
|
|
13800
14108
|
["", {
|
|
13801
14109
|
type: "IfStatement",
|
|
13802
14110
|
then: block,
|
|
@@ -13808,6 +14116,18 @@ var ForStatementControlWithWhen$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(For
|
|
|
13808
14116
|
function ForStatementControlWithWhen(ctx, state2) {
|
|
13809
14117
|
return (0, import_lib4.$EVENT)(ctx, state2, "ForStatementControlWithWhen", ForStatementControlWithWhen$0);
|
|
13810
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
|
+
}
|
|
13811
14131
|
var ForStatementControl$0 = (0, import_lib4.$T)((0, import_lib4.$S)((0, import_lib4.$N)(CoffeeForLoopsEnabled), ForStatementParameters), function(value) {
|
|
13812
14132
|
return value[1];
|
|
13813
14133
|
});
|
|
@@ -13861,7 +14181,7 @@ var CoffeeForStatementParameters$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0
|
|
|
13861
14181
|
const counterRef = makeRef("i");
|
|
13862
14182
|
const lenRef = makeRef("len");
|
|
13863
14183
|
if (exp.type === "RangeExpression") {
|
|
13864
|
-
return forRange(open, declaration, exp, step
|
|
14184
|
+
return forRange(open, declaration, exp, step && prepend(trimFirstSpace(step[0]), trimFirstSpace(step[2])), close);
|
|
13865
14185
|
}
|
|
13866
14186
|
const expRef = maybeRef(exp);
|
|
13867
14187
|
const varRef = declaration;
|
|
@@ -13963,10 +14283,10 @@ var ForStatementParameters$1 = (0, import_lib4.$TS)((0, import_lib4.$S)(InsertOp
|
|
|
13963
14283
|
};
|
|
13964
14284
|
});
|
|
13965
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) {
|
|
13966
|
-
return processForInOf($0
|
|
14286
|
+
return processForInOf($0);
|
|
13967
14287
|
});
|
|
13968
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) {
|
|
13969
|
-
return processForInOf($0
|
|
14289
|
+
return processForInOf($0);
|
|
13970
14290
|
});
|
|
13971
14291
|
var ForStatementParameters$4 = ForRangeParameters;
|
|
13972
14292
|
var ForStatementParameters$$ = [ForStatementParameters$0, ForStatementParameters$1, ForStatementParameters$2, ForStatementParameters$3, ForStatementParameters$4];
|
|
@@ -14003,7 +14323,7 @@ var ForDeclaration$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(LetOrConstOrVar,
|
|
|
14003
14323
|
return {
|
|
14004
14324
|
type: "ForDeclaration",
|
|
14005
14325
|
children: [c, binding],
|
|
14006
|
-
|
|
14326
|
+
decl: c.token,
|
|
14007
14327
|
binding,
|
|
14008
14328
|
names: binding.names
|
|
14009
14329
|
};
|
|
@@ -14014,7 +14334,7 @@ var ForDeclaration$1 = (0, import_lib4.$TS)((0, import_lib4.$S)(InsertConst, (0,
|
|
|
14014
14334
|
return {
|
|
14015
14335
|
type: "ForDeclaration",
|
|
14016
14336
|
children: [c, binding],
|
|
14017
|
-
|
|
14337
|
+
decl: c.token,
|
|
14018
14338
|
binding,
|
|
14019
14339
|
names: binding.names
|
|
14020
14340
|
};
|
|
@@ -14734,19 +15054,19 @@ var ThrowStatement$0 = (0, import_lib4.$T)((0, import_lib4.$S)(Throw, MaybeParen
|
|
|
14734
15054
|
function ThrowStatement(ctx, state2) {
|
|
14735
15055
|
return (0, import_lib4.$EVENT)(ctx, state2, "ThrowStatement", ThrowStatement$0);
|
|
14736
15056
|
}
|
|
14737
|
-
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) {
|
|
14738
15058
|
return { $loc, token: $1 };
|
|
14739
15059
|
});
|
|
14740
15060
|
function Break(ctx, state2) {
|
|
14741
15061
|
return (0, import_lib4.$EVENT)(ctx, state2, "Break", Break$0);
|
|
14742
15062
|
}
|
|
14743
|
-
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) {
|
|
14744
15064
|
return { $loc, token: $1 };
|
|
14745
15065
|
});
|
|
14746
15066
|
function Continue(ctx, state2) {
|
|
14747
15067
|
return (0, import_lib4.$EVENT)(ctx, state2, "Continue", Continue$0);
|
|
14748
15068
|
}
|
|
14749
|
-
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) {
|
|
14750
15070
|
return { $loc, token: $1 };
|
|
14751
15071
|
});
|
|
14752
15072
|
function Debugger(ctx, state2) {
|
|
@@ -14814,7 +15134,7 @@ var MaybeParenNestedExpression$$ = [MaybeParenNestedExpression$0, MaybeParenNest
|
|
|
14814
15134
|
function MaybeParenNestedExpression(ctx, state2) {
|
|
14815
15135
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "MaybeParenNestedExpression", MaybeParenNestedExpression$$);
|
|
14816
15136
|
}
|
|
14817
|
-
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) {
|
|
14818
15138
|
const imp = [
|
|
14819
15139
|
{ ...$1, ts: true },
|
|
14820
15140
|
{ ...$1, token: "const", js: true }
|
|
@@ -15004,7 +15324,7 @@ var ImpliedFrom$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L0, 'ImpliedF
|
|
|
15004
15324
|
function ImpliedFrom(ctx, state2) {
|
|
15005
15325
|
return (0, import_lib4.$EVENT)(ctx, state2, "ImpliedFrom", ImpliedFrom$0);
|
|
15006
15326
|
}
|
|
15007
|
-
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) {
|
|
15008
15328
|
var keyword = $2;
|
|
15009
15329
|
var object = $5;
|
|
15010
15330
|
return {
|
|
@@ -15323,19 +15643,19 @@ var LexicalDeclaration$$ = [LexicalDeclaration$0, LexicalDeclaration$1];
|
|
|
15323
15643
|
function LexicalDeclaration(ctx, state2) {
|
|
15324
15644
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "LexicalDeclaration", LexicalDeclaration$$);
|
|
15325
15645
|
}
|
|
15326
|
-
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) {
|
|
15327
15647
|
return { $loc, token: "=", decl: "const " };
|
|
15328
15648
|
});
|
|
15329
15649
|
function ConstAssignment(ctx, state2) {
|
|
15330
15650
|
return (0, import_lib4.$EVENT)(ctx, state2, "ConstAssignment", ConstAssignment$0);
|
|
15331
15651
|
}
|
|
15332
|
-
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) {
|
|
15333
15653
|
return { $loc, token: "=", decl: "let " };
|
|
15334
15654
|
});
|
|
15335
15655
|
function LetAssignment(ctx, state2) {
|
|
15336
15656
|
return (0, import_lib4.$EVENT)(ctx, state2, "LetAssignment", LetAssignment$0);
|
|
15337
15657
|
}
|
|
15338
|
-
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) {
|
|
15339
15659
|
return { $loc, token: "=" };
|
|
15340
15660
|
});
|
|
15341
15661
|
function TypeAssignment(ctx, state2) {
|
|
@@ -15758,7 +16078,7 @@ var MultiLineComment$$ = [MultiLineComment$0, MultiLineComment$1];
|
|
|
15758
16078
|
function MultiLineComment(ctx, state2) {
|
|
15759
16079
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "MultiLineComment", MultiLineComment$$);
|
|
15760
16080
|
}
|
|
15761
|
-
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) {
|
|
15762
16082
|
return { type: "Comment", $loc, token: $1 };
|
|
15763
16083
|
});
|
|
15764
16084
|
function JSMultiLineComment(ctx, state2) {
|
|
@@ -15804,7 +16124,7 @@ function _(ctx, state2) {
|
|
|
15804
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) {
|
|
15805
16125
|
return { $loc, token: $0 };
|
|
15806
16126
|
});
|
|
15807
|
-
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) {
|
|
15808
16128
|
return " ";
|
|
15809
16129
|
});
|
|
15810
16130
|
var NonNewlineWhitespace$$ = [NonNewlineWhitespace$0, NonNewlineWhitespace$1];
|
|
@@ -15850,7 +16170,7 @@ function SimpleStatementDelimiter(ctx, state2) {
|
|
|
15850
16170
|
}
|
|
15851
16171
|
var StatementDelimiter$0 = (0, import_lib4.$Y)(EOS);
|
|
15852
16172
|
var StatementDelimiter$1 = SemicolonDelimiter;
|
|
15853
|
-
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 "]"'))));
|
|
15854
16174
|
var StatementDelimiter$$ = [StatementDelimiter$0, StatementDelimiter$1, StatementDelimiter$2];
|
|
15855
16175
|
function StatementDelimiter(ctx, state2) {
|
|
15856
16176
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "StatementDelimiter", StatementDelimiter$$);
|
|
@@ -15874,7 +16194,7 @@ var Loc$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L0, 'Loc ""'), functi
|
|
|
15874
16194
|
function Loc(ctx, state2) {
|
|
15875
16195
|
return (0, import_lib4.$EVENT)(ctx, state2, "Loc", Loc$0);
|
|
15876
16196
|
}
|
|
15877
|
-
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) {
|
|
15878
16198
|
return { $loc, token: $1, ts: true };
|
|
15879
16199
|
});
|
|
15880
16200
|
function Abstract(ctx, state2) {
|
|
@@ -15886,43 +16206,43 @@ var Ampersand$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L117, 'Ampersan
|
|
|
15886
16206
|
function Ampersand(ctx, state2) {
|
|
15887
16207
|
return (0, import_lib4.$EVENT)(ctx, state2, "Ampersand", Ampersand$0);
|
|
15888
16208
|
}
|
|
15889
|
-
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) {
|
|
15890
16210
|
return { $loc, token: $1 };
|
|
15891
16211
|
});
|
|
15892
16212
|
function As(ctx, state2) {
|
|
15893
16213
|
return (0, import_lib4.$EVENT)(ctx, state2, "As", As$0);
|
|
15894
16214
|
}
|
|
15895
|
-
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) {
|
|
15896
16216
|
return { $loc, token: $1 };
|
|
15897
16217
|
});
|
|
15898
16218
|
function At(ctx, state2) {
|
|
15899
16219
|
return (0, import_lib4.$EVENT)(ctx, state2, "At", At$0);
|
|
15900
16220
|
}
|
|
15901
|
-
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) {
|
|
15902
16222
|
return { $loc, token: "@" };
|
|
15903
16223
|
});
|
|
15904
16224
|
function AtAt(ctx, state2) {
|
|
15905
16225
|
return (0, import_lib4.$EVENT)(ctx, state2, "AtAt", AtAt$0);
|
|
15906
16226
|
}
|
|
15907
|
-
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) {
|
|
15908
16228
|
return { $loc, token: $1, type: "Async" };
|
|
15909
16229
|
});
|
|
15910
16230
|
function Async(ctx, state2) {
|
|
15911
16231
|
return (0, import_lib4.$EVENT)(ctx, state2, "Async", Async$0);
|
|
15912
16232
|
}
|
|
15913
|
-
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) {
|
|
15914
16234
|
return { $loc, token: $1, type: "Await" };
|
|
15915
16235
|
});
|
|
15916
16236
|
function Await(ctx, state2) {
|
|
15917
16237
|
return (0, import_lib4.$EVENT)(ctx, state2, "Await", Await$0);
|
|
15918
16238
|
}
|
|
15919
|
-
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) {
|
|
15920
16240
|
return { $loc, token: $1 };
|
|
15921
16241
|
});
|
|
15922
16242
|
function Backtick(ctx, state2) {
|
|
15923
16243
|
return (0, import_lib4.$EVENT)(ctx, state2, "Backtick", Backtick$0);
|
|
15924
16244
|
}
|
|
15925
|
-
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) {
|
|
15926
16246
|
return { $loc, token: $1 };
|
|
15927
16247
|
});
|
|
15928
16248
|
function By(ctx, state2) {
|
|
@@ -15934,19 +16254,19 @@ var Caret$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L22, 'Caret "^"'),
|
|
|
15934
16254
|
function Caret(ctx, state2) {
|
|
15935
16255
|
return (0, import_lib4.$EVENT)(ctx, state2, "Caret", Caret$0);
|
|
15936
16256
|
}
|
|
15937
|
-
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) {
|
|
15938
16258
|
return { $loc, token: $1 };
|
|
15939
16259
|
});
|
|
15940
16260
|
function Case(ctx, state2) {
|
|
15941
16261
|
return (0, import_lib4.$EVENT)(ctx, state2, "Case", Case$0);
|
|
15942
16262
|
}
|
|
15943
|
-
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) {
|
|
15944
16264
|
return { $loc, token: $1 };
|
|
15945
16265
|
});
|
|
15946
16266
|
function Catch(ctx, state2) {
|
|
15947
16267
|
return (0, import_lib4.$EVENT)(ctx, state2, "Catch", Catch$0);
|
|
15948
16268
|
}
|
|
15949
|
-
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) {
|
|
15950
16270
|
return { $loc, token: $1 };
|
|
15951
16271
|
});
|
|
15952
16272
|
function Class(ctx, state2) {
|
|
@@ -15970,13 +16290,13 @@ var CloseBracket$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L46, 'CloseB
|
|
|
15970
16290
|
function CloseBracket(ctx, state2) {
|
|
15971
16291
|
return (0, import_lib4.$EVENT)(ctx, state2, "CloseBracket", CloseBracket$0);
|
|
15972
16292
|
}
|
|
15973
|
-
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) {
|
|
15974
16294
|
return { $loc, token: $1 };
|
|
15975
16295
|
});
|
|
15976
16296
|
function CloseParen(ctx, state2) {
|
|
15977
16297
|
return (0, import_lib4.$EVENT)(ctx, state2, "CloseParen", CloseParen$0);
|
|
15978
16298
|
}
|
|
15979
|
-
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) {
|
|
15980
16300
|
return { $loc, token: "${" };
|
|
15981
16301
|
});
|
|
15982
16302
|
function CoffeeSubstitutionStart(ctx, state2) {
|
|
@@ -15994,37 +16314,37 @@ var Comma$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L17, 'Comma ","'),
|
|
|
15994
16314
|
function Comma(ctx, state2) {
|
|
15995
16315
|
return (0, import_lib4.$EVENT)(ctx, state2, "Comma", Comma$0);
|
|
15996
16316
|
}
|
|
15997
|
-
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) {
|
|
15998
16318
|
return { $loc, token: $1 };
|
|
15999
16319
|
});
|
|
16000
16320
|
function Comptime(ctx, state2) {
|
|
16001
16321
|
return (0, import_lib4.$EVENT)(ctx, state2, "Comptime", Comptime$0);
|
|
16002
16322
|
}
|
|
16003
|
-
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) {
|
|
16004
16324
|
return { $loc, token: "constructor" };
|
|
16005
16325
|
});
|
|
16006
16326
|
function ConstructorShorthand(ctx, state2) {
|
|
16007
16327
|
return (0, import_lib4.$EVENT)(ctx, state2, "ConstructorShorthand", ConstructorShorthand$0);
|
|
16008
16328
|
}
|
|
16009
|
-
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) {
|
|
16010
16330
|
return { $loc, token: $1 };
|
|
16011
16331
|
});
|
|
16012
16332
|
function Declare(ctx, state2) {
|
|
16013
16333
|
return (0, import_lib4.$EVENT)(ctx, state2, "Declare", Declare$0);
|
|
16014
16334
|
}
|
|
16015
|
-
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) {
|
|
16016
16336
|
return { $loc, token: $1 };
|
|
16017
16337
|
});
|
|
16018
16338
|
function Default(ctx, state2) {
|
|
16019
16339
|
return (0, import_lib4.$EVENT)(ctx, state2, "Default", Default$0);
|
|
16020
16340
|
}
|
|
16021
|
-
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) {
|
|
16022
16342
|
return { $loc, token: $1 };
|
|
16023
16343
|
});
|
|
16024
16344
|
function Delete(ctx, state2) {
|
|
16025
16345
|
return (0, import_lib4.$EVENT)(ctx, state2, "Delete", Delete$0);
|
|
16026
16346
|
}
|
|
16027
|
-
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) {
|
|
16028
16348
|
return { $loc, token: $1 };
|
|
16029
16349
|
});
|
|
16030
16350
|
function Do(ctx, state2) {
|
|
@@ -16044,51 +16364,51 @@ var Dot$$ = [Dot$0, Dot$1];
|
|
|
16044
16364
|
function Dot(ctx, state2) {
|
|
16045
16365
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "Dot", Dot$$);
|
|
16046
16366
|
}
|
|
16047
|
-
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) {
|
|
16048
16368
|
return { $loc, token: $1 };
|
|
16049
16369
|
});
|
|
16050
|
-
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) {
|
|
16051
16371
|
return { $loc, token: ".." };
|
|
16052
16372
|
});
|
|
16053
16373
|
var DotDot$$ = [DotDot$0, DotDot$1];
|
|
16054
16374
|
function DotDot(ctx, state2) {
|
|
16055
16375
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "DotDot", DotDot$$);
|
|
16056
16376
|
}
|
|
16057
|
-
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) {
|
|
16058
16378
|
return { $loc, token: $1 };
|
|
16059
16379
|
});
|
|
16060
|
-
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) {
|
|
16061
16381
|
return { $loc, token: "..." };
|
|
16062
16382
|
});
|
|
16063
16383
|
var DotDotDot$$ = [DotDotDot$0, DotDotDot$1];
|
|
16064
16384
|
function DotDotDot(ctx, state2) {
|
|
16065
16385
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "DotDotDot", DotDotDot$$);
|
|
16066
16386
|
}
|
|
16067
|
-
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) {
|
|
16068
16388
|
return { $loc, token: $1 };
|
|
16069
16389
|
});
|
|
16070
16390
|
function DoubleColon(ctx, state2) {
|
|
16071
16391
|
return (0, import_lib4.$EVENT)(ctx, state2, "DoubleColon", DoubleColon$0);
|
|
16072
16392
|
}
|
|
16073
|
-
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) {
|
|
16074
16394
|
return { $loc, token: ":" };
|
|
16075
16395
|
});
|
|
16076
16396
|
function DoubleColonAsColon(ctx, state2) {
|
|
16077
16397
|
return (0, import_lib4.$EVENT)(ctx, state2, "DoubleColonAsColon", DoubleColonAsColon$0);
|
|
16078
16398
|
}
|
|
16079
|
-
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) {
|
|
16080
16400
|
return { $loc, token: $1 };
|
|
16081
16401
|
});
|
|
16082
16402
|
function DoubleQuote(ctx, state2) {
|
|
16083
16403
|
return (0, import_lib4.$EVENT)(ctx, state2, "DoubleQuote", DoubleQuote$0);
|
|
16084
16404
|
}
|
|
16085
|
-
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) {
|
|
16086
16406
|
return { $loc, token: $1 };
|
|
16087
16407
|
});
|
|
16088
16408
|
function Each(ctx, state2) {
|
|
16089
16409
|
return (0, import_lib4.$EVENT)(ctx, state2, "Each", Each$0);
|
|
16090
16410
|
}
|
|
16091
|
-
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) {
|
|
16092
16412
|
return { $loc, token: $1 };
|
|
16093
16413
|
});
|
|
16094
16414
|
function Else(ctx, state2) {
|
|
@@ -16100,61 +16420,61 @@ var Equals$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L3, 'Equals "="'),
|
|
|
16100
16420
|
function Equals(ctx, state2) {
|
|
16101
16421
|
return (0, import_lib4.$EVENT)(ctx, state2, "Equals", Equals$0);
|
|
16102
16422
|
}
|
|
16103
|
-
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) {
|
|
16104
16424
|
return { $loc, token: $1 };
|
|
16105
16425
|
});
|
|
16106
16426
|
function ExclamationPoint(ctx, state2) {
|
|
16107
16427
|
return (0, import_lib4.$EVENT)(ctx, state2, "ExclamationPoint", ExclamationPoint$0);
|
|
16108
16428
|
}
|
|
16109
|
-
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) {
|
|
16110
16430
|
return { $loc, token: $1 };
|
|
16111
16431
|
});
|
|
16112
16432
|
function Export(ctx, state2) {
|
|
16113
16433
|
return (0, import_lib4.$EVENT)(ctx, state2, "Export", Export$0);
|
|
16114
16434
|
}
|
|
16115
|
-
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) {
|
|
16116
16436
|
return { $loc, token: $1 };
|
|
16117
16437
|
});
|
|
16118
16438
|
function Extends(ctx, state2) {
|
|
16119
16439
|
return (0, import_lib4.$EVENT)(ctx, state2, "Extends", Extends$0);
|
|
16120
16440
|
}
|
|
16121
|
-
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) {
|
|
16122
16442
|
return { $loc, token: $1 };
|
|
16123
16443
|
});
|
|
16124
16444
|
function Finally(ctx, state2) {
|
|
16125
16445
|
return (0, import_lib4.$EVENT)(ctx, state2, "Finally", Finally$0);
|
|
16126
16446
|
}
|
|
16127
|
-
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) {
|
|
16128
16448
|
return { $loc, token: $1 };
|
|
16129
16449
|
});
|
|
16130
16450
|
function For(ctx, state2) {
|
|
16131
16451
|
return (0, import_lib4.$EVENT)(ctx, state2, "For", For$0);
|
|
16132
16452
|
}
|
|
16133
|
-
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) {
|
|
16134
16454
|
return { $loc, token: $1 };
|
|
16135
16455
|
});
|
|
16136
16456
|
function From(ctx, state2) {
|
|
16137
16457
|
return (0, import_lib4.$EVENT)(ctx, state2, "From", From$0);
|
|
16138
16458
|
}
|
|
16139
|
-
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) {
|
|
16140
16460
|
return { $loc, token: $1 };
|
|
16141
16461
|
});
|
|
16142
16462
|
function Function2(ctx, state2) {
|
|
16143
16463
|
return (0, import_lib4.$EVENT)(ctx, state2, "Function", Function$0);
|
|
16144
16464
|
}
|
|
16145
|
-
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) {
|
|
16146
16466
|
return { $loc, token: $1, type: "GetOrSet" };
|
|
16147
16467
|
});
|
|
16148
16468
|
function GetOrSet(ctx, state2) {
|
|
16149
16469
|
return (0, import_lib4.$EVENT)(ctx, state2, "GetOrSet", GetOrSet$0);
|
|
16150
16470
|
}
|
|
16151
|
-
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) {
|
|
16152
16472
|
return { $loc, token: $1 };
|
|
16153
16473
|
});
|
|
16154
16474
|
function Hash(ctx, state2) {
|
|
16155
16475
|
return (0, import_lib4.$EVENT)(ctx, state2, "Hash", Hash$0);
|
|
16156
16476
|
}
|
|
16157
|
-
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) {
|
|
16158
16478
|
return { $loc, token: $1 };
|
|
16159
16479
|
});
|
|
16160
16480
|
function If(ctx, state2) {
|
|
@@ -16166,67 +16486,67 @@ var Import$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)
|
|
|
16166
16486
|
function Import(ctx, state2) {
|
|
16167
16487
|
return (0, import_lib4.$EVENT)(ctx, state2, "Import", Import$0);
|
|
16168
16488
|
}
|
|
16169
|
-
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) {
|
|
16170
16490
|
return { $loc, token: $1 };
|
|
16171
16491
|
});
|
|
16172
16492
|
function In(ctx, state2) {
|
|
16173
16493
|
return (0, import_lib4.$EVENT)(ctx, state2, "In", In$0);
|
|
16174
16494
|
}
|
|
16175
|
-
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) {
|
|
16176
16496
|
return { $loc, token: $1 };
|
|
16177
16497
|
});
|
|
16178
16498
|
function Infer(ctx, state2) {
|
|
16179
16499
|
return (0, import_lib4.$EVENT)(ctx, state2, "Infer", Infer$0);
|
|
16180
16500
|
}
|
|
16181
|
-
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) {
|
|
16182
16502
|
return { $loc, token: $1 };
|
|
16183
16503
|
});
|
|
16184
16504
|
function LetOrConst(ctx, state2) {
|
|
16185
16505
|
return (0, import_lib4.$EVENT)(ctx, state2, "LetOrConst", LetOrConst$0);
|
|
16186
16506
|
}
|
|
16187
|
-
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) {
|
|
16188
16508
|
return { $loc, token: $1 };
|
|
16189
16509
|
});
|
|
16190
16510
|
function Const(ctx, state2) {
|
|
16191
16511
|
return (0, import_lib4.$EVENT)(ctx, state2, "Const", Const$0);
|
|
16192
16512
|
}
|
|
16193
|
-
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) {
|
|
16194
16514
|
return { $loc, token: $1 };
|
|
16195
16515
|
});
|
|
16196
16516
|
function Is(ctx, state2) {
|
|
16197
16517
|
return (0, import_lib4.$EVENT)(ctx, state2, "Is", Is$0);
|
|
16198
16518
|
}
|
|
16199
|
-
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) {
|
|
16200
16520
|
return { $loc, token: $1 };
|
|
16201
16521
|
});
|
|
16202
16522
|
function LetOrConstOrVar(ctx, state2) {
|
|
16203
16523
|
return (0, import_lib4.$EVENT)(ctx, state2, "LetOrConstOrVar", LetOrConstOrVar$0);
|
|
16204
16524
|
}
|
|
16205
|
-
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) {
|
|
16206
16526
|
return { $loc, token: $1 };
|
|
16207
16527
|
});
|
|
16208
16528
|
function Like(ctx, state2) {
|
|
16209
16529
|
return (0, import_lib4.$EVENT)(ctx, state2, "Like", Like$0);
|
|
16210
16530
|
}
|
|
16211
|
-
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) {
|
|
16212
16532
|
return { $loc, token: "while" };
|
|
16213
16533
|
});
|
|
16214
16534
|
function Loop(ctx, state2) {
|
|
16215
16535
|
return (0, import_lib4.$EVENT)(ctx, state2, "Loop", Loop$0);
|
|
16216
16536
|
}
|
|
16217
|
-
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) {
|
|
16218
16538
|
return { $loc, token: $1 };
|
|
16219
16539
|
});
|
|
16220
16540
|
function New(ctx, state2) {
|
|
16221
16541
|
return (0, import_lib4.$EVENT)(ctx, state2, "New", New$0);
|
|
16222
16542
|
}
|
|
16223
|
-
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) {
|
|
16224
16544
|
return { $loc, token: "!" };
|
|
16225
16545
|
});
|
|
16226
16546
|
function Not(ctx, state2) {
|
|
16227
16547
|
return (0, import_lib4.$EVENT)(ctx, state2, "Not", Not$0);
|
|
16228
16548
|
}
|
|
16229
|
-
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) {
|
|
16230
16550
|
return { $loc, token: $1 };
|
|
16231
16551
|
});
|
|
16232
16552
|
function Of(ctx, state2) {
|
|
@@ -16244,7 +16564,7 @@ var OpenBrace$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L1, 'OpenBrace
|
|
|
16244
16564
|
function OpenBrace(ctx, state2) {
|
|
16245
16565
|
return (0, import_lib4.$EVENT)(ctx, state2, "OpenBrace", OpenBrace$0);
|
|
16246
16566
|
}
|
|
16247
|
-
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) {
|
|
16248
16568
|
return { $loc, token: $1 };
|
|
16249
16569
|
});
|
|
16250
16570
|
function OpenBracket(ctx, state2) {
|
|
@@ -16256,49 +16576,49 @@ var OpenParen$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L4, 'OpenParen
|
|
|
16256
16576
|
function OpenParen(ctx, state2) {
|
|
16257
16577
|
return (0, import_lib4.$EVENT)(ctx, state2, "OpenParen", OpenParen$0);
|
|
16258
16578
|
}
|
|
16259
|
-
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) {
|
|
16260
16580
|
return { $loc, token: $1 };
|
|
16261
16581
|
});
|
|
16262
16582
|
function Operator(ctx, state2) {
|
|
16263
16583
|
return (0, import_lib4.$EVENT)(ctx, state2, "Operator", Operator$0);
|
|
16264
16584
|
}
|
|
16265
|
-
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) {
|
|
16266
16586
|
return { $loc, token: $1, ts: true };
|
|
16267
16587
|
});
|
|
16268
16588
|
function Override(ctx, state2) {
|
|
16269
16589
|
return (0, import_lib4.$EVENT)(ctx, state2, "Override", Override$0);
|
|
16270
16590
|
}
|
|
16271
|
-
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) {
|
|
16272
16592
|
return { $loc, token: $1 };
|
|
16273
16593
|
});
|
|
16274
16594
|
function Own(ctx, state2) {
|
|
16275
16595
|
return (0, import_lib4.$EVENT)(ctx, state2, "Own", Own$0);
|
|
16276
16596
|
}
|
|
16277
|
-
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) {
|
|
16278
16598
|
return { $loc, token: $1 };
|
|
16279
16599
|
});
|
|
16280
16600
|
function Public(ctx, state2) {
|
|
16281
16601
|
return (0, import_lib4.$EVENT)(ctx, state2, "Public", Public$0);
|
|
16282
16602
|
}
|
|
16283
|
-
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) {
|
|
16284
16604
|
return { $loc, token: $1 };
|
|
16285
16605
|
});
|
|
16286
16606
|
function Private(ctx, state2) {
|
|
16287
16607
|
return (0, import_lib4.$EVENT)(ctx, state2, "Private", Private$0);
|
|
16288
16608
|
}
|
|
16289
|
-
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) {
|
|
16290
16610
|
return { $loc, token: $1 };
|
|
16291
16611
|
});
|
|
16292
16612
|
function Protected(ctx, state2) {
|
|
16293
16613
|
return (0, import_lib4.$EVENT)(ctx, state2, "Protected", Protected$0);
|
|
16294
16614
|
}
|
|
16295
|
-
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) {
|
|
16296
16616
|
return { $loc, token: "||>" };
|
|
16297
16617
|
});
|
|
16298
|
-
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) {
|
|
16299
16619
|
return { $loc, token: "|>=" };
|
|
16300
16620
|
});
|
|
16301
|
-
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) {
|
|
16302
16622
|
return { $loc, token: "|>" };
|
|
16303
16623
|
});
|
|
16304
16624
|
var Pipe$$ = [Pipe$0, Pipe$1, Pipe$2];
|
|
@@ -16311,19 +16631,19 @@ var QuestionMark$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L6, 'Questio
|
|
|
16311
16631
|
function QuestionMark(ctx, state2) {
|
|
16312
16632
|
return (0, import_lib4.$EVENT)(ctx, state2, "QuestionMark", QuestionMark$0);
|
|
16313
16633
|
}
|
|
16314
|
-
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) {
|
|
16315
16635
|
return { $loc, token: $1, ts: true };
|
|
16316
16636
|
});
|
|
16317
16637
|
function Readonly(ctx, state2) {
|
|
16318
16638
|
return (0, import_lib4.$EVENT)(ctx, state2, "Readonly", Readonly$0);
|
|
16319
16639
|
}
|
|
16320
|
-
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) {
|
|
16321
16641
|
return { $loc, token: $1 };
|
|
16322
16642
|
});
|
|
16323
16643
|
function Return(ctx, state2) {
|
|
16324
16644
|
return (0, import_lib4.$EVENT)(ctx, state2, "Return", Return$0);
|
|
16325
16645
|
}
|
|
16326
|
-
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) {
|
|
16327
16647
|
return { $loc, token: $1 };
|
|
16328
16648
|
});
|
|
16329
16649
|
function Satisfies(ctx, state2) {
|
|
@@ -16335,7 +16655,7 @@ var Semicolon$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L119, 'Semicolo
|
|
|
16335
16655
|
function Semicolon(ctx, state2) {
|
|
16336
16656
|
return (0, import_lib4.$EVENT)(ctx, state2, "Semicolon", Semicolon$0);
|
|
16337
16657
|
}
|
|
16338
|
-
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) {
|
|
16339
16659
|
return { $loc, token: $1 };
|
|
16340
16660
|
});
|
|
16341
16661
|
function SingleQuote(ctx, state2) {
|
|
@@ -16347,149 +16667,149 @@ var Star$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L75, 'Star "*"'), fu
|
|
|
16347
16667
|
function Star(ctx, state2) {
|
|
16348
16668
|
return (0, import_lib4.$EVENT)(ctx, state2, "Star", Star$0);
|
|
16349
16669
|
}
|
|
16350
|
-
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) {
|
|
16351
16671
|
return { $loc, token: $1 };
|
|
16352
16672
|
});
|
|
16353
|
-
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) {
|
|
16354
16674
|
return { $loc, token: "static " };
|
|
16355
16675
|
});
|
|
16356
16676
|
var Static$$ = [Static$0, Static$1];
|
|
16357
16677
|
function Static(ctx, state2) {
|
|
16358
16678
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "Static", Static$$);
|
|
16359
16679
|
}
|
|
16360
|
-
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) {
|
|
16361
16681
|
return { $loc, token: $1 };
|
|
16362
16682
|
});
|
|
16363
16683
|
function SubstitutionStart(ctx, state2) {
|
|
16364
16684
|
return (0, import_lib4.$EVENT)(ctx, state2, "SubstitutionStart", SubstitutionStart$0);
|
|
16365
16685
|
}
|
|
16366
|
-
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) {
|
|
16367
16687
|
return { $loc, token: $1 };
|
|
16368
16688
|
});
|
|
16369
16689
|
function Super(ctx, state2) {
|
|
16370
16690
|
return (0, import_lib4.$EVENT)(ctx, state2, "Super", Super$0);
|
|
16371
16691
|
}
|
|
16372
|
-
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) {
|
|
16373
16693
|
return { $loc, token: $1 };
|
|
16374
16694
|
});
|
|
16375
16695
|
function Switch(ctx, state2) {
|
|
16376
16696
|
return (0, import_lib4.$EVENT)(ctx, state2, "Switch", Switch$0);
|
|
16377
16697
|
}
|
|
16378
|
-
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) {
|
|
16379
16699
|
return { $loc, token: $1 };
|
|
16380
16700
|
});
|
|
16381
16701
|
function Target(ctx, state2) {
|
|
16382
16702
|
return (0, import_lib4.$EVENT)(ctx, state2, "Target", Target$0);
|
|
16383
16703
|
}
|
|
16384
|
-
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) {
|
|
16385
16705
|
return { $loc, token: "" };
|
|
16386
16706
|
});
|
|
16387
16707
|
function Then(ctx, state2) {
|
|
16388
16708
|
return (0, import_lib4.$EVENT)(ctx, state2, "Then", Then$0);
|
|
16389
16709
|
}
|
|
16390
|
-
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) {
|
|
16391
16711
|
return { $loc, token: $1 };
|
|
16392
16712
|
});
|
|
16393
16713
|
function This(ctx, state2) {
|
|
16394
16714
|
return (0, import_lib4.$EVENT)(ctx, state2, "This", This$0);
|
|
16395
16715
|
}
|
|
16396
|
-
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) {
|
|
16397
16717
|
return { $loc, token: $1 };
|
|
16398
16718
|
});
|
|
16399
16719
|
function Throw(ctx, state2) {
|
|
16400
16720
|
return (0, import_lib4.$EVENT)(ctx, state2, "Throw", Throw$0);
|
|
16401
16721
|
}
|
|
16402
|
-
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) {
|
|
16403
16723
|
return { $loc, token: "`" };
|
|
16404
16724
|
});
|
|
16405
16725
|
function TripleDoubleQuote(ctx, state2) {
|
|
16406
16726
|
return (0, import_lib4.$EVENT)(ctx, state2, "TripleDoubleQuote", TripleDoubleQuote$0);
|
|
16407
16727
|
}
|
|
16408
|
-
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) {
|
|
16409
16729
|
return { $loc, token: "`" };
|
|
16410
16730
|
});
|
|
16411
16731
|
function TripleSingleQuote(ctx, state2) {
|
|
16412
16732
|
return (0, import_lib4.$EVENT)(ctx, state2, "TripleSingleQuote", TripleSingleQuote$0);
|
|
16413
16733
|
}
|
|
16414
|
-
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) {
|
|
16415
16735
|
return { $loc, token: "/" };
|
|
16416
16736
|
});
|
|
16417
16737
|
function TripleSlash(ctx, state2) {
|
|
16418
16738
|
return (0, import_lib4.$EVENT)(ctx, state2, "TripleSlash", TripleSlash$0);
|
|
16419
16739
|
}
|
|
16420
|
-
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) {
|
|
16421
16741
|
return { $loc, token: "`" };
|
|
16422
16742
|
});
|
|
16423
16743
|
function TripleTick(ctx, state2) {
|
|
16424
16744
|
return (0, import_lib4.$EVENT)(ctx, state2, "TripleTick", TripleTick$0);
|
|
16425
16745
|
}
|
|
16426
|
-
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) {
|
|
16427
16747
|
return { $loc, token: $1 };
|
|
16428
16748
|
});
|
|
16429
16749
|
function Try(ctx, state2) {
|
|
16430
16750
|
return (0, import_lib4.$EVENT)(ctx, state2, "Try", Try$0);
|
|
16431
16751
|
}
|
|
16432
|
-
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) {
|
|
16433
16753
|
return { $loc, token: $1 };
|
|
16434
16754
|
});
|
|
16435
16755
|
function Typeof(ctx, state2) {
|
|
16436
16756
|
return (0, import_lib4.$EVENT)(ctx, state2, "Typeof", Typeof$0);
|
|
16437
16757
|
}
|
|
16438
|
-
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) {
|
|
16439
16759
|
return { $loc, token: $1 };
|
|
16440
16760
|
});
|
|
16441
16761
|
function Undefined(ctx, state2) {
|
|
16442
16762
|
return (0, import_lib4.$EVENT)(ctx, state2, "Undefined", Undefined$0);
|
|
16443
16763
|
}
|
|
16444
|
-
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) {
|
|
16445
16765
|
return { $loc, token: $1, negated: true };
|
|
16446
16766
|
});
|
|
16447
16767
|
function Unless(ctx, state2) {
|
|
16448
16768
|
return (0, import_lib4.$EVENT)(ctx, state2, "Unless", Unless$0);
|
|
16449
16769
|
}
|
|
16450
|
-
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) {
|
|
16451
16771
|
return { $loc, token: $1, negated: true };
|
|
16452
16772
|
});
|
|
16453
16773
|
function Until(ctx, state2) {
|
|
16454
16774
|
return (0, import_lib4.$EVENT)(ctx, state2, "Until", Until$0);
|
|
16455
16775
|
}
|
|
16456
|
-
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) {
|
|
16457
16777
|
return { $loc, token: $1 };
|
|
16458
16778
|
});
|
|
16459
16779
|
function Using(ctx, state2) {
|
|
16460
16780
|
return (0, import_lib4.$EVENT)(ctx, state2, "Using", Using$0);
|
|
16461
16781
|
}
|
|
16462
|
-
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) {
|
|
16463
16783
|
return { $loc, token: $1 };
|
|
16464
16784
|
});
|
|
16465
16785
|
function Var(ctx, state2) {
|
|
16466
16786
|
return (0, import_lib4.$EVENT)(ctx, state2, "Var", Var$0);
|
|
16467
16787
|
}
|
|
16468
|
-
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) {
|
|
16469
16789
|
return { $loc, token: $1 };
|
|
16470
16790
|
});
|
|
16471
16791
|
function Void(ctx, state2) {
|
|
16472
16792
|
return (0, import_lib4.$EVENT)(ctx, state2, "Void", Void$0);
|
|
16473
16793
|
}
|
|
16474
|
-
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) {
|
|
16475
16795
|
return { $loc, token: "case" };
|
|
16476
16796
|
});
|
|
16477
16797
|
function When(ctx, state2) {
|
|
16478
16798
|
return (0, import_lib4.$EVENT)(ctx, state2, "When", When$0);
|
|
16479
16799
|
}
|
|
16480
|
-
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) {
|
|
16481
16801
|
return { $loc, token: $1 };
|
|
16482
16802
|
});
|
|
16483
16803
|
function While(ctx, state2) {
|
|
16484
16804
|
return (0, import_lib4.$EVENT)(ctx, state2, "While", While$0);
|
|
16485
16805
|
}
|
|
16486
|
-
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) {
|
|
16487
16807
|
return { $loc, token: $1 };
|
|
16488
16808
|
});
|
|
16489
16809
|
function With(ctx, state2) {
|
|
16490
16810
|
return (0, import_lib4.$EVENT)(ctx, state2, "With", With$0);
|
|
16491
16811
|
}
|
|
16492
|
-
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) {
|
|
16493
16813
|
return { $loc, token: $1, type: "Yield" };
|
|
16494
16814
|
});
|
|
16495
16815
|
function Yield(ctx, state2) {
|
|
@@ -16508,7 +16828,7 @@ var JSXImplicitFragment$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(JSXTag, (0,
|
|
|
16508
16828
|
],
|
|
16509
16829
|
jsxChildren: [$1].concat($2.map(([, tag]) => tag))
|
|
16510
16830
|
};
|
|
16511
|
-
const type = typeOfJSX(jsx, config
|
|
16831
|
+
const type = typeOfJSX(jsx, config);
|
|
16512
16832
|
return type ? [
|
|
16513
16833
|
{ ts: true, children: ["("] },
|
|
16514
16834
|
jsx,
|
|
@@ -16568,7 +16888,7 @@ var JSXElement$$ = [JSXElement$0, JSXElement$1, JSXElement$2];
|
|
|
16568
16888
|
function JSXElement(ctx, state2) {
|
|
16569
16889
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "JSXElement", JSXElement$$);
|
|
16570
16890
|
}
|
|
16571
|
-
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) {
|
|
16572
16892
|
return { type: "JSXElement", children: $0, tag: $2 };
|
|
16573
16893
|
});
|
|
16574
16894
|
function JSXSelfClosingElement(ctx, state2) {
|
|
@@ -16602,7 +16922,7 @@ var JSXOptionalClosingElement$$ = [JSXOptionalClosingElement$0, JSXOptionalClosi
|
|
|
16602
16922
|
function JSXOptionalClosingElement(ctx, state2) {
|
|
16603
16923
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "JSXOptionalClosingElement", JSXOptionalClosingElement$$);
|
|
16604
16924
|
}
|
|
16605
|
-
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 ">"'));
|
|
16606
16926
|
function JSXClosingElement(ctx, state2) {
|
|
16607
16927
|
return (0, import_lib4.$EVENT)(ctx, state2, "JSXClosingElement", JSXClosingElement$0);
|
|
16608
16928
|
}
|
|
@@ -16623,7 +16943,7 @@ var JSXFragment$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$N)
|
|
|
16623
16943
|
];
|
|
16624
16944
|
return { type: "JSXFragment", children: parts, jsxChildren: children.jsxChildren };
|
|
16625
16945
|
});
|
|
16626
|
-
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) {
|
|
16627
16947
|
var children = $3;
|
|
16628
16948
|
$0 = $0.slice(1);
|
|
16629
16949
|
return {
|
|
@@ -16636,7 +16956,7 @@ var JSXFragment$$ = [JSXFragment$0, JSXFragment$1];
|
|
|
16636
16956
|
function JSXFragment(ctx, state2) {
|
|
16637
16957
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "JSXFragment", JSXFragment$$);
|
|
16638
16958
|
}
|
|
16639
|
-
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) {
|
|
16640
16960
|
state.JSXTagStack.push("");
|
|
16641
16961
|
return $1;
|
|
16642
16962
|
});
|
|
@@ -16653,11 +16973,11 @@ var JSXOptionalClosingFragment$$ = [JSXOptionalClosingFragment$0, JSXOptionalClo
|
|
|
16653
16973
|
function JSXOptionalClosingFragment(ctx, state2) {
|
|
16654
16974
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "JSXOptionalClosingFragment", JSXOptionalClosingFragment$$);
|
|
16655
16975
|
}
|
|
16656
|
-
var JSXClosingFragment$0 = (0, import_lib4.$EXPECT)($
|
|
16976
|
+
var JSXClosingFragment$0 = (0, import_lib4.$EXPECT)($L230, 'JSXClosingFragment "</>"');
|
|
16657
16977
|
function JSXClosingFragment(ctx, state2) {
|
|
16658
16978
|
return (0, import_lib4.$EVENT)(ctx, state2, "JSXClosingFragment", JSXClosingFragment$0);
|
|
16659
16979
|
}
|
|
16660
|
-
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) {
|
|
16661
16981
|
return config.defaultElement;
|
|
16662
16982
|
});
|
|
16663
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)))));
|
|
@@ -16835,7 +17155,7 @@ var JSXAttribute$4 = (0, import_lib4.$TS)((0, import_lib4.$S)(Identifier, (0, im
|
|
|
16835
17155
|
}
|
|
16836
17156
|
return $skip;
|
|
16837
17157
|
});
|
|
16838
|
-
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) {
|
|
16839
17159
|
return [" ", "id=", $2];
|
|
16840
17160
|
});
|
|
16841
17161
|
var JSXAttribute$6 = (0, import_lib4.$TS)((0, import_lib4.$S)(Dot, JSXShorthandString), function($skip, $loc, $0, $1, $2) {
|
|
@@ -17180,7 +17500,7 @@ var JSXChildGeneral$$ = [JSXChildGeneral$0, JSXChildGeneral$1, JSXChildGeneral$2
|
|
|
17180
17500
|
function JSXChildGeneral(ctx, state2) {
|
|
17181
17501
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "JSXChildGeneral", JSXChildGeneral$$);
|
|
17182
17502
|
}
|
|
17183
|
-
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) {
|
|
17184
17504
|
return ["{/*", $2, "*/}"];
|
|
17185
17505
|
});
|
|
17186
17506
|
function JSXComment(ctx, state2) {
|
|
@@ -17468,37 +17788,37 @@ var InterfaceExtendsTarget$0 = ImplementsTarget;
|
|
|
17468
17788
|
function InterfaceExtendsTarget(ctx, state2) {
|
|
17469
17789
|
return (0, import_lib4.$EVENT)(ctx, state2, "InterfaceExtendsTarget", InterfaceExtendsTarget$0);
|
|
17470
17790
|
}
|
|
17471
|
-
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) {
|
|
17472
17792
|
return { $loc, token: $1 };
|
|
17473
17793
|
});
|
|
17474
17794
|
function TypeKeyword(ctx, state2) {
|
|
17475
17795
|
return (0, import_lib4.$EVENT)(ctx, state2, "TypeKeyword", TypeKeyword$0);
|
|
17476
17796
|
}
|
|
17477
|
-
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) {
|
|
17478
17798
|
return { $loc, token: $1 };
|
|
17479
17799
|
});
|
|
17480
17800
|
function Enum(ctx, state2) {
|
|
17481
17801
|
return (0, import_lib4.$EVENT)(ctx, state2, "Enum", Enum$0);
|
|
17482
17802
|
}
|
|
17483
|
-
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) {
|
|
17484
17804
|
return { $loc, token: $1 };
|
|
17485
17805
|
});
|
|
17486
17806
|
function Interface(ctx, state2) {
|
|
17487
17807
|
return (0, import_lib4.$EVENT)(ctx, state2, "Interface", Interface$0);
|
|
17488
17808
|
}
|
|
17489
|
-
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) {
|
|
17490
17810
|
return { $loc, token: $1 };
|
|
17491
17811
|
});
|
|
17492
17812
|
function Global(ctx, state2) {
|
|
17493
17813
|
return (0, import_lib4.$EVENT)(ctx, state2, "Global", Global$0);
|
|
17494
17814
|
}
|
|
17495
|
-
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) {
|
|
17496
17816
|
return { $loc, token: $1 };
|
|
17497
17817
|
});
|
|
17498
17818
|
function Module(ctx, state2) {
|
|
17499
17819
|
return (0, import_lib4.$EVENT)(ctx, state2, "Module", Module$0);
|
|
17500
17820
|
}
|
|
17501
|
-
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) {
|
|
17502
17822
|
return { $loc, token: $1 };
|
|
17503
17823
|
});
|
|
17504
17824
|
function Namespace(ctx, state2) {
|
|
@@ -17812,14 +18132,14 @@ var ReturnTypeSuffix$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib
|
|
|
17812
18132
|
function ReturnTypeSuffix(ctx, state2) {
|
|
17813
18133
|
return (0, import_lib4.$EVENT)(ctx, state2, "ReturnTypeSuffix", ReturnTypeSuffix$0);
|
|
17814
18134
|
}
|
|
17815
|
-
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) {
|
|
17816
18136
|
var asserts = $1;
|
|
17817
18137
|
var t = $3;
|
|
17818
18138
|
if (!t)
|
|
17819
18139
|
return $skip;
|
|
17820
18140
|
if (asserts) {
|
|
17821
18141
|
t = {
|
|
17822
|
-
type: "
|
|
18142
|
+
type: "TypeAsserts",
|
|
17823
18143
|
t,
|
|
17824
18144
|
children: [asserts[0], asserts[1], t],
|
|
17825
18145
|
ts: true
|
|
@@ -17913,8 +18233,8 @@ var TypeUnarySuffix$$ = [TypeUnarySuffix$0, TypeUnarySuffix$1, TypeUnarySuffix$2
|
|
|
17913
18233
|
function TypeUnarySuffix(ctx, state2) {
|
|
17914
18234
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "TypeUnarySuffix", TypeUnarySuffix$$);
|
|
17915
18235
|
}
|
|
17916
|
-
var TypeUnaryOp$0 = (0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
17917
|
-
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);
|
|
17918
18238
|
var TypeUnaryOp$$ = [TypeUnaryOp$0, TypeUnaryOp$1];
|
|
17919
18239
|
function TypeUnaryOp(ctx, state2) {
|
|
17920
18240
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "TypeUnaryOp", TypeUnaryOp$$);
|
|
@@ -17944,7 +18264,7 @@ var TypeIndexedAccess$$ = [TypeIndexedAccess$0, TypeIndexedAccess$1, TypeIndexed
|
|
|
17944
18264
|
function TypeIndexedAccess(ctx, state2) {
|
|
17945
18265
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "TypeIndexedAccess", TypeIndexedAccess$$);
|
|
17946
18266
|
}
|
|
17947
|
-
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) {
|
|
17948
18268
|
return { $loc, token: "unknown" };
|
|
17949
18269
|
});
|
|
17950
18270
|
function UnknownAlias(ctx, state2) {
|
|
@@ -18015,12 +18335,17 @@ var ImportType$$ = [ImportType$0, ImportType$1];
|
|
|
18015
18335
|
function ImportType(ctx, state2) {
|
|
18016
18336
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "ImportType", ImportType$$);
|
|
18017
18337
|
}
|
|
18018
|
-
var TypeTuple$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(OpenBracket, AllowAll, (0, import_lib4.$E)(
|
|
18019
|
-
|
|
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)
|
|
18020
18344
|
return $skip;
|
|
18021
18345
|
return {
|
|
18022
18346
|
type: "TypeTuple",
|
|
18023
|
-
|
|
18347
|
+
elements,
|
|
18348
|
+
children: [open, elements, ws, close]
|
|
18024
18349
|
};
|
|
18025
18350
|
});
|
|
18026
18351
|
function TypeTuple(ctx, state2) {
|
|
@@ -18082,19 +18407,28 @@ var TypeElement$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(__, (0, import_lib4
|
|
|
18082
18407
|
message: "... both before and after identifier"
|
|
18083
18408
|
}];
|
|
18084
18409
|
}
|
|
18085
|
-
return
|
|
18410
|
+
return {
|
|
18411
|
+
type: "TypeElement",
|
|
18412
|
+
name,
|
|
18413
|
+
t: type,
|
|
18414
|
+
children: [ws, dots, name, colon, type]
|
|
18415
|
+
};
|
|
18086
18416
|
});
|
|
18087
18417
|
var TypeElement$1 = (0, import_lib4.$S)(__, DotDotDot, __, Type);
|
|
18088
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) {
|
|
18089
18419
|
var type = $1;
|
|
18090
18420
|
var spaceDots = $2;
|
|
18091
|
-
if (
|
|
18092
|
-
|
|
18093
|
-
|
|
18094
|
-
|
|
18095
|
-
|
|
18096
|
-
|
|
18097
|
-
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
|
+
};
|
|
18098
18432
|
});
|
|
18099
18433
|
var TypeElement$$ = [TypeElement$0, TypeElement$1, TypeElement$2];
|
|
18100
18434
|
function TypeElement(ctx, state2) {
|
|
@@ -18323,13 +18657,13 @@ var TypeLiteral$2 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EX
|
|
|
18323
18657
|
return num;
|
|
18324
18658
|
return $0;
|
|
18325
18659
|
});
|
|
18326
|
-
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) {
|
|
18327
18661
|
return { type: "VoidType", $loc, token: $1 };
|
|
18328
18662
|
});
|
|
18329
|
-
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) {
|
|
18330
18664
|
return { type: "UniqueSymbolType", children: $0 };
|
|
18331
18665
|
});
|
|
18332
|
-
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) {
|
|
18333
18667
|
return { $loc, token: "[]" };
|
|
18334
18668
|
});
|
|
18335
18669
|
var TypeLiteral$$ = [TypeLiteral$0, TypeLiteral$1, TypeLiteral$2, TypeLiteral$3, TypeLiteral$4, TypeLiteral$5];
|
|
@@ -18348,7 +18682,7 @@ var InlineInterfacePropertyDelimiter$0 = (0, import_lib4.$C)((0, import_lib4.$S)
|
|
|
18348
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) {
|
|
18349
18683
|
return value[1];
|
|
18350
18684
|
});
|
|
18351
|
-
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 "}"'))));
|
|
18352
18686
|
var InlineInterfacePropertyDelimiter$3 = (0, import_lib4.$Y)(EOS);
|
|
18353
18687
|
var InlineInterfacePropertyDelimiter$$ = [InlineInterfacePropertyDelimiter$0, InlineInterfacePropertyDelimiter$1, InlineInterfacePropertyDelimiter$2, InlineInterfacePropertyDelimiter$3];
|
|
18354
18688
|
function InlineInterfacePropertyDelimiter(ctx, state2) {
|
|
@@ -18364,31 +18698,54 @@ var TypeBinaryOp$$ = [TypeBinaryOp$0, TypeBinaryOp$1];
|
|
|
18364
18698
|
function TypeBinaryOp(ctx, state2) {
|
|
18365
18699
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "TypeBinaryOp", TypeBinaryOp$$);
|
|
18366
18700
|
}
|
|
18367
|
-
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, __,
|
|
18368
|
-
var
|
|
18369
|
-
|
|
18370
|
-
|
|
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_) {
|
|
18371
18708
|
children[1] = {
|
|
18372
18709
|
type: "Error",
|
|
18373
18710
|
message: "abstract function types must be constructors (abstract new)"
|
|
18374
18711
|
};
|
|
18375
18712
|
}
|
|
18376
|
-
if (
|
|
18377
|
-
|
|
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
|
+
}
|
|
18378
18734
|
return {
|
|
18379
18735
|
type: "TypeFunction",
|
|
18380
18736
|
children,
|
|
18381
|
-
ts: true
|
|
18737
|
+
ts: true,
|
|
18738
|
+
returnType
|
|
18382
18739
|
};
|
|
18383
18740
|
});
|
|
18384
18741
|
function TypeFunction(ctx, state2) {
|
|
18385
18742
|
return (0, import_lib4.$EVENT)(ctx, state2, "TypeFunction", TypeFunction$0);
|
|
18386
18743
|
}
|
|
18387
|
-
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) {
|
|
18388
18745
|
return { $loc, token: "=>" };
|
|
18389
18746
|
});
|
|
18390
|
-
function
|
|
18391
|
-
return (0, import_lib4.$EVENT)(ctx, state2, "
|
|
18747
|
+
function TypeFunctionArrow(ctx, state2) {
|
|
18748
|
+
return (0, import_lib4.$EVENT)(ctx, state2, "TypeFunctionArrow", TypeFunctionArrow$0);
|
|
18392
18749
|
}
|
|
18393
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) {
|
|
18394
18751
|
var args = $2;
|
|
@@ -18564,7 +18921,7 @@ var CivetPrologue$$ = [CivetPrologue$0, CivetPrologue$1];
|
|
|
18564
18921
|
function CivetPrologue(ctx, state2) {
|
|
18565
18922
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "CivetPrologue", CivetPrologue$$);
|
|
18566
18923
|
}
|
|
18567
|
-
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) {
|
|
18568
18925
|
var options = $3;
|
|
18569
18926
|
return {
|
|
18570
18927
|
type: "CivetPrologue",
|