@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.js
CHANGED
|
@@ -58,7 +58,7 @@ var require_machine = __commonJS({
|
|
|
58
58
|
$EVENT: () => $EVENT2,
|
|
59
59
|
$EVENT_C: () => $EVENT_C2,
|
|
60
60
|
$EXPECT: () => $EXPECT2,
|
|
61
|
-
$L: () => $
|
|
61
|
+
$L: () => $L246,
|
|
62
62
|
$N: () => $N2,
|
|
63
63
|
$P: () => $P2,
|
|
64
64
|
$Q: () => $Q2,
|
|
@@ -83,7 +83,7 @@ var require_machine = __commonJS({
|
|
|
83
83
|
return result;
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
|
-
function $
|
|
86
|
+
function $L246(str) {
|
|
87
87
|
return function(_ctx, state2) {
|
|
88
88
|
const { input, pos } = state2, { length } = str, end = pos + length;
|
|
89
89
|
if (input.substring(pos, end) === str) {
|
|
@@ -576,7 +576,8 @@ __export(lib_exports, {
|
|
|
576
576
|
stripTrailingImplicitComma: () => stripTrailingImplicitComma,
|
|
577
577
|
trimFirstSpace: () => trimFirstSpace,
|
|
578
578
|
typeOfJSX: () => typeOfJSX,
|
|
579
|
-
wrapIIFE: () => wrapIIFE
|
|
579
|
+
wrapIIFE: () => wrapIIFE,
|
|
580
|
+
wrapTypeInPromise: () => wrapTypeInPromise
|
|
580
581
|
});
|
|
581
582
|
|
|
582
583
|
// source/parser/util.civet
|
|
@@ -916,32 +917,54 @@ function literalValue(literal) {
|
|
|
916
917
|
case "false":
|
|
917
918
|
return false;
|
|
918
919
|
}
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
920
|
+
let ref3;
|
|
921
|
+
switch (literal.subtype) {
|
|
922
|
+
case "StringLiteral": {
|
|
923
|
+
assert.equal(
|
|
924
|
+
raw.startsWith('"') && raw.endsWith('"') || raw.startsWith("'") && raw.endsWith("'"),
|
|
925
|
+
true,
|
|
926
|
+
"String literal should begin and end in single or double quotes"
|
|
927
|
+
);
|
|
928
|
+
return raw.slice(1, -1);
|
|
929
|
+
}
|
|
930
|
+
case "NumericLiteral": {
|
|
931
|
+
raw = raw.replace(/_/g, "");
|
|
932
|
+
if (raw.endsWith("n")) {
|
|
933
|
+
return BigInt(raw.slice(0, -1));
|
|
934
|
+
} else if (raw.match(/[\.eE]/)) {
|
|
935
|
+
return parseFloat(raw);
|
|
936
|
+
} else if ((ref3 = raw.match(/^[+-]?0(.)/)) && Array.isArray(ref3) && len(ref3, 2)) {
|
|
937
|
+
const [, base] = ref3;
|
|
938
|
+
switch (base.toLowerCase()) {
|
|
939
|
+
case "x":
|
|
940
|
+
return parseInt(raw.replace(/0[xX]/, ""), 16);
|
|
941
|
+
case "b":
|
|
942
|
+
return parseInt(raw.replace(/0[bB]/, ""), 2);
|
|
943
|
+
case "o":
|
|
944
|
+
return parseInt(raw.replace(/0[oO]/, ""), 8);
|
|
945
|
+
}
|
|
940
946
|
}
|
|
947
|
+
return parseInt(raw, 10);
|
|
948
|
+
}
|
|
949
|
+
default: {
|
|
950
|
+
throw new Error("Unrecognized literal " + JSON.stringify(literal));
|
|
941
951
|
}
|
|
942
|
-
return parseInt(raw, 10);
|
|
943
952
|
}
|
|
944
|
-
|
|
953
|
+
}
|
|
954
|
+
function makeNumericLiteral(n) {
|
|
955
|
+
const s = n.toString();
|
|
956
|
+
return {
|
|
957
|
+
type: "Literal",
|
|
958
|
+
subtype: "NumericLiteral",
|
|
959
|
+
raw: s,
|
|
960
|
+
children: [
|
|
961
|
+
{
|
|
962
|
+
type: "NumericLiteral",
|
|
963
|
+
token: s
|
|
964
|
+
}
|
|
965
|
+
// missing $loc
|
|
966
|
+
]
|
|
967
|
+
};
|
|
945
968
|
}
|
|
946
969
|
function startsWith(target, value) {
|
|
947
970
|
if (!target)
|
|
@@ -1002,21 +1025,39 @@ function hasImportDeclaration(exp) {
|
|
|
1002
1025
|
function hasExportDeclaration(exp) {
|
|
1003
1026
|
return gatherRecursiveWithinFunction(exp, ($4) => $4.type === "ExportDeclaration").length > 0;
|
|
1004
1027
|
}
|
|
1005
|
-
function deepCopy(
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1028
|
+
function deepCopy(root) {
|
|
1029
|
+
const copied = /* @__PURE__ */ new Map();
|
|
1030
|
+
return recurse(root);
|
|
1031
|
+
function recurse(node) {
|
|
1032
|
+
if (!(node != null && typeof node === "object")) {
|
|
1033
|
+
return node;
|
|
1034
|
+
}
|
|
1035
|
+
if (!copied.has(node)) {
|
|
1036
|
+
if (Array.isArray(node)) {
|
|
1037
|
+
const array = new Array(node.length);
|
|
1038
|
+
copied.set(node, array);
|
|
1039
|
+
for (let i4 = 0, len4 = node.length; i4 < len4; i4++) {
|
|
1040
|
+
const i = i4;
|
|
1041
|
+
const item = node[i4];
|
|
1042
|
+
array[i] = recurse(item);
|
|
1043
|
+
}
|
|
1044
|
+
} else if (node?.type === "Ref") {
|
|
1045
|
+
copied.set(node, node);
|
|
1046
|
+
} else {
|
|
1047
|
+
const obj = {};
|
|
1048
|
+
copied.set(node, obj);
|
|
1049
|
+
for (const key in node) {
|
|
1050
|
+
const value = node[key];
|
|
1051
|
+
if (key === "parent") {
|
|
1052
|
+
obj.parent = copied.get(value) ?? value;
|
|
1053
|
+
} else {
|
|
1054
|
+
obj[key] = recurse(value);
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
return copied.get(node);
|
|
1012
1060
|
}
|
|
1013
|
-
if (node?.type === "Ref")
|
|
1014
|
-
return node;
|
|
1015
|
-
return Object.fromEntries(
|
|
1016
|
-
Object.entries(node).map(([key, value]) => {
|
|
1017
|
-
return [key, deepCopy(value)];
|
|
1018
|
-
})
|
|
1019
|
-
);
|
|
1020
1061
|
}
|
|
1021
1062
|
function removeHoistDecs(node) {
|
|
1022
1063
|
if (node == null)
|
|
@@ -1090,8 +1131,8 @@ function updateParentPointers(node, parent, depth = 1) {
|
|
|
1090
1131
|
return;
|
|
1091
1132
|
}
|
|
1092
1133
|
if (Array.isArray(node)) {
|
|
1093
|
-
for (let
|
|
1094
|
-
const child = node[
|
|
1134
|
+
for (let i5 = 0, len5 = node.length; i5 < len5; i5++) {
|
|
1135
|
+
const child = node[i5];
|
|
1095
1136
|
updateParentPointers(child, parent, depth);
|
|
1096
1137
|
}
|
|
1097
1138
|
return;
|
|
@@ -1101,8 +1142,8 @@ function updateParentPointers(node, parent, depth = 1) {
|
|
|
1101
1142
|
node.parent = parent;
|
|
1102
1143
|
}
|
|
1103
1144
|
if (depth && isParent(node)) {
|
|
1104
|
-
for (let
|
|
1105
|
-
const child =
|
|
1145
|
+
for (let ref4 = node.children, i6 = 0, len6 = ref4.length; i6 < len6; i6++) {
|
|
1146
|
+
const child = ref4[i6];
|
|
1106
1147
|
updateParentPointers(child, node, depth - 1);
|
|
1107
1148
|
}
|
|
1108
1149
|
}
|
|
@@ -1139,7 +1180,7 @@ function spliceChild(node, child, del, ...replacements) {
|
|
|
1139
1180
|
return children.splice(index, del, ...replacements);
|
|
1140
1181
|
}
|
|
1141
1182
|
function convertOptionalType(suffix) {
|
|
1142
|
-
if (suffix.t.type === "
|
|
1183
|
+
if (suffix.t.type === "TypeAsserts") {
|
|
1143
1184
|
spliceChild(suffix, suffix.optional, 1, suffix.optional = {
|
|
1144
1185
|
type: "Error",
|
|
1145
1186
|
message: "Can't use optional ?: syntax with asserts type"
|
|
@@ -1161,7 +1202,7 @@ var typeNeedsNoParens = /* @__PURE__ */ new Set([
|
|
|
1161
1202
|
"TypeIdentifier",
|
|
1162
1203
|
"ImportType",
|
|
1163
1204
|
"TypeLiteral",
|
|
1164
|
-
"
|
|
1205
|
+
"TypeTuple",
|
|
1165
1206
|
"TypeParenthesized"
|
|
1166
1207
|
]);
|
|
1167
1208
|
function parenthesizeType(type) {
|
|
@@ -1239,8 +1280,8 @@ function wrapIIFE(expressions, asyncFlag, generator) {
|
|
|
1239
1280
|
children.splice(1, 0, ".bind(this)");
|
|
1240
1281
|
}
|
|
1241
1282
|
if (gatherRecursiveWithinFunction(block, (a2) => typeof a2 === "object" && a2 != null && "token" in a2 && a2.token === "arguments").length) {
|
|
1242
|
-
let
|
|
1243
|
-
children[children.length - 1] = (
|
|
1283
|
+
let ref5;
|
|
1284
|
+
children[children.length - 1] = (ref5 = parameters.children)[ref5.length - 1] = "(arguments)";
|
|
1244
1285
|
}
|
|
1245
1286
|
}
|
|
1246
1287
|
let exp = makeNode({
|
|
@@ -1278,9 +1319,9 @@ function wrapWithReturn(expression) {
|
|
|
1278
1319
|
}
|
|
1279
1320
|
function flatJoin(array, separator) {
|
|
1280
1321
|
const result = [];
|
|
1281
|
-
for (let
|
|
1282
|
-
const i =
|
|
1283
|
-
const items = array[
|
|
1322
|
+
for (let i7 = 0, len7 = array.length; i7 < len7; i7++) {
|
|
1323
|
+
const i = i7;
|
|
1324
|
+
const items = array[i7];
|
|
1284
1325
|
if (i) {
|
|
1285
1326
|
result.push(separator);
|
|
1286
1327
|
}
|
|
@@ -1851,6 +1892,13 @@ var declareHelper = {
|
|
|
1851
1892
|
").push(rhs), lhs);\n"
|
|
1852
1893
|
]]);
|
|
1853
1894
|
},
|
|
1895
|
+
AutoPromise(ref) {
|
|
1896
|
+
state.prelude.push([
|
|
1897
|
+
"",
|
|
1898
|
+
ts(["type ", ref, "<T> = T extends Promise<unknown> ? T : Promise<T>"]),
|
|
1899
|
+
";\n"
|
|
1900
|
+
]);
|
|
1901
|
+
},
|
|
1854
1902
|
JSX(jsxRef) {
|
|
1855
1903
|
state.prelude.push([
|
|
1856
1904
|
"",
|
|
@@ -1956,12 +2004,17 @@ function gen(root, options) {
|
|
|
1956
2004
|
));
|
|
1957
2005
|
return "";
|
|
1958
2006
|
}
|
|
1959
|
-
if (
|
|
2007
|
+
if ("$loc" in node) {
|
|
1960
2008
|
const { token, $loc } = node;
|
|
1961
|
-
|
|
2009
|
+
if ($loc != null) {
|
|
2010
|
+
updateSourceMap?.(token, $loc.pos);
|
|
2011
|
+
}
|
|
1962
2012
|
return token;
|
|
1963
2013
|
}
|
|
1964
2014
|
if (!node.children) {
|
|
2015
|
+
if (node.token != null) {
|
|
2016
|
+
return node.token;
|
|
2017
|
+
}
|
|
1965
2018
|
switch (node.type) {
|
|
1966
2019
|
case "Ref": {
|
|
1967
2020
|
throw new Error(`Unpopulated ref ${stringify(node)}`);
|
|
@@ -2339,9 +2392,49 @@ function getTypeArguments(args) {
|
|
|
2339
2392
|
function isVoidType(t) {
|
|
2340
2393
|
return typeof t === "object" && t != null && "type" in t && t.type === "TypeLiteral" && "t" in t && typeof t.t === "object" && t.t != null && "type" in t.t && t.t.type === "VoidType";
|
|
2341
2394
|
}
|
|
2395
|
+
function isPromiseType(t) {
|
|
2396
|
+
return typeof t === "object" && t != null && "type" in t && t.type === "TypeIdentifier" && "raw" in t && t.raw === "Promise";
|
|
2397
|
+
}
|
|
2342
2398
|
function isPromiseVoidType(t) {
|
|
2343
|
-
|
|
2344
|
-
|
|
2399
|
+
if (!isPromiseType(t)) {
|
|
2400
|
+
return false;
|
|
2401
|
+
}
|
|
2402
|
+
const args = getTypeArguments(t.args?.args);
|
|
2403
|
+
return args.length === 1 && isVoidType(args[0].t);
|
|
2404
|
+
}
|
|
2405
|
+
function wrapTypeInPromise(t) {
|
|
2406
|
+
if (isPromiseType(t)) {
|
|
2407
|
+
return t;
|
|
2408
|
+
}
|
|
2409
|
+
return wrapTypeInApplication(t, getHelperRef("AutoPromise"), "Promise");
|
|
2410
|
+
}
|
|
2411
|
+
function wrapTypeInApplication(t, id, raw) {
|
|
2412
|
+
const ws = getTrimmingSpace(t);
|
|
2413
|
+
t = trimFirstSpace(t);
|
|
2414
|
+
const innerArgs = [{
|
|
2415
|
+
type: "TypeArgument",
|
|
2416
|
+
ts: true,
|
|
2417
|
+
t,
|
|
2418
|
+
children: [t]
|
|
2419
|
+
}];
|
|
2420
|
+
const args = {
|
|
2421
|
+
type: "TypeArguments",
|
|
2422
|
+
ts: true,
|
|
2423
|
+
args: innerArgs,
|
|
2424
|
+
children: ["<", innerArgs, ">"]
|
|
2425
|
+
};
|
|
2426
|
+
if (!(raw != null)) {
|
|
2427
|
+
if (!(typeof id === "string")) {
|
|
2428
|
+
throw new Error("wrapTypeInApplication requires string id or raw argument");
|
|
2429
|
+
}
|
|
2430
|
+
raw = id;
|
|
2431
|
+
}
|
|
2432
|
+
return {
|
|
2433
|
+
type: "TypeIdentifier",
|
|
2434
|
+
raw,
|
|
2435
|
+
args,
|
|
2436
|
+
children: [ws, id, args]
|
|
2437
|
+
};
|
|
2345
2438
|
}
|
|
2346
2439
|
function implicitFunctionBlock(f) {
|
|
2347
2440
|
if (f.abstract || f.block || f.signature?.optional)
|
|
@@ -2402,7 +2495,8 @@ function processReturnValue(func) {
|
|
|
2402
2495
|
}
|
|
2403
2496
|
const ref = makeRef("ret");
|
|
2404
2497
|
let declaration;
|
|
2405
|
-
values.
|
|
2498
|
+
for (let i1 = 0, len3 = values.length; i1 < len3; i1++) {
|
|
2499
|
+
const value = values[i1];
|
|
2406
2500
|
value.children = [ref];
|
|
2407
2501
|
const { ancestor, child } = findAncestor(
|
|
2408
2502
|
value,
|
|
@@ -2410,21 +2504,41 @@ function processReturnValue(func) {
|
|
|
2410
2504
|
isFunction
|
|
2411
2505
|
);
|
|
2412
2506
|
if (ancestor) {
|
|
2413
|
-
|
|
2507
|
+
declaration ??= child;
|
|
2414
2508
|
}
|
|
2415
|
-
|
|
2416
|
-
return;
|
|
2417
|
-
});
|
|
2509
|
+
}
|
|
2418
2510
|
let returnType = func.returnType ?? func.signature?.returnType;
|
|
2419
2511
|
if (returnType) {
|
|
2420
2512
|
const { t } = returnType;
|
|
2421
2513
|
let m;
|
|
2422
2514
|
if (m = t.type, m === "TypePredicate") {
|
|
2423
|
-
|
|
2424
|
-
|
|
2515
|
+
const token = { token: "boolean" };
|
|
2516
|
+
const literal = {
|
|
2517
|
+
type: "TypeLiteral",
|
|
2518
|
+
t: token,
|
|
2519
|
+
children: [token]
|
|
2520
|
+
};
|
|
2521
|
+
returnType = {
|
|
2522
|
+
type: "ReturnTypeAnnotation",
|
|
2523
|
+
ts: true,
|
|
2524
|
+
t: literal,
|
|
2525
|
+
children: [": ", literal]
|
|
2526
|
+
};
|
|
2527
|
+
} else if (m === "TypeAsserts") {
|
|
2425
2528
|
returnType = void 0;
|
|
2426
2529
|
}
|
|
2427
2530
|
}
|
|
2531
|
+
if (returnType) {
|
|
2532
|
+
returnType = deepCopy(returnType);
|
|
2533
|
+
addParentPointers(returnType);
|
|
2534
|
+
if (func.signature.modifier.async) {
|
|
2535
|
+
replaceNode(
|
|
2536
|
+
returnType.t,
|
|
2537
|
+
makeNode(wrapTypeInApplication(returnType.t, "Awaited")),
|
|
2538
|
+
returnType
|
|
2539
|
+
);
|
|
2540
|
+
}
|
|
2541
|
+
}
|
|
2428
2542
|
if (declaration) {
|
|
2429
2543
|
if (!(declaration.typeSuffix != null)) {
|
|
2430
2544
|
declaration.children[1] = declaration.typeSuffix = returnType;
|
|
@@ -2432,11 +2546,11 @@ function processReturnValue(func) {
|
|
|
2432
2546
|
} else {
|
|
2433
2547
|
block.expressions.unshift([
|
|
2434
2548
|
getIndent(block.expressions[0]),
|
|
2435
|
-
{
|
|
2549
|
+
makeNode({
|
|
2436
2550
|
type: "Declaration",
|
|
2437
2551
|
children: ["let ", ref, returnType],
|
|
2438
2552
|
names: []
|
|
2439
|
-
},
|
|
2553
|
+
}),
|
|
2440
2554
|
";"
|
|
2441
2555
|
]);
|
|
2442
2556
|
}
|
|
@@ -2854,19 +2968,15 @@ function wrapIterationReturningResults(statement, collect) {
|
|
|
2854
2968
|
"wrapIterationReturningResults should not be called twice on the same statement"
|
|
2855
2969
|
);
|
|
2856
2970
|
const resultsRef = statement.resultsRef = makeRef("results");
|
|
2857
|
-
const
|
|
2971
|
+
const declaration = iterationDeclaration(statement);
|
|
2858
2972
|
const { ancestor, child } = findAncestor(statement, ($4) => $4.type === "BlockStatement");
|
|
2859
2973
|
assert.notNull(ancestor, `Could not find block containing ${statement.type}`);
|
|
2860
2974
|
const index = findChildIndex(ancestor.expressions, child);
|
|
2975
|
+
assert.notEqual(index, -1, `Could not find ${statement.type} in containing block`);
|
|
2861
2976
|
const iterationTuple = ancestor.expressions[index];
|
|
2862
2977
|
ancestor.expressions.splice(index, 0, [iterationTuple[0], declaration, ";"]);
|
|
2863
2978
|
iterationTuple[0] = "";
|
|
2864
2979
|
braceBlock(ancestor);
|
|
2865
|
-
if (!breakWithOnly) {
|
|
2866
|
-
assignResults(statement.block, (node) => {
|
|
2867
|
-
return [resultsRef, ".push(", node, ")"];
|
|
2868
|
-
});
|
|
2869
|
-
}
|
|
2870
2980
|
if (collect) {
|
|
2871
2981
|
statement.children.push(collect(resultsRef));
|
|
2872
2982
|
} else {
|
|
@@ -2874,15 +2984,16 @@ function wrapIterationReturningResults(statement, collect) {
|
|
|
2874
2984
|
}
|
|
2875
2985
|
}
|
|
2876
2986
|
function iterationDeclaration(statement) {
|
|
2877
|
-
const { resultsRef } = statement;
|
|
2878
|
-
|
|
2987
|
+
const { resultsRef, block } = statement;
|
|
2988
|
+
const reduction = statement.type === "ForStatement" && statement.reduction;
|
|
2989
|
+
let decl = reduction ? "let" : "const";
|
|
2879
2990
|
if (statement.type === "IterationStatement" || statement.type === "ForStatement") {
|
|
2880
2991
|
if (processBreakContinueWith(statement)) {
|
|
2881
2992
|
decl = "let";
|
|
2882
2993
|
}
|
|
2883
2994
|
}
|
|
2884
2995
|
const breakWithOnly = decl === "let" && isLoopStatement(statement) && gatherRecursive(
|
|
2885
|
-
|
|
2996
|
+
block,
|
|
2886
2997
|
(s) => s.type === "BreakStatement" && !s.with,
|
|
2887
2998
|
(s) => isFunction(s) || s.type === "IterationStatement"
|
|
2888
2999
|
).length === 0;
|
|
@@ -2893,14 +3004,124 @@ function iterationDeclaration(statement) {
|
|
|
2893
3004
|
names: [],
|
|
2894
3005
|
bindings: []
|
|
2895
3006
|
};
|
|
2896
|
-
if (
|
|
2897
|
-
declaration.children.push("=
|
|
3007
|
+
if (reduction) {
|
|
3008
|
+
declaration.children.push("=" + (() => {
|
|
3009
|
+
switch (reduction.subtype) {
|
|
3010
|
+
case "some": {
|
|
3011
|
+
return "false";
|
|
3012
|
+
}
|
|
3013
|
+
case "every": {
|
|
3014
|
+
return "true";
|
|
3015
|
+
}
|
|
3016
|
+
case "min": {
|
|
3017
|
+
return "Infinity";
|
|
3018
|
+
}
|
|
3019
|
+
case "max": {
|
|
3020
|
+
return "-Infinity";
|
|
3021
|
+
}
|
|
3022
|
+
case "product": {
|
|
3023
|
+
return "1";
|
|
3024
|
+
}
|
|
3025
|
+
default: {
|
|
3026
|
+
return "0";
|
|
3027
|
+
}
|
|
3028
|
+
}
|
|
3029
|
+
})());
|
|
2898
3030
|
} else {
|
|
2899
|
-
if (
|
|
2900
|
-
declaration.children.push("
|
|
3031
|
+
if (decl === "const") {
|
|
3032
|
+
declaration.children.push("=[]");
|
|
3033
|
+
} else {
|
|
3034
|
+
if (!breakWithOnly) {
|
|
3035
|
+
declaration.children.push(";", resultsRef, "=[]");
|
|
3036
|
+
}
|
|
3037
|
+
}
|
|
3038
|
+
}
|
|
3039
|
+
if (!breakWithOnly) {
|
|
3040
|
+
if (iterationDefaultBody(statement)) {
|
|
3041
|
+
return declaration;
|
|
3042
|
+
}
|
|
3043
|
+
if (!block.empty) {
|
|
3044
|
+
assignResults(block, (node) => {
|
|
3045
|
+
if (!reduction) {
|
|
3046
|
+
return [resultsRef, ".push(", node, ")"];
|
|
3047
|
+
}
|
|
3048
|
+
switch (reduction.subtype) {
|
|
3049
|
+
case "some": {
|
|
3050
|
+
return ["if (", node, ") {", resultsRef, " = true; break}"];
|
|
3051
|
+
}
|
|
3052
|
+
case "every": {
|
|
3053
|
+
return [
|
|
3054
|
+
"if (!",
|
|
3055
|
+
makeLeftHandSideExpression(node),
|
|
3056
|
+
") {",
|
|
3057
|
+
resultsRef,
|
|
3058
|
+
" = false; break}"
|
|
3059
|
+
];
|
|
3060
|
+
}
|
|
3061
|
+
case "count": {
|
|
3062
|
+
return ["if (", node, ") ++", resultsRef];
|
|
3063
|
+
}
|
|
3064
|
+
case "sum": {
|
|
3065
|
+
return [resultsRef, " += ", node];
|
|
3066
|
+
}
|
|
3067
|
+
case "product": {
|
|
3068
|
+
return [resultsRef, " *= ", node];
|
|
3069
|
+
}
|
|
3070
|
+
case "min": {
|
|
3071
|
+
return [resultsRef, " = Math.min(", resultsRef, ", ", node, ")"];
|
|
3072
|
+
}
|
|
3073
|
+
case "max": {
|
|
3074
|
+
return [resultsRef, " = Math.max(", resultsRef, ", ", node, ")"];
|
|
3075
|
+
}
|
|
3076
|
+
}
|
|
3077
|
+
});
|
|
2901
3078
|
}
|
|
2902
3079
|
}
|
|
2903
|
-
return
|
|
3080
|
+
return declaration;
|
|
3081
|
+
}
|
|
3082
|
+
function iterationDefaultBody(statement) {
|
|
3083
|
+
const { block, resultsRef } = statement;
|
|
3084
|
+
if (!block.empty) {
|
|
3085
|
+
return false;
|
|
3086
|
+
}
|
|
3087
|
+
const reduction = statement.type === "ForStatement" && statement.reduction;
|
|
3088
|
+
function fillBlock(expression) {
|
|
3089
|
+
let ref8;
|
|
3090
|
+
let m2;
|
|
3091
|
+
if (m2 = (ref8 = block.expressions)[ref8.length - 1], Array.isArray(m2) && m2.length >= 2 && typeof m2[1] === "object" && m2[1] != null && "type" in m2[1] && m2[1].type === "EmptyStatement" && "implicit" in m2[1] && m2[1].implicit === true) {
|
|
3092
|
+
block.expressions.pop();
|
|
3093
|
+
}
|
|
3094
|
+
block.expressions.push(expression);
|
|
3095
|
+
block.empty = false;
|
|
3096
|
+
return braceBlock(block);
|
|
3097
|
+
}
|
|
3098
|
+
if (reduction) {
|
|
3099
|
+
switch (reduction.subtype) {
|
|
3100
|
+
case "some": {
|
|
3101
|
+
fillBlock(["", [resultsRef, " = true; break"]]);
|
|
3102
|
+
block.empty = false;
|
|
3103
|
+
braceBlock(block);
|
|
3104
|
+
return true;
|
|
3105
|
+
}
|
|
3106
|
+
case "every": {
|
|
3107
|
+
fillBlock(["", [resultsRef, " = false; break"]]);
|
|
3108
|
+
block.empty = false;
|
|
3109
|
+
braceBlock(block);
|
|
3110
|
+
return true;
|
|
3111
|
+
}
|
|
3112
|
+
case "count": {
|
|
3113
|
+
fillBlock(["", ["++", resultsRef]]);
|
|
3114
|
+
block.empty = false;
|
|
3115
|
+
braceBlock(block);
|
|
3116
|
+
return true;
|
|
3117
|
+
}
|
|
3118
|
+
}
|
|
3119
|
+
}
|
|
3120
|
+
if (statement.type === "ForStatement" && statement.declaration?.type === "ForDeclaration") {
|
|
3121
|
+
fillBlock(["", patternAsValue(statement.declaration.binding)]);
|
|
3122
|
+
block.empty = false;
|
|
3123
|
+
}
|
|
3124
|
+
return false;
|
|
2904
3125
|
}
|
|
2905
3126
|
function processParams(f) {
|
|
2906
3127
|
const { type, parameters, block } = f;
|
|
@@ -2931,18 +3152,18 @@ function processParams(f) {
|
|
|
2931
3152
|
const classExpressions = ancestor.body.expressions;
|
|
2932
3153
|
let index = findChildIndex(classExpressions, f);
|
|
2933
3154
|
assert.notEqual(index, -1, "Could not find constructor in class");
|
|
2934
|
-
let
|
|
2935
|
-
while (
|
|
3155
|
+
let m3;
|
|
3156
|
+
while (m3 = classExpressions[index - 1]?.[1], typeof m3 === "object" && m3 != null && "type" in m3 && m3.type === "MethodDefinition" && "name" in m3 && m3.name === "constructor") {
|
|
2936
3157
|
index--;
|
|
2937
3158
|
}
|
|
2938
3159
|
const fStatement = classExpressions[index];
|
|
2939
|
-
for (let
|
|
2940
|
-
const parameter =
|
|
3160
|
+
for (let ref9 = gatherRecursive(parameters, ($9) => $9.type === "Parameter"), i2 = 0, len1 = ref9.length; i2 < len1; i2++) {
|
|
3161
|
+
const parameter = ref9[i2];
|
|
2941
3162
|
if (!parameter.typeSuffix) {
|
|
2942
3163
|
continue;
|
|
2943
3164
|
}
|
|
2944
|
-
for (let
|
|
2945
|
-
const binding =
|
|
3165
|
+
for (let ref10 = gatherRecursive(parameter, ($10) => $10.type === "AtBinding"), i3 = 0, len22 = ref10.length; i3 < len22; i3++) {
|
|
3166
|
+
const binding = ref10[i3];
|
|
2946
3167
|
const typeSuffix = binding.parent?.typeSuffix;
|
|
2947
3168
|
if (!typeSuffix) {
|
|
2948
3169
|
continue;
|
|
@@ -2996,11 +3217,11 @@ function processParams(f) {
|
|
|
2996
3217
|
}
|
|
2997
3218
|
function processSignature(f) {
|
|
2998
3219
|
const { block, signature } = f;
|
|
2999
|
-
if (
|
|
3220
|
+
if (!f.async?.length && hasAwait(block)) {
|
|
3000
3221
|
f.async.push("async ");
|
|
3001
3222
|
signature.modifier.async = true;
|
|
3002
3223
|
}
|
|
3003
|
-
if (
|
|
3224
|
+
if (!f.generator?.length && hasYield(block)) {
|
|
3004
3225
|
if (f.type === "ArrowFunction") {
|
|
3005
3226
|
gatherRecursiveWithinFunction(block, ($11) => $11.type === "YieldExpression").forEach((y) => {
|
|
3006
3227
|
const i = y.children.findIndex(($12) => $12.type === "Yield");
|
|
@@ -3014,21 +3235,26 @@ function processSignature(f) {
|
|
|
3014
3235
|
signature.modifier.generator = true;
|
|
3015
3236
|
}
|
|
3016
3237
|
}
|
|
3238
|
+
if (signature.modifier.async && !signature.modifier.generator && signature.returnType && !isPromiseType(signature.returnType.t)) {
|
|
3239
|
+
replaceNode(signature.returnType.t, wrapTypeInPromise(signature.returnType.t));
|
|
3240
|
+
}
|
|
3017
3241
|
}
|
|
3018
3242
|
function processFunctions(statements, config2) {
|
|
3019
|
-
gatherRecursiveAll(statements, (
|
|
3243
|
+
for (let ref11 = gatherRecursiveAll(statements, ($13) => $13.type === "FunctionExpression" || $13.type === "ArrowFunction"), i4 = 0, len3 = ref11.length; i4 < len3; i4++) {
|
|
3244
|
+
const f = ref11[i4];
|
|
3020
3245
|
if (f.type === "FunctionExpression") {
|
|
3021
3246
|
implicitFunctionBlock(f);
|
|
3022
3247
|
}
|
|
3023
3248
|
processSignature(f);
|
|
3024
3249
|
processParams(f);
|
|
3025
|
-
|
|
3026
|
-
}
|
|
3027
|
-
gatherRecursiveAll(statements, (
|
|
3250
|
+
processReturn(f, config2.implicitReturns);
|
|
3251
|
+
}
|
|
3252
|
+
for (let ref12 = gatherRecursiveAll(statements, ($14) => $14.type === "MethodDefinition"), i5 = 0, len4 = ref12.length; i5 < len4; i5++) {
|
|
3253
|
+
const f = ref12[i5];
|
|
3028
3254
|
implicitFunctionBlock(f);
|
|
3029
3255
|
processParams(f);
|
|
3030
|
-
|
|
3031
|
-
}
|
|
3256
|
+
processReturn(f, config2.implicitReturns);
|
|
3257
|
+
}
|
|
3032
3258
|
}
|
|
3033
3259
|
function expressionizeIteration(exp) {
|
|
3034
3260
|
let { async, generator, block, children, statement } = exp;
|
|
@@ -3041,47 +3267,65 @@ function expressionizeIteration(exp) {
|
|
|
3041
3267
|
updateParentPointers(exp);
|
|
3042
3268
|
return;
|
|
3043
3269
|
}
|
|
3270
|
+
let statements;
|
|
3044
3271
|
if (generator) {
|
|
3272
|
+
if (statement.reduction) {
|
|
3273
|
+
children.unshift({
|
|
3274
|
+
type: "Error",
|
|
3275
|
+
message: `Cannot use reduction (${statement.reduction.subtype}) with generators`
|
|
3276
|
+
});
|
|
3277
|
+
}
|
|
3278
|
+
iterationDefaultBody(statement);
|
|
3045
3279
|
assignResults(block, (node) => {
|
|
3046
3280
|
return {
|
|
3047
3281
|
type: "YieldExpression",
|
|
3048
3282
|
expression: node,
|
|
3049
|
-
children: [
|
|
3283
|
+
children: [
|
|
3284
|
+
{
|
|
3285
|
+
type: "Yield",
|
|
3286
|
+
token: "yield "
|
|
3287
|
+
},
|
|
3288
|
+
node
|
|
3289
|
+
]
|
|
3050
3290
|
};
|
|
3051
3291
|
});
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
wrapIIFE([
|
|
3056
|
-
["", statement, void 0],
|
|
3057
|
-
// Prevent implicit return in generator, by adding an explicit return
|
|
3058
|
-
["", {
|
|
3059
|
-
type: "ReturnStatement",
|
|
3060
|
-
expression: void 0,
|
|
3061
|
-
children: [";return"]
|
|
3062
|
-
}, void 0]
|
|
3063
|
-
], async, generator)
|
|
3064
|
-
);
|
|
3292
|
+
statements = [
|
|
3293
|
+
["", statement]
|
|
3294
|
+
];
|
|
3065
3295
|
} else {
|
|
3066
3296
|
const resultsRef = statement.resultsRef ??= makeRef("results");
|
|
3067
|
-
const
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3297
|
+
const declaration = iterationDeclaration(statement);
|
|
3298
|
+
statements = [
|
|
3299
|
+
["", declaration, ";"],
|
|
3300
|
+
["", statement, statement.block.bare ? ";" : void 0],
|
|
3301
|
+
["", resultsRef]
|
|
3302
|
+
];
|
|
3303
|
+
}
|
|
3304
|
+
let done;
|
|
3305
|
+
if (!async) {
|
|
3306
|
+
let ref13;
|
|
3307
|
+
if ((ref13 = blockContainingStatement(exp)) && typeof ref13 === "object" && "block" in ref13 && "index" in ref13) {
|
|
3308
|
+
const { block: parentBlock, index } = ref13;
|
|
3309
|
+
statements[0][0] = parentBlock.expressions[index][0];
|
|
3310
|
+
parentBlock.expressions.splice(index, index + 1 - index, ...statements);
|
|
3311
|
+
updateParentPointers(parentBlock);
|
|
3312
|
+
braceBlock(parentBlock);
|
|
3313
|
+
done = true;
|
|
3073
3314
|
}
|
|
3074
|
-
children.splice(
|
|
3075
|
-
i,
|
|
3076
|
-
1,
|
|
3077
|
-
wrapIIFE([
|
|
3078
|
-
["", declaration, ";"],
|
|
3079
|
-
["", statement, void 0],
|
|
3080
|
-
["", wrapWithReturn(resultsRef)]
|
|
3081
|
-
], async)
|
|
3082
|
-
);
|
|
3083
3315
|
}
|
|
3084
|
-
|
|
3316
|
+
if (!done) {
|
|
3317
|
+
if (!generator) {
|
|
3318
|
+
statements[statements.length - 1][1] = wrapWithReturn(statements[statements.length - 1][1]);
|
|
3319
|
+
}
|
|
3320
|
+
children.splice(i, 1, wrapIIFE(statements, async, generator));
|
|
3321
|
+
updateParentPointers(exp);
|
|
3322
|
+
}
|
|
3323
|
+
}
|
|
3324
|
+
function processIterationExpressions(statements) {
|
|
3325
|
+
for (let ref14 = gatherRecursiveAll(statements, ($15) => $15.type === "IterationExpression"), i6 = 0, len5 = ref14.length; i6 < len5; i6++) {
|
|
3326
|
+
const s = ref14[i6];
|
|
3327
|
+
expressionizeIteration(s);
|
|
3328
|
+
}
|
|
3085
3329
|
}
|
|
3086
3330
|
function skipImplicitArguments(args) {
|
|
3087
3331
|
if (args.length === 1) {
|
|
@@ -3105,12 +3349,12 @@ function processCoffeeDo(ws, expression) {
|
|
|
3105
3349
|
...parameters,
|
|
3106
3350
|
children: (() => {
|
|
3107
3351
|
const results1 = [];
|
|
3108
|
-
for (let
|
|
3109
|
-
let parameter =
|
|
3352
|
+
for (let ref15 = parameters.children, i7 = 0, len6 = ref15.length; i7 < len6; i7++) {
|
|
3353
|
+
let parameter = ref15[i7];
|
|
3110
3354
|
if (typeof parameter === "object" && parameter != null && "type" in parameter && parameter.type === "Parameter") {
|
|
3111
|
-
let
|
|
3112
|
-
if (
|
|
3113
|
-
const initializer =
|
|
3355
|
+
let ref16;
|
|
3356
|
+
if (ref16 = parameter.initializer) {
|
|
3357
|
+
const initializer = ref16;
|
|
3114
3358
|
args.push(initializer.expression, parameter.delim);
|
|
3115
3359
|
parameter = {
|
|
3116
3360
|
...parameter,
|
|
@@ -3131,7 +3375,7 @@ function processCoffeeDo(ws, expression) {
|
|
|
3131
3375
|
expression = {
|
|
3132
3376
|
...expression,
|
|
3133
3377
|
parameters: newParameters,
|
|
3134
|
-
children: expression.children.map(($
|
|
3378
|
+
children: expression.children.map(($16) => $16 === parameters ? newParameters : $16)
|
|
3135
3379
|
};
|
|
3136
3380
|
}
|
|
3137
3381
|
return {
|
|
@@ -3153,7 +3397,7 @@ function makeAmpersandFunction(rhs) {
|
|
|
3153
3397
|
ref = makeRef("$");
|
|
3154
3398
|
inplacePrepend(ref, body);
|
|
3155
3399
|
}
|
|
3156
|
-
if (startsWithPredicate(body, ($
|
|
3400
|
+
if (startsWithPredicate(body, ($17) => $17.type === "ObjectExpression")) {
|
|
3157
3401
|
body = makeLeftHandSideExpression(body);
|
|
3158
3402
|
}
|
|
3159
3403
|
const parameters = makeNode({
|
|
@@ -3393,6 +3637,28 @@ function needsPrecedingSemicolon(exp) {
|
|
|
3393
3637
|
}
|
|
3394
3638
|
}
|
|
3395
3639
|
}
|
|
3640
|
+
function blockContainingStatement(exp) {
|
|
3641
|
+
let child = exp;
|
|
3642
|
+
let parent = exp.parent;
|
|
3643
|
+
let m;
|
|
3644
|
+
while (parent != null && (m = parent.type, m === "StatementExpression" || m === "PipelineExpression" || m === "UnwrappedExpression")) {
|
|
3645
|
+
child = parent;
|
|
3646
|
+
parent = parent.parent;
|
|
3647
|
+
}
|
|
3648
|
+
if (!(parent?.type === "BlockStatement")) {
|
|
3649
|
+
return;
|
|
3650
|
+
}
|
|
3651
|
+
const index = findChildIndex(parent.expressions, child);
|
|
3652
|
+
assert.notEqual(index, -1, "Could not find statement in parent block");
|
|
3653
|
+
if (!(parent.expressions[index][1] === child)) {
|
|
3654
|
+
return;
|
|
3655
|
+
}
|
|
3656
|
+
return {
|
|
3657
|
+
block: parent,
|
|
3658
|
+
index,
|
|
3659
|
+
child
|
|
3660
|
+
};
|
|
3661
|
+
}
|
|
3396
3662
|
|
|
3397
3663
|
// source/parser/op.civet
|
|
3398
3664
|
var precedenceOrder = [
|
|
@@ -4654,8 +4920,9 @@ function convertWithClause(withClause, extendsClause) {
|
|
|
4654
4920
|
|
|
4655
4921
|
// source/parser/unary.civet
|
|
4656
4922
|
function processUnaryExpression(pre, exp, post) {
|
|
4657
|
-
if (!(pre.length || post))
|
|
4923
|
+
if (!(pre.length || post)) {
|
|
4658
4924
|
return exp;
|
|
4925
|
+
}
|
|
4659
4926
|
if (post?.token === "?") {
|
|
4660
4927
|
post = {
|
|
4661
4928
|
$loc: post.$loc,
|
|
@@ -4686,29 +4953,25 @@ function processUnaryExpression(pre, exp, post) {
|
|
|
4686
4953
|
}
|
|
4687
4954
|
return exp;
|
|
4688
4955
|
}
|
|
4689
|
-
if (exp
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
children: [literal, post]
|
|
4703
|
-
};
|
|
4704
|
-
}
|
|
4705
|
-
return literal;
|
|
4956
|
+
if (exp?.type === "Literal" && pre.length) {
|
|
4957
|
+
let [...ref] = pre, [last] = ref.splice(-1);
|
|
4958
|
+
let m;
|
|
4959
|
+
if (m = last?.token, m === "+" || m === "-") {
|
|
4960
|
+
last = last;
|
|
4961
|
+
exp = {
|
|
4962
|
+
...exp,
|
|
4963
|
+
children: [last, ...exp.children],
|
|
4964
|
+
raw: `${last.token}${exp.raw}`
|
|
4965
|
+
};
|
|
4966
|
+
pre = pre.slice(0, -1);
|
|
4967
|
+
if (!(pre.length || post)) {
|
|
4968
|
+
return exp;
|
|
4706
4969
|
}
|
|
4707
4970
|
}
|
|
4708
4971
|
}
|
|
4709
|
-
let
|
|
4710
|
-
while (
|
|
4711
|
-
const l =
|
|
4972
|
+
let ref1;
|
|
4973
|
+
while (ref1 = pre.length) {
|
|
4974
|
+
const l = ref1;
|
|
4712
4975
|
const last = pre[l - 1];
|
|
4713
4976
|
if (last.type === "Await") {
|
|
4714
4977
|
if (last.op) {
|
|
@@ -4721,8 +4984,8 @@ function processUnaryExpression(pre, exp, post) {
|
|
|
4721
4984
|
};
|
|
4722
4985
|
pre = pre.slice(0, -1);
|
|
4723
4986
|
} else {
|
|
4724
|
-
let
|
|
4725
|
-
if (
|
|
4987
|
+
let m1;
|
|
4988
|
+
if (m1 = firstNonSpace(exp), typeof m1 === "string" && /^[ \t]*\n/.test(m1) || typeof m1 === "object" && m1 != null && "token" in m1 && typeof m1.token === "string" && /^[ \t]*\n/.test(m1.token)) {
|
|
4726
4989
|
exp = parenthesizeExpression(exp);
|
|
4727
4990
|
}
|
|
4728
4991
|
exp = {
|
|
@@ -4826,6 +5089,7 @@ function constructInvocation(fn, arg) {
|
|
|
4826
5089
|
updateParentPointers(ref);
|
|
4827
5090
|
return makeNode({
|
|
4828
5091
|
type: "UnwrappedExpression",
|
|
5092
|
+
expression: body,
|
|
4829
5093
|
children: [skipIfOnlyWS(fn.leadingComment), body, skipIfOnlyWS(fn.trailingComment)]
|
|
4830
5094
|
});
|
|
4831
5095
|
}
|
|
@@ -4862,6 +5126,17 @@ function constructPipeStep(fn, arg, returning) {
|
|
|
4862
5126
|
returning
|
|
4863
5127
|
];
|
|
4864
5128
|
}
|
|
5129
|
+
case "throw": {
|
|
5130
|
+
const statement = { type: "ThrowStatement", children };
|
|
5131
|
+
return [
|
|
5132
|
+
{
|
|
5133
|
+
type: "StatementExpression",
|
|
5134
|
+
statement,
|
|
5135
|
+
children: [statement]
|
|
5136
|
+
},
|
|
5137
|
+
null
|
|
5138
|
+
];
|
|
5139
|
+
}
|
|
4865
5140
|
case "return": {
|
|
4866
5141
|
return [{
|
|
4867
5142
|
type: "ReturnStatement",
|
|
@@ -5146,25 +5421,40 @@ function forRange(open, forDeclaration, range, stepExp, close) {
|
|
|
5146
5421
|
const infinite = typeof end === "object" && end != null && "type" in end && end.type === "Identifier" && "name" in end && end.name === "Infinity";
|
|
5147
5422
|
let stepRef, asc;
|
|
5148
5423
|
if (stepExp) {
|
|
5149
|
-
stepExp =
|
|
5424
|
+
stepExp = trimFirstSpace(stepExp);
|
|
5150
5425
|
stepRef = maybeRef(stepExp, "step");
|
|
5151
5426
|
} else if (infinite) {
|
|
5152
|
-
stepExp = stepRef =
|
|
5427
|
+
stepExp = stepRef = makeNumericLiteral(1);
|
|
5153
5428
|
} else if (increasing != null) {
|
|
5154
5429
|
if (increasing) {
|
|
5155
|
-
stepExp = stepRef =
|
|
5430
|
+
stepExp = stepRef = makeNumericLiteral(1);
|
|
5156
5431
|
asc = true;
|
|
5157
5432
|
} else {
|
|
5158
|
-
stepExp = stepRef =
|
|
5433
|
+
stepExp = stepRef = makeNumericLiteral(-1);
|
|
5159
5434
|
asc = false;
|
|
5160
5435
|
}
|
|
5161
5436
|
}
|
|
5162
5437
|
let ref2;
|
|
5438
|
+
if (stepExp?.type === "Literal") {
|
|
5439
|
+
try {
|
|
5440
|
+
ref2 = literalValue(stepExp);
|
|
5441
|
+
} catch (e) {
|
|
5442
|
+
ref2 = void 0;
|
|
5443
|
+
}
|
|
5444
|
+
} else {
|
|
5445
|
+
ref2 = void 0;
|
|
5446
|
+
}
|
|
5447
|
+
;
|
|
5448
|
+
const stepValue = ref2;
|
|
5449
|
+
if (typeof stepValue === "number") {
|
|
5450
|
+
asc = stepValue > 0;
|
|
5451
|
+
}
|
|
5452
|
+
let ref3;
|
|
5163
5453
|
if (stepRef)
|
|
5164
|
-
|
|
5454
|
+
ref3 = start;
|
|
5165
5455
|
else
|
|
5166
|
-
|
|
5167
|
-
let startRef =
|
|
5456
|
+
ref3 = maybeRef(start, "start");
|
|
5457
|
+
let startRef = ref3;
|
|
5168
5458
|
let endRef = maybeRef(end, "end");
|
|
5169
5459
|
const startRefDec = startRef !== start ? [startRef, " = ", start, ", "] : [];
|
|
5170
5460
|
const endRefDec = endRef !== end ? [endRef, " = ", end, ", "] : [];
|
|
@@ -5176,11 +5466,11 @@ function forRange(open, forDeclaration, range, stepExp, close) {
|
|
|
5176
5466
|
];
|
|
5177
5467
|
}
|
|
5178
5468
|
let ascDec = [], ascRef;
|
|
5179
|
-
if (
|
|
5469
|
+
if (stepExp) {
|
|
5180
5470
|
if (!(stepRef === stepExp)) {
|
|
5181
5471
|
ascDec = [", ", stepRef, " = ", stepExp];
|
|
5182
5472
|
}
|
|
5183
|
-
} else if ("Literal"
|
|
5473
|
+
} else if (start?.type === "Literal" && "Literal" === end?.type) {
|
|
5184
5474
|
asc = literalValue(start) <= literalValue(end);
|
|
5185
5475
|
if ("StringLiteral" === start.subtype && start.subtype === end.subtype) {
|
|
5186
5476
|
startRef = literalValue(start).charCodeAt(0).toString();
|
|
@@ -5191,10 +5481,11 @@ function forRange(open, forDeclaration, range, stepExp, close) {
|
|
|
5191
5481
|
ascDec = [", ", ascRef, " = ", startRef, " <= ", endRef];
|
|
5192
5482
|
}
|
|
5193
5483
|
let varAssign = [], varLetAssign = varAssign, varLet = varAssign, blockPrefix;
|
|
5194
|
-
|
|
5195
|
-
|
|
5484
|
+
let names = forDeclaration?.names;
|
|
5485
|
+
if (forDeclaration?.decl) {
|
|
5486
|
+
if (forDeclaration.decl === "let") {
|
|
5196
5487
|
const varName = forDeclaration.children.splice(1);
|
|
5197
|
-
varAssign = [...
|
|
5488
|
+
varAssign = [...trimFirstSpace(varName), " = "];
|
|
5198
5489
|
varLet = [",", ...varName, " = ", counterRef];
|
|
5199
5490
|
} else {
|
|
5200
5491
|
const value = "StringLiteral" === start.subtype ? ["String.fromCharCode(", counterRef, ")"] : counterRef;
|
|
@@ -5203,26 +5494,41 @@ function forRange(open, forDeclaration, range, stepExp, close) {
|
|
|
5203
5494
|
];
|
|
5204
5495
|
}
|
|
5205
5496
|
} else if (forDeclaration) {
|
|
5497
|
+
assert.equal(
|
|
5498
|
+
forDeclaration.type,
|
|
5499
|
+
"AssignmentExpression",
|
|
5500
|
+
"Internal error: Coffee-style for loop must be an assignment expression"
|
|
5501
|
+
);
|
|
5206
5502
|
varAssign = varLetAssign = [forDeclaration, " = "];
|
|
5503
|
+
names = [];
|
|
5207
5504
|
}
|
|
5208
5505
|
const declaration = {
|
|
5209
5506
|
type: "Declaration",
|
|
5210
5507
|
children: ["let ", ...startRefDec, ...endRefDec, counterRef, " = ", ...varLetAssign, startRef, ...varLet, ...ascDec],
|
|
5211
|
-
names
|
|
5508
|
+
names
|
|
5212
5509
|
};
|
|
5213
5510
|
const counterPart = right.inclusive ? [counterRef, " <= ", endRef, " : ", counterRef, " >= ", endRef] : [counterRef, " < ", endRef, " : ", counterRef, " > ", endRef];
|
|
5214
|
-
const condition = infinite ? [] : asc != null ? asc ? counterPart.slice(0, 3) : counterPart.slice(4) : stepRef ? [stepRef, " !== 0 && (", stepRef, " > 0 ? ", ...counterPart, ")"] : [ascRef, " ? ", ...counterPart];
|
|
5215
|
-
const increment =
|
|
5511
|
+
const condition = infinite || stepValue === 0 ? [] : asc != null ? asc ? counterPart.slice(0, 3) : counterPart.slice(4) : stepRef ? [stepRef, " !== 0 && (", stepRef, " > 0 ? ", ...counterPart, ")"] : [ascRef, " ? ", ...counterPart];
|
|
5512
|
+
const increment = stepValue === 1 ? [...varAssign, "++", counterRef] : stepValue === -1 ? [...varAssign, "--", counterRef] : stepRef ? [...varAssign, counterRef, " += ", stepRef] : ascRef ? [...varAssign, ascRef, " ? ++", counterRef, " : --", counterRef] : [...varAssign, asc ? "++" : "--", counterRef];
|
|
5216
5513
|
return {
|
|
5217
|
-
declaration,
|
|
5514
|
+
// This declaration doesn't always appear in the output,
|
|
5515
|
+
// but it's still helpful for determining the primary loop variable
|
|
5516
|
+
declaration: forDeclaration,
|
|
5218
5517
|
children: [range.error, open, declaration, "; ", ...condition, "; ", ...increment, close],
|
|
5219
5518
|
blockPrefix
|
|
5220
5519
|
};
|
|
5221
5520
|
}
|
|
5222
|
-
function processForInOf($0
|
|
5521
|
+
function processForInOf($0) {
|
|
5223
5522
|
let [awaits, eachOwn, open, declaration, declaration2, ws, inOf, exp, step, close] = $0;
|
|
5224
5523
|
if (exp.type === "RangeExpression" && inOf.token === "of" && !declaration2) {
|
|
5225
|
-
return forRange(
|
|
5524
|
+
return forRange(
|
|
5525
|
+
open,
|
|
5526
|
+
declaration,
|
|
5527
|
+
exp,
|
|
5528
|
+
step && prepend(trimFirstSpace(step[0]), trimFirstSpace(step[2])),
|
|
5529
|
+
// omit "by" token
|
|
5530
|
+
close
|
|
5531
|
+
);
|
|
5226
5532
|
} else if (step) {
|
|
5227
5533
|
throw new Error("for..of/in cannot use 'by' except with range literals");
|
|
5228
5534
|
}
|
|
@@ -5238,22 +5544,22 @@ function processForInOf($0, getRef) {
|
|
|
5238
5544
|
if (declaration2) {
|
|
5239
5545
|
const [, , ws22, decl22] = declaration2;
|
|
5240
5546
|
blockPrefix.push(["", [
|
|
5241
|
-
|
|
5547
|
+
trimFirstSpace(ws22),
|
|
5242
5548
|
decl22,
|
|
5243
5549
|
" = ",
|
|
5244
5550
|
counterRef
|
|
5245
5551
|
], ";"]);
|
|
5246
5552
|
assignmentNames.push(...decl22.names);
|
|
5247
5553
|
}
|
|
5248
|
-
const expRefDec = expRef2 !== exp ? [
|
|
5554
|
+
const expRefDec = expRef2 !== exp ? [trimFirstSpace(expRef2), " = ", trimFirstSpace(exp), ", "] : [];
|
|
5249
5555
|
blockPrefix.push(["", {
|
|
5250
5556
|
type: "Declaration",
|
|
5251
|
-
children: [declaration, " = ",
|
|
5557
|
+
children: [declaration, " = ", trimFirstSpace(expRef2), "[", counterRef, "]"],
|
|
5252
5558
|
names: assignmentNames
|
|
5253
5559
|
}, ";"]);
|
|
5254
5560
|
declaration = {
|
|
5255
5561
|
type: "Declaration",
|
|
5256
|
-
children: ["let ", ...expRefDec, counterRef, " = 0, ", lenRef, " = ",
|
|
5562
|
+
children: ["let ", ...expRefDec, counterRef, " = 0, ", lenRef, " = ", trimFirstSpace(expRef2), ".length"],
|
|
5257
5563
|
names: []
|
|
5258
5564
|
};
|
|
5259
5565
|
const condition = [counterRef, " < ", lenRef, "; "];
|
|
@@ -5301,7 +5607,7 @@ function processForInOf($0, getRef) {
|
|
|
5301
5607
|
return {
|
|
5302
5608
|
declaration,
|
|
5303
5609
|
blockPrefix,
|
|
5304
|
-
children: [awaits, eachOwnError, open, declaration, ws, inOf, expRef ?? exp,
|
|
5610
|
+
children: [awaits, eachOwnError, open, declaration, ws, inOf, expRef ?? exp, close]
|
|
5305
5611
|
// omit declaration2, replace eachOwn with eachOwnError, replace exp with expRef
|
|
5306
5612
|
};
|
|
5307
5613
|
}
|
|
@@ -5318,7 +5624,7 @@ function processForInOf($0, getRef) {
|
|
|
5318
5624
|
};
|
|
5319
5625
|
blockPrefix.push(["", {
|
|
5320
5626
|
type: "Declaration",
|
|
5321
|
-
children: [
|
|
5627
|
+
children: [trimFirstSpace(ws2), decl2, " = ", counterRef, "++"],
|
|
5322
5628
|
names: decl2.names
|
|
5323
5629
|
}, ";"]);
|
|
5324
5630
|
break;
|
|
@@ -5337,13 +5643,13 @@ function processForInOf($0, getRef) {
|
|
|
5337
5643
|
};
|
|
5338
5644
|
}
|
|
5339
5645
|
if (own) {
|
|
5340
|
-
const hasPropRef =
|
|
5341
|
-
blockPrefix.push(["", ["if (!", hasPropRef, "(",
|
|
5646
|
+
const hasPropRef = getHelperRef("hasProp");
|
|
5647
|
+
blockPrefix.push(["", ["if (!", hasPropRef, "(", trimFirstSpace(expRef2), ", ", trimFirstSpace(pattern), ")) continue"], ";"]);
|
|
5342
5648
|
}
|
|
5343
5649
|
if (decl2) {
|
|
5344
5650
|
blockPrefix.push(["", {
|
|
5345
5651
|
type: "Declaration",
|
|
5346
|
-
children: [
|
|
5652
|
+
children: [trimFirstSpace(ws2), decl2, " = ", trimFirstSpace(expRef2), "[", trimFirstSpace(pattern), "]"],
|
|
5347
5653
|
names: decl2.names
|
|
5348
5654
|
}, ";"]);
|
|
5349
5655
|
}
|
|
@@ -5356,7 +5662,7 @@ function processForInOf($0, getRef) {
|
|
|
5356
5662
|
}
|
|
5357
5663
|
return {
|
|
5358
5664
|
declaration,
|
|
5359
|
-
children: [awaits, eachOwnError, open, declaration, ws, inOf, exp,
|
|
5665
|
+
children: [awaits, eachOwnError, open, declaration, ws, inOf, exp, close],
|
|
5360
5666
|
// omit declaration2, replace each with eachOwnError
|
|
5361
5667
|
blockPrefix,
|
|
5362
5668
|
hoistDec
|
|
@@ -5489,7 +5795,7 @@ function createVarDecs(block, scopes, pushVar) {
|
|
|
5489
5795
|
return createVarDecs(block2, scopes, pushVar);
|
|
5490
5796
|
});
|
|
5491
5797
|
forNodes.forEach(({ block: block2, declaration }) => {
|
|
5492
|
-
scopes.push(new Set(declaration
|
|
5798
|
+
scopes.push(new Set(declaration?.names));
|
|
5493
5799
|
createVarDecs(block2, scopes, pushVar);
|
|
5494
5800
|
return scopes.pop();
|
|
5495
5801
|
});
|
|
@@ -6453,8 +6759,8 @@ function processBindingPatternLHS(lhs, tail) {
|
|
|
6453
6759
|
tail.push(...splices.map((s) => [", ", s]), ...thisAssignments.map((a) => [", ", a]));
|
|
6454
6760
|
}
|
|
6455
6761
|
function processAssignments(statements) {
|
|
6456
|
-
gatherRecursiveAll(statements, (
|
|
6457
|
-
function
|
|
6762
|
+
for (let ref6 = gatherRecursiveAll(statements, ($3) => $3.type === "AssignmentExpression" || $3.type === "UpdateExpression"), i5 = 0, len4 = ref6.length; i5 < len4; i5++) {
|
|
6763
|
+
let extractAssignment2 = function(lhs) {
|
|
6458
6764
|
let expr = lhs;
|
|
6459
6765
|
while (expr.type === "ParenthesizedExpression") {
|
|
6460
6766
|
expr = expr.expression;
|
|
@@ -6472,17 +6778,20 @@ function processAssignments(statements) {
|
|
|
6472
6778
|
}
|
|
6473
6779
|
;
|
|
6474
6780
|
return;
|
|
6475
|
-
}
|
|
6781
|
+
};
|
|
6782
|
+
var extractAssignment = extractAssignment2;
|
|
6783
|
+
const exp = ref6[i5];
|
|
6476
6784
|
const pre = [], post = [];
|
|
6477
|
-
let
|
|
6785
|
+
let ref7;
|
|
6478
6786
|
switch (exp.type) {
|
|
6479
6787
|
case "AssignmentExpression": {
|
|
6480
|
-
if (!exp.lhs)
|
|
6481
|
-
|
|
6788
|
+
if (!exp.lhs) {
|
|
6789
|
+
continue;
|
|
6790
|
+
}
|
|
6482
6791
|
exp.lhs.forEach((lhsPart, i) => {
|
|
6483
|
-
let
|
|
6484
|
-
if (
|
|
6485
|
-
const newLhs =
|
|
6792
|
+
let ref8;
|
|
6793
|
+
if (ref8 = extractAssignment2(lhsPart[1])) {
|
|
6794
|
+
const newLhs = ref8;
|
|
6486
6795
|
return lhsPart[1] = newLhs;
|
|
6487
6796
|
}
|
|
6488
6797
|
;
|
|
@@ -6491,8 +6800,8 @@ function processAssignments(statements) {
|
|
|
6491
6800
|
break;
|
|
6492
6801
|
}
|
|
6493
6802
|
case "UpdateExpression": {
|
|
6494
|
-
if (
|
|
6495
|
-
const newLhs =
|
|
6803
|
+
if (ref7 = extractAssignment2(exp.assigned)) {
|
|
6804
|
+
const newLhs = ref7;
|
|
6496
6805
|
const i = exp.children.indexOf(exp.assigned);
|
|
6497
6806
|
exp.assigned = exp.children[i] = newLhs;
|
|
6498
6807
|
}
|
|
@@ -6500,15 +6809,17 @@ function processAssignments(statements) {
|
|
|
6500
6809
|
break;
|
|
6501
6810
|
}
|
|
6502
6811
|
}
|
|
6503
|
-
if (pre.length)
|
|
6812
|
+
if (pre.length) {
|
|
6504
6813
|
exp.children.unshift(...pre);
|
|
6505
|
-
|
|
6814
|
+
}
|
|
6815
|
+
if (post.length) {
|
|
6506
6816
|
exp.children.push(...post);
|
|
6817
|
+
}
|
|
6507
6818
|
if (exp.type === "UpdateExpression") {
|
|
6508
6819
|
const { assigned } = exp;
|
|
6509
6820
|
const ref = makeRef();
|
|
6510
6821
|
const newMemberExp = unchainOptionalMemberExpression(assigned, ref, (children) => {
|
|
6511
|
-
return exp.children.map(($
|
|
6822
|
+
return exp.children.map(($4) => $4 === assigned ? children : $4);
|
|
6512
6823
|
});
|
|
6513
6824
|
if (newMemberExp !== assigned) {
|
|
6514
6825
|
if (newMemberExp.usesRef) {
|
|
@@ -6518,169 +6829,163 @@ function processAssignments(statements) {
|
|
|
6518
6829
|
names: []
|
|
6519
6830
|
};
|
|
6520
6831
|
}
|
|
6521
|
-
|
|
6832
|
+
replaceNode(exp, newMemberExp);
|
|
6522
6833
|
}
|
|
6523
|
-
;
|
|
6524
|
-
return;
|
|
6525
6834
|
}
|
|
6526
|
-
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
6547
|
-
block = void 0;
|
|
6548
|
-
}
|
|
6835
|
+
}
|
|
6836
|
+
for (let ref9 = gatherRecursiveAll(statements, ($5) => $5.type === "AssignmentExpression"), i6 = 0, len5 = ref9.length; i6 < len5; i6++) {
|
|
6837
|
+
const exp = ref9[i6];
|
|
6838
|
+
if (!(exp.names === null)) {
|
|
6839
|
+
continue;
|
|
6840
|
+
}
|
|
6841
|
+
let { lhs: $1, expression: $2 } = exp, tail = [], len3 = $1.length;
|
|
6842
|
+
let block;
|
|
6843
|
+
let ref10;
|
|
6844
|
+
if (exp.parent?.type === "BlockStatement" && !(ref10 = $1[$1.length - 1])?.[ref10.length - 1]?.special) {
|
|
6845
|
+
block = makeBlockFragment();
|
|
6846
|
+
let ref11;
|
|
6847
|
+
if (ref11 = prependStatementExpressionBlock(
|
|
6848
|
+
{ type: "Initializer", expression: $2, children: [void 0, void 0, $2] },
|
|
6849
|
+
block
|
|
6850
|
+
)) {
|
|
6851
|
+
const ref = ref11;
|
|
6852
|
+
exp.children = exp.children.map(($6) => $6 === $2 ? ref : $6);
|
|
6853
|
+
$2 = ref;
|
|
6854
|
+
} else {
|
|
6855
|
+
block = void 0;
|
|
6549
6856
|
}
|
|
6550
|
-
|
|
6551
|
-
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
exp
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
)
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
|
|
6857
|
+
}
|
|
6858
|
+
let ref12;
|
|
6859
|
+
if ($1.some(($7) => (ref12 = $7)[ref12.length - 1].special)) {
|
|
6860
|
+
if ($1.length !== 1)
|
|
6861
|
+
throw new Error("Only one assignment with id= is allowed");
|
|
6862
|
+
const [, lhs, , op] = $1[0];
|
|
6863
|
+
const { call, omitLhs } = op;
|
|
6864
|
+
const index = exp.children.indexOf($2);
|
|
6865
|
+
if (index < 0)
|
|
6866
|
+
throw new Error("Assertion error: exp not in AssignmentExpression");
|
|
6867
|
+
exp.children.splice(
|
|
6868
|
+
index,
|
|
6869
|
+
1,
|
|
6870
|
+
exp.expression = $2 = [call, "(", lhs, ", ", $2, ")"]
|
|
6871
|
+
);
|
|
6872
|
+
if (omitLhs) {
|
|
6873
|
+
replaceNode(exp, $2);
|
|
6874
|
+
continue;
|
|
6567
6875
|
}
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6876
|
+
}
|
|
6877
|
+
let wrapped = false;
|
|
6878
|
+
let i = 0;
|
|
6879
|
+
while (i < len3) {
|
|
6880
|
+
const lastAssignment = $1[i++];
|
|
6881
|
+
const [, lhs, , op] = lastAssignment;
|
|
6882
|
+
if (!(op.token === "=")) {
|
|
6883
|
+
continue;
|
|
6884
|
+
}
|
|
6885
|
+
let m2;
|
|
6886
|
+
if (m2 = lhs.type, m2 === "ObjectExpression" || m2 === "ObjectBindingPattern") {
|
|
6887
|
+
if (!wrapped) {
|
|
6888
|
+
wrapped = true;
|
|
6889
|
+
lhs.children.splice(0, 0, "(");
|
|
6890
|
+
tail.push(")");
|
|
6583
6891
|
}
|
|
6584
6892
|
}
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
|
|
6893
|
+
}
|
|
6894
|
+
const refsToDeclare = /* @__PURE__ */ new Set();
|
|
6895
|
+
i = len3 - 1;
|
|
6896
|
+
while (i >= 0) {
|
|
6897
|
+
const lastAssignment = $1[i];
|
|
6898
|
+
if (lastAssignment[3].token === "=") {
|
|
6899
|
+
const lhs = lastAssignment[1];
|
|
6900
|
+
let m3;
|
|
6901
|
+
if (lhs.type === "MemberExpression") {
|
|
6902
|
+
const members = lhs.children;
|
|
6903
|
+
const lastMember = members[members.length - 1];
|
|
6904
|
+
if (typeof lastMember === "object" && lastMember != null && "type" in lastMember && lastMember.type === "CallExpression" && "children" in lastMember && Array.isArray(lastMember.children) && lastMember.children.length >= 1 && lastMember.children[0] === peekHelperRef("rslice")) {
|
|
6905
|
+
lastMember.children.push({
|
|
6906
|
+
type: "Error",
|
|
6907
|
+
message: "Slice range cannot be decreasing in assignment"
|
|
6908
|
+
});
|
|
6909
|
+
break;
|
|
6910
|
+
}
|
|
6911
|
+
if (lastMember.type === "SliceExpression") {
|
|
6912
|
+
const { start, end, children: c } = lastMember;
|
|
6913
|
+
c[0].token = ".splice(";
|
|
6914
|
+
c[1] = start;
|
|
6915
|
+
c[2] = ", ";
|
|
6916
|
+
if (end) {
|
|
6917
|
+
c[3] = [end, " - ", start];
|
|
6918
|
+
} else {
|
|
6919
|
+
c[3] = ["1/0"];
|
|
6601
6920
|
}
|
|
6602
|
-
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
c[2] = ", ";
|
|
6607
|
-
if (end) {
|
|
6608
|
-
c[3] = [end, " - ", start];
|
|
6609
|
-
} else {
|
|
6610
|
-
c[3] = ["1/0"];
|
|
6611
|
-
}
|
|
6612
|
-
c[4] = [", ...", $2];
|
|
6613
|
-
c[5] = ")";
|
|
6921
|
+
c[4] = [", ...", $2];
|
|
6922
|
+
c[5] = ")";
|
|
6923
|
+
lastAssignment.pop();
|
|
6924
|
+
if (isWhitespaceOrEmpty(lastAssignment[2]))
|
|
6614
6925
|
lastAssignment.pop();
|
|
6615
|
-
|
|
6616
|
-
|
|
6617
|
-
if ($1.length > 1) {
|
|
6618
|
-
throw new Error("Not implemented yet! TODO: Handle multiple splice assignments");
|
|
6619
|
-
}
|
|
6620
|
-
exp.children = [$1];
|
|
6621
|
-
exp.names = [];
|
|
6622
|
-
break;
|
|
6926
|
+
if ($1.length > 1) {
|
|
6927
|
+
throw new Error("Not implemented yet! TODO: Handle multiple splice assignments");
|
|
6623
6928
|
}
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6929
|
+
exp.children = [$1];
|
|
6930
|
+
exp.names = [];
|
|
6931
|
+
break;
|
|
6627
6932
|
}
|
|
6933
|
+
} else if (m3 = lhs.type, m3 === "ObjectBindingPattern" || m3 === "ArrayBindingPattern") {
|
|
6934
|
+
processBindingPatternLHS(lhs, tail);
|
|
6935
|
+
gatherRecursiveAll(lhs, ($8) => $8.type === "Ref").forEach(refsToDeclare.add.bind(refsToDeclare));
|
|
6628
6936
|
}
|
|
6629
|
-
i--;
|
|
6630
6937
|
}
|
|
6631
|
-
i
|
|
6632
|
-
|
|
6633
|
-
|
|
6634
|
-
|
|
6635
|
-
|
|
6636
|
-
|
|
6637
|
-
|
|
6638
|
-
|
|
6639
|
-
|
|
6640
|
-
|
|
6641
|
-
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
|
|
6645
|
-
|
|
6646
|
-
|
|
6647
|
-
|
|
6648
|
-
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
newMemberExp.parent = exp;
|
|
6652
|
-
$2 = newMemberExp;
|
|
6938
|
+
i--;
|
|
6939
|
+
}
|
|
6940
|
+
i = len3 - 1;
|
|
6941
|
+
const optionalChainRef = makeRef();
|
|
6942
|
+
while (i >= 0) {
|
|
6943
|
+
const assignment = $1[i];
|
|
6944
|
+
const [ws1, lhs, ws2, op] = assignment;
|
|
6945
|
+
if (lhs.type === "MemberExpression" || lhs.type === "CallExpression") {
|
|
6946
|
+
const newMemberExp = unchainOptionalMemberExpression(lhs, optionalChainRef, (children) => {
|
|
6947
|
+
const assigns = $1.splice(i + 1, len3 - 1 - i);
|
|
6948
|
+
$1.pop();
|
|
6949
|
+
return [ws1, ...children, ws2, op, ...assigns, $2];
|
|
6950
|
+
});
|
|
6951
|
+
if (newMemberExp !== lhs) {
|
|
6952
|
+
if (newMemberExp.usesRef) {
|
|
6953
|
+
exp.hoistDec = {
|
|
6954
|
+
type: "Declaration",
|
|
6955
|
+
children: ["let ", optionalChainRef],
|
|
6956
|
+
names: []
|
|
6957
|
+
};
|
|
6653
6958
|
}
|
|
6959
|
+
replaceNode($2, newMemberExp);
|
|
6960
|
+
$2 = newMemberExp;
|
|
6654
6961
|
}
|
|
6655
|
-
i--;
|
|
6656
6962
|
}
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
|
|
6663
|
-
|
|
6664
|
-
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
exp.names = $1.flatMap(([, l]) => l.names || []);
|
|
6669
|
-
if (tail.length) {
|
|
6670
|
-
const index = exp.children.indexOf($2);
|
|
6671
|
-
if (index < 0)
|
|
6672
|
-
throw new Error("Assertion error: exp not in AssignmentExpression");
|
|
6673
|
-
exp.children.splice(index + 1, 0, ...tail);
|
|
6674
|
-
}
|
|
6675
|
-
if (block) {
|
|
6676
|
-
block.parent = exp.parent;
|
|
6677
|
-
block.expressions.push(["", exp]);
|
|
6678
|
-
exp.parent = block;
|
|
6679
|
-
return block;
|
|
6963
|
+
i--;
|
|
6964
|
+
}
|
|
6965
|
+
if (refsToDeclare.size) {
|
|
6966
|
+
if (exp.hoistDec) {
|
|
6967
|
+
exp.hoistDec.children.push([...refsToDeclare].map(($9) => [",", $9]));
|
|
6968
|
+
} else {
|
|
6969
|
+
exp.hoistDec = {
|
|
6970
|
+
type: "Declaration",
|
|
6971
|
+
children: ["let ", [...refsToDeclare].map((r, i2) => i2 ? [",", r] : r)],
|
|
6972
|
+
names: []
|
|
6973
|
+
};
|
|
6680
6974
|
}
|
|
6681
|
-
return exp;
|
|
6682
6975
|
}
|
|
6683
|
-
|
|
6976
|
+
exp.names = $1.flatMap(([, l]) => l.names || []);
|
|
6977
|
+
if (tail.length) {
|
|
6978
|
+
const index = exp.children.indexOf($2);
|
|
6979
|
+
if (index < 0)
|
|
6980
|
+
throw new Error("Assertion error: exp not in AssignmentExpression");
|
|
6981
|
+
exp.children.splice(index + 1, 0, ...tail);
|
|
6982
|
+
}
|
|
6983
|
+
if (block) {
|
|
6984
|
+
replaceNode(exp, block);
|
|
6985
|
+
block.expressions.push(["", exp]);
|
|
6986
|
+
exp.parent = block;
|
|
6987
|
+
}
|
|
6988
|
+
}
|
|
6684
6989
|
}
|
|
6685
6990
|
function unchainOptionalMemberExpression(exp, ref, innerExp) {
|
|
6686
6991
|
let j = 0;
|
|
@@ -6730,9 +7035,9 @@ function unchainOptionalMemberExpression(exp, ref, innerExp) {
|
|
|
6730
7035
|
}
|
|
6731
7036
|
j++;
|
|
6732
7037
|
}
|
|
6733
|
-
let
|
|
6734
|
-
if (
|
|
6735
|
-
const l =
|
|
7038
|
+
let ref13;
|
|
7039
|
+
if (ref13 = conditions.length) {
|
|
7040
|
+
const l = ref13;
|
|
6736
7041
|
const cs = flatJoin(conditions, " && ");
|
|
6737
7042
|
return {
|
|
6738
7043
|
...exp,
|
|
@@ -6771,28 +7076,28 @@ function processTypes(node) {
|
|
|
6771
7076
|
if (!unary.suffix.length) {
|
|
6772
7077
|
return;
|
|
6773
7078
|
}
|
|
6774
|
-
let
|
|
7079
|
+
let ref14;
|
|
6775
7080
|
let m4;
|
|
6776
|
-
if (m4 = (
|
|
7081
|
+
if (m4 = (ref14 = unary.suffix)[ref14.length - 1], typeof m4 === "object" && m4 != null && "token" in m4 && m4.token === "?") {
|
|
6777
7082
|
const { token } = m4;
|
|
6778
7083
|
let last;
|
|
6779
7084
|
let count = 0;
|
|
6780
|
-
let
|
|
6781
|
-
while (unary.suffix.length && (
|
|
7085
|
+
let ref15;
|
|
7086
|
+
while (unary.suffix.length && (ref15 = unary.suffix)[ref15.length - 1]?.token === "?") {
|
|
6782
7087
|
last = unary.suffix.pop();
|
|
6783
7088
|
count++;
|
|
6784
7089
|
}
|
|
6785
|
-
let
|
|
6786
|
-
while (unary.suffix.length && (
|
|
7090
|
+
let ref16;
|
|
7091
|
+
while (unary.suffix.length && (ref16 = unary.suffix)[ref16.length - 1]?.type === "NonNullAssertion") {
|
|
6787
7092
|
unary.suffix.pop();
|
|
6788
7093
|
}
|
|
6789
|
-
let
|
|
7094
|
+
let ref17;
|
|
6790
7095
|
if (unary.suffix.length || unary.prefix.length)
|
|
6791
|
-
|
|
7096
|
+
ref17 = unary;
|
|
6792
7097
|
else
|
|
6793
|
-
|
|
6794
|
-
const t =
|
|
6795
|
-
if (unary.parent?.type === "
|
|
7098
|
+
ref17 = unary.t;
|
|
7099
|
+
const t = ref17;
|
|
7100
|
+
if (unary.parent?.type === "TypeElement" && !unary.parent.name) {
|
|
6796
7101
|
if (count === 1) {
|
|
6797
7102
|
unary.suffix.push(last);
|
|
6798
7103
|
return;
|
|
@@ -6819,12 +7124,12 @@ function processTypes(node) {
|
|
|
6819
7124
|
}
|
|
6820
7125
|
} else if (typeof m4 === "object" && m4 != null && "type" in m4 && m4.type === "NonNullAssertion") {
|
|
6821
7126
|
const { type } = m4;
|
|
6822
|
-
let
|
|
6823
|
-
while (unary.suffix.length && (
|
|
7127
|
+
let ref18;
|
|
7128
|
+
while (unary.suffix.length && (ref18 = unary.suffix)[ref18.length - 1]?.type === "NonNullAssertion") {
|
|
6824
7129
|
unary.suffix.pop();
|
|
6825
7130
|
}
|
|
6826
|
-
let
|
|
6827
|
-
while (unary.suffix.length && (
|
|
7131
|
+
let ref19;
|
|
7132
|
+
while (unary.suffix.length && (ref19 = unary.suffix)[ref19.length - 1]?.token === "?") {
|
|
6828
7133
|
unary.suffix.pop();
|
|
6829
7134
|
}
|
|
6830
7135
|
const t = trimFirstSpace(
|
|
@@ -6850,35 +7155,41 @@ function processTypes(node) {
|
|
|
6850
7155
|
});
|
|
6851
7156
|
}
|
|
6852
7157
|
function processStatementExpressions(statements) {
|
|
6853
|
-
gatherRecursiveAll(statements, ($
|
|
6854
|
-
const exp =
|
|
6855
|
-
const { statement } = exp;
|
|
6856
|
-
|
|
7158
|
+
for (let ref20 = gatherRecursiveAll(statements, ($10) => $10.type === "StatementExpression"), i7 = 0, len6 = ref20.length; i7 < len6; i7++) {
|
|
7159
|
+
const exp = ref20[i7];
|
|
7160
|
+
const { maybe, statement } = exp;
|
|
7161
|
+
if ((maybe || statement.type === "ThrowStatement") && blockContainingStatement(exp)) {
|
|
7162
|
+
replaceNode(exp, statement);
|
|
7163
|
+
continue;
|
|
7164
|
+
}
|
|
7165
|
+
let ref21;
|
|
6857
7166
|
switch (statement.type) {
|
|
6858
7167
|
case "IfStatement": {
|
|
6859
|
-
if (
|
|
6860
|
-
const expression =
|
|
6861
|
-
|
|
7168
|
+
if (ref21 = expressionizeIfStatement(statement)) {
|
|
7169
|
+
const expression = ref21;
|
|
7170
|
+
replaceNode(statement, expression, exp);
|
|
6862
7171
|
} else {
|
|
6863
|
-
|
|
7172
|
+
replaceNode(statement, wrapIIFE([["", statement]]), exp);
|
|
6864
7173
|
}
|
|
7174
|
+
;
|
|
7175
|
+
break;
|
|
6865
7176
|
}
|
|
6866
7177
|
case "IterationExpression": {
|
|
6867
7178
|
if (statement.subtype === "ComptimeStatement") {
|
|
6868
|
-
|
|
7179
|
+
replaceNode(
|
|
6869
7180
|
statement,
|
|
6870
7181
|
expressionizeComptime(statement.statement),
|
|
6871
7182
|
exp
|
|
6872
7183
|
);
|
|
6873
7184
|
}
|
|
6874
7185
|
;
|
|
6875
|
-
|
|
7186
|
+
break;
|
|
6876
7187
|
}
|
|
6877
7188
|
default: {
|
|
6878
|
-
|
|
7189
|
+
replaceNode(statement, wrapIIFE([["", statement]]), exp);
|
|
6879
7190
|
}
|
|
6880
7191
|
}
|
|
6881
|
-
}
|
|
7192
|
+
}
|
|
6882
7193
|
}
|
|
6883
7194
|
function processNegativeIndexAccess(statements) {
|
|
6884
7195
|
gatherRecursiveAll(statements, (n) => n.type === "NegativeIndex").forEach((exp) => {
|
|
@@ -6926,7 +7237,7 @@ function processProgram(root) {
|
|
|
6926
7237
|
if (config2.iife || config2.repl) {
|
|
6927
7238
|
rootIIFE = wrapIIFE(root.expressions, root.topLevelAwait);
|
|
6928
7239
|
const newExpressions = [["", rootIIFE]];
|
|
6929
|
-
root.children = root.children.map(($
|
|
7240
|
+
root.children = root.children.map(($11) => $11 === root.expressions ? newExpressions : $11);
|
|
6930
7241
|
root.expressions = newExpressions;
|
|
6931
7242
|
}
|
|
6932
7243
|
addParentPointers(root);
|
|
@@ -6940,7 +7251,7 @@ function processProgram(root) {
|
|
|
6940
7251
|
processAssignments(statements);
|
|
6941
7252
|
processStatementExpressions(statements);
|
|
6942
7253
|
processPatternMatching(statements);
|
|
6943
|
-
|
|
7254
|
+
processIterationExpressions(statements);
|
|
6944
7255
|
hoistRefDecs(statements);
|
|
6945
7256
|
processFunctions(statements, config2);
|
|
6946
7257
|
statements.unshift(...state2.prelude);
|
|
@@ -6966,17 +7277,17 @@ async function processProgramAsync(root) {
|
|
|
6966
7277
|
await processComptime(statements);
|
|
6967
7278
|
}
|
|
6968
7279
|
function processRepl(root, rootIIFE) {
|
|
6969
|
-
const topBlock = gatherRecursive(rootIIFE, ($
|
|
7280
|
+
const topBlock = gatherRecursive(rootIIFE, ($12) => $12.type === "BlockStatement")[0];
|
|
6970
7281
|
let i = 0;
|
|
6971
|
-
for (let
|
|
6972
|
-
const decl =
|
|
7282
|
+
for (let ref22 = gatherRecursiveWithinFunction(topBlock, ($13) => $13.type === "Declaration"), i8 = 0, len7 = ref22.length; i8 < len7; i8++) {
|
|
7283
|
+
const decl = ref22[i8];
|
|
6973
7284
|
if (decl.parent === topBlock || decl.decl === "var") {
|
|
6974
7285
|
decl.children.shift();
|
|
6975
7286
|
root.expressions.splice(i++, 0, ["", `var ${decl.names.join(",")};`]);
|
|
6976
7287
|
}
|
|
6977
7288
|
}
|
|
6978
|
-
for (let
|
|
6979
|
-
const func =
|
|
7289
|
+
for (let ref23 = gatherRecursive(topBlock, ($14) => $14.type === "FunctionExpression"), i9 = 0, len8 = ref23.length; i9 < len8; i9++) {
|
|
7290
|
+
const func = ref23[i9];
|
|
6980
7291
|
if (func.name && func.parent?.type === "BlockStatement") {
|
|
6981
7292
|
if (func.parent === topBlock) {
|
|
6982
7293
|
replaceNode(func, void 0);
|
|
@@ -6988,8 +7299,8 @@ function processRepl(root, rootIIFE) {
|
|
|
6988
7299
|
}
|
|
6989
7300
|
}
|
|
6990
7301
|
}
|
|
6991
|
-
for (let
|
|
6992
|
-
const classExp =
|
|
7302
|
+
for (let ref24 = gatherRecursiveWithinFunction(topBlock, ($15) => $15.type === "ClassExpression"), i10 = 0, len9 = ref24.length; i10 < len9; i10++) {
|
|
7303
|
+
const classExp = ref24[i10];
|
|
6993
7304
|
let m5;
|
|
6994
7305
|
if (classExp.name && classExp.parent === topBlock || (m5 = classExp.parent, typeof m5 === "object" && m5 != null && "type" in m5 && m5.type === "ReturnStatement" && "parent" in m5 && m5.parent === topBlock)) {
|
|
6995
7306
|
classExp.children.unshift(classExp.name, "=");
|
|
@@ -6998,7 +7309,7 @@ function processRepl(root, rootIIFE) {
|
|
|
6998
7309
|
}
|
|
6999
7310
|
}
|
|
7000
7311
|
function populateRefs(statements) {
|
|
7001
|
-
const refNodes = gatherRecursive(statements, ($
|
|
7312
|
+
const refNodes = gatherRecursive(statements, ($16) => $16.type === "Ref");
|
|
7002
7313
|
if (refNodes.length) {
|
|
7003
7314
|
const ids = gatherRecursive(statements, (s) => s.type === "Identifier");
|
|
7004
7315
|
const names = new Set(ids.flatMap(({ names: names2 }) => names2 || []));
|
|
@@ -7021,13 +7332,14 @@ function populateRefs(statements) {
|
|
|
7021
7332
|
function processPlaceholders(statements) {
|
|
7022
7333
|
const placeholderMap = /* @__PURE__ */ new Map();
|
|
7023
7334
|
const liftedIfs = /* @__PURE__ */ new Set();
|
|
7024
|
-
gatherRecursiveAll(statements, ($
|
|
7335
|
+
gatherRecursiveAll(statements, ($17) => $17.type === "Placeholder").forEach((_exp) => {
|
|
7025
7336
|
const exp = _exp;
|
|
7026
7337
|
let ancestor;
|
|
7027
7338
|
if (exp.subtype === ".") {
|
|
7028
|
-
({ ancestor } = findAncestor(exp, ($
|
|
7339
|
+
({ ancestor } = findAncestor(exp, ($18) => $18.type === "Call"));
|
|
7029
7340
|
ancestor = ancestor?.parent;
|
|
7030
|
-
|
|
7341
|
+
let m6;
|
|
7342
|
+
while (ancestor?.parent != null && (m6 = ancestor.parent.type, m6 === "UnaryExpression" || m6 === "NewExpression" || m6 === "AwaitExpression" || m6 === "ThrowStatement" || m6 === "StatementExpression")) {
|
|
7031
7343
|
ancestor = ancestor.parent;
|
|
7032
7344
|
}
|
|
7033
7345
|
if (!ancestor) {
|
|
@@ -7044,10 +7356,10 @@ function processPlaceholders(statements) {
|
|
|
7044
7356
|
if (type === "IfStatement") {
|
|
7045
7357
|
liftedIfs.add(ancestor2);
|
|
7046
7358
|
}
|
|
7047
|
-
let m6;
|
|
7048
7359
|
let m7;
|
|
7360
|
+
let m8;
|
|
7049
7361
|
return type === "Call" || // Block, except for if/else blocks when condition already lifted
|
|
7050
|
-
type === "BlockStatement" && !((
|
|
7362
|
+
type === "BlockStatement" && !((m7 = ancestor2.parent, typeof m7 === "object" && m7 != null && "type" in m7 && m7.type === "IfStatement") && liftedIfs.has(ancestor2.parent)) && !((m8 = ancestor2.parent, typeof m8 === "object" && m8 != null && "type" in m8 && m8.type === "ElseClause" && "parent" in m8 && typeof m8.parent === "object" && m8.parent != null && "type" in m8.parent && m8.parent.type === "IfStatement") && liftedIfs.has(ancestor2.parent.parent)) || type === "PipelineExpression" || // Declaration
|
|
7051
7363
|
type === "Initializer" || // Right-hand side of assignment
|
|
7052
7364
|
type === "AssignmentExpression" && findChildIndex(ancestor2, child2) === ancestor2.children.indexOf(ancestor2.expression) || type === "ReturnStatement" || type === "YieldExpression";
|
|
7053
7365
|
}));
|
|
@@ -7123,11 +7435,11 @@ function processPlaceholders(statements) {
|
|
|
7123
7435
|
for (const [ancestor, placeholders] of placeholderMap) {
|
|
7124
7436
|
let ref = makeRef("$");
|
|
7125
7437
|
let typeSuffix;
|
|
7126
|
-
for (let
|
|
7127
|
-
const placeholder = placeholders[
|
|
7438
|
+
for (let i11 = 0, len10 = placeholders.length; i11 < len10; i11++) {
|
|
7439
|
+
const placeholder = placeholders[i11];
|
|
7128
7440
|
typeSuffix ??= placeholder.typeSuffix;
|
|
7129
|
-
let
|
|
7130
|
-
replaceNode((
|
|
7441
|
+
let ref25;
|
|
7442
|
+
replaceNode((ref25 = placeholder.children)[ref25.length - 1], ref);
|
|
7131
7443
|
}
|
|
7132
7444
|
const { parent } = ancestor;
|
|
7133
7445
|
const body = maybeUnwrap(ancestor);
|
|
@@ -7148,16 +7460,16 @@ function processPlaceholders(statements) {
|
|
|
7148
7460
|
}
|
|
7149
7461
|
case "PipelineExpression": {
|
|
7150
7462
|
const i = findChildIndex(parent, ancestor);
|
|
7151
|
-
let
|
|
7463
|
+
let ref26;
|
|
7152
7464
|
if (i === 1) {
|
|
7153
|
-
|
|
7465
|
+
ref26 = ancestor === parent.children[i];
|
|
7154
7466
|
} else if (i === 2) {
|
|
7155
|
-
|
|
7467
|
+
ref26 = ancestor === parent.children[i][findChildIndex(parent.children[i], ancestor)][3];
|
|
7156
7468
|
} else {
|
|
7157
|
-
|
|
7469
|
+
ref26 = void 0;
|
|
7158
7470
|
}
|
|
7159
7471
|
;
|
|
7160
|
-
outer =
|
|
7472
|
+
outer = ref26;
|
|
7161
7473
|
break;
|
|
7162
7474
|
}
|
|
7163
7475
|
case "AssignmentExpression":
|
|
@@ -7172,9 +7484,9 @@ function processPlaceholders(statements) {
|
|
|
7172
7484
|
fnExp = makeLeftHandSideExpression(fnExp);
|
|
7173
7485
|
}
|
|
7174
7486
|
replaceNode(ancestor, fnExp, parent);
|
|
7175
|
-
let
|
|
7176
|
-
if (
|
|
7177
|
-
const ws =
|
|
7487
|
+
let ref27;
|
|
7488
|
+
if (ref27 = getTrimmingSpace(body)) {
|
|
7489
|
+
const ws = ref27;
|
|
7178
7490
|
inplaceInsertTrimmingSpace(body, "");
|
|
7179
7491
|
inplacePrepend(ws, fnExp);
|
|
7180
7492
|
}
|
|
@@ -7219,8 +7531,8 @@ function reorderBindingRestProperty(props) {
|
|
|
7219
7531
|
}
|
|
7220
7532
|
];
|
|
7221
7533
|
}
|
|
7222
|
-
let
|
|
7223
|
-
if (Array.isArray(rest.delim) && (
|
|
7534
|
+
let ref28;
|
|
7535
|
+
if (Array.isArray(rest.delim) && (ref28 = rest.delim)[ref28.length - 1]?.token === ",") {
|
|
7224
7536
|
rest.delim = rest.delim.slice(0, -1);
|
|
7225
7537
|
rest.children = [...rest.children.slice(0, -1), rest.delim];
|
|
7226
7538
|
}
|
|
@@ -7245,9 +7557,9 @@ function replaceNodes(root, predicate, replacer) {
|
|
|
7245
7557
|
return root;
|
|
7246
7558
|
}
|
|
7247
7559
|
}
|
|
7248
|
-
for (let
|
|
7249
|
-
const i =
|
|
7250
|
-
const node = array[
|
|
7560
|
+
for (let i12 = 0, len11 = array.length; i12 < len11; i12++) {
|
|
7561
|
+
const i = i12;
|
|
7562
|
+
const node = array[i12];
|
|
7251
7563
|
if (!(node != null)) {
|
|
7252
7564
|
return;
|
|
7253
7565
|
}
|
|
@@ -7259,34 +7571,6 @@ function replaceNodes(root, predicate, replacer) {
|
|
|
7259
7571
|
}
|
|
7260
7572
|
return root;
|
|
7261
7573
|
}
|
|
7262
|
-
function replaceNodesRecursive(root, predicate, replacer) {
|
|
7263
|
-
if (!(root != null)) {
|
|
7264
|
-
return root;
|
|
7265
|
-
}
|
|
7266
|
-
const array = Array.isArray(root) ? root : root.children;
|
|
7267
|
-
if (!array) {
|
|
7268
|
-
if (predicate(root)) {
|
|
7269
|
-
return replacer(root, root);
|
|
7270
|
-
} else {
|
|
7271
|
-
return root;
|
|
7272
|
-
}
|
|
7273
|
-
}
|
|
7274
|
-
for (let i10 = 0, len9 = array.length; i10 < len9; i10++) {
|
|
7275
|
-
const i = i10;
|
|
7276
|
-
const node = array[i10];
|
|
7277
|
-
if (!(node != null)) {
|
|
7278
|
-
continue;
|
|
7279
|
-
}
|
|
7280
|
-
if (predicate(node)) {
|
|
7281
|
-
const ret = replacer(node, root);
|
|
7282
|
-
replaceNodesRecursive(ret, predicate, replacer);
|
|
7283
|
-
array[i] = ret;
|
|
7284
|
-
} else {
|
|
7285
|
-
replaceNodesRecursive(node, predicate, replacer);
|
|
7286
|
-
}
|
|
7287
|
-
}
|
|
7288
|
-
return root;
|
|
7289
|
-
}
|
|
7290
7574
|
function typeOfJSX(node, config2) {
|
|
7291
7575
|
switch (node.type) {
|
|
7292
7576
|
case "JSXElement":
|
|
@@ -7670,6 +7954,7 @@ var grammar = {
|
|
|
7670
7954
|
ForStatement,
|
|
7671
7955
|
ForClause,
|
|
7672
7956
|
ForStatementControlWithWhen,
|
|
7957
|
+
ForReduction,
|
|
7673
7958
|
ForStatementControl,
|
|
7674
7959
|
WhenCondition,
|
|
7675
7960
|
CoffeeForStatementParameters,
|
|
@@ -8083,7 +8368,7 @@ var grammar = {
|
|
|
8083
8368
|
InlineInterfacePropertyDelimiter,
|
|
8084
8369
|
TypeBinaryOp,
|
|
8085
8370
|
TypeFunction,
|
|
8086
|
-
|
|
8371
|
+
TypeFunctionArrow,
|
|
8087
8372
|
TypeArguments,
|
|
8088
8373
|
ImplicitTypeArguments,
|
|
8089
8374
|
TypeApplicationStart,
|
|
@@ -8290,128 +8575,135 @@ var $L116 = (0, import_lib4.$L)("\u2209");
|
|
|
8290
8575
|
var $L117 = (0, import_lib4.$L)("&");
|
|
8291
8576
|
var $L118 = (0, import_lib4.$L)("|");
|
|
8292
8577
|
var $L119 = (0, import_lib4.$L)(";");
|
|
8293
|
-
var $L120 = (0, import_lib4.$L)("
|
|
8294
|
-
var $L121 = (0, import_lib4.$L)("
|
|
8295
|
-
var $L122 = (0, import_lib4.$L)("
|
|
8296
|
-
var $L123 = (0, import_lib4.$L)("
|
|
8297
|
-
var $L124 = (0, import_lib4.$L)("
|
|
8298
|
-
var $L125 = (0, import_lib4.$L)("
|
|
8299
|
-
var $L126 = (0, import_lib4.$L)("
|
|
8300
|
-
var $L127 = (0, import_lib4.$L)("
|
|
8301
|
-
var $L128 = (0, import_lib4.$L)("
|
|
8302
|
-
var $L129 = (0, import_lib4.$L)("
|
|
8303
|
-
var $L130 = (0, import_lib4.$L)("
|
|
8304
|
-
var $L131 = (0, import_lib4.$L)("
|
|
8305
|
-
var $L132 = (0, import_lib4.$L)("
|
|
8306
|
-
var $L133 = (0, import_lib4.$L)("
|
|
8307
|
-
var $L134 = (0, import_lib4.$L)("
|
|
8308
|
-
var $L135 = (0, import_lib4.$L)("
|
|
8309
|
-
var $L136 = (0, import_lib4.$L)("
|
|
8310
|
-
var $L137 = (0, import_lib4.$L)("
|
|
8311
|
-
var $L138 = (0, import_lib4.$L)("
|
|
8312
|
-
var $L139 = (0, import_lib4.$L)("
|
|
8313
|
-
var $L140 = (0, import_lib4.$L)("
|
|
8314
|
-
var $L141 = (0, import_lib4.$L)("
|
|
8315
|
-
var $L142 = (0, import_lib4.$L)("
|
|
8316
|
-
var $L143 = (0, import_lib4.$L)("
|
|
8317
|
-
var $L144 = (0, import_lib4.$L)("
|
|
8318
|
-
var $L145 = (0, import_lib4.$L)("
|
|
8319
|
-
var $L146 = (0, import_lib4.$L)("
|
|
8320
|
-
var $L147 = (0, import_lib4.$L)("
|
|
8321
|
-
var $L148 = (0, import_lib4.$L)("
|
|
8322
|
-
var $L149 = (0, import_lib4.$L)("
|
|
8323
|
-
var $L150 = (0, import_lib4.$L)("
|
|
8324
|
-
var $L151 = (0, import_lib4.$L)("
|
|
8325
|
-
var $L152 = (0, import_lib4.$L)("
|
|
8326
|
-
var $L153 = (0, import_lib4.$L)("
|
|
8327
|
-
var $L154 = (0, import_lib4.$L)("
|
|
8328
|
-
var $L155 = (0, import_lib4.$L)("
|
|
8329
|
-
var $L156 = (0, import_lib4.$L)(
|
|
8330
|
-
var $L157 = (0, import_lib4.$L)("
|
|
8331
|
-
var $L158 = (0, import_lib4.$L)("
|
|
8332
|
-
var $L159 = (0, import_lib4.$L)("
|
|
8333
|
-
var $L160 = (0, import_lib4.$L)("
|
|
8334
|
-
var $L161 = (0, import_lib4.$L)("
|
|
8335
|
-
var $L162 = (0, import_lib4.$L)("
|
|
8336
|
-
var $L163 = (0, import_lib4.$L)("
|
|
8337
|
-
var $L164 = (0, import_lib4.$L)("
|
|
8338
|
-
var $L165 = (0, import_lib4.$L)("
|
|
8339
|
-
var $L166 = (0, import_lib4.$L)("
|
|
8340
|
-
var $L167 = (0, import_lib4.$L)("
|
|
8341
|
-
var $L168 = (0, import_lib4.$L)("
|
|
8342
|
-
var $L169 = (0, import_lib4.$L)("
|
|
8343
|
-
var $L170 = (0, import_lib4.$L)("
|
|
8344
|
-
var $L171 = (0, import_lib4.$L)("
|
|
8345
|
-
var $L172 = (0, import_lib4.$L)("
|
|
8346
|
-
var $L173 = (0, import_lib4.$L)("
|
|
8347
|
-
var $L174 = (0, import_lib4.$L)("
|
|
8348
|
-
var $L175 = (0, import_lib4.$L)("
|
|
8349
|
-
var $L176 = (0, import_lib4.$L)("
|
|
8350
|
-
var $L177 = (0, import_lib4.$L)("
|
|
8351
|
-
var $L178 = (0, import_lib4.$L)("
|
|
8352
|
-
var $L179 = (0, import_lib4.$L)("
|
|
8353
|
-
var $L180 = (0, import_lib4.$L)("
|
|
8354
|
-
var $L181 = (0, import_lib4.$L)("
|
|
8355
|
-
var $L182 = (0, import_lib4.$L)("
|
|
8356
|
-
var $L183 = (0, import_lib4.$L)("
|
|
8357
|
-
var $L184 = (0, import_lib4.$L)("
|
|
8358
|
-
var $L185 = (0, import_lib4.$L)("
|
|
8359
|
-
var $L186 = (0, import_lib4.$L)("
|
|
8360
|
-
var $L187 = (0, import_lib4.$L)("
|
|
8361
|
-
var $L188 = (0, import_lib4.$L)("
|
|
8362
|
-
var $L189 = (0, import_lib4.$L)("
|
|
8363
|
-
var $L190 = (0, import_lib4.$L)("
|
|
8364
|
-
var $L191 = (0, import_lib4.$L)("
|
|
8365
|
-
var $L192 = (0, import_lib4.$L)("
|
|
8366
|
-
var $L193 = (0, import_lib4.$L)("
|
|
8367
|
-
var $L194 = (0, import_lib4.$L)("
|
|
8368
|
-
var $L195 = (0, import_lib4.$L)("
|
|
8369
|
-
var $L196 = (0, import_lib4.$L)("
|
|
8370
|
-
var $L197 = (0, import_lib4.$L)("
|
|
8371
|
-
var $L198 = (0, import_lib4.$L)("
|
|
8372
|
-
var $L199 = (0, import_lib4.$L)("
|
|
8373
|
-
var $L200 = (0, import_lib4.$L)("
|
|
8374
|
-
var $L201 = (0, import_lib4.$L)("
|
|
8375
|
-
var $L202 = (0, import_lib4.$L)("
|
|
8376
|
-
var $L203 = (0, import_lib4.$L)("
|
|
8377
|
-
var $L204 = (0, import_lib4.$L)("
|
|
8378
|
-
var $L205 = (0, import_lib4.$L)("
|
|
8379
|
-
var $L206 = (0, import_lib4.$L)(
|
|
8380
|
-
var $L207 = (0, import_lib4.$L)("
|
|
8381
|
-
var $L208 = (0, import_lib4.$L)("
|
|
8382
|
-
var $L209 = (0, import_lib4.$L)("
|
|
8383
|
-
var $L210 = (0, import_lib4.$L)("
|
|
8384
|
-
var $L211 = (0, import_lib4.$L)("
|
|
8385
|
-
var $L212 = (0, import_lib4.$L)("
|
|
8386
|
-
var $L213 = (0, import_lib4.$L)("
|
|
8387
|
-
var $L214 = (0, import_lib4.$L)("
|
|
8388
|
-
var $L215 = (0, import_lib4.$L)("
|
|
8389
|
-
var $L216 = (0, import_lib4.$L)("
|
|
8390
|
-
var $L217 = (0, import_lib4.$L)("
|
|
8391
|
-
var $L218 = (0, import_lib4.$L)("
|
|
8392
|
-
var $L219 = (0, import_lib4.$L)("
|
|
8393
|
-
var $L220 = (0, import_lib4.$L)("
|
|
8394
|
-
var $L221 = (0, import_lib4.$L)("
|
|
8395
|
-
var $L222 = (0, import_lib4.$L)("
|
|
8396
|
-
var $L223 = (0, import_lib4.$L)("
|
|
8397
|
-
var $L224 = (0, import_lib4.$L)("
|
|
8398
|
-
var $L225 = (0, import_lib4.$L)("
|
|
8399
|
-
var $L226 = (0, import_lib4.$L)("
|
|
8400
|
-
var $L227 = (0, import_lib4.$L)("
|
|
8401
|
-
var $L228 = (0, import_lib4.$L)("
|
|
8402
|
-
var $L229 = (0, import_lib4.$L)("
|
|
8403
|
-
var $L230 = (0, import_lib4.$L)("
|
|
8404
|
-
var $L231 = (0, import_lib4.$L)("
|
|
8405
|
-
var $L232 = (0, import_lib4.$L)("
|
|
8406
|
-
var $L233 = (0, import_lib4.$L)("
|
|
8407
|
-
var $L234 = (0, import_lib4.$L)("
|
|
8408
|
-
var $L235 = (0, import_lib4.$L)("
|
|
8409
|
-
var $L236 = (0, import_lib4.$L)("
|
|
8410
|
-
var $L237 = (0, import_lib4.$L)("
|
|
8411
|
-
var $L238 = (0, import_lib4.$L)("
|
|
8578
|
+
var $L120 = (0, import_lib4.$L)("some");
|
|
8579
|
+
var $L121 = (0, import_lib4.$L)("every");
|
|
8580
|
+
var $L122 = (0, import_lib4.$L)("count");
|
|
8581
|
+
var $L123 = (0, import_lib4.$L)("sum");
|
|
8582
|
+
var $L124 = (0, import_lib4.$L)("product");
|
|
8583
|
+
var $L125 = (0, import_lib4.$L)("min");
|
|
8584
|
+
var $L126 = (0, import_lib4.$L)("max");
|
|
8585
|
+
var $L127 = (0, import_lib4.$L)("break");
|
|
8586
|
+
var $L128 = (0, import_lib4.$L)("continue");
|
|
8587
|
+
var $L129 = (0, import_lib4.$L)("debugger");
|
|
8588
|
+
var $L130 = (0, import_lib4.$L)("require");
|
|
8589
|
+
var $L131 = (0, import_lib4.$L)("with");
|
|
8590
|
+
var $L132 = (0, import_lib4.$L)("assert");
|
|
8591
|
+
var $L133 = (0, import_lib4.$L)(":=");
|
|
8592
|
+
var $L134 = (0, import_lib4.$L)("\u2254");
|
|
8593
|
+
var $L135 = (0, import_lib4.$L)(".=");
|
|
8594
|
+
var $L136 = (0, import_lib4.$L)("::=");
|
|
8595
|
+
var $L137 = (0, import_lib4.$L)("/*");
|
|
8596
|
+
var $L138 = (0, import_lib4.$L)("*/");
|
|
8597
|
+
var $L139 = (0, import_lib4.$L)("\\");
|
|
8598
|
+
var $L140 = (0, import_lib4.$L)(")");
|
|
8599
|
+
var $L141 = (0, import_lib4.$L)("abstract");
|
|
8600
|
+
var $L142 = (0, import_lib4.$L)("as");
|
|
8601
|
+
var $L143 = (0, import_lib4.$L)("@");
|
|
8602
|
+
var $L144 = (0, import_lib4.$L)("@@");
|
|
8603
|
+
var $L145 = (0, import_lib4.$L)("async");
|
|
8604
|
+
var $L146 = (0, import_lib4.$L)("await");
|
|
8605
|
+
var $L147 = (0, import_lib4.$L)("`");
|
|
8606
|
+
var $L148 = (0, import_lib4.$L)("by");
|
|
8607
|
+
var $L149 = (0, import_lib4.$L)("case");
|
|
8608
|
+
var $L150 = (0, import_lib4.$L)("catch");
|
|
8609
|
+
var $L151 = (0, import_lib4.$L)("class");
|
|
8610
|
+
var $L152 = (0, import_lib4.$L)("#{");
|
|
8611
|
+
var $L153 = (0, import_lib4.$L)("comptime");
|
|
8612
|
+
var $L154 = (0, import_lib4.$L)("declare");
|
|
8613
|
+
var $L155 = (0, import_lib4.$L)("default");
|
|
8614
|
+
var $L156 = (0, import_lib4.$L)("delete");
|
|
8615
|
+
var $L157 = (0, import_lib4.$L)("do");
|
|
8616
|
+
var $L158 = (0, import_lib4.$L)("..");
|
|
8617
|
+
var $L159 = (0, import_lib4.$L)("\u2025");
|
|
8618
|
+
var $L160 = (0, import_lib4.$L)("...");
|
|
8619
|
+
var $L161 = (0, import_lib4.$L)("\u2026");
|
|
8620
|
+
var $L162 = (0, import_lib4.$L)("::");
|
|
8621
|
+
var $L163 = (0, import_lib4.$L)('"');
|
|
8622
|
+
var $L164 = (0, import_lib4.$L)("each");
|
|
8623
|
+
var $L165 = (0, import_lib4.$L)("else");
|
|
8624
|
+
var $L166 = (0, import_lib4.$L)("!");
|
|
8625
|
+
var $L167 = (0, import_lib4.$L)("export");
|
|
8626
|
+
var $L168 = (0, import_lib4.$L)("extends");
|
|
8627
|
+
var $L169 = (0, import_lib4.$L)("finally");
|
|
8628
|
+
var $L170 = (0, import_lib4.$L)("for");
|
|
8629
|
+
var $L171 = (0, import_lib4.$L)("from");
|
|
8630
|
+
var $L172 = (0, import_lib4.$L)("function");
|
|
8631
|
+
var $L173 = (0, import_lib4.$L)("get");
|
|
8632
|
+
var $L174 = (0, import_lib4.$L)("set");
|
|
8633
|
+
var $L175 = (0, import_lib4.$L)("#");
|
|
8634
|
+
var $L176 = (0, import_lib4.$L)("if");
|
|
8635
|
+
var $L177 = (0, import_lib4.$L)("in");
|
|
8636
|
+
var $L178 = (0, import_lib4.$L)("infer");
|
|
8637
|
+
var $L179 = (0, import_lib4.$L)("let");
|
|
8638
|
+
var $L180 = (0, import_lib4.$L)("const");
|
|
8639
|
+
var $L181 = (0, import_lib4.$L)("is");
|
|
8640
|
+
var $L182 = (0, import_lib4.$L)("var");
|
|
8641
|
+
var $L183 = (0, import_lib4.$L)("like");
|
|
8642
|
+
var $L184 = (0, import_lib4.$L)("loop");
|
|
8643
|
+
var $L185 = (0, import_lib4.$L)("new");
|
|
8644
|
+
var $L186 = (0, import_lib4.$L)("not");
|
|
8645
|
+
var $L187 = (0, import_lib4.$L)("of");
|
|
8646
|
+
var $L188 = (0, import_lib4.$L)("[");
|
|
8647
|
+
var $L189 = (0, import_lib4.$L)("operator");
|
|
8648
|
+
var $L190 = (0, import_lib4.$L)("override");
|
|
8649
|
+
var $L191 = (0, import_lib4.$L)("own");
|
|
8650
|
+
var $L192 = (0, import_lib4.$L)("public");
|
|
8651
|
+
var $L193 = (0, import_lib4.$L)("private");
|
|
8652
|
+
var $L194 = (0, import_lib4.$L)("protected");
|
|
8653
|
+
var $L195 = (0, import_lib4.$L)("||>");
|
|
8654
|
+
var $L196 = (0, import_lib4.$L)("|\u25B7");
|
|
8655
|
+
var $L197 = (0, import_lib4.$L)("|>=");
|
|
8656
|
+
var $L198 = (0, import_lib4.$L)("\u25B7=");
|
|
8657
|
+
var $L199 = (0, import_lib4.$L)("|>");
|
|
8658
|
+
var $L200 = (0, import_lib4.$L)("\u25B7");
|
|
8659
|
+
var $L201 = (0, import_lib4.$L)("readonly");
|
|
8660
|
+
var $L202 = (0, import_lib4.$L)("return");
|
|
8661
|
+
var $L203 = (0, import_lib4.$L)("satisfies");
|
|
8662
|
+
var $L204 = (0, import_lib4.$L)("'");
|
|
8663
|
+
var $L205 = (0, import_lib4.$L)("static");
|
|
8664
|
+
var $L206 = (0, import_lib4.$L)("${");
|
|
8665
|
+
var $L207 = (0, import_lib4.$L)("super");
|
|
8666
|
+
var $L208 = (0, import_lib4.$L)("switch");
|
|
8667
|
+
var $L209 = (0, import_lib4.$L)("target");
|
|
8668
|
+
var $L210 = (0, import_lib4.$L)("then");
|
|
8669
|
+
var $L211 = (0, import_lib4.$L)("this");
|
|
8670
|
+
var $L212 = (0, import_lib4.$L)("throw");
|
|
8671
|
+
var $L213 = (0, import_lib4.$L)('"""');
|
|
8672
|
+
var $L214 = (0, import_lib4.$L)("'''");
|
|
8673
|
+
var $L215 = (0, import_lib4.$L)("///");
|
|
8674
|
+
var $L216 = (0, import_lib4.$L)("```");
|
|
8675
|
+
var $L217 = (0, import_lib4.$L)("try");
|
|
8676
|
+
var $L218 = (0, import_lib4.$L)("typeof");
|
|
8677
|
+
var $L219 = (0, import_lib4.$L)("undefined");
|
|
8678
|
+
var $L220 = (0, import_lib4.$L)("unless");
|
|
8679
|
+
var $L221 = (0, import_lib4.$L)("until");
|
|
8680
|
+
var $L222 = (0, import_lib4.$L)("using");
|
|
8681
|
+
var $L223 = (0, import_lib4.$L)("void");
|
|
8682
|
+
var $L224 = (0, import_lib4.$L)("when");
|
|
8683
|
+
var $L225 = (0, import_lib4.$L)("while");
|
|
8684
|
+
var $L226 = (0, import_lib4.$L)("yield");
|
|
8685
|
+
var $L227 = (0, import_lib4.$L)("/>");
|
|
8686
|
+
var $L228 = (0, import_lib4.$L)("</");
|
|
8687
|
+
var $L229 = (0, import_lib4.$L)("<>");
|
|
8688
|
+
var $L230 = (0, import_lib4.$L)("</>");
|
|
8689
|
+
var $L231 = (0, import_lib4.$L)("<!--");
|
|
8690
|
+
var $L232 = (0, import_lib4.$L)("-->");
|
|
8691
|
+
var $L233 = (0, import_lib4.$L)("type");
|
|
8692
|
+
var $L234 = (0, import_lib4.$L)("enum");
|
|
8693
|
+
var $L235 = (0, import_lib4.$L)("interface");
|
|
8694
|
+
var $L236 = (0, import_lib4.$L)("global");
|
|
8695
|
+
var $L237 = (0, import_lib4.$L)("module");
|
|
8696
|
+
var $L238 = (0, import_lib4.$L)("namespace");
|
|
8697
|
+
var $L239 = (0, import_lib4.$L)("asserts");
|
|
8698
|
+
var $L240 = (0, import_lib4.$L)("keyof");
|
|
8699
|
+
var $L241 = (0, import_lib4.$L)("???");
|
|
8700
|
+
var $L242 = (0, import_lib4.$L)("unique");
|
|
8701
|
+
var $L243 = (0, import_lib4.$L)("symbol");
|
|
8702
|
+
var $L244 = (0, import_lib4.$L)("[]");
|
|
8703
|
+
var $L245 = (0, import_lib4.$L)("civet");
|
|
8412
8704
|
var $R0 = (0, import_lib4.$R)(new RegExp("(?=async|debugger|if|unless|comptime|do|for|loop|until|while|switch|throw|try)", "suy"));
|
|
8413
8705
|
var $R1 = (0, import_lib4.$R)(new RegExp("&(?=\\s)", "suy"));
|
|
8414
|
-
var $R2 = (0, import_lib4.$R)(new RegExp("(as|of|satisfies|then|when|implements|xor|xnor)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
|
|
8706
|
+
var $R2 = (0, import_lib4.$R)(new RegExp("(as|of|by|satisfies|then|when|implements|xor|xnor)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
|
|
8415
8707
|
var $R3 = (0, import_lib4.$R)(new RegExp("[0-9]", "suy"));
|
|
8416
8708
|
var $R4 = (0, import_lib4.$R)(new RegExp("(?!\\p{ID_Start}|[_$0-9(\\[{])", "suy"));
|
|
8417
8709
|
var $R5 = (0, import_lib4.$R)(new RegExp("[ \\t]", "suy"));
|
|
@@ -8638,12 +8930,7 @@ var StatementExpression$1 = (0, import_lib4.$TS)((0, import_lib4.$S)(IfStatement
|
|
|
8638
8930
|
return $skip;
|
|
8639
8931
|
return $1;
|
|
8640
8932
|
});
|
|
8641
|
-
var StatementExpression$2 =
|
|
8642
|
-
if ($1.block.implicit && $1.subtype !== "DoStatement" && $1.subtype !== "ComptimeStatement") {
|
|
8643
|
-
return $skip;
|
|
8644
|
-
}
|
|
8645
|
-
return $1;
|
|
8646
|
-
});
|
|
8933
|
+
var StatementExpression$2 = IterationExpression;
|
|
8647
8934
|
var StatementExpression$3 = SwitchStatement;
|
|
8648
8935
|
var StatementExpression$4 = ThrowStatement;
|
|
8649
8936
|
var StatementExpression$5 = TryStatement;
|
|
@@ -8741,7 +9028,7 @@ var ForbiddenImplicitCalls$$ = [ForbiddenImplicitCalls$0, ForbiddenImplicitCalls
|
|
|
8741
9028
|
function ForbiddenImplicitCalls(ctx, state2) {
|
|
8742
9029
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "ForbiddenImplicitCalls", ForbiddenImplicitCalls$$);
|
|
8743
9030
|
}
|
|
8744
|
-
var ReservedBinary$0 = (0, import_lib4.$R$0)((0, import_lib4.$EXPECT)($R2, "ReservedBinary /(as|of|satisfies|then|when|implements|xor|xnor)(?!\\p{ID_Continue}|[\\u200C\\u200D$])/"));
|
|
9031
|
+
var ReservedBinary$0 = (0, import_lib4.$R$0)((0, import_lib4.$EXPECT)($R2, "ReservedBinary /(as|of|by|satisfies|then|when|implements|xor|xnor)(?!\\p{ID_Continue}|[\\u200C\\u200D$])/"));
|
|
8745
9032
|
function ReservedBinary(ctx, state2) {
|
|
8746
9033
|
return (0, import_lib4.$EVENT)(ctx, state2, "ReservedBinary", ReservedBinary$0);
|
|
8747
9034
|
}
|
|
@@ -9372,7 +9659,7 @@ var PipelineHeadItem$$ = [PipelineHeadItem$0, PipelineHeadItem$1];
|
|
|
9372
9659
|
function PipelineHeadItem(ctx, state2) {
|
|
9373
9660
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "PipelineHeadItem", PipelineHeadItem$$);
|
|
9374
9661
|
}
|
|
9375
|
-
var PipelineTailItem$0 = (0, import_lib4.$T)((0, import_lib4.$S)((0, import_lib4.$C)(AwaitOp, Yield, Return), (0, import_lib4.$N)(AccessStart)), function(value) {
|
|
9662
|
+
var PipelineTailItem$0 = (0, import_lib4.$T)((0, import_lib4.$S)((0, import_lib4.$C)(AwaitOp, Yield, Return, Throw), (0, import_lib4.$N)(AccessStart), (0, import_lib4.$N)(MaybeNestedExpression)), function(value) {
|
|
9376
9663
|
return value[0];
|
|
9377
9664
|
});
|
|
9378
9665
|
var PipelineTailItem$1 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L15, 'PipelineTailItem "import"'), (0, import_lib4.$N)(AccessStart)), function($skip, $loc, $0, $1, $2) {
|
|
@@ -11779,16 +12066,31 @@ var CoffeeScriptBooleanLiteral$$ = [CoffeeScriptBooleanLiteral$0, CoffeeScriptBo
|
|
|
11779
12066
|
function CoffeeScriptBooleanLiteral(ctx, state2) {
|
|
11780
12067
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "CoffeeScriptBooleanLiteral", CoffeeScriptBooleanLiteral$$);
|
|
11781
12068
|
}
|
|
11782
|
-
var SymbolLiteral$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(Colon, IdentifierName), function($skip, $loc, $0, $1, $2) {
|
|
12069
|
+
var SymbolLiteral$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(Colon, (0, import_lib4.$C)(IdentifierName, StringLiteral)), function($skip, $loc, $0, $1, $2) {
|
|
11783
12070
|
var colon = $1;
|
|
11784
12071
|
var id = $2;
|
|
11785
|
-
|
|
12072
|
+
let name, token;
|
|
12073
|
+
if (id.type === "Identifier") {
|
|
12074
|
+
({ name, children: [token] } = id);
|
|
12075
|
+
} else {
|
|
12076
|
+
name = literalValue({
|
|
12077
|
+
type: "Literal",
|
|
12078
|
+
subtype: "StringLiteral",
|
|
12079
|
+
raw: id.token,
|
|
12080
|
+
children: [id]
|
|
12081
|
+
});
|
|
12082
|
+
token = id;
|
|
12083
|
+
}
|
|
11786
12084
|
if (config.symbols.includes(name)) {
|
|
11787
12085
|
return {
|
|
11788
12086
|
type: "SymbolLiteral",
|
|
11789
|
-
children: [
|
|
12087
|
+
children: id.type === "Identifier" ? [
|
|
11790
12088
|
{ ...colon, token: "Symbol." },
|
|
11791
12089
|
token
|
|
12090
|
+
] : [
|
|
12091
|
+
{ ...colon, token: "Symbol[" },
|
|
12092
|
+
token,
|
|
12093
|
+
"]"
|
|
11792
12094
|
],
|
|
11793
12095
|
name
|
|
11794
12096
|
};
|
|
@@ -11796,9 +12098,9 @@ var SymbolLiteral$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(Colon, Identifier
|
|
|
11796
12098
|
return {
|
|
11797
12099
|
type: "SymbolLiteral",
|
|
11798
12100
|
children: [
|
|
11799
|
-
{ ...colon, token:
|
|
11800
|
-
token,
|
|
11801
|
-
|
|
12101
|
+
{ ...colon, token: "Symbol.for(" },
|
|
12102
|
+
id.type === "Identifier" ? ['"', token, '"'] : token,
|
|
12103
|
+
")"
|
|
11802
12104
|
],
|
|
11803
12105
|
name
|
|
11804
12106
|
};
|
|
@@ -13441,6 +13743,8 @@ var Statement$2 = (0, import_lib4.$T)((0, import_lib4.$S)(IfStatement, (0, impor
|
|
|
13441
13743
|
var Statement$3 = (0, import_lib4.$TS)((0, import_lib4.$S)(IterationStatement, (0, import_lib4.$N)(ShouldExpressionize)), function($skip, $loc, $0, $1, $2) {
|
|
13442
13744
|
if ($1.generator)
|
|
13443
13745
|
return $skip;
|
|
13746
|
+
if ($1.reduction)
|
|
13747
|
+
return $skip;
|
|
13444
13748
|
return $1;
|
|
13445
13749
|
});
|
|
13446
13750
|
var Statement$4 = (0, import_lib4.$T)((0, import_lib4.$S)(SwitchStatement, (0, import_lib4.$N)(ShouldExpressionize)), function(value) {
|
|
@@ -13486,7 +13790,7 @@ function EmptyStatement(ctx, state2) {
|
|
|
13486
13790
|
return (0, import_lib4.$EVENT)(ctx, state2, "EmptyStatement", EmptyStatement$0);
|
|
13487
13791
|
}
|
|
13488
13792
|
var InsertEmptyStatement$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(InsertSemicolon), function($skip, $loc, $0, $1) {
|
|
13489
|
-
return { type: "EmptyStatement", children: [$1] };
|
|
13793
|
+
return { type: "EmptyStatement", children: [$1], implicit: true };
|
|
13490
13794
|
});
|
|
13491
13795
|
function InsertEmptyStatement(ctx, state2) {
|
|
13492
13796
|
return (0, import_lib4.$EVENT)(ctx, state2, "InsertEmptyStatement", InsertEmptyStatement$0);
|
|
@@ -13792,15 +14096,19 @@ var ForClause$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(For, (0, import_lib4.
|
|
|
13792
14096
|
block: null,
|
|
13793
14097
|
blockPrefix: c.blockPrefix,
|
|
13794
14098
|
hoistDec: c.hoistDec,
|
|
14099
|
+
reduction: c.reduction,
|
|
13795
14100
|
generator
|
|
13796
14101
|
};
|
|
13797
14102
|
});
|
|
13798
14103
|
function ForClause(ctx, state2) {
|
|
13799
14104
|
return (0, import_lib4.$EVENT)(ctx, state2, "ForClause", ForClause$0);
|
|
13800
14105
|
}
|
|
13801
|
-
var ForStatementControlWithWhen$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(ForStatementControl, (0, import_lib4.$E)(WhenCondition)), function($skip, $loc, $0, $1, $2) {
|
|
13802
|
-
var
|
|
13803
|
-
var
|
|
14106
|
+
var ForStatementControlWithWhen$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)(ForReduction), ForStatementControl, (0, import_lib4.$E)(WhenCondition)), function($skip, $loc, $0, $1, $2, $3) {
|
|
14107
|
+
var reduction = $1;
|
|
14108
|
+
var control = $2;
|
|
14109
|
+
var condition = $3;
|
|
14110
|
+
if (reduction)
|
|
14111
|
+
control = { ...control, reduction };
|
|
13804
14112
|
if (!condition)
|
|
13805
14113
|
return control;
|
|
13806
14114
|
const expressions = [["", {
|
|
@@ -13816,7 +14124,7 @@ var ForStatementControlWithWhen$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(For
|
|
|
13816
14124
|
return {
|
|
13817
14125
|
...control,
|
|
13818
14126
|
blockPrefix: [
|
|
13819
|
-
...control.blockPrefix,
|
|
14127
|
+
...control.blockPrefix ?? [],
|
|
13820
14128
|
["", {
|
|
13821
14129
|
type: "IfStatement",
|
|
13822
14130
|
then: block,
|
|
@@ -13828,6 +14136,18 @@ var ForStatementControlWithWhen$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(For
|
|
|
13828
14136
|
function ForStatementControlWithWhen(ctx, state2) {
|
|
13829
14137
|
return (0, import_lib4.$EVENT)(ctx, state2, "ForStatementControlWithWhen", ForStatementControlWithWhen$0);
|
|
13830
14138
|
}
|
|
14139
|
+
var ForReduction$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L120, 'ForReduction "some"'), (0, import_lib4.$EXPECT)($L121, 'ForReduction "every"'), (0, import_lib4.$EXPECT)($L122, 'ForReduction "count"'), (0, import_lib4.$EXPECT)($L123, 'ForReduction "sum"'), (0, import_lib4.$EXPECT)($L124, 'ForReduction "product"'), (0, import_lib4.$EXPECT)($L125, 'ForReduction "min"'), (0, import_lib4.$EXPECT)($L126, 'ForReduction "max"')), NonIdContinue, __), function($skip, $loc, $0, $1, $2, $3) {
|
|
14140
|
+
var subtype = $1;
|
|
14141
|
+
var ws = $3;
|
|
14142
|
+
return {
|
|
14143
|
+
type: "ForReduction",
|
|
14144
|
+
subtype,
|
|
14145
|
+
children: [ws]
|
|
14146
|
+
};
|
|
14147
|
+
});
|
|
14148
|
+
function ForReduction(ctx, state2) {
|
|
14149
|
+
return (0, import_lib4.$EVENT)(ctx, state2, "ForReduction", ForReduction$0);
|
|
14150
|
+
}
|
|
13831
14151
|
var ForStatementControl$0 = (0, import_lib4.$T)((0, import_lib4.$S)((0, import_lib4.$N)(CoffeeForLoopsEnabled), ForStatementParameters), function(value) {
|
|
13832
14152
|
return value[1];
|
|
13833
14153
|
});
|
|
@@ -13881,7 +14201,7 @@ var CoffeeForStatementParameters$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0
|
|
|
13881
14201
|
const counterRef = makeRef("i");
|
|
13882
14202
|
const lenRef = makeRef("len");
|
|
13883
14203
|
if (exp.type === "RangeExpression") {
|
|
13884
|
-
return forRange(open, declaration, exp, step
|
|
14204
|
+
return forRange(open, declaration, exp, step && prepend(trimFirstSpace(step[0]), trimFirstSpace(step[2])), close);
|
|
13885
14205
|
}
|
|
13886
14206
|
const expRef = maybeRef(exp);
|
|
13887
14207
|
const varRef = declaration;
|
|
@@ -13983,10 +14303,10 @@ var ForStatementParameters$1 = (0, import_lib4.$TS)((0, import_lib4.$S)(InsertOp
|
|
|
13983
14303
|
};
|
|
13984
14304
|
});
|
|
13985
14305
|
var ForStatementParameters$2 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)((0, import_lib4.$S)(Await, __)), (0, import_lib4.$E)((0, import_lib4.$S)((0, import_lib4.$C)(Each, Own), __)), (0, import_lib4.$S)(OpenParen, __), ForInOfDeclaration, (0, import_lib4.$E)((0, import_lib4.$S)(__, Comma, __, ForInOfDeclaration)), __, (0, import_lib4.$C)(In, Of), ExpressionWithObjectApplicationForbidden, (0, import_lib4.$E)((0, import_lib4.$S)(__, By, ExpressionWithObjectApplicationForbidden)), (0, import_lib4.$S)(__, CloseParen)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10) {
|
|
13986
|
-
return processForInOf($0
|
|
14306
|
+
return processForInOf($0);
|
|
13987
14307
|
});
|
|
13988
14308
|
var ForStatementParameters$3 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)((0, import_lib4.$S)(Await, __)), (0, import_lib4.$E)((0, import_lib4.$S)((0, import_lib4.$C)(Each, Own), __)), InsertOpenParen, ForInOfDeclaration, (0, import_lib4.$E)((0, import_lib4.$S)(__, Comma, __, ForInOfDeclaration)), __, (0, import_lib4.$C)(In, Of), ExpressionWithObjectApplicationForbidden, (0, import_lib4.$E)((0, import_lib4.$S)(__, By, ExpressionWithObjectApplicationForbidden)), InsertCloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10) {
|
|
13989
|
-
return processForInOf($0
|
|
14309
|
+
return processForInOf($0);
|
|
13990
14310
|
});
|
|
13991
14311
|
var ForStatementParameters$4 = ForRangeParameters;
|
|
13992
14312
|
var ForStatementParameters$$ = [ForStatementParameters$0, ForStatementParameters$1, ForStatementParameters$2, ForStatementParameters$3, ForStatementParameters$4];
|
|
@@ -14023,7 +14343,7 @@ var ForDeclaration$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(LetOrConstOrVar,
|
|
|
14023
14343
|
return {
|
|
14024
14344
|
type: "ForDeclaration",
|
|
14025
14345
|
children: [c, binding],
|
|
14026
|
-
|
|
14346
|
+
decl: c.token,
|
|
14027
14347
|
binding,
|
|
14028
14348
|
names: binding.names
|
|
14029
14349
|
};
|
|
@@ -14034,7 +14354,7 @@ var ForDeclaration$1 = (0, import_lib4.$TS)((0, import_lib4.$S)(InsertConst, (0,
|
|
|
14034
14354
|
return {
|
|
14035
14355
|
type: "ForDeclaration",
|
|
14036
14356
|
children: [c, binding],
|
|
14037
|
-
|
|
14357
|
+
decl: c.token,
|
|
14038
14358
|
binding,
|
|
14039
14359
|
names: binding.names
|
|
14040
14360
|
};
|
|
@@ -14754,19 +15074,19 @@ var ThrowStatement$0 = (0, import_lib4.$T)((0, import_lib4.$S)(Throw, MaybeParen
|
|
|
14754
15074
|
function ThrowStatement(ctx, state2) {
|
|
14755
15075
|
return (0, import_lib4.$EVENT)(ctx, state2, "ThrowStatement", ThrowStatement$0);
|
|
14756
15076
|
}
|
|
14757
|
-
var Break$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
15077
|
+
var Break$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L127, 'Break "break"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
14758
15078
|
return { $loc, token: $1 };
|
|
14759
15079
|
});
|
|
14760
15080
|
function Break(ctx, state2) {
|
|
14761
15081
|
return (0, import_lib4.$EVENT)(ctx, state2, "Break", Break$0);
|
|
14762
15082
|
}
|
|
14763
|
-
var Continue$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
15083
|
+
var Continue$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L128, 'Continue "continue"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
14764
15084
|
return { $loc, token: $1 };
|
|
14765
15085
|
});
|
|
14766
15086
|
function Continue(ctx, state2) {
|
|
14767
15087
|
return (0, import_lib4.$EVENT)(ctx, state2, "Continue", Continue$0);
|
|
14768
15088
|
}
|
|
14769
|
-
var Debugger$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
15089
|
+
var Debugger$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L129, 'Debugger "debugger"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
14770
15090
|
return { $loc, token: $1 };
|
|
14771
15091
|
});
|
|
14772
15092
|
function Debugger(ctx, state2) {
|
|
@@ -14834,7 +15154,7 @@ var MaybeParenNestedExpression$$ = [MaybeParenNestedExpression$0, MaybeParenNest
|
|
|
14834
15154
|
function MaybeParenNestedExpression(ctx, state2) {
|
|
14835
15155
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "MaybeParenNestedExpression", MaybeParenNestedExpression$$);
|
|
14836
15156
|
}
|
|
14837
|
-
var ImportDeclaration$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(Import, _, Identifier, (0, import_lib4.$E)(_), Equals, __, (0, import_lib4.$EXPECT)($
|
|
15157
|
+
var ImportDeclaration$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(Import, _, Identifier, (0, import_lib4.$E)(_), Equals, __, (0, import_lib4.$EXPECT)($L130, 'ImportDeclaration "require"'), NonIdContinue, Arguments), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
|
|
14838
15158
|
const imp = [
|
|
14839
15159
|
{ ...$1, ts: true },
|
|
14840
15160
|
{ ...$1, token: "const", js: true }
|
|
@@ -15024,7 +15344,7 @@ var ImpliedFrom$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L0, 'ImpliedF
|
|
|
15024
15344
|
function ImpliedFrom(ctx, state2) {
|
|
15025
15345
|
return (0, import_lib4.$EVENT)(ctx, state2, "ImpliedFrom", ImpliedFrom$0);
|
|
15026
15346
|
}
|
|
15027
|
-
var ImportAssertion$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)(_), (0, import_lib4.$C)((0, import_lib4.$EXPECT)($
|
|
15347
|
+
var ImportAssertion$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)(_), (0, import_lib4.$C)((0, import_lib4.$EXPECT)($L131, 'ImportAssertion "with"'), (0, import_lib4.$EXPECT)($L132, 'ImportAssertion "assert"')), NonIdContinue, (0, import_lib4.$E)(_), ObjectLiteral), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
15028
15348
|
var keyword = $2;
|
|
15029
15349
|
var object = $5;
|
|
15030
15350
|
return {
|
|
@@ -15343,19 +15663,19 @@ var LexicalDeclaration$$ = [LexicalDeclaration$0, LexicalDeclaration$1];
|
|
|
15343
15663
|
function LexicalDeclaration(ctx, state2) {
|
|
15344
15664
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "LexicalDeclaration", LexicalDeclaration$$);
|
|
15345
15665
|
}
|
|
15346
|
-
var ConstAssignment$0 = (0, import_lib4.$TV)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($
|
|
15666
|
+
var ConstAssignment$0 = (0, import_lib4.$TV)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L133, 'ConstAssignment ":="'), (0, import_lib4.$EXPECT)($L134, 'ConstAssignment "\u2254"')), function($skip, $loc, $0, $1) {
|
|
15347
15667
|
return { $loc, token: "=", decl: "const " };
|
|
15348
15668
|
});
|
|
15349
15669
|
function ConstAssignment(ctx, state2) {
|
|
15350
15670
|
return (0, import_lib4.$EVENT)(ctx, state2, "ConstAssignment", ConstAssignment$0);
|
|
15351
15671
|
}
|
|
15352
|
-
var LetAssignment$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
15672
|
+
var LetAssignment$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L135, 'LetAssignment ".="'), function($skip, $loc, $0, $1) {
|
|
15353
15673
|
return { $loc, token: "=", decl: "let " };
|
|
15354
15674
|
});
|
|
15355
15675
|
function LetAssignment(ctx, state2) {
|
|
15356
15676
|
return (0, import_lib4.$EVENT)(ctx, state2, "LetAssignment", LetAssignment$0);
|
|
15357
15677
|
}
|
|
15358
|
-
var TypeAssignment$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
15678
|
+
var TypeAssignment$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L136, 'TypeAssignment "::="'), function($skip, $loc, $0, $1) {
|
|
15359
15679
|
return { $loc, token: "=" };
|
|
15360
15680
|
});
|
|
15361
15681
|
function TypeAssignment(ctx, state2) {
|
|
@@ -15778,7 +16098,7 @@ var MultiLineComment$$ = [MultiLineComment$0, MultiLineComment$1];
|
|
|
15778
16098
|
function MultiLineComment(ctx, state2) {
|
|
15779
16099
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "MultiLineComment", MultiLineComment$$);
|
|
15780
16100
|
}
|
|
15781
|
-
var JSMultiLineComment$0 = (0, import_lib4.$TV)((0, import_lib4.$TEXT)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16101
|
+
var JSMultiLineComment$0 = (0, import_lib4.$TV)((0, import_lib4.$TEXT)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L137, 'JSMultiLineComment "/*"'), (0, import_lib4.$Q)((0, import_lib4.$S)((0, import_lib4.$N)((0, import_lib4.$EXPECT)($L138, 'JSMultiLineComment "*/"')), (0, import_lib4.$EXPECT)($R67, "JSMultiLineComment /./"))), (0, import_lib4.$EXPECT)($L138, 'JSMultiLineComment "*/"'))), function($skip, $loc, $0, $1) {
|
|
15782
16102
|
return { type: "Comment", $loc, token: $1 };
|
|
15783
16103
|
});
|
|
15784
16104
|
function JSMultiLineComment(ctx, state2) {
|
|
@@ -15824,7 +16144,7 @@ function _(ctx, state2) {
|
|
|
15824
16144
|
var NonNewlineWhitespace$0 = (0, import_lib4.$TR)((0, import_lib4.$EXPECT)($R22, "NonNewlineWhitespace /[ \\t]+/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
|
|
15825
16145
|
return { $loc, token: $0 };
|
|
15826
16146
|
});
|
|
15827
|
-
var NonNewlineWhitespace$1 = (0, import_lib4.$T)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16147
|
+
var NonNewlineWhitespace$1 = (0, import_lib4.$T)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L139, 'NonNewlineWhitespace "\\\\\\\\"'), CoffeeLineContinuationEnabled, EOL), function(value) {
|
|
15828
16148
|
return " ";
|
|
15829
16149
|
});
|
|
15830
16150
|
var NonNewlineWhitespace$$ = [NonNewlineWhitespace$0, NonNewlineWhitespace$1];
|
|
@@ -15870,7 +16190,7 @@ function SimpleStatementDelimiter(ctx, state2) {
|
|
|
15870
16190
|
}
|
|
15871
16191
|
var StatementDelimiter$0 = (0, import_lib4.$Y)(EOS);
|
|
15872
16192
|
var StatementDelimiter$1 = SemicolonDelimiter;
|
|
15873
|
-
var StatementDelimiter$2 = (0, import_lib4.$Y)((0, import_lib4.$S)((0, import_lib4.$E)(_), (0, import_lib4.$C)((0, import_lib4.$EXPECT)($L37, 'StatementDelimiter "}"'), (0, import_lib4.$EXPECT)($
|
|
16193
|
+
var StatementDelimiter$2 = (0, import_lib4.$Y)((0, import_lib4.$S)((0, import_lib4.$E)(_), (0, import_lib4.$C)((0, import_lib4.$EXPECT)($L37, 'StatementDelimiter "}"'), (0, import_lib4.$EXPECT)($L140, 'StatementDelimiter ")"'), (0, import_lib4.$EXPECT)($L46, 'StatementDelimiter "]"'))));
|
|
15874
16194
|
var StatementDelimiter$$ = [StatementDelimiter$0, StatementDelimiter$1, StatementDelimiter$2];
|
|
15875
16195
|
function StatementDelimiter(ctx, state2) {
|
|
15876
16196
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "StatementDelimiter", StatementDelimiter$$);
|
|
@@ -15894,7 +16214,7 @@ var Loc$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L0, 'Loc ""'), functi
|
|
|
15894
16214
|
function Loc(ctx, state2) {
|
|
15895
16215
|
return (0, import_lib4.$EVENT)(ctx, state2, "Loc", Loc$0);
|
|
15896
16216
|
}
|
|
15897
|
-
var Abstract$0 = (0, import_lib4.$TV)((0, import_lib4.$TEXT)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16217
|
+
var Abstract$0 = (0, import_lib4.$TV)((0, import_lib4.$TEXT)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L141, 'Abstract "abstract"'), NonIdContinue, (0, import_lib4.$E)((0, import_lib4.$EXPECT)($L18, 'Abstract " "')))), function($skip, $loc, $0, $1) {
|
|
15898
16218
|
return { $loc, token: $1, ts: true };
|
|
15899
16219
|
});
|
|
15900
16220
|
function Abstract(ctx, state2) {
|
|
@@ -15906,43 +16226,43 @@ var Ampersand$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L117, 'Ampersan
|
|
|
15906
16226
|
function Ampersand(ctx, state2) {
|
|
15907
16227
|
return (0, import_lib4.$EVENT)(ctx, state2, "Ampersand", Ampersand$0);
|
|
15908
16228
|
}
|
|
15909
|
-
var As$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16229
|
+
var As$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L142, 'As "as"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
15910
16230
|
return { $loc, token: $1 };
|
|
15911
16231
|
});
|
|
15912
16232
|
function As(ctx, state2) {
|
|
15913
16233
|
return (0, import_lib4.$EVENT)(ctx, state2, "As", As$0);
|
|
15914
16234
|
}
|
|
15915
|
-
var At$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16235
|
+
var At$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L143, 'At "@"'), function($skip, $loc, $0, $1) {
|
|
15916
16236
|
return { $loc, token: $1 };
|
|
15917
16237
|
});
|
|
15918
16238
|
function At(ctx, state2) {
|
|
15919
16239
|
return (0, import_lib4.$EVENT)(ctx, state2, "At", At$0);
|
|
15920
16240
|
}
|
|
15921
|
-
var AtAt$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16241
|
+
var AtAt$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L144, 'AtAt "@@"'), function($skip, $loc, $0, $1) {
|
|
15922
16242
|
return { $loc, token: "@" };
|
|
15923
16243
|
});
|
|
15924
16244
|
function AtAt(ctx, state2) {
|
|
15925
16245
|
return (0, import_lib4.$EVENT)(ctx, state2, "AtAt", AtAt$0);
|
|
15926
16246
|
}
|
|
15927
|
-
var Async$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16247
|
+
var Async$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L145, 'Async "async"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
15928
16248
|
return { $loc, token: $1, type: "Async" };
|
|
15929
16249
|
});
|
|
15930
16250
|
function Async(ctx, state2) {
|
|
15931
16251
|
return (0, import_lib4.$EVENT)(ctx, state2, "Async", Async$0);
|
|
15932
16252
|
}
|
|
15933
|
-
var Await$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16253
|
+
var Await$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L146, 'Await "await"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
15934
16254
|
return { $loc, token: $1, type: "Await" };
|
|
15935
16255
|
});
|
|
15936
16256
|
function Await(ctx, state2) {
|
|
15937
16257
|
return (0, import_lib4.$EVENT)(ctx, state2, "Await", Await$0);
|
|
15938
16258
|
}
|
|
15939
|
-
var Backtick$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16259
|
+
var Backtick$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L147, 'Backtick "`"'), function($skip, $loc, $0, $1) {
|
|
15940
16260
|
return { $loc, token: $1 };
|
|
15941
16261
|
});
|
|
15942
16262
|
function Backtick(ctx, state2) {
|
|
15943
16263
|
return (0, import_lib4.$EVENT)(ctx, state2, "Backtick", Backtick$0);
|
|
15944
16264
|
}
|
|
15945
|
-
var By$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16265
|
+
var By$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L148, 'By "by"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
15946
16266
|
return { $loc, token: $1 };
|
|
15947
16267
|
});
|
|
15948
16268
|
function By(ctx, state2) {
|
|
@@ -15954,19 +16274,19 @@ var Caret$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L22, 'Caret "^"'),
|
|
|
15954
16274
|
function Caret(ctx, state2) {
|
|
15955
16275
|
return (0, import_lib4.$EVENT)(ctx, state2, "Caret", Caret$0);
|
|
15956
16276
|
}
|
|
15957
|
-
var Case$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16277
|
+
var Case$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L149, 'Case "case"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
15958
16278
|
return { $loc, token: $1 };
|
|
15959
16279
|
});
|
|
15960
16280
|
function Case(ctx, state2) {
|
|
15961
16281
|
return (0, import_lib4.$EVENT)(ctx, state2, "Case", Case$0);
|
|
15962
16282
|
}
|
|
15963
|
-
var Catch$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16283
|
+
var Catch$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L150, 'Catch "catch"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
15964
16284
|
return { $loc, token: $1 };
|
|
15965
16285
|
});
|
|
15966
16286
|
function Catch(ctx, state2) {
|
|
15967
16287
|
return (0, import_lib4.$EVENT)(ctx, state2, "Catch", Catch$0);
|
|
15968
16288
|
}
|
|
15969
|
-
var Class$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16289
|
+
var Class$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L151, 'Class "class"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
15970
16290
|
return { $loc, token: $1 };
|
|
15971
16291
|
});
|
|
15972
16292
|
function Class(ctx, state2) {
|
|
@@ -15990,13 +16310,13 @@ var CloseBracket$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L46, 'CloseB
|
|
|
15990
16310
|
function CloseBracket(ctx, state2) {
|
|
15991
16311
|
return (0, import_lib4.$EVENT)(ctx, state2, "CloseBracket", CloseBracket$0);
|
|
15992
16312
|
}
|
|
15993
|
-
var CloseParen$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16313
|
+
var CloseParen$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L140, 'CloseParen ")"'), function($skip, $loc, $0, $1) {
|
|
15994
16314
|
return { $loc, token: $1 };
|
|
15995
16315
|
});
|
|
15996
16316
|
function CloseParen(ctx, state2) {
|
|
15997
16317
|
return (0, import_lib4.$EVENT)(ctx, state2, "CloseParen", CloseParen$0);
|
|
15998
16318
|
}
|
|
15999
|
-
var CoffeeSubstitutionStart$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16319
|
+
var CoffeeSubstitutionStart$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L152, 'CoffeeSubstitutionStart "#{"'), function($skip, $loc, $0, $1) {
|
|
16000
16320
|
return { $loc, token: "${" };
|
|
16001
16321
|
});
|
|
16002
16322
|
function CoffeeSubstitutionStart(ctx, state2) {
|
|
@@ -16014,37 +16334,37 @@ var Comma$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L17, 'Comma ","'),
|
|
|
16014
16334
|
function Comma(ctx, state2) {
|
|
16015
16335
|
return (0, import_lib4.$EVENT)(ctx, state2, "Comma", Comma$0);
|
|
16016
16336
|
}
|
|
16017
|
-
var Comptime$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16337
|
+
var Comptime$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L153, 'Comptime "comptime"'), NonIdContinue, (0, import_lib4.$N)((0, import_lib4.$EXPECT)($L16, 'Comptime ":"'))), function($skip, $loc, $0, $1, $2, $3) {
|
|
16018
16338
|
return { $loc, token: $1 };
|
|
16019
16339
|
});
|
|
16020
16340
|
function Comptime(ctx, state2) {
|
|
16021
16341
|
return (0, import_lib4.$EVENT)(ctx, state2, "Comptime", Comptime$0);
|
|
16022
16342
|
}
|
|
16023
|
-
var ConstructorShorthand$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16343
|
+
var ConstructorShorthand$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L143, 'ConstructorShorthand "@"'), function($skip, $loc, $0, $1) {
|
|
16024
16344
|
return { $loc, token: "constructor" };
|
|
16025
16345
|
});
|
|
16026
16346
|
function ConstructorShorthand(ctx, state2) {
|
|
16027
16347
|
return (0, import_lib4.$EVENT)(ctx, state2, "ConstructorShorthand", ConstructorShorthand$0);
|
|
16028
16348
|
}
|
|
16029
|
-
var Declare$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16349
|
+
var Declare$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L154, 'Declare "declare"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16030
16350
|
return { $loc, token: $1 };
|
|
16031
16351
|
});
|
|
16032
16352
|
function Declare(ctx, state2) {
|
|
16033
16353
|
return (0, import_lib4.$EVENT)(ctx, state2, "Declare", Declare$0);
|
|
16034
16354
|
}
|
|
16035
|
-
var Default$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16355
|
+
var Default$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L155, 'Default "default"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16036
16356
|
return { $loc, token: $1 };
|
|
16037
16357
|
});
|
|
16038
16358
|
function Default(ctx, state2) {
|
|
16039
16359
|
return (0, import_lib4.$EVENT)(ctx, state2, "Default", Default$0);
|
|
16040
16360
|
}
|
|
16041
|
-
var Delete$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16361
|
+
var Delete$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L156, 'Delete "delete"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16042
16362
|
return { $loc, token: $1 };
|
|
16043
16363
|
});
|
|
16044
16364
|
function Delete(ctx, state2) {
|
|
16045
16365
|
return (0, import_lib4.$EVENT)(ctx, state2, "Delete", Delete$0);
|
|
16046
16366
|
}
|
|
16047
|
-
var Do$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16367
|
+
var Do$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L157, 'Do "do"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16048
16368
|
return { $loc, token: $1 };
|
|
16049
16369
|
});
|
|
16050
16370
|
function Do(ctx, state2) {
|
|
@@ -16064,51 +16384,51 @@ var Dot$$ = [Dot$0, Dot$1];
|
|
|
16064
16384
|
function Dot(ctx, state2) {
|
|
16065
16385
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "Dot", Dot$$);
|
|
16066
16386
|
}
|
|
16067
|
-
var DotDot$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16387
|
+
var DotDot$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L158, 'DotDot ".."'), (0, import_lib4.$N)((0, import_lib4.$EXPECT)($L7, 'DotDot "."'))), function($skip, $loc, $0, $1, $2) {
|
|
16068
16388
|
return { $loc, token: $1 };
|
|
16069
16389
|
});
|
|
16070
|
-
var DotDot$1 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16390
|
+
var DotDot$1 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L159, 'DotDot "\u2025"'), function($skip, $loc, $0, $1) {
|
|
16071
16391
|
return { $loc, token: ".." };
|
|
16072
16392
|
});
|
|
16073
16393
|
var DotDot$$ = [DotDot$0, DotDot$1];
|
|
16074
16394
|
function DotDot(ctx, state2) {
|
|
16075
16395
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "DotDot", DotDot$$);
|
|
16076
16396
|
}
|
|
16077
|
-
var DotDotDot$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16397
|
+
var DotDotDot$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L160, 'DotDotDot "..."'), function($skip, $loc, $0, $1) {
|
|
16078
16398
|
return { $loc, token: $1 };
|
|
16079
16399
|
});
|
|
16080
|
-
var DotDotDot$1 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16400
|
+
var DotDotDot$1 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L161, 'DotDotDot "\u2026"'), function($skip, $loc, $0, $1) {
|
|
16081
16401
|
return { $loc, token: "..." };
|
|
16082
16402
|
});
|
|
16083
16403
|
var DotDotDot$$ = [DotDotDot$0, DotDotDot$1];
|
|
16084
16404
|
function DotDotDot(ctx, state2) {
|
|
16085
16405
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "DotDotDot", DotDotDot$$);
|
|
16086
16406
|
}
|
|
16087
|
-
var DoubleColon$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16407
|
+
var DoubleColon$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L162, 'DoubleColon "::"'), function($skip, $loc, $0, $1) {
|
|
16088
16408
|
return { $loc, token: $1 };
|
|
16089
16409
|
});
|
|
16090
16410
|
function DoubleColon(ctx, state2) {
|
|
16091
16411
|
return (0, import_lib4.$EVENT)(ctx, state2, "DoubleColon", DoubleColon$0);
|
|
16092
16412
|
}
|
|
16093
|
-
var DoubleColonAsColon$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16413
|
+
var DoubleColonAsColon$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L162, 'DoubleColonAsColon "::"'), function($skip, $loc, $0, $1) {
|
|
16094
16414
|
return { $loc, token: ":" };
|
|
16095
16415
|
});
|
|
16096
16416
|
function DoubleColonAsColon(ctx, state2) {
|
|
16097
16417
|
return (0, import_lib4.$EVENT)(ctx, state2, "DoubleColonAsColon", DoubleColonAsColon$0);
|
|
16098
16418
|
}
|
|
16099
|
-
var DoubleQuote$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16419
|
+
var DoubleQuote$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L163, 'DoubleQuote "\\\\\\""'), function($skip, $loc, $0, $1) {
|
|
16100
16420
|
return { $loc, token: $1 };
|
|
16101
16421
|
});
|
|
16102
16422
|
function DoubleQuote(ctx, state2) {
|
|
16103
16423
|
return (0, import_lib4.$EVENT)(ctx, state2, "DoubleQuote", DoubleQuote$0);
|
|
16104
16424
|
}
|
|
16105
|
-
var Each$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16425
|
+
var Each$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L164, 'Each "each"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16106
16426
|
return { $loc, token: $1 };
|
|
16107
16427
|
});
|
|
16108
16428
|
function Each(ctx, state2) {
|
|
16109
16429
|
return (0, import_lib4.$EVENT)(ctx, state2, "Each", Each$0);
|
|
16110
16430
|
}
|
|
16111
|
-
var Else$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16431
|
+
var Else$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L165, 'Else "else"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16112
16432
|
return { $loc, token: $1 };
|
|
16113
16433
|
});
|
|
16114
16434
|
function Else(ctx, state2) {
|
|
@@ -16120,61 +16440,61 @@ var Equals$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L3, 'Equals "="'),
|
|
|
16120
16440
|
function Equals(ctx, state2) {
|
|
16121
16441
|
return (0, import_lib4.$EVENT)(ctx, state2, "Equals", Equals$0);
|
|
16122
16442
|
}
|
|
16123
|
-
var ExclamationPoint$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16443
|
+
var ExclamationPoint$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L166, 'ExclamationPoint "!"'), function($skip, $loc, $0, $1) {
|
|
16124
16444
|
return { $loc, token: $1 };
|
|
16125
16445
|
});
|
|
16126
16446
|
function ExclamationPoint(ctx, state2) {
|
|
16127
16447
|
return (0, import_lib4.$EVENT)(ctx, state2, "ExclamationPoint", ExclamationPoint$0);
|
|
16128
16448
|
}
|
|
16129
|
-
var Export$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16449
|
+
var Export$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L167, 'Export "export"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16130
16450
|
return { $loc, token: $1 };
|
|
16131
16451
|
});
|
|
16132
16452
|
function Export(ctx, state2) {
|
|
16133
16453
|
return (0, import_lib4.$EVENT)(ctx, state2, "Export", Export$0);
|
|
16134
16454
|
}
|
|
16135
|
-
var Extends$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16455
|
+
var Extends$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L168, 'Extends "extends"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16136
16456
|
return { $loc, token: $1 };
|
|
16137
16457
|
});
|
|
16138
16458
|
function Extends(ctx, state2) {
|
|
16139
16459
|
return (0, import_lib4.$EVENT)(ctx, state2, "Extends", Extends$0);
|
|
16140
16460
|
}
|
|
16141
|
-
var Finally$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16461
|
+
var Finally$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L169, 'Finally "finally"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16142
16462
|
return { $loc, token: $1 };
|
|
16143
16463
|
});
|
|
16144
16464
|
function Finally(ctx, state2) {
|
|
16145
16465
|
return (0, import_lib4.$EVENT)(ctx, state2, "Finally", Finally$0);
|
|
16146
16466
|
}
|
|
16147
|
-
var For$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16467
|
+
var For$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L170, 'For "for"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16148
16468
|
return { $loc, token: $1 };
|
|
16149
16469
|
});
|
|
16150
16470
|
function For(ctx, state2) {
|
|
16151
16471
|
return (0, import_lib4.$EVENT)(ctx, state2, "For", For$0);
|
|
16152
16472
|
}
|
|
16153
|
-
var From$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16473
|
+
var From$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L171, 'From "from"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16154
16474
|
return { $loc, token: $1 };
|
|
16155
16475
|
});
|
|
16156
16476
|
function From(ctx, state2) {
|
|
16157
16477
|
return (0, import_lib4.$EVENT)(ctx, state2, "From", From$0);
|
|
16158
16478
|
}
|
|
16159
|
-
var Function$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16479
|
+
var Function$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L172, 'Function "function"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16160
16480
|
return { $loc, token: $1 };
|
|
16161
16481
|
});
|
|
16162
16482
|
function Function2(ctx, state2) {
|
|
16163
16483
|
return (0, import_lib4.$EVENT)(ctx, state2, "Function", Function$0);
|
|
16164
16484
|
}
|
|
16165
|
-
var GetOrSet$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($
|
|
16485
|
+
var GetOrSet$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L173, 'GetOrSet "get"'), (0, import_lib4.$EXPECT)($L174, 'GetOrSet "set"')), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16166
16486
|
return { $loc, token: $1, type: "GetOrSet" };
|
|
16167
16487
|
});
|
|
16168
16488
|
function GetOrSet(ctx, state2) {
|
|
16169
16489
|
return (0, import_lib4.$EVENT)(ctx, state2, "GetOrSet", GetOrSet$0);
|
|
16170
16490
|
}
|
|
16171
|
-
var Hash$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16491
|
+
var Hash$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L175, 'Hash "#"'), function($skip, $loc, $0, $1) {
|
|
16172
16492
|
return { $loc, token: $1 };
|
|
16173
16493
|
});
|
|
16174
16494
|
function Hash(ctx, state2) {
|
|
16175
16495
|
return (0, import_lib4.$EVENT)(ctx, state2, "Hash", Hash$0);
|
|
16176
16496
|
}
|
|
16177
|
-
var If$0 = (0, import_lib4.$TV)((0, import_lib4.$TEXT)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16497
|
+
var If$0 = (0, import_lib4.$TV)((0, import_lib4.$TEXT)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L176, 'If "if"'), NonIdContinue, (0, import_lib4.$E)((0, import_lib4.$EXPECT)($L18, 'If " "')))), function($skip, $loc, $0, $1) {
|
|
16178
16498
|
return { $loc, token: $1 };
|
|
16179
16499
|
});
|
|
16180
16500
|
function If(ctx, state2) {
|
|
@@ -16186,67 +16506,67 @@ var Import$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)
|
|
|
16186
16506
|
function Import(ctx, state2) {
|
|
16187
16507
|
return (0, import_lib4.$EVENT)(ctx, state2, "Import", Import$0);
|
|
16188
16508
|
}
|
|
16189
|
-
var In$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16509
|
+
var In$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L177, 'In "in"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16190
16510
|
return { $loc, token: $1 };
|
|
16191
16511
|
});
|
|
16192
16512
|
function In(ctx, state2) {
|
|
16193
16513
|
return (0, import_lib4.$EVENT)(ctx, state2, "In", In$0);
|
|
16194
16514
|
}
|
|
16195
|
-
var Infer$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16515
|
+
var Infer$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L178, 'Infer "infer"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16196
16516
|
return { $loc, token: $1 };
|
|
16197
16517
|
});
|
|
16198
16518
|
function Infer(ctx, state2) {
|
|
16199
16519
|
return (0, import_lib4.$EVENT)(ctx, state2, "Infer", Infer$0);
|
|
16200
16520
|
}
|
|
16201
|
-
var LetOrConst$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($
|
|
16521
|
+
var LetOrConst$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L179, 'LetOrConst "let"'), (0, import_lib4.$EXPECT)($L180, 'LetOrConst "const"')), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16202
16522
|
return { $loc, token: $1 };
|
|
16203
16523
|
});
|
|
16204
16524
|
function LetOrConst(ctx, state2) {
|
|
16205
16525
|
return (0, import_lib4.$EVENT)(ctx, state2, "LetOrConst", LetOrConst$0);
|
|
16206
16526
|
}
|
|
16207
|
-
var Const$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16527
|
+
var Const$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L180, 'Const "const"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16208
16528
|
return { $loc, token: $1 };
|
|
16209
16529
|
});
|
|
16210
16530
|
function Const(ctx, state2) {
|
|
16211
16531
|
return (0, import_lib4.$EVENT)(ctx, state2, "Const", Const$0);
|
|
16212
16532
|
}
|
|
16213
|
-
var Is$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16533
|
+
var Is$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L181, 'Is "is"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16214
16534
|
return { $loc, token: $1 };
|
|
16215
16535
|
});
|
|
16216
16536
|
function Is(ctx, state2) {
|
|
16217
16537
|
return (0, import_lib4.$EVENT)(ctx, state2, "Is", Is$0);
|
|
16218
16538
|
}
|
|
16219
|
-
var LetOrConstOrVar$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($
|
|
16539
|
+
var LetOrConstOrVar$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L179, 'LetOrConstOrVar "let"'), (0, import_lib4.$EXPECT)($L180, 'LetOrConstOrVar "const"'), (0, import_lib4.$EXPECT)($L182, 'LetOrConstOrVar "var"')), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16220
16540
|
return { $loc, token: $1 };
|
|
16221
16541
|
});
|
|
16222
16542
|
function LetOrConstOrVar(ctx, state2) {
|
|
16223
16543
|
return (0, import_lib4.$EVENT)(ctx, state2, "LetOrConstOrVar", LetOrConstOrVar$0);
|
|
16224
16544
|
}
|
|
16225
|
-
var Like$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16545
|
+
var Like$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L183, 'Like "like"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16226
16546
|
return { $loc, token: $1 };
|
|
16227
16547
|
});
|
|
16228
16548
|
function Like(ctx, state2) {
|
|
16229
16549
|
return (0, import_lib4.$EVENT)(ctx, state2, "Like", Like$0);
|
|
16230
16550
|
}
|
|
16231
|
-
var Loop$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16551
|
+
var Loop$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L184, 'Loop "loop"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16232
16552
|
return { $loc, token: "while" };
|
|
16233
16553
|
});
|
|
16234
16554
|
function Loop(ctx, state2) {
|
|
16235
16555
|
return (0, import_lib4.$EVENT)(ctx, state2, "Loop", Loop$0);
|
|
16236
16556
|
}
|
|
16237
|
-
var New$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16557
|
+
var New$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L185, 'New "new"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16238
16558
|
return { $loc, token: $1 };
|
|
16239
16559
|
});
|
|
16240
16560
|
function New(ctx, state2) {
|
|
16241
16561
|
return (0, import_lib4.$EVENT)(ctx, state2, "New", New$0);
|
|
16242
16562
|
}
|
|
16243
|
-
var Not$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16563
|
+
var Not$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L186, 'Not "not"'), NonIdContinue, (0, import_lib4.$N)((0, import_lib4.$S)((0, import_lib4.$E)(_), (0, import_lib4.$EXPECT)($L16, 'Not ":"')))), function($skip, $loc, $0, $1, $2, $3) {
|
|
16244
16564
|
return { $loc, token: "!" };
|
|
16245
16565
|
});
|
|
16246
16566
|
function Not(ctx, state2) {
|
|
16247
16567
|
return (0, import_lib4.$EVENT)(ctx, state2, "Not", Not$0);
|
|
16248
16568
|
}
|
|
16249
|
-
var Of$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16569
|
+
var Of$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L187, 'Of "of"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16250
16570
|
return { $loc, token: $1 };
|
|
16251
16571
|
});
|
|
16252
16572
|
function Of(ctx, state2) {
|
|
@@ -16264,7 +16584,7 @@ var OpenBrace$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L1, 'OpenBrace
|
|
|
16264
16584
|
function OpenBrace(ctx, state2) {
|
|
16265
16585
|
return (0, import_lib4.$EVENT)(ctx, state2, "OpenBrace", OpenBrace$0);
|
|
16266
16586
|
}
|
|
16267
|
-
var OpenBracket$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16587
|
+
var OpenBracket$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L188, 'OpenBracket "["'), function($skip, $loc, $0, $1) {
|
|
16268
16588
|
return { $loc, token: $1 };
|
|
16269
16589
|
});
|
|
16270
16590
|
function OpenBracket(ctx, state2) {
|
|
@@ -16276,49 +16596,49 @@ var OpenParen$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L4, 'OpenParen
|
|
|
16276
16596
|
function OpenParen(ctx, state2) {
|
|
16277
16597
|
return (0, import_lib4.$EVENT)(ctx, state2, "OpenParen", OpenParen$0);
|
|
16278
16598
|
}
|
|
16279
|
-
var Operator$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16599
|
+
var Operator$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L189, 'Operator "operator"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16280
16600
|
return { $loc, token: $1 };
|
|
16281
16601
|
});
|
|
16282
16602
|
function Operator(ctx, state2) {
|
|
16283
16603
|
return (0, import_lib4.$EVENT)(ctx, state2, "Operator", Operator$0);
|
|
16284
16604
|
}
|
|
16285
|
-
var Override$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16605
|
+
var Override$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L190, 'Override "override"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16286
16606
|
return { $loc, token: $1, ts: true };
|
|
16287
16607
|
});
|
|
16288
16608
|
function Override(ctx, state2) {
|
|
16289
16609
|
return (0, import_lib4.$EVENT)(ctx, state2, "Override", Override$0);
|
|
16290
16610
|
}
|
|
16291
|
-
var Own$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16611
|
+
var Own$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L191, 'Own "own"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16292
16612
|
return { $loc, token: $1 };
|
|
16293
16613
|
});
|
|
16294
16614
|
function Own(ctx, state2) {
|
|
16295
16615
|
return (0, import_lib4.$EVENT)(ctx, state2, "Own", Own$0);
|
|
16296
16616
|
}
|
|
16297
|
-
var Public$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16617
|
+
var Public$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L192, 'Public "public"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16298
16618
|
return { $loc, token: $1 };
|
|
16299
16619
|
});
|
|
16300
16620
|
function Public(ctx, state2) {
|
|
16301
16621
|
return (0, import_lib4.$EVENT)(ctx, state2, "Public", Public$0);
|
|
16302
16622
|
}
|
|
16303
|
-
var Private$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16623
|
+
var Private$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L193, 'Private "private"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16304
16624
|
return { $loc, token: $1 };
|
|
16305
16625
|
});
|
|
16306
16626
|
function Private(ctx, state2) {
|
|
16307
16627
|
return (0, import_lib4.$EVENT)(ctx, state2, "Private", Private$0);
|
|
16308
16628
|
}
|
|
16309
|
-
var Protected$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16629
|
+
var Protected$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L194, 'Protected "protected"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16310
16630
|
return { $loc, token: $1 };
|
|
16311
16631
|
});
|
|
16312
16632
|
function Protected(ctx, state2) {
|
|
16313
16633
|
return (0, import_lib4.$EVENT)(ctx, state2, "Protected", Protected$0);
|
|
16314
16634
|
}
|
|
16315
|
-
var Pipe$0 = (0, import_lib4.$TV)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($
|
|
16635
|
+
var Pipe$0 = (0, import_lib4.$TV)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L195, 'Pipe "||>"'), (0, import_lib4.$EXPECT)($L196, 'Pipe "|\u25B7"')), function($skip, $loc, $0, $1) {
|
|
16316
16636
|
return { $loc, token: "||>" };
|
|
16317
16637
|
});
|
|
16318
|
-
var Pipe$1 = (0, import_lib4.$TV)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($
|
|
16638
|
+
var Pipe$1 = (0, import_lib4.$TV)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L197, 'Pipe "|>="'), (0, import_lib4.$EXPECT)($L198, 'Pipe "\u25B7="')), function($skip, $loc, $0, $1) {
|
|
16319
16639
|
return { $loc, token: "|>=" };
|
|
16320
16640
|
});
|
|
16321
|
-
var Pipe$2 = (0, import_lib4.$TV)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($
|
|
16641
|
+
var Pipe$2 = (0, import_lib4.$TV)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L199, 'Pipe "|>"'), (0, import_lib4.$EXPECT)($L200, 'Pipe "\u25B7"')), function($skip, $loc, $0, $1) {
|
|
16322
16642
|
return { $loc, token: "|>" };
|
|
16323
16643
|
});
|
|
16324
16644
|
var Pipe$$ = [Pipe$0, Pipe$1, Pipe$2];
|
|
@@ -16331,19 +16651,19 @@ var QuestionMark$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L6, 'Questio
|
|
|
16331
16651
|
function QuestionMark(ctx, state2) {
|
|
16332
16652
|
return (0, import_lib4.$EVENT)(ctx, state2, "QuestionMark", QuestionMark$0);
|
|
16333
16653
|
}
|
|
16334
|
-
var Readonly$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16654
|
+
var Readonly$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L201, 'Readonly "readonly"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16335
16655
|
return { $loc, token: $1, ts: true };
|
|
16336
16656
|
});
|
|
16337
16657
|
function Readonly(ctx, state2) {
|
|
16338
16658
|
return (0, import_lib4.$EVENT)(ctx, state2, "Readonly", Readonly$0);
|
|
16339
16659
|
}
|
|
16340
|
-
var Return$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16660
|
+
var Return$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L202, 'Return "return"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16341
16661
|
return { $loc, token: $1 };
|
|
16342
16662
|
});
|
|
16343
16663
|
function Return(ctx, state2) {
|
|
16344
16664
|
return (0, import_lib4.$EVENT)(ctx, state2, "Return", Return$0);
|
|
16345
16665
|
}
|
|
16346
|
-
var Satisfies$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16666
|
+
var Satisfies$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L203, 'Satisfies "satisfies"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16347
16667
|
return { $loc, token: $1 };
|
|
16348
16668
|
});
|
|
16349
16669
|
function Satisfies(ctx, state2) {
|
|
@@ -16355,7 +16675,7 @@ var Semicolon$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L119, 'Semicolo
|
|
|
16355
16675
|
function Semicolon(ctx, state2) {
|
|
16356
16676
|
return (0, import_lib4.$EVENT)(ctx, state2, "Semicolon", Semicolon$0);
|
|
16357
16677
|
}
|
|
16358
|
-
var SingleQuote$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16678
|
+
var SingleQuote$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L204, `SingleQuote "'"`), function($skip, $loc, $0, $1) {
|
|
16359
16679
|
return { $loc, token: $1 };
|
|
16360
16680
|
});
|
|
16361
16681
|
function SingleQuote(ctx, state2) {
|
|
@@ -16367,149 +16687,149 @@ var Star$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L75, 'Star "*"'), fu
|
|
|
16367
16687
|
function Star(ctx, state2) {
|
|
16368
16688
|
return (0, import_lib4.$EVENT)(ctx, state2, "Star", Star$0);
|
|
16369
16689
|
}
|
|
16370
|
-
var Static$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16690
|
+
var Static$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L205, 'Static "static"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16371
16691
|
return { $loc, token: $1 };
|
|
16372
16692
|
});
|
|
16373
|
-
var Static$1 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16693
|
+
var Static$1 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L143, 'Static "@"'), (0, import_lib4.$N)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L4, 'Static "("'), (0, import_lib4.$EXPECT)($L143, 'Static "@"')))), function($skip, $loc, $0, $1, $2) {
|
|
16374
16694
|
return { $loc, token: "static " };
|
|
16375
16695
|
});
|
|
16376
16696
|
var Static$$ = [Static$0, Static$1];
|
|
16377
16697
|
function Static(ctx, state2) {
|
|
16378
16698
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "Static", Static$$);
|
|
16379
16699
|
}
|
|
16380
|
-
var SubstitutionStart$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16700
|
+
var SubstitutionStart$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L206, 'SubstitutionStart "${"'), function($skip, $loc, $0, $1) {
|
|
16381
16701
|
return { $loc, token: $1 };
|
|
16382
16702
|
});
|
|
16383
16703
|
function SubstitutionStart(ctx, state2) {
|
|
16384
16704
|
return (0, import_lib4.$EVENT)(ctx, state2, "SubstitutionStart", SubstitutionStart$0);
|
|
16385
16705
|
}
|
|
16386
|
-
var Super$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16706
|
+
var Super$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L207, 'Super "super"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16387
16707
|
return { $loc, token: $1 };
|
|
16388
16708
|
});
|
|
16389
16709
|
function Super(ctx, state2) {
|
|
16390
16710
|
return (0, import_lib4.$EVENT)(ctx, state2, "Super", Super$0);
|
|
16391
16711
|
}
|
|
16392
|
-
var Switch$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16712
|
+
var Switch$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L208, 'Switch "switch"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16393
16713
|
return { $loc, token: $1 };
|
|
16394
16714
|
});
|
|
16395
16715
|
function Switch(ctx, state2) {
|
|
16396
16716
|
return (0, import_lib4.$EVENT)(ctx, state2, "Switch", Switch$0);
|
|
16397
16717
|
}
|
|
16398
|
-
var Target$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16718
|
+
var Target$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L209, 'Target "target"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16399
16719
|
return { $loc, token: $1 };
|
|
16400
16720
|
});
|
|
16401
16721
|
function Target(ctx, state2) {
|
|
16402
16722
|
return (0, import_lib4.$EVENT)(ctx, state2, "Target", Target$0);
|
|
16403
16723
|
}
|
|
16404
|
-
var Then$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(__, (0, import_lib4.$EXPECT)($
|
|
16724
|
+
var Then$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(__, (0, import_lib4.$EXPECT)($L210, 'Then "then"'), NonIdContinue), function($skip, $loc, $0, $1, $2, $3) {
|
|
16405
16725
|
return { $loc, token: "" };
|
|
16406
16726
|
});
|
|
16407
16727
|
function Then(ctx, state2) {
|
|
16408
16728
|
return (0, import_lib4.$EVENT)(ctx, state2, "Then", Then$0);
|
|
16409
16729
|
}
|
|
16410
|
-
var This$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16730
|
+
var This$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L211, 'This "this"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16411
16731
|
return { $loc, token: $1 };
|
|
16412
16732
|
});
|
|
16413
16733
|
function This(ctx, state2) {
|
|
16414
16734
|
return (0, import_lib4.$EVENT)(ctx, state2, "This", This$0);
|
|
16415
16735
|
}
|
|
16416
|
-
var Throw$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16736
|
+
var Throw$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L212, 'Throw "throw"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16417
16737
|
return { $loc, token: $1 };
|
|
16418
16738
|
});
|
|
16419
16739
|
function Throw(ctx, state2) {
|
|
16420
16740
|
return (0, import_lib4.$EVENT)(ctx, state2, "Throw", Throw$0);
|
|
16421
16741
|
}
|
|
16422
|
-
var TripleDoubleQuote$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16742
|
+
var TripleDoubleQuote$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L213, 'TripleDoubleQuote "\\\\\\"\\\\\\"\\\\\\""'), function($skip, $loc, $0, $1) {
|
|
16423
16743
|
return { $loc, token: "`" };
|
|
16424
16744
|
});
|
|
16425
16745
|
function TripleDoubleQuote(ctx, state2) {
|
|
16426
16746
|
return (0, import_lib4.$EVENT)(ctx, state2, "TripleDoubleQuote", TripleDoubleQuote$0);
|
|
16427
16747
|
}
|
|
16428
|
-
var TripleSingleQuote$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16748
|
+
var TripleSingleQuote$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L214, `TripleSingleQuote "'''"`), function($skip, $loc, $0, $1) {
|
|
16429
16749
|
return { $loc, token: "`" };
|
|
16430
16750
|
});
|
|
16431
16751
|
function TripleSingleQuote(ctx, state2) {
|
|
16432
16752
|
return (0, import_lib4.$EVENT)(ctx, state2, "TripleSingleQuote", TripleSingleQuote$0);
|
|
16433
16753
|
}
|
|
16434
|
-
var TripleSlash$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16754
|
+
var TripleSlash$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L215, 'TripleSlash "///"'), function($skip, $loc, $0, $1) {
|
|
16435
16755
|
return { $loc, token: "/" };
|
|
16436
16756
|
});
|
|
16437
16757
|
function TripleSlash(ctx, state2) {
|
|
16438
16758
|
return (0, import_lib4.$EVENT)(ctx, state2, "TripleSlash", TripleSlash$0);
|
|
16439
16759
|
}
|
|
16440
|
-
var TripleTick$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16760
|
+
var TripleTick$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L216, 'TripleTick "```"'), function($skip, $loc, $0, $1) {
|
|
16441
16761
|
return { $loc, token: "`" };
|
|
16442
16762
|
});
|
|
16443
16763
|
function TripleTick(ctx, state2) {
|
|
16444
16764
|
return (0, import_lib4.$EVENT)(ctx, state2, "TripleTick", TripleTick$0);
|
|
16445
16765
|
}
|
|
16446
|
-
var Try$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16766
|
+
var Try$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L217, 'Try "try"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16447
16767
|
return { $loc, token: $1 };
|
|
16448
16768
|
});
|
|
16449
16769
|
function Try(ctx, state2) {
|
|
16450
16770
|
return (0, import_lib4.$EVENT)(ctx, state2, "Try", Try$0);
|
|
16451
16771
|
}
|
|
16452
|
-
var Typeof$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16772
|
+
var Typeof$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L218, 'Typeof "typeof"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16453
16773
|
return { $loc, token: $1 };
|
|
16454
16774
|
});
|
|
16455
16775
|
function Typeof(ctx, state2) {
|
|
16456
16776
|
return (0, import_lib4.$EVENT)(ctx, state2, "Typeof", Typeof$0);
|
|
16457
16777
|
}
|
|
16458
|
-
var Undefined$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16778
|
+
var Undefined$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L219, 'Undefined "undefined"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16459
16779
|
return { $loc, token: $1 };
|
|
16460
16780
|
});
|
|
16461
16781
|
function Undefined(ctx, state2) {
|
|
16462
16782
|
return (0, import_lib4.$EVENT)(ctx, state2, "Undefined", Undefined$0);
|
|
16463
16783
|
}
|
|
16464
|
-
var Unless$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16784
|
+
var Unless$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L220, 'Unless "unless"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16465
16785
|
return { $loc, token: $1, negated: true };
|
|
16466
16786
|
});
|
|
16467
16787
|
function Unless(ctx, state2) {
|
|
16468
16788
|
return (0, import_lib4.$EVENT)(ctx, state2, "Unless", Unless$0);
|
|
16469
16789
|
}
|
|
16470
|
-
var Until$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16790
|
+
var Until$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L221, 'Until "until"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16471
16791
|
return { $loc, token: $1, negated: true };
|
|
16472
16792
|
});
|
|
16473
16793
|
function Until(ctx, state2) {
|
|
16474
16794
|
return (0, import_lib4.$EVENT)(ctx, state2, "Until", Until$0);
|
|
16475
16795
|
}
|
|
16476
|
-
var Using$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16796
|
+
var Using$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L222, 'Using "using"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16477
16797
|
return { $loc, token: $1 };
|
|
16478
16798
|
});
|
|
16479
16799
|
function Using(ctx, state2) {
|
|
16480
16800
|
return (0, import_lib4.$EVENT)(ctx, state2, "Using", Using$0);
|
|
16481
16801
|
}
|
|
16482
|
-
var Var$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16802
|
+
var Var$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L182, 'Var "var"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16483
16803
|
return { $loc, token: $1 };
|
|
16484
16804
|
});
|
|
16485
16805
|
function Var(ctx, state2) {
|
|
16486
16806
|
return (0, import_lib4.$EVENT)(ctx, state2, "Var", Var$0);
|
|
16487
16807
|
}
|
|
16488
|
-
var Void$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16808
|
+
var Void$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L223, 'Void "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16489
16809
|
return { $loc, token: $1 };
|
|
16490
16810
|
});
|
|
16491
16811
|
function Void(ctx, state2) {
|
|
16492
16812
|
return (0, import_lib4.$EVENT)(ctx, state2, "Void", Void$0);
|
|
16493
16813
|
}
|
|
16494
|
-
var When$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16814
|
+
var When$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L224, 'When "when"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16495
16815
|
return { $loc, token: "case" };
|
|
16496
16816
|
});
|
|
16497
16817
|
function When(ctx, state2) {
|
|
16498
16818
|
return (0, import_lib4.$EVENT)(ctx, state2, "When", When$0);
|
|
16499
16819
|
}
|
|
16500
|
-
var While$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16820
|
+
var While$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L225, 'While "while"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16501
16821
|
return { $loc, token: $1 };
|
|
16502
16822
|
});
|
|
16503
16823
|
function While(ctx, state2) {
|
|
16504
16824
|
return (0, import_lib4.$EVENT)(ctx, state2, "While", While$0);
|
|
16505
16825
|
}
|
|
16506
|
-
var With$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16826
|
+
var With$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L131, 'With "with"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16507
16827
|
return { $loc, token: $1 };
|
|
16508
16828
|
});
|
|
16509
16829
|
function With(ctx, state2) {
|
|
16510
16830
|
return (0, import_lib4.$EVENT)(ctx, state2, "With", With$0);
|
|
16511
16831
|
}
|
|
16512
|
-
var Yield$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16832
|
+
var Yield$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L226, 'Yield "yield"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16513
16833
|
return { $loc, token: $1, type: "Yield" };
|
|
16514
16834
|
});
|
|
16515
16835
|
function Yield(ctx, state2) {
|
|
@@ -16528,7 +16848,7 @@ var JSXImplicitFragment$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(JSXTag, (0,
|
|
|
16528
16848
|
],
|
|
16529
16849
|
jsxChildren: [$1].concat($2.map(([, tag]) => tag))
|
|
16530
16850
|
};
|
|
16531
|
-
const type = typeOfJSX(jsx, config
|
|
16851
|
+
const type = typeOfJSX(jsx, config);
|
|
16532
16852
|
return type ? [
|
|
16533
16853
|
{ ts: true, children: ["("] },
|
|
16534
16854
|
jsx,
|
|
@@ -16588,7 +16908,7 @@ var JSXElement$$ = [JSXElement$0, JSXElement$1, JSXElement$2];
|
|
|
16588
16908
|
function JSXElement(ctx, state2) {
|
|
16589
16909
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "JSXElement", JSXElement$$);
|
|
16590
16910
|
}
|
|
16591
|
-
var JSXSelfClosingElement$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L19, 'JSXSelfClosingElement "<"'), JSXElementName, (0, import_lib4.$E)(TypeArguments), (0, import_lib4.$E)(JSXAttributes), (0, import_lib4.$E)(Whitespace), (0, import_lib4.$EXPECT)($
|
|
16911
|
+
var JSXSelfClosingElement$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L19, 'JSXSelfClosingElement "<"'), JSXElementName, (0, import_lib4.$E)(TypeArguments), (0, import_lib4.$E)(JSXAttributes), (0, import_lib4.$E)(Whitespace), (0, import_lib4.$EXPECT)($L227, 'JSXSelfClosingElement "/>"')), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
16592
16912
|
return { type: "JSXElement", children: $0, tag: $2 };
|
|
16593
16913
|
});
|
|
16594
16914
|
function JSXSelfClosingElement(ctx, state2) {
|
|
@@ -16622,7 +16942,7 @@ var JSXOptionalClosingElement$$ = [JSXOptionalClosingElement$0, JSXOptionalClosi
|
|
|
16622
16942
|
function JSXOptionalClosingElement(ctx, state2) {
|
|
16623
16943
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "JSXOptionalClosingElement", JSXOptionalClosingElement$$);
|
|
16624
16944
|
}
|
|
16625
|
-
var JSXClosingElement$0 = (0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
16945
|
+
var JSXClosingElement$0 = (0, import_lib4.$S)((0, import_lib4.$EXPECT)($L228, 'JSXClosingElement "</"'), (0, import_lib4.$E)(Whitespace), JSXElementName, (0, import_lib4.$E)(Whitespace), (0, import_lib4.$EXPECT)($L45, 'JSXClosingElement ">"'));
|
|
16626
16946
|
function JSXClosingElement(ctx, state2) {
|
|
16627
16947
|
return (0, import_lib4.$EVENT)(ctx, state2, "JSXClosingElement", JSXClosingElement$0);
|
|
16628
16948
|
}
|
|
@@ -16643,7 +16963,7 @@ var JSXFragment$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$N)
|
|
|
16643
16963
|
];
|
|
16644
16964
|
return { type: "JSXFragment", children: parts, jsxChildren: children.jsxChildren };
|
|
16645
16965
|
});
|
|
16646
|
-
var JSXFragment$1 = (0, import_lib4.$TS)((0, import_lib4.$S)(CoffeeJSXEnabled, (0, import_lib4.$EXPECT)($
|
|
16966
|
+
var JSXFragment$1 = (0, import_lib4.$TS)((0, import_lib4.$S)(CoffeeJSXEnabled, (0, import_lib4.$EXPECT)($L229, 'JSXFragment "<>"'), (0, import_lib4.$E)(JSXChildren), (0, import_lib4.$E)(Whitespace), JSXClosingFragment), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
16647
16967
|
var children = $3;
|
|
16648
16968
|
$0 = $0.slice(1);
|
|
16649
16969
|
return {
|
|
@@ -16656,7 +16976,7 @@ var JSXFragment$$ = [JSXFragment$0, JSXFragment$1];
|
|
|
16656
16976
|
function JSXFragment(ctx, state2) {
|
|
16657
16977
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "JSXFragment", JSXFragment$$);
|
|
16658
16978
|
}
|
|
16659
|
-
var PushJSXOpeningFragment$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
16979
|
+
var PushJSXOpeningFragment$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L229, 'PushJSXOpeningFragment "<>"'), function($skip, $loc, $0, $1) {
|
|
16660
16980
|
state.JSXTagStack.push("");
|
|
16661
16981
|
return $1;
|
|
16662
16982
|
});
|
|
@@ -16673,11 +16993,11 @@ var JSXOptionalClosingFragment$$ = [JSXOptionalClosingFragment$0, JSXOptionalClo
|
|
|
16673
16993
|
function JSXOptionalClosingFragment(ctx, state2) {
|
|
16674
16994
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "JSXOptionalClosingFragment", JSXOptionalClosingFragment$$);
|
|
16675
16995
|
}
|
|
16676
|
-
var JSXClosingFragment$0 = (0, import_lib4.$EXPECT)($
|
|
16996
|
+
var JSXClosingFragment$0 = (0, import_lib4.$EXPECT)($L230, 'JSXClosingFragment "</>"');
|
|
16677
16997
|
function JSXClosingFragment(ctx, state2) {
|
|
16678
16998
|
return (0, import_lib4.$EVENT)(ctx, state2, "JSXClosingFragment", JSXClosingFragment$0);
|
|
16679
16999
|
}
|
|
16680
|
-
var JSXElementName$0 = (0, import_lib4.$TV)((0, import_lib4.$Y)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($
|
|
17000
|
+
var JSXElementName$0 = (0, import_lib4.$TV)((0, import_lib4.$Y)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L175, 'JSXElementName "#"'), Dot), JSXShorthandString)), function($skip, $loc, $0, $1) {
|
|
16681
17001
|
return config.defaultElement;
|
|
16682
17002
|
});
|
|
16683
17003
|
var JSXElementName$1 = (0, import_lib4.$TEXT)((0, import_lib4.$S)(JSXIdentifierName, (0, import_lib4.$C)((0, import_lib4.$S)(Colon, JSXIdentifierName), (0, import_lib4.$Q)((0, import_lib4.$S)(Dot, JSXIdentifierName)))));
|
|
@@ -16855,7 +17175,7 @@ var JSXAttribute$4 = (0, import_lib4.$TS)((0, import_lib4.$S)(Identifier, (0, im
|
|
|
16855
17175
|
}
|
|
16856
17176
|
return $skip;
|
|
16857
17177
|
});
|
|
16858
|
-
var JSXAttribute$5 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
17178
|
+
var JSXAttribute$5 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L175, 'JSXAttribute "#"'), JSXShorthandString), function($skip, $loc, $0, $1, $2) {
|
|
16859
17179
|
return [" ", "id=", $2];
|
|
16860
17180
|
});
|
|
16861
17181
|
var JSXAttribute$6 = (0, import_lib4.$TS)((0, import_lib4.$S)(Dot, JSXShorthandString), function($skip, $loc, $0, $1, $2) {
|
|
@@ -17200,7 +17520,7 @@ var JSXChildGeneral$$ = [JSXChildGeneral$0, JSXChildGeneral$1, JSXChildGeneral$2
|
|
|
17200
17520
|
function JSXChildGeneral(ctx, state2) {
|
|
17201
17521
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "JSXChildGeneral", JSXChildGeneral$$);
|
|
17202
17522
|
}
|
|
17203
|
-
var JSXComment$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
17523
|
+
var JSXComment$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L231, 'JSXComment "<!--"'), JSXCommentContent, (0, import_lib4.$EXPECT)($L232, 'JSXComment "-->"')), function($skip, $loc, $0, $1, $2, $3) {
|
|
17204
17524
|
return ["{/*", $2, "*/}"];
|
|
17205
17525
|
});
|
|
17206
17526
|
function JSXComment(ctx, state2) {
|
|
@@ -17488,37 +17808,37 @@ var InterfaceExtendsTarget$0 = ImplementsTarget;
|
|
|
17488
17808
|
function InterfaceExtendsTarget(ctx, state2) {
|
|
17489
17809
|
return (0, import_lib4.$EVENT)(ctx, state2, "InterfaceExtendsTarget", InterfaceExtendsTarget$0);
|
|
17490
17810
|
}
|
|
17491
|
-
var TypeKeyword$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
17811
|
+
var TypeKeyword$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L233, 'TypeKeyword "type"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
17492
17812
|
return { $loc, token: $1 };
|
|
17493
17813
|
});
|
|
17494
17814
|
function TypeKeyword(ctx, state2) {
|
|
17495
17815
|
return (0, import_lib4.$EVENT)(ctx, state2, "TypeKeyword", TypeKeyword$0);
|
|
17496
17816
|
}
|
|
17497
|
-
var Enum$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
17817
|
+
var Enum$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L234, 'Enum "enum"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
17498
17818
|
return { $loc, token: $1 };
|
|
17499
17819
|
});
|
|
17500
17820
|
function Enum(ctx, state2) {
|
|
17501
17821
|
return (0, import_lib4.$EVENT)(ctx, state2, "Enum", Enum$0);
|
|
17502
17822
|
}
|
|
17503
|
-
var Interface$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
17823
|
+
var Interface$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L235, 'Interface "interface"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
17504
17824
|
return { $loc, token: $1 };
|
|
17505
17825
|
});
|
|
17506
17826
|
function Interface(ctx, state2) {
|
|
17507
17827
|
return (0, import_lib4.$EVENT)(ctx, state2, "Interface", Interface$0);
|
|
17508
17828
|
}
|
|
17509
|
-
var Global$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
17829
|
+
var Global$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L236, 'Global "global"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
17510
17830
|
return { $loc, token: $1 };
|
|
17511
17831
|
});
|
|
17512
17832
|
function Global(ctx, state2) {
|
|
17513
17833
|
return (0, import_lib4.$EVENT)(ctx, state2, "Global", Global$0);
|
|
17514
17834
|
}
|
|
17515
|
-
var Module$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
17835
|
+
var Module$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L237, 'Module "module"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
17516
17836
|
return { $loc, token: $1 };
|
|
17517
17837
|
});
|
|
17518
17838
|
function Module(ctx, state2) {
|
|
17519
17839
|
return (0, import_lib4.$EVENT)(ctx, state2, "Module", Module$0);
|
|
17520
17840
|
}
|
|
17521
|
-
var Namespace$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
17841
|
+
var Namespace$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L238, 'Namespace "namespace"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
17522
17842
|
return { $loc, token: $1 };
|
|
17523
17843
|
});
|
|
17524
17844
|
function Namespace(ctx, state2) {
|
|
@@ -17832,14 +18152,14 @@ var ReturnTypeSuffix$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib
|
|
|
17832
18152
|
function ReturnTypeSuffix(ctx, state2) {
|
|
17833
18153
|
return (0, import_lib4.$EVENT)(ctx, state2, "ReturnTypeSuffix", ReturnTypeSuffix$0);
|
|
17834
18154
|
}
|
|
17835
|
-
var ReturnType$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)((0, import_lib4.$S)(__, (0, import_lib4.$EXPECT)($
|
|
18155
|
+
var ReturnType$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)((0, import_lib4.$S)(__, (0, import_lib4.$EXPECT)($L239, 'ReturnType "asserts"'), NonIdContinue)), ForbidIndentedApplication, (0, import_lib4.$E)(TypePredicate), RestoreIndentedApplication), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
17836
18156
|
var asserts = $1;
|
|
17837
18157
|
var t = $3;
|
|
17838
18158
|
if (!t)
|
|
17839
18159
|
return $skip;
|
|
17840
18160
|
if (asserts) {
|
|
17841
18161
|
t = {
|
|
17842
|
-
type: "
|
|
18162
|
+
type: "TypeAsserts",
|
|
17843
18163
|
t,
|
|
17844
18164
|
children: [asserts[0], asserts[1], t],
|
|
17845
18165
|
ts: true
|
|
@@ -17933,8 +18253,8 @@ var TypeUnarySuffix$$ = [TypeUnarySuffix$0, TypeUnarySuffix$1, TypeUnarySuffix$2
|
|
|
17933
18253
|
function TypeUnarySuffix(ctx, state2) {
|
|
17934
18254
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "TypeUnarySuffix", TypeUnarySuffix$$);
|
|
17935
18255
|
}
|
|
17936
|
-
var TypeUnaryOp$0 = (0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
17937
|
-
var TypeUnaryOp$1 = (0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
18256
|
+
var TypeUnaryOp$0 = (0, import_lib4.$S)((0, import_lib4.$EXPECT)($L240, 'TypeUnaryOp "keyof"'), NonIdContinue);
|
|
18257
|
+
var TypeUnaryOp$1 = (0, import_lib4.$S)((0, import_lib4.$EXPECT)($L201, 'TypeUnaryOp "readonly"'), NonIdContinue);
|
|
17938
18258
|
var TypeUnaryOp$$ = [TypeUnaryOp$0, TypeUnaryOp$1];
|
|
17939
18259
|
function TypeUnaryOp(ctx, state2) {
|
|
17940
18260
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "TypeUnaryOp", TypeUnaryOp$$);
|
|
@@ -17964,7 +18284,7 @@ var TypeIndexedAccess$$ = [TypeIndexedAccess$0, TypeIndexedAccess$1, TypeIndexed
|
|
|
17964
18284
|
function TypeIndexedAccess(ctx, state2) {
|
|
17965
18285
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "TypeIndexedAccess", TypeIndexedAccess$$);
|
|
17966
18286
|
}
|
|
17967
|
-
var UnknownAlias$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
18287
|
+
var UnknownAlias$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L241, 'UnknownAlias "???"'), function($skip, $loc, $0, $1) {
|
|
17968
18288
|
return { $loc, token: "unknown" };
|
|
17969
18289
|
});
|
|
17970
18290
|
function UnknownAlias(ctx, state2) {
|
|
@@ -18035,12 +18355,17 @@ var ImportType$$ = [ImportType$0, ImportType$1];
|
|
|
18035
18355
|
function ImportType(ctx, state2) {
|
|
18036
18356
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "ImportType", ImportType$$);
|
|
18037
18357
|
}
|
|
18038
|
-
var TypeTuple$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(OpenBracket, AllowAll, (0, import_lib4.$E)(
|
|
18039
|
-
|
|
18358
|
+
var TypeTuple$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(OpenBracket, AllowAll, (0, import_lib4.$E)(TypeTupleContent), RestoreAll, __, CloseBracket), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
18359
|
+
var open = $1;
|
|
18360
|
+
var elements = $3;
|
|
18361
|
+
var ws = $5;
|
|
18362
|
+
var close = $6;
|
|
18363
|
+
if (!elements)
|
|
18040
18364
|
return $skip;
|
|
18041
18365
|
return {
|
|
18042
18366
|
type: "TypeTuple",
|
|
18043
|
-
|
|
18367
|
+
elements,
|
|
18368
|
+
children: [open, elements, ws, close]
|
|
18044
18369
|
};
|
|
18045
18370
|
});
|
|
18046
18371
|
function TypeTuple(ctx, state2) {
|
|
@@ -18102,19 +18427,28 @@ var TypeElement$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(__, (0, import_lib4
|
|
|
18102
18427
|
message: "... both before and after identifier"
|
|
18103
18428
|
}];
|
|
18104
18429
|
}
|
|
18105
|
-
return
|
|
18430
|
+
return {
|
|
18431
|
+
type: "TypeElement",
|
|
18432
|
+
name,
|
|
18433
|
+
t: type,
|
|
18434
|
+
children: [ws, dots, name, colon, type]
|
|
18435
|
+
};
|
|
18106
18436
|
});
|
|
18107
18437
|
var TypeElement$1 = (0, import_lib4.$S)(__, DotDotDot, __, Type);
|
|
18108
18438
|
var TypeElement$2 = (0, import_lib4.$TS)((0, import_lib4.$S)(Type, (0, import_lib4.$E)((0, import_lib4.$S)((0, import_lib4.$E)(_), DotDotDot))), function($skip, $loc, $0, $1, $2) {
|
|
18109
18439
|
var type = $1;
|
|
18110
18440
|
var spaceDots = $2;
|
|
18111
|
-
if (
|
|
18112
|
-
|
|
18113
|
-
|
|
18114
|
-
|
|
18115
|
-
|
|
18116
|
-
|
|
18117
|
-
return
|
|
18441
|
+
if (spaceDots) {
|
|
18442
|
+
const [space, dots] = spaceDots;
|
|
18443
|
+
const ws = getTrimmingSpace(type);
|
|
18444
|
+
spaceDots = [ws, dots, space];
|
|
18445
|
+
type = trimFirstSpace(type);
|
|
18446
|
+
}
|
|
18447
|
+
return {
|
|
18448
|
+
type: "TypeElement",
|
|
18449
|
+
t: type,
|
|
18450
|
+
children: [spaceDots, type]
|
|
18451
|
+
};
|
|
18118
18452
|
});
|
|
18119
18453
|
var TypeElement$$ = [TypeElement$0, TypeElement$1, TypeElement$2];
|
|
18120
18454
|
function TypeElement(ctx, state2) {
|
|
@@ -18343,13 +18677,13 @@ var TypeLiteral$2 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EX
|
|
|
18343
18677
|
return num;
|
|
18344
18678
|
return $0;
|
|
18345
18679
|
});
|
|
18346
|
-
var TypeLiteral$3 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
18680
|
+
var TypeLiteral$3 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L223, 'TypeLiteral "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
18347
18681
|
return { type: "VoidType", $loc, token: $1 };
|
|
18348
18682
|
});
|
|
18349
|
-
var TypeLiteral$4 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
18683
|
+
var TypeLiteral$4 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L242, 'TypeLiteral "unique"'), _, (0, import_lib4.$EXPECT)($L243, 'TypeLiteral "symbol"'), NonIdContinue), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
18350
18684
|
return { type: "UniqueSymbolType", children: $0 };
|
|
18351
18685
|
});
|
|
18352
|
-
var TypeLiteral$5 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($
|
|
18686
|
+
var TypeLiteral$5 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L244, 'TypeLiteral "[]"'), function($skip, $loc, $0, $1) {
|
|
18353
18687
|
return { $loc, token: "[]" };
|
|
18354
18688
|
});
|
|
18355
18689
|
var TypeLiteral$$ = [TypeLiteral$0, TypeLiteral$1, TypeLiteral$2, TypeLiteral$3, TypeLiteral$4, TypeLiteral$5];
|
|
@@ -18368,7 +18702,7 @@ var InlineInterfacePropertyDelimiter$0 = (0, import_lib4.$C)((0, import_lib4.$S)
|
|
|
18368
18702
|
var InlineInterfacePropertyDelimiter$1 = (0, import_lib4.$T)((0, import_lib4.$S)((0, import_lib4.$Y)((0, import_lib4.$S)(SameLineOrIndentedFurther, InlineBasicInterfaceProperty)), InsertComma), function(value) {
|
|
18369
18703
|
return value[1];
|
|
18370
18704
|
});
|
|
18371
|
-
var InlineInterfacePropertyDelimiter$2 = (0, import_lib4.$Y)((0, import_lib4.$S)(__, (0, import_lib4.$C)((0, import_lib4.$EXPECT)($L16, 'InlineInterfacePropertyDelimiter ":"'), (0, import_lib4.$EXPECT)($
|
|
18705
|
+
var InlineInterfacePropertyDelimiter$2 = (0, import_lib4.$Y)((0, import_lib4.$S)(__, (0, import_lib4.$C)((0, import_lib4.$EXPECT)($L16, 'InlineInterfacePropertyDelimiter ":"'), (0, import_lib4.$EXPECT)($L140, 'InlineInterfacePropertyDelimiter ")"'), (0, import_lib4.$EXPECT)($L46, 'InlineInterfacePropertyDelimiter "]"'), (0, import_lib4.$EXPECT)($L37, 'InlineInterfacePropertyDelimiter "}"'))));
|
|
18372
18706
|
var InlineInterfacePropertyDelimiter$3 = (0, import_lib4.$Y)(EOS);
|
|
18373
18707
|
var InlineInterfacePropertyDelimiter$$ = [InlineInterfacePropertyDelimiter$0, InlineInterfacePropertyDelimiter$1, InlineInterfacePropertyDelimiter$2, InlineInterfacePropertyDelimiter$3];
|
|
18374
18708
|
function InlineInterfacePropertyDelimiter(ctx, state2) {
|
|
@@ -18384,31 +18718,54 @@ var TypeBinaryOp$$ = [TypeBinaryOp$0, TypeBinaryOp$1];
|
|
|
18384
18718
|
function TypeBinaryOp(ctx, state2) {
|
|
18385
18719
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "TypeBinaryOp", TypeBinaryOp$$);
|
|
18386
18720
|
}
|
|
18387
|
-
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, __,
|
|
18388
|
-
var
|
|
18389
|
-
|
|
18390
|
-
|
|
18721
|
+
var TypeFunction$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)((0, import_lib4.$S)(Abstract, (0, import_lib4.$E)(_))), (0, import_lib4.$E)((0, import_lib4.$S)(Async, (0, import_lib4.$E)(_))), (0, import_lib4.$E)((0, import_lib4.$S)(New, (0, import_lib4.$E)(_))), Parameters, __, TypeFunctionArrow, (0, import_lib4.$C)(ReturnType, Loc)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
|
|
18722
|
+
var abstract = $1;
|
|
18723
|
+
var async = $2;
|
|
18724
|
+
var new_ = $3;
|
|
18725
|
+
var returnType = $7;
|
|
18726
|
+
const children = [abstract, ...$0.slice(2)];
|
|
18727
|
+
if (abstract && !new_) {
|
|
18391
18728
|
children[1] = {
|
|
18392
18729
|
type: "Error",
|
|
18393
18730
|
message: "abstract function types must be constructors (abstract new)"
|
|
18394
18731
|
};
|
|
18395
18732
|
}
|
|
18396
|
-
if (
|
|
18397
|
-
|
|
18733
|
+
if (returnType.$loc && returnType.token === "") {
|
|
18734
|
+
const t = {
|
|
18735
|
+
type: "VoidType",
|
|
18736
|
+
$loc: returnType.$loc,
|
|
18737
|
+
token: "void"
|
|
18738
|
+
};
|
|
18739
|
+
children[children.length - 1] = returnType = {
|
|
18740
|
+
type: "ReturnTypeAnnotation",
|
|
18741
|
+
ts: true,
|
|
18742
|
+
t,
|
|
18743
|
+
children: [t]
|
|
18744
|
+
};
|
|
18745
|
+
}
|
|
18746
|
+
if (async) {
|
|
18747
|
+
const t = wrapTypeInPromise(returnType.t);
|
|
18748
|
+
children[children.length - 1] = returnType = {
|
|
18749
|
+
...returnType,
|
|
18750
|
+
t,
|
|
18751
|
+
children: returnType.children.map(($) => $ === returnType.t ? t : $)
|
|
18752
|
+
};
|
|
18753
|
+
}
|
|
18398
18754
|
return {
|
|
18399
18755
|
type: "TypeFunction",
|
|
18400
18756
|
children,
|
|
18401
|
-
ts: true
|
|
18757
|
+
ts: true,
|
|
18758
|
+
returnType
|
|
18402
18759
|
};
|
|
18403
18760
|
});
|
|
18404
18761
|
function TypeFunction(ctx, state2) {
|
|
18405
18762
|
return (0, import_lib4.$EVENT)(ctx, state2, "TypeFunction", TypeFunction$0);
|
|
18406
18763
|
}
|
|
18407
|
-
var
|
|
18764
|
+
var TypeFunctionArrow$0 = (0, import_lib4.$TV)((0, import_lib4.$C)((0, import_lib4.$EXPECT)($L13, 'TypeFunctionArrow "=>"'), (0, import_lib4.$EXPECT)($L14, 'TypeFunctionArrow "\u21D2"'), (0, import_lib4.$EXPECT)($L35, 'TypeFunctionArrow "->"'), (0, import_lib4.$EXPECT)($L36, 'TypeFunctionArrow "\u2192"')), function($skip, $loc, $0, $1) {
|
|
18408
18765
|
return { $loc, token: "=>" };
|
|
18409
18766
|
});
|
|
18410
|
-
function
|
|
18411
|
-
return (0, import_lib4.$EVENT)(ctx, state2, "
|
|
18767
|
+
function TypeFunctionArrow(ctx, state2) {
|
|
18768
|
+
return (0, import_lib4.$EVENT)(ctx, state2, "TypeFunctionArrow", TypeFunctionArrow$0);
|
|
18412
18769
|
}
|
|
18413
18770
|
var TypeArguments$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(OpenAngleBracket, (0, import_lib4.$P)((0, import_lib4.$S)(__, TypeArgumentDelimited)), __, CloseAngleBracket), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
18414
18771
|
var args = $2;
|
|
@@ -18584,7 +18941,7 @@ var CivetPrologue$$ = [CivetPrologue$0, CivetPrologue$1];
|
|
|
18584
18941
|
function CivetPrologue(ctx, state2) {
|
|
18585
18942
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "CivetPrologue", CivetPrologue$$);
|
|
18586
18943
|
}
|
|
18587
|
-
var CivetPrologueContent$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($
|
|
18944
|
+
var CivetPrologueContent$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L245, 'CivetPrologueContent "civet"'), NonIdContinue, (0, import_lib4.$Q)(CivetOption), (0, import_lib4.$EXPECT)($R95, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
18588
18945
|
var options = $3;
|
|
18589
18946
|
return {
|
|
18590
18947
|
type: "CivetPrologue",
|