@danielx/civet 0.6.86 → 0.6.88
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/README.md +3 -4
- package/dist/browser.js +607 -254
- package/dist/civet +106 -10
- package/dist/esm.mjs +0 -11
- package/dist/main.js +607 -254
- package/dist/main.mjs +607 -254
- package/package.json +2 -2
- package/register.js +20 -4
package/dist/browser.js
CHANGED
|
@@ -1712,7 +1712,11 @@ var Civet = (() => {
|
|
|
1712
1712
|
}
|
|
1713
1713
|
case "Identifier":
|
|
1714
1714
|
case "BindingProperty": {
|
|
1715
|
-
const children = [
|
|
1715
|
+
const children = [
|
|
1716
|
+
// { name: value } = ... declares value, not name
|
|
1717
|
+
pattern.value ?? pattern.name,
|
|
1718
|
+
pattern.delim
|
|
1719
|
+
];
|
|
1716
1720
|
if (isWhitespaceOrEmpty(pattern.children[0])) {
|
|
1717
1721
|
children.unshift(pattern.children[0]);
|
|
1718
1722
|
}
|
|
@@ -2320,6 +2324,111 @@ var Civet = (() => {
|
|
|
2320
2324
|
}
|
|
2321
2325
|
}
|
|
2322
2326
|
}
|
|
2327
|
+
function dynamizeFromClause(from) {
|
|
2328
|
+
from = from.slice(1);
|
|
2329
|
+
from = insertTrimmingSpace(from, "");
|
|
2330
|
+
if (from.at(-1)?.type === "ImportAssertion") {
|
|
2331
|
+
const assert2 = from.pop();
|
|
2332
|
+
from.push(", {", assert2.keyword, ":", assert2.object, "}");
|
|
2333
|
+
}
|
|
2334
|
+
return ["(", ...from, ")"];
|
|
2335
|
+
}
|
|
2336
|
+
function dynamizeImportDeclaration(decl) {
|
|
2337
|
+
const { imports } = decl;
|
|
2338
|
+
let { star, binding, specifiers } = imports;
|
|
2339
|
+
const justDefault = binding && !specifiers && !star;
|
|
2340
|
+
const pattern = (() => {
|
|
2341
|
+
{
|
|
2342
|
+
if (binding) {
|
|
2343
|
+
if (specifiers) {
|
|
2344
|
+
return makeRef();
|
|
2345
|
+
} else {
|
|
2346
|
+
return binding;
|
|
2347
|
+
}
|
|
2348
|
+
} else {
|
|
2349
|
+
return convertNamedImportsToObject(imports, true);
|
|
2350
|
+
}
|
|
2351
|
+
}
|
|
2352
|
+
})();
|
|
2353
|
+
const c = "const";
|
|
2354
|
+
const initializer = [
|
|
2355
|
+
" = ",
|
|
2356
|
+
justDefault ? "(" : void 0,
|
|
2357
|
+
{ type: "Await", children: ["await"] },
|
|
2358
|
+
" ",
|
|
2359
|
+
decl.children[0],
|
|
2360
|
+
// import
|
|
2361
|
+
dynamizeFromClause(decl.from),
|
|
2362
|
+
justDefault ? ").default" : void 0
|
|
2363
|
+
];
|
|
2364
|
+
const bindings = [{
|
|
2365
|
+
type: "Binding",
|
|
2366
|
+
names: pattern.names,
|
|
2367
|
+
pattern,
|
|
2368
|
+
initializer,
|
|
2369
|
+
children: [pattern, initializer]
|
|
2370
|
+
}];
|
|
2371
|
+
if (binding && specifiers) {
|
|
2372
|
+
const pattern2 = binding;
|
|
2373
|
+
const initializer2 = [
|
|
2374
|
+
" = ",
|
|
2375
|
+
pattern,
|
|
2376
|
+
".default"
|
|
2377
|
+
];
|
|
2378
|
+
bindings.push({
|
|
2379
|
+
type: "Binding",
|
|
2380
|
+
names: binding.names,
|
|
2381
|
+
pattern: pattern2,
|
|
2382
|
+
initializer: initializer2,
|
|
2383
|
+
children: [pattern2, initializer2]
|
|
2384
|
+
});
|
|
2385
|
+
const pattern3 = convertNamedImportsToObject(imports.children.at(-1), true);
|
|
2386
|
+
const initializer3 = [
|
|
2387
|
+
" = ",
|
|
2388
|
+
pattern
|
|
2389
|
+
];
|
|
2390
|
+
bindings.push({
|
|
2391
|
+
type: "Binding",
|
|
2392
|
+
names: specifiers.names,
|
|
2393
|
+
pattern: pattern3,
|
|
2394
|
+
initializer: initializer3,
|
|
2395
|
+
children: [pattern3, initializer3]
|
|
2396
|
+
});
|
|
2397
|
+
}
|
|
2398
|
+
return {
|
|
2399
|
+
type: "Declaration",
|
|
2400
|
+
names: imports.names,
|
|
2401
|
+
bindings,
|
|
2402
|
+
decl: c,
|
|
2403
|
+
children: [
|
|
2404
|
+
c,
|
|
2405
|
+
" ",
|
|
2406
|
+
bindings.flatMap((binding2, i) => i > 0 ? [", ", binding2] : [binding2])
|
|
2407
|
+
]
|
|
2408
|
+
};
|
|
2409
|
+
}
|
|
2410
|
+
function dynamizeImportDeclarationExpression($0) {
|
|
2411
|
+
const [imp, ws1, named, ws2, from] = $0;
|
|
2412
|
+
const object = convertNamedImportsToObject(named);
|
|
2413
|
+
const dot = ".";
|
|
2414
|
+
return processCallMemberExpression({
|
|
2415
|
+
type: "CallExpression",
|
|
2416
|
+
children: [
|
|
2417
|
+
{ type: "Await", children: "await" },
|
|
2418
|
+
" ",
|
|
2419
|
+
imp,
|
|
2420
|
+
insertTrimmingSpace(ws2, ""),
|
|
2421
|
+
dynamizeFromClause(from),
|
|
2422
|
+
{
|
|
2423
|
+
type: "PropertyGlob",
|
|
2424
|
+
dot,
|
|
2425
|
+
object,
|
|
2426
|
+
children: [ws1, dot, object],
|
|
2427
|
+
reversed: true
|
|
2428
|
+
}
|
|
2429
|
+
]
|
|
2430
|
+
});
|
|
2431
|
+
}
|
|
2323
2432
|
var init_declaration = __esm({
|
|
2324
2433
|
"source/parser/declaration.civet"() {
|
|
2325
2434
|
"use strict";
|
|
@@ -2329,6 +2438,7 @@ var Civet = (() => {
|
|
|
2329
2438
|
init_util();
|
|
2330
2439
|
init_function();
|
|
2331
2440
|
init_binding();
|
|
2441
|
+
init_lib();
|
|
2332
2442
|
}
|
|
2333
2443
|
});
|
|
2334
2444
|
|
|
@@ -3145,10 +3255,13 @@ var Civet = (() => {
|
|
|
3145
3255
|
adjustIndexAccess: () => adjustIndexAccess,
|
|
3146
3256
|
attachPostfixStatementAsExpression: () => attachPostfixStatementAsExpression,
|
|
3147
3257
|
blockWithPrefix: () => blockWithPrefix,
|
|
3258
|
+
convertNamedImportsToObject: () => convertNamedImportsToObject,
|
|
3148
3259
|
convertObjectToJSXAttributes: () => convertObjectToJSXAttributes,
|
|
3149
3260
|
dedentBlockString: () => dedentBlockString,
|
|
3150
3261
|
dedentBlockSubstitutions: () => dedentBlockSubstitutions,
|
|
3151
3262
|
deepCopy: () => deepCopy,
|
|
3263
|
+
dynamizeImportDeclaration: () => dynamizeImportDeclaration,
|
|
3264
|
+
dynamizeImportDeclarationExpression: () => dynamizeImportDeclarationExpression,
|
|
3152
3265
|
expressionizeTypeIf: () => expressionizeTypeIf,
|
|
3153
3266
|
forRange: () => forRange,
|
|
3154
3267
|
gatherBindingCode: () => gatherBindingCode,
|
|
@@ -3207,8 +3320,11 @@ var Civet = (() => {
|
|
|
3207
3320
|
return post;
|
|
3208
3321
|
}
|
|
3209
3322
|
function adjustIndexAccess(dot) {
|
|
3210
|
-
if (
|
|
3211
|
-
|
|
3323
|
+
if (dot.optional) {
|
|
3324
|
+
return {
|
|
3325
|
+
...dot,
|
|
3326
|
+
children: [...dot.children, "["]
|
|
3327
|
+
};
|
|
3212
3328
|
} else {
|
|
3213
3329
|
dot = replaceNodes(
|
|
3214
3330
|
deepCopy(dot),
|
|
@@ -3417,9 +3533,13 @@ var Civet = (() => {
|
|
|
3417
3533
|
throw new Error(`Glob pattern must have call or member expression value, found ${JSON.stringify(part.value)}`);
|
|
3418
3534
|
}
|
|
3419
3535
|
let suppressPrefix = false;
|
|
3420
|
-
let
|
|
3536
|
+
let name = part.name;
|
|
3537
|
+
let value = part.value ?? name;
|
|
3421
3538
|
const wValue = getTrimmingSpace(part.value);
|
|
3422
3539
|
[value, suppressPrefix] = handleThisPrivateShorthands(value);
|
|
3540
|
+
if (glob.reversed) {
|
|
3541
|
+
[name, value] = [value, name];
|
|
3542
|
+
}
|
|
3423
3543
|
if (!suppressPrefix) {
|
|
3424
3544
|
value = prefix.concat(insertTrimmingSpace(value, ""));
|
|
3425
3545
|
}
|
|
@@ -3437,13 +3557,13 @@ var Civet = (() => {
|
|
|
3437
3557
|
} else {
|
|
3438
3558
|
parts.push({
|
|
3439
3559
|
type: part.type === "Identifier" ? "Property" : part.type,
|
|
3440
|
-
name
|
|
3560
|
+
name,
|
|
3441
3561
|
value,
|
|
3442
3562
|
delim: part.delim,
|
|
3443
3563
|
names: part.names,
|
|
3444
3564
|
children: [
|
|
3445
3565
|
isWhitespaceOrEmpty(part.children[0]) && part.children[0],
|
|
3446
|
-
|
|
3566
|
+
name,
|
|
3447
3567
|
isWhitespaceOrEmpty(part.children[2]) && part.children[2],
|
|
3448
3568
|
part.children[3]?.token === ":" ? part.children[3] : ":",
|
|
3449
3569
|
value,
|
|
@@ -3588,6 +3708,35 @@ var Civet = (() => {
|
|
|
3588
3708
|
block
|
|
3589
3709
|
};
|
|
3590
3710
|
}
|
|
3711
|
+
function convertNamedImportsToObject(node, pattern) {
|
|
3712
|
+
const properties = node.specifiers.map((specifier) => {
|
|
3713
|
+
if (specifier.ts) {
|
|
3714
|
+
return { type: "Error", message: "cannot use `type` in dynamic import" };
|
|
3715
|
+
} else {
|
|
3716
|
+
const { source, binding } = specifier;
|
|
3717
|
+
const delim = specifier.children.at(-1);
|
|
3718
|
+
return {
|
|
3719
|
+
type: pattern ? "BindingProperty" : "Property",
|
|
3720
|
+
name: source,
|
|
3721
|
+
value: !(source === binding) ? binding : void 0,
|
|
3722
|
+
delim,
|
|
3723
|
+
children: source === binding ? [source, delim] : [source, ":", binding, delim]
|
|
3724
|
+
};
|
|
3725
|
+
}
|
|
3726
|
+
});
|
|
3727
|
+
return {
|
|
3728
|
+
type: pattern ? "ObjectBindingPattern" : "ObjectExpression",
|
|
3729
|
+
names: node.names,
|
|
3730
|
+
properties,
|
|
3731
|
+
children: [
|
|
3732
|
+
node.children[0],
|
|
3733
|
+
// {
|
|
3734
|
+
properties,
|
|
3735
|
+
node.children.at(-1)
|
|
3736
|
+
// }
|
|
3737
|
+
]
|
|
3738
|
+
};
|
|
3739
|
+
}
|
|
3591
3740
|
function convertObjectToJSXAttributes(obj) {
|
|
3592
3741
|
const { properties } = obj;
|
|
3593
3742
|
const parts = [];
|
|
@@ -3729,108 +3878,231 @@ var Civet = (() => {
|
|
|
3729
3878
|
if (pre.length)
|
|
3730
3879
|
exp.children.unshift(...pre);
|
|
3731
3880
|
if (post.length)
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
if (ref4 = prependStatementExpressionBlock([null, null, $2], block)) {
|
|
3742
|
-
const ref = ref4;
|
|
3743
|
-
exp.children = exp.children.map(function(c) {
|
|
3744
|
-
if (c === $2)
|
|
3745
|
-
return ref;
|
|
3746
|
-
else
|
|
3881
|
+
exp.children.push(...post);
|
|
3882
|
+
if (exp.type === "UpdateExpression") {
|
|
3883
|
+
const { assigned } = exp;
|
|
3884
|
+
const ref = makeRef();
|
|
3885
|
+
const newMemberExp = unchainOptionalMemberExpression(assigned, ref, (children) => {
|
|
3886
|
+
return exp.children.map((c) => {
|
|
3887
|
+
if (c === assigned) {
|
|
3888
|
+
return children;
|
|
3889
|
+
} else {
|
|
3747
3890
|
return c;
|
|
3891
|
+
}
|
|
3748
3892
|
});
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3893
|
+
});
|
|
3894
|
+
if (newMemberExp !== assigned) {
|
|
3895
|
+
if (newMemberExp.usesRef) {
|
|
3896
|
+
newMemberExp.hoistDec = {
|
|
3897
|
+
type: "Declaration",
|
|
3898
|
+
children: ["let ", ref],
|
|
3899
|
+
names: []
|
|
3900
|
+
};
|
|
3901
|
+
}
|
|
3902
|
+
return replaceNode(exp, newMemberExp);
|
|
3752
3903
|
}
|
|
3904
|
+
;
|
|
3905
|
+
return;
|
|
3753
3906
|
}
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3907
|
+
;
|
|
3908
|
+
return;
|
|
3909
|
+
});
|
|
3910
|
+
replaceNodesRecursive(
|
|
3911
|
+
statements,
|
|
3912
|
+
(n) => n.type === "AssignmentExpression" && n.names === null,
|
|
3913
|
+
(exp) => {
|
|
3914
|
+
let { lhs: $1, exp: $2 } = exp, tail = [], i = 0, len = $1.length;
|
|
3915
|
+
let block;
|
|
3916
|
+
if (exp.parent.type === "BlockStatement" && !$1.at(-1)?.at(-1)?.special) {
|
|
3917
|
+
block = makeBlockFragment();
|
|
3918
|
+
let ref4;
|
|
3919
|
+
if (ref4 = prependStatementExpressionBlock([null, null, $2], block)) {
|
|
3920
|
+
const ref = ref4;
|
|
3921
|
+
exp.children = exp.children.map(function(c) {
|
|
3922
|
+
if (c === $2)
|
|
3923
|
+
return ref;
|
|
3924
|
+
else
|
|
3925
|
+
return c;
|
|
3926
|
+
});
|
|
3927
|
+
$2 = ref;
|
|
3928
|
+
} else {
|
|
3929
|
+
block = void 0;
|
|
3930
|
+
}
|
|
3769
3931
|
}
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3932
|
+
if ($1.some((left) => left[left.length - 1].special)) {
|
|
3933
|
+
if ($1.length !== 1)
|
|
3934
|
+
throw new Error("Only one assignment with id= is allowed");
|
|
3935
|
+
const [, lhs, , op] = $1[0];
|
|
3936
|
+
const { call, omitLhs } = op;
|
|
3937
|
+
const index2 = exp.children.indexOf($2);
|
|
3938
|
+
if (index2 < 0)
|
|
3939
|
+
throw new Error("Assertion error: exp not in AssignmentExpression");
|
|
3940
|
+
exp.children.splice(
|
|
3941
|
+
index2,
|
|
3942
|
+
1,
|
|
3943
|
+
exp.exp = $2 = [call, "(", lhs, ", ", $2, ")"]
|
|
3944
|
+
);
|
|
3945
|
+
if (omitLhs) {
|
|
3946
|
+
return $2;
|
|
3782
3947
|
}
|
|
3783
3948
|
}
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
if (lhs.type === "
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
if (
|
|
3949
|
+
let wrapped = false;
|
|
3950
|
+
while (i < len) {
|
|
3951
|
+
const lastAssignment = $1[i++];
|
|
3952
|
+
const [, lhs, , op] = lastAssignment;
|
|
3953
|
+
if (op.token !== "=")
|
|
3954
|
+
continue;
|
|
3955
|
+
if (lhs.type === "ObjectExpression" || lhs.type === "ObjectBindingPattern") {
|
|
3956
|
+
if (!wrapped) {
|
|
3957
|
+
wrapped = true;
|
|
3958
|
+
lhs.children.splice(0, 0, "(");
|
|
3959
|
+
tail.push(")");
|
|
3960
|
+
}
|
|
3961
|
+
}
|
|
3962
|
+
}
|
|
3963
|
+
i = len - 1;
|
|
3964
|
+
while (i >= 0) {
|
|
3965
|
+
const lastAssignment = $1[i];
|
|
3966
|
+
if (lastAssignment[3].token === "=") {
|
|
3967
|
+
const lhs = lastAssignment[1];
|
|
3968
|
+
if (lhs.type === "MemberExpression") {
|
|
3969
|
+
const members = lhs.children;
|
|
3970
|
+
const lastMember = members[members.length - 1];
|
|
3971
|
+
if (lastMember.type === "SliceExpression") {
|
|
3972
|
+
const { start, end, children: c } = lastMember;
|
|
3973
|
+
c[0].token = ".splice(";
|
|
3974
|
+
c[1] = start;
|
|
3975
|
+
c[2] = ", ";
|
|
3976
|
+
if (end) {
|
|
3977
|
+
c[3] = [end, " - ", start];
|
|
3978
|
+
} else {
|
|
3979
|
+
c[3] = ["1/0"];
|
|
3980
|
+
}
|
|
3981
|
+
c[4] = [", ...", $2];
|
|
3982
|
+
c[5] = ")";
|
|
3807
3983
|
lastAssignment.pop();
|
|
3808
|
-
|
|
3809
|
-
|
|
3984
|
+
if (isWhitespaceOrEmpty(lastAssignment[2]))
|
|
3985
|
+
lastAssignment.pop();
|
|
3986
|
+
if ($1.length > 1) {
|
|
3987
|
+
throw new Error("Not implemented yet! TODO: Handle multiple splice assignments");
|
|
3988
|
+
}
|
|
3989
|
+
exp.children = [$1];
|
|
3990
|
+
exp.names = [];
|
|
3991
|
+
return exp;
|
|
3810
3992
|
}
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
return exp;
|
|
3993
|
+
} else if (lhs.type === "ObjectBindingPattern" || lhs.type === "ArrayBindingPattern") {
|
|
3994
|
+
processBindingPatternLHS(lhs, tail);
|
|
3814
3995
|
}
|
|
3815
|
-
} else if (lhs.type === "ObjectBindingPattern" || lhs.type === "ArrayBindingPattern") {
|
|
3816
|
-
processBindingPatternLHS(lhs, tail);
|
|
3817
3996
|
}
|
|
3997
|
+
i--;
|
|
3818
3998
|
}
|
|
3819
|
-
i
|
|
3999
|
+
i = len - 1;
|
|
4000
|
+
const optionalChainRef = makeRef();
|
|
4001
|
+
while (i >= 0) {
|
|
4002
|
+
const assignment = $1[i];
|
|
4003
|
+
const [ws1, lhs, ws2, op] = assignment;
|
|
4004
|
+
if (lhs.type === "MemberExpression" || lhs.type === "CallExpression") {
|
|
4005
|
+
const newMemberExp = unchainOptionalMemberExpression(lhs, optionalChainRef, (children) => {
|
|
4006
|
+
const assigns = $1.splice(i + 1, len - 1 - i);
|
|
4007
|
+
$1.pop();
|
|
4008
|
+
return [ws1, ...children, ws2, op, ...assigns, $2];
|
|
4009
|
+
});
|
|
4010
|
+
if (newMemberExp !== lhs) {
|
|
4011
|
+
if (newMemberExp.usesRef) {
|
|
4012
|
+
exp.hoistDec = {
|
|
4013
|
+
type: "Declaration",
|
|
4014
|
+
children: ["let ", optionalChainRef],
|
|
4015
|
+
names: []
|
|
4016
|
+
};
|
|
4017
|
+
}
|
|
4018
|
+
replaceNode($2, newMemberExp);
|
|
4019
|
+
newMemberExp.parent = exp;
|
|
4020
|
+
$2 = newMemberExp;
|
|
4021
|
+
}
|
|
4022
|
+
}
|
|
4023
|
+
i--;
|
|
4024
|
+
}
|
|
4025
|
+
exp.names = $1.flatMap(([, l]) => l.names || []);
|
|
4026
|
+
const index = exp.children.indexOf($2);
|
|
4027
|
+
if (index < 0)
|
|
4028
|
+
throw new Error("Assertion error: exp not in AssignmentExpression");
|
|
4029
|
+
exp.children.splice(index + 1, 0, ...tail);
|
|
4030
|
+
if (block) {
|
|
4031
|
+
block.parent = exp.parent;
|
|
4032
|
+
block.expressions.push(["", exp]);
|
|
4033
|
+
exp.parent = block;
|
|
4034
|
+
return block;
|
|
4035
|
+
}
|
|
4036
|
+
return exp;
|
|
3820
4037
|
}
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
4038
|
+
);
|
|
4039
|
+
}
|
|
4040
|
+
function unchainOptionalMemberExpression(exp, ref, innerExp) {
|
|
4041
|
+
let j = 0;
|
|
4042
|
+
const { children } = exp;
|
|
4043
|
+
let usesRef = false;
|
|
4044
|
+
const conditions = [];
|
|
4045
|
+
while (j < children.length) {
|
|
4046
|
+
const child = children[j];
|
|
4047
|
+
const type = child?.type;
|
|
4048
|
+
let hasOptional = false;
|
|
4049
|
+
switch (type) {
|
|
4050
|
+
case "PropertyAccess": {
|
|
4051
|
+
if (child.dot?.optional) {
|
|
4052
|
+
hasOptional = true;
|
|
4053
|
+
child.dot.children.shift();
|
|
4054
|
+
child.dot.optional = false;
|
|
4055
|
+
}
|
|
4056
|
+
;
|
|
4057
|
+
break;
|
|
4058
|
+
}
|
|
4059
|
+
case "Call":
|
|
4060
|
+
case "Index": {
|
|
4061
|
+
if (child.optional) {
|
|
4062
|
+
hasOptional = true;
|
|
4063
|
+
child.children.shift();
|
|
4064
|
+
child.optional = void 0;
|
|
4065
|
+
}
|
|
4066
|
+
;
|
|
4067
|
+
break;
|
|
4068
|
+
}
|
|
3831
4069
|
}
|
|
4070
|
+
if (hasOptional) {
|
|
4071
|
+
let base;
|
|
4072
|
+
if (j > 1 || needsRef(children[0])) {
|
|
4073
|
+
usesRef = true;
|
|
4074
|
+
base = makeLeftHandSideExpression({
|
|
4075
|
+
type: "AssignmentExpression",
|
|
4076
|
+
children: [ref, " = ", children.splice(0, j)]
|
|
4077
|
+
});
|
|
4078
|
+
base.parent = child;
|
|
4079
|
+
children.unshift(ref);
|
|
4080
|
+
j = 0;
|
|
4081
|
+
} else {
|
|
4082
|
+
base = children[0];
|
|
4083
|
+
}
|
|
4084
|
+
conditions.push([base, " != null"]);
|
|
4085
|
+
}
|
|
4086
|
+
j++;
|
|
4087
|
+
}
|
|
4088
|
+
let ref5;
|
|
4089
|
+
if (ref5 = conditions.length) {
|
|
4090
|
+
const l = ref5;
|
|
4091
|
+
const cs = conditions.map((c, i) => {
|
|
4092
|
+
if (i === l - 1) {
|
|
4093
|
+
return c;
|
|
4094
|
+
} else {
|
|
4095
|
+
return [c, " && "];
|
|
4096
|
+
}
|
|
4097
|
+
});
|
|
4098
|
+
return {
|
|
4099
|
+
...exp,
|
|
4100
|
+
children: [...cs, " ? ", innerExp(children), " : void 0"],
|
|
4101
|
+
usesRef
|
|
4102
|
+
};
|
|
4103
|
+
} else {
|
|
3832
4104
|
return exp;
|
|
3833
|
-
}
|
|
4105
|
+
}
|
|
3834
4106
|
}
|
|
3835
4107
|
function attachPostfixStatementAsExpression(exp, post) {
|
|
3836
4108
|
const postfixStatement = post[1];
|
|
@@ -3896,11 +4168,11 @@ var Civet = (() => {
|
|
|
3896
4168
|
if (!(exp.children[0] === exp.statement)) {
|
|
3897
4169
|
ws = exp.children[0];
|
|
3898
4170
|
}
|
|
3899
|
-
let
|
|
4171
|
+
let ref6;
|
|
3900
4172
|
switch (statement.type) {
|
|
3901
4173
|
case "IfStatement": {
|
|
3902
|
-
if (
|
|
3903
|
-
const expression =
|
|
4174
|
+
if (ref6 = expressionizeIfStatement(statement)) {
|
|
4175
|
+
const expression = ref6;
|
|
3904
4176
|
exp.statement = expression;
|
|
3905
4177
|
exp.children = [exp.statement];
|
|
3906
4178
|
} else {
|
|
@@ -4205,9 +4477,9 @@ var Civet = (() => {
|
|
|
4205
4477
|
}
|
|
4206
4478
|
});
|
|
4207
4479
|
|
|
4208
|
-
//
|
|
4480
|
+
// node_modules/@danielx/hera/dist/machine.js
|
|
4209
4481
|
var require_machine = __commonJS({
|
|
4210
|
-
"
|
|
4482
|
+
"node_modules/@danielx/hera/dist/machine.js"(exports, module) {
|
|
4211
4483
|
"use strict";
|
|
4212
4484
|
var __defProp2 = Object.defineProperty;
|
|
4213
4485
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -4678,6 +4950,8 @@ ${input.slice(result.pos)}
|
|
|
4678
4950
|
$TV,
|
|
4679
4951
|
$Y,
|
|
4680
4952
|
Parser,
|
|
4953
|
+
ParserContext,
|
|
4954
|
+
ParserOptions,
|
|
4681
4955
|
Validator
|
|
4682
4956
|
} = require_machine();
|
|
4683
4957
|
var grammar = {
|
|
@@ -5182,6 +5456,7 @@ ${input.slice(result.pos)}
|
|
|
5182
5456
|
OpenBracket,
|
|
5183
5457
|
OpenParen,
|
|
5184
5458
|
Operator,
|
|
5459
|
+
Override,
|
|
5185
5460
|
Own,
|
|
5186
5461
|
Public,
|
|
5187
5462
|
Private,
|
|
@@ -5579,59 +5854,60 @@ ${input.slice(result.pos)}
|
|
|
5579
5854
|
var $L170 = $L("of");
|
|
5580
5855
|
var $L171 = $L("[");
|
|
5581
5856
|
var $L172 = $L("operator");
|
|
5582
|
-
var $L173 = $L("
|
|
5583
|
-
var $L174 = $L("
|
|
5584
|
-
var $L175 = $L("
|
|
5585
|
-
var $L176 = $L("
|
|
5586
|
-
var $L177 = $L("
|
|
5587
|
-
var $L178 = $L("
|
|
5588
|
-
var $L179 = $L("
|
|
5589
|
-
var $L180 = $L("
|
|
5590
|
-
var $L181 = $L("
|
|
5591
|
-
var $L182 = $L("
|
|
5592
|
-
var $L183 = $L("
|
|
5593
|
-
var $L184 = $L("
|
|
5594
|
-
var $L185 = $L("
|
|
5595
|
-
var $L186 = $L("
|
|
5596
|
-
var $L187 = $L("
|
|
5597
|
-
var $L188 = $L("
|
|
5598
|
-
var $L189 = $L("
|
|
5599
|
-
var $L190 = $L("
|
|
5600
|
-
var $L191 = $L("
|
|
5601
|
-
var $L192 = $L("
|
|
5602
|
-
var $L193 = $L("
|
|
5603
|
-
var $L194 = $L("
|
|
5604
|
-
var $L195 = $L(
|
|
5605
|
-
var $L196 = $L("'
|
|
5606
|
-
var $L197 = $L("
|
|
5607
|
-
var $L198 = $L("
|
|
5608
|
-
var $L199 = $L("
|
|
5609
|
-
var $L200 = $L("
|
|
5610
|
-
var $L201 = $L("
|
|
5611
|
-
var $L202 = $L("
|
|
5612
|
-
var $L203 = $L("
|
|
5613
|
-
var $L204 = $L("
|
|
5614
|
-
var $L205 = $L("
|
|
5615
|
-
var $L206 = $L("
|
|
5616
|
-
var $L207 = $L("
|
|
5617
|
-
var $L208 = $L("
|
|
5618
|
-
var $L209 = $L("
|
|
5619
|
-
var $L210 = $L("
|
|
5620
|
-
var $L211 = $L("
|
|
5621
|
-
var $L212 = $L("
|
|
5622
|
-
var $L213 = $L("
|
|
5623
|
-
var $L214 = $L("
|
|
5624
|
-
var $L215 = $L("
|
|
5625
|
-
var $L216 = $L("
|
|
5626
|
-
var $L217 = $L("
|
|
5627
|
-
var $L218 = $L("
|
|
5628
|
-
var $L219 = $L("
|
|
5629
|
-
var $L220 = $L("
|
|
5630
|
-
var $L221 = $L("
|
|
5631
|
-
var $L222 = $L("
|
|
5632
|
-
var $L223 = $L("
|
|
5633
|
-
var $L224 = $L("
|
|
5634
|
-
var $L225 = $L("
|
|
5857
|
+
var $L173 = $L("override");
|
|
5858
|
+
var $L174 = $L("own");
|
|
5859
|
+
var $L175 = $L("public");
|
|
5860
|
+
var $L176 = $L("private");
|
|
5861
|
+
var $L177 = $L("protected");
|
|
5862
|
+
var $L178 = $L("||>");
|
|
5863
|
+
var $L179 = $L("|\u25B7");
|
|
5864
|
+
var $L180 = $L("|>=");
|
|
5865
|
+
var $L181 = $L("\u25B7=");
|
|
5866
|
+
var $L182 = $L("|>");
|
|
5867
|
+
var $L183 = $L("\u25B7");
|
|
5868
|
+
var $L184 = $L("readonly");
|
|
5869
|
+
var $L185 = $L("return");
|
|
5870
|
+
var $L186 = $L("satisfies");
|
|
5871
|
+
var $L187 = $L("'");
|
|
5872
|
+
var $L188 = $L("static");
|
|
5873
|
+
var $L189 = $L("${");
|
|
5874
|
+
var $L190 = $L("super");
|
|
5875
|
+
var $L191 = $L("switch");
|
|
5876
|
+
var $L192 = $L("target");
|
|
5877
|
+
var $L193 = $L("then");
|
|
5878
|
+
var $L194 = $L("this");
|
|
5879
|
+
var $L195 = $L("throw");
|
|
5880
|
+
var $L196 = $L('"""');
|
|
5881
|
+
var $L197 = $L("'''");
|
|
5882
|
+
var $L198 = $L("///");
|
|
5883
|
+
var $L199 = $L("```");
|
|
5884
|
+
var $L200 = $L("try");
|
|
5885
|
+
var $L201 = $L("typeof");
|
|
5886
|
+
var $L202 = $L("unless");
|
|
5887
|
+
var $L203 = $L("until");
|
|
5888
|
+
var $L204 = $L("using");
|
|
5889
|
+
var $L205 = $L("var");
|
|
5890
|
+
var $L206 = $L("void");
|
|
5891
|
+
var $L207 = $L("when");
|
|
5892
|
+
var $L208 = $L("while");
|
|
5893
|
+
var $L209 = $L("yield");
|
|
5894
|
+
var $L210 = $L("/>");
|
|
5895
|
+
var $L211 = $L("</");
|
|
5896
|
+
var $L212 = $L("<>");
|
|
5897
|
+
var $L213 = $L("</>");
|
|
5898
|
+
var $L214 = $L("<!--");
|
|
5899
|
+
var $L215 = $L("-->");
|
|
5900
|
+
var $L216 = $L("type");
|
|
5901
|
+
var $L217 = $L("enum");
|
|
5902
|
+
var $L218 = $L("interface");
|
|
5903
|
+
var $L219 = $L("global");
|
|
5904
|
+
var $L220 = $L("module");
|
|
5905
|
+
var $L221 = $L("namespace");
|
|
5906
|
+
var $L222 = $L("asserts");
|
|
5907
|
+
var $L223 = $L("keyof");
|
|
5908
|
+
var $L224 = $L("???");
|
|
5909
|
+
var $L225 = $L("[]");
|
|
5910
|
+
var $L226 = $L("civet");
|
|
5635
5911
|
var $R0 = $R(new RegExp("(?=async|debugger|if|unless|do|for|loop|until|while|switch|throw|try)", "suy"));
|
|
5636
5912
|
var $R1 = $R(new RegExp("(as|of|satisfies|then|when|implements|xor|xnor)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
|
|
5637
5913
|
var $R2 = $R(new RegExp("[0-9]", "suy"));
|
|
@@ -6716,9 +6992,9 @@ ${input.slice(result.pos)}
|
|
|
6716
6992
|
function NestedClassElement(ctx, state) {
|
|
6717
6993
|
return $EVENT(ctx, state, "NestedClassElement", NestedClassElement$0);
|
|
6718
6994
|
}
|
|
6719
|
-
var ClassElement$0 = $TS($S($E(Decorators), $E(AccessModifier), $E($S(Static, $E(_))), ClassElementDefinition), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
6995
|
+
var ClassElement$0 = $TS($S($E(Decorators), $E(AccessModifier), $E($S(Static, $E(_))), $E($S(Override, $E(_))), ClassElementDefinition), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
6720
6996
|
var decorators = $1;
|
|
6721
|
-
var definition = $
|
|
6997
|
+
var definition = $5;
|
|
6722
6998
|
if (definition.type === "MultiMethodDefinition") {
|
|
6723
6999
|
return {
|
|
6724
7000
|
...definition,
|
|
@@ -6732,7 +7008,7 @@ ${input.slice(result.pos)}
|
|
|
6732
7008
|
}
|
|
6733
7009
|
return {
|
|
6734
7010
|
...definition,
|
|
6735
|
-
children: [decorators, $2, $3, ...definition.children]
|
|
7011
|
+
children: [decorators, $2, $3, $4, ...definition.children]
|
|
6736
7012
|
};
|
|
6737
7013
|
});
|
|
6738
7014
|
var ClassElement$1 = $TS($S(Static, BracedBlock), function($skip, $loc, $0, $1, $2) {
|
|
@@ -6774,7 +7050,7 @@ ${input.slice(result.pos)}
|
|
|
6774
7050
|
function NestedClassSignatureElement(ctx, state) {
|
|
6775
7051
|
return $EVENT(ctx, state, "NestedClassSignatureElement", NestedClassSignatureElement$0);
|
|
6776
7052
|
}
|
|
6777
|
-
var ClassSignatureElement$0 = $S($E(Decorators), $E(AccessModifier), $E($S(Static, $E(_))), $C(MethodSignature, FieldDefinition));
|
|
7053
|
+
var ClassSignatureElement$0 = $S($E(Decorators), $E(AccessModifier), $E($S(Static, $E(_))), $E($S(Override, $E(_))), $C(MethodSignature, FieldDefinition));
|
|
6778
7054
|
var ClassSignatureElement$1 = $S(Static, ClassSignatureBody);
|
|
6779
7055
|
var ClassSignatureElement$$ = [ClassSignatureElement$0, ClassSignatureElement$1];
|
|
6780
7056
|
function ClassSignatureElement(ctx, state) {
|
|
@@ -6936,14 +7212,17 @@ ${input.slice(result.pos)}
|
|
|
6936
7212
|
children: [$1, ...$2, ...rest.flat()]
|
|
6937
7213
|
});
|
|
6938
7214
|
});
|
|
6939
|
-
var CallExpression$1 = $TS($S(
|
|
7215
|
+
var CallExpression$1 = $TS($S(Import, _, NamedImports, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
7216
|
+
return dynamizeImportDeclarationExpression($0);
|
|
7217
|
+
});
|
|
7218
|
+
var CallExpression$2 = $TS($S($EXPECT($L20, 'CallExpression "import"'), ArgumentsWithTrailingMemberExpressions, $Q(CallExpressionRest)), function($skip, $loc, $0, $1, $2, $3) {
|
|
6940
7219
|
var rest = $3;
|
|
6941
7220
|
return processCallMemberExpression({
|
|
6942
7221
|
type: "CallExpression",
|
|
6943
7222
|
children: [$1, ...$2, ...rest.flat()]
|
|
6944
7223
|
});
|
|
6945
7224
|
});
|
|
6946
|
-
var CallExpression$
|
|
7225
|
+
var CallExpression$3 = $TS($S(MemberExpression, AllowedTrailingMemberExpressions, $Q(CallExpressionRest)), function($skip, $loc, $0, $1, $2, $3) {
|
|
6947
7226
|
var member = $1;
|
|
6948
7227
|
var trailing = $2;
|
|
6949
7228
|
var rest = $3;
|
|
@@ -6956,7 +7235,7 @@ ${input.slice(result.pos)}
|
|
|
6956
7235
|
}
|
|
6957
7236
|
return member;
|
|
6958
7237
|
});
|
|
6959
|
-
var CallExpression$$ = [CallExpression$0, CallExpression$1, CallExpression$2];
|
|
7238
|
+
var CallExpression$$ = [CallExpression$0, CallExpression$1, CallExpression$2, CallExpression$3];
|
|
6960
7239
|
function CallExpression(ctx, state) {
|
|
6961
7240
|
return $EVENT_C(ctx, state, "CallExpression", CallExpression$$);
|
|
6962
7241
|
}
|
|
@@ -6972,18 +7251,28 @@ ${input.slice(result.pos)}
|
|
|
6972
7251
|
return literal;
|
|
6973
7252
|
});
|
|
6974
7253
|
var CallExpressionRest$3 = $TS($S($E(OptionalShorthand), ArgumentsWithTrailingMemberExpressions), function($skip, $loc, $0, $1, $2) {
|
|
6975
|
-
|
|
6976
|
-
|
|
6977
|
-
|
|
7254
|
+
var optional = $1;
|
|
7255
|
+
var argsWithTrailing = $2;
|
|
7256
|
+
if (!optional)
|
|
7257
|
+
return argsWithTrailing;
|
|
7258
|
+
const call = argsWithTrailing[0];
|
|
7259
|
+
return [{
|
|
7260
|
+
...call,
|
|
7261
|
+
children: [optional, ...call.children],
|
|
7262
|
+
optional
|
|
7263
|
+
}, ...argsWithTrailing.slice(1)];
|
|
6978
7264
|
});
|
|
6979
7265
|
var CallExpressionRest$$ = [CallExpressionRest$0, CallExpressionRest$1, CallExpressionRest$2, CallExpressionRest$3];
|
|
6980
7266
|
function CallExpressionRest(ctx, state) {
|
|
6981
7267
|
return $EVENT_C(ctx, state, "CallExpressionRest", CallExpressionRest$$);
|
|
6982
7268
|
}
|
|
6983
7269
|
var OptionalShorthand$0 = $TS($S($EXPECT($R6, "OptionalShorthand /(?=[\\/?])/"), $Q(InlineComment), QuestionMark, OptionalDot), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
7270
|
+
var comments = $2;
|
|
7271
|
+
var q = $3;
|
|
7272
|
+
var d = $4;
|
|
6984
7273
|
return {
|
|
6985
7274
|
type: "Optional",
|
|
6986
|
-
children:
|
|
7275
|
+
children: [...comments, q, d]
|
|
6987
7276
|
};
|
|
6988
7277
|
});
|
|
6989
7278
|
function OptionalShorthand(ctx, state) {
|
|
@@ -7054,7 +7343,11 @@ ${input.slice(result.pos)}
|
|
|
7054
7343
|
if (dot.type === "Optional" && content.type === "SliceExpression") {
|
|
7055
7344
|
return [...dot.children.slice(0, -1), ...comments, content];
|
|
7056
7345
|
}
|
|
7057
|
-
return
|
|
7346
|
+
return {
|
|
7347
|
+
...content,
|
|
7348
|
+
children: [dot, ...comments, ...content.children],
|
|
7349
|
+
optional: dot
|
|
7350
|
+
};
|
|
7058
7351
|
}
|
|
7059
7352
|
return [...comments, content];
|
|
7060
7353
|
});
|
|
@@ -7158,9 +7451,14 @@ ${input.slice(result.pos)}
|
|
|
7158
7451
|
return $EVENT_C(ctx, state, "SliceParameters", SliceParameters$$);
|
|
7159
7452
|
}
|
|
7160
7453
|
var AccessStart$0 = $TS($S($E(PropertyAccessModifier), Dot, $N(Dot)), function($skip, $loc, $0, $1, $2, $3) {
|
|
7161
|
-
|
|
7162
|
-
|
|
7163
|
-
|
|
7454
|
+
var modifier = $1;
|
|
7455
|
+
var dot = $2;
|
|
7456
|
+
let children = modifier ? [modifier, dot] : [dot];
|
|
7457
|
+
return {
|
|
7458
|
+
type: "AccessStart",
|
|
7459
|
+
children,
|
|
7460
|
+
optional: modifier?.token === "?"
|
|
7461
|
+
};
|
|
7164
7462
|
});
|
|
7165
7463
|
function AccessStart(ctx, state) {
|
|
7166
7464
|
return $EVENT(ctx, state, "AccessStart", AccessStart$0);
|
|
@@ -7203,13 +7501,14 @@ ${input.slice(result.pos)}
|
|
|
7203
7501
|
};
|
|
7204
7502
|
});
|
|
7205
7503
|
var PropertyAccess$2 = $TS($S(AccessStart, $Q(InlineComment), $C(IdentifierName, PrivateIdentifier, LengthShorthand)), function($skip, $loc, $0, $1, $2, $3) {
|
|
7206
|
-
var
|
|
7504
|
+
var dot = $1;
|
|
7207
7505
|
var comments = $2;
|
|
7208
7506
|
var id = $3;
|
|
7209
|
-
const children = [
|
|
7507
|
+
const children = [dot, ...comments, ...id.children];
|
|
7210
7508
|
return {
|
|
7211
7509
|
type: "PropertyAccess",
|
|
7212
7510
|
name: id.name,
|
|
7511
|
+
dot,
|
|
7213
7512
|
children
|
|
7214
7513
|
};
|
|
7215
7514
|
});
|
|
@@ -7217,16 +7516,20 @@ ${input.slice(result.pos)}
|
|
|
7217
7516
|
var p = $2;
|
|
7218
7517
|
var id = $3;
|
|
7219
7518
|
if (id) {
|
|
7519
|
+
const dot = { token: ".prototype.", $loc: p.$loc };
|
|
7220
7520
|
return {
|
|
7221
7521
|
type: "PropertyAccess",
|
|
7222
7522
|
name: id.name,
|
|
7223
|
-
|
|
7523
|
+
dot,
|
|
7524
|
+
children: [dot, id]
|
|
7224
7525
|
};
|
|
7225
7526
|
} else {
|
|
7527
|
+
const dot = { token: ".prototype", $loc: p.$loc };
|
|
7226
7528
|
return {
|
|
7227
7529
|
type: "PropertyAccess",
|
|
7228
7530
|
name: "prototype",
|
|
7229
|
-
|
|
7531
|
+
dot,
|
|
7532
|
+
children: [dot]
|
|
7230
7533
|
};
|
|
7231
7534
|
}
|
|
7232
7535
|
});
|
|
@@ -11196,28 +11499,31 @@ ${input.slice(result.pos)}
|
|
|
11196
11499
|
};
|
|
11197
11500
|
});
|
|
11198
11501
|
var ImportDeclaration$1 = $T($S(Import, __, TypeKeyword, __, ImportClause, __, FromClause), function(value) {
|
|
11199
|
-
|
|
11502
|
+
var imports = value[4];
|
|
11503
|
+
var from = value[6];
|
|
11504
|
+
return { "type": "ImportDeclaration", "ts": true, "children": value, "imports": imports, "from": from };
|
|
11200
11505
|
});
|
|
11201
11506
|
var ImportDeclaration$2 = $T($S(Import, __, ImportClause, __, FromClause), function(value) {
|
|
11202
|
-
|
|
11507
|
+
var imports = value[2];
|
|
11508
|
+
var from = value[4];
|
|
11509
|
+
return { "type": "ImportDeclaration", "children": value, "imports": imports, "from": from };
|
|
11203
11510
|
});
|
|
11204
11511
|
var ImportDeclaration$3 = $T($S(Import, __, ModuleSpecifier), function(value) {
|
|
11205
|
-
|
|
11512
|
+
var module3 = value[2];
|
|
11513
|
+
return { "type": "ImportDeclaration", "children": value, "module": module3 };
|
|
11206
11514
|
});
|
|
11207
11515
|
var ImportDeclaration$4 = $TS($S(ImpliedImport, $E($S(TypeKeyword, __)), ImportClause, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
11208
11516
|
var i = $1;
|
|
11209
11517
|
var t = $2;
|
|
11210
|
-
var
|
|
11518
|
+
var imports = $3;
|
|
11211
11519
|
var w = $4;
|
|
11212
|
-
var
|
|
11520
|
+
var from = $5;
|
|
11213
11521
|
i.$loc = {
|
|
11214
|
-
pos:
|
|
11215
|
-
length:
|
|
11522
|
+
pos: from[0].$loc.pos - 1,
|
|
11523
|
+
length: from[0].$loc.length + 1
|
|
11216
11524
|
};
|
|
11217
|
-
const children = [i, t,
|
|
11218
|
-
|
|
11219
|
-
return children;
|
|
11220
|
-
return { type: "ImportDeclaration", ts: true, children };
|
|
11525
|
+
const children = [i, t, imports, w, from];
|
|
11526
|
+
return { type: "ImportDeclaration", ts: !!t, children, imports, from };
|
|
11221
11527
|
});
|
|
11222
11528
|
var ImportDeclaration$$ = [ImportDeclaration$0, ImportDeclaration$1, ImportDeclaration$2, ImportDeclaration$3, ImportDeclaration$4];
|
|
11223
11529
|
function ImportDeclaration(ctx, state) {
|
|
@@ -11235,14 +11541,17 @@ ${input.slice(result.pos)}
|
|
|
11235
11541
|
if (rest) {
|
|
11236
11542
|
return {
|
|
11237
11543
|
type: "Declaration",
|
|
11238
|
-
children:
|
|
11239
|
-
names: [...binding.names, ...rest[3].names]
|
|
11544
|
+
children: [binding, ...rest],
|
|
11545
|
+
names: [...binding.names, ...rest[3].names],
|
|
11546
|
+
binding,
|
|
11547
|
+
specifiers: rest[3].specifiers
|
|
11240
11548
|
};
|
|
11241
11549
|
}
|
|
11242
11550
|
return {
|
|
11243
11551
|
type: "Declaration",
|
|
11244
|
-
children:
|
|
11245
|
-
names: binding.names
|
|
11552
|
+
children: [binding],
|
|
11553
|
+
names: binding.names,
|
|
11554
|
+
binding
|
|
11246
11555
|
};
|
|
11247
11556
|
});
|
|
11248
11557
|
var ImportClause$1 = NameSpaceImport;
|
|
@@ -11252,11 +11561,14 @@ ${input.slice(result.pos)}
|
|
|
11252
11561
|
return $EVENT_C(ctx, state, "ImportClause", ImportClause$$);
|
|
11253
11562
|
}
|
|
11254
11563
|
var NameSpaceImport$0 = $TS($S(Star, ImportAsToken, __, ImportedBinding), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
11564
|
+
var star = $1;
|
|
11255
11565
|
var binding = $4;
|
|
11256
11566
|
return {
|
|
11257
11567
|
type: "Declaration",
|
|
11258
11568
|
children: $0,
|
|
11259
|
-
names: binding.names
|
|
11569
|
+
names: binding.names,
|
|
11570
|
+
binding,
|
|
11571
|
+
star
|
|
11260
11572
|
};
|
|
11261
11573
|
});
|
|
11262
11574
|
function NameSpaceImport(ctx, state) {
|
|
@@ -11268,17 +11580,32 @@ ${input.slice(result.pos)}
|
|
|
11268
11580
|
return {
|
|
11269
11581
|
type: "Declaration",
|
|
11270
11582
|
children: $0,
|
|
11271
|
-
names
|
|
11583
|
+
names,
|
|
11584
|
+
specifiers
|
|
11272
11585
|
};
|
|
11273
11586
|
});
|
|
11274
11587
|
function NamedImports(ctx, state) {
|
|
11275
11588
|
return $EVENT(ctx, state, "NamedImports", NamedImports$0);
|
|
11276
11589
|
}
|
|
11277
|
-
var FromClause$0 = $S(From, __, ModuleSpecifier)
|
|
11590
|
+
var FromClause$0 = $TS($S(From, __, ModuleSpecifier), function($skip, $loc, $0, $1, $2, $3) {
|
|
11591
|
+
var module3 = $3;
|
|
11592
|
+
if (!Array.isArray(module3))
|
|
11593
|
+
return $0;
|
|
11594
|
+
return [$1, $2, ...module3];
|
|
11595
|
+
});
|
|
11278
11596
|
function FromClause(ctx, state) {
|
|
11279
11597
|
return $EVENT(ctx, state, "FromClause", FromClause$0);
|
|
11280
11598
|
}
|
|
11281
|
-
var ImportAssertion$0 = $S($E(_), $C($EXPECT($L117, 'ImportAssertion "with"'), $EXPECT($L118, 'ImportAssertion "assert"')), NonIdContinue, $E(_), ObjectLiteral)
|
|
11599
|
+
var ImportAssertion$0 = $TS($S($E(_), $C($EXPECT($L117, 'ImportAssertion "with"'), $EXPECT($L118, 'ImportAssertion "assert"')), NonIdContinue, $E(_), ObjectLiteral), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
11600
|
+
var keyword = $2;
|
|
11601
|
+
var object = $5;
|
|
11602
|
+
return {
|
|
11603
|
+
type: "ImportAssertion",
|
|
11604
|
+
keyword,
|
|
11605
|
+
object,
|
|
11606
|
+
children: $0
|
|
11607
|
+
};
|
|
11608
|
+
});
|
|
11282
11609
|
function ImportAssertion(ctx, state) {
|
|
11283
11610
|
return $EVENT(ctx, state, "ImportAssertion", ImportAssertion$0);
|
|
11284
11611
|
}
|
|
@@ -11308,8 +11635,10 @@ ${input.slice(result.pos)}
|
|
|
11308
11635
|
return $EVENT_C(ctx, state, "TypeAndImportSpecifier", TypeAndImportSpecifier$$);
|
|
11309
11636
|
}
|
|
11310
11637
|
var ImportSpecifier$0 = $TS($S(__, ModuleExportName, ImportAsToken, __, ImportedBinding, ObjectPropertyDelimiter), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
11638
|
+
var source = $2;
|
|
11311
11639
|
var binding = $5;
|
|
11312
11640
|
return {
|
|
11641
|
+
source,
|
|
11313
11642
|
binding,
|
|
11314
11643
|
children: $0
|
|
11315
11644
|
};
|
|
@@ -11317,6 +11646,7 @@ ${input.slice(result.pos)}
|
|
|
11317
11646
|
var ImportSpecifier$1 = $TS($S(__, ImportedBinding, ObjectPropertyDelimiter), function($skip, $loc, $0, $1, $2, $3) {
|
|
11318
11647
|
var binding = $2;
|
|
11319
11648
|
return {
|
|
11649
|
+
source: binding,
|
|
11320
11650
|
binding,
|
|
11321
11651
|
children: $0
|
|
11322
11652
|
};
|
|
@@ -11508,9 +11838,18 @@ ${input.slice(result.pos)}
|
|
|
11508
11838
|
function ImplicitExportSpecifier(ctx, state) {
|
|
11509
11839
|
return $EVENT(ctx, state, "ImplicitExportSpecifier", ImplicitExportSpecifier$0);
|
|
11510
11840
|
}
|
|
11511
|
-
var Declaration$0 =
|
|
11512
|
-
|
|
11513
|
-
|
|
11841
|
+
var Declaration$0 = $TV(ImportDeclaration, function($skip, $loc, $0, $1) {
|
|
11842
|
+
var decl = $0;
|
|
11843
|
+
if (decl.ts || decl.module || !decl.imports || !decl.from)
|
|
11844
|
+
return $skip;
|
|
11845
|
+
const { imports } = decl;
|
|
11846
|
+
if (!imports.binding && !imports.specifiers)
|
|
11847
|
+
return $skip;
|
|
11848
|
+
return dynamizeImportDeclaration(decl);
|
|
11849
|
+
});
|
|
11850
|
+
var Declaration$1 = HoistableDeclaration;
|
|
11851
|
+
var Declaration$2 = ClassDeclaration;
|
|
11852
|
+
var Declaration$3 = $TV(LexicalDeclaration, function($skip, $loc, $0, $1) {
|
|
11514
11853
|
var d = $0;
|
|
11515
11854
|
if (d.thisAssignments?.length)
|
|
11516
11855
|
return {
|
|
@@ -11524,11 +11863,11 @@ ${input.slice(result.pos)}
|
|
|
11524
11863
|
};
|
|
11525
11864
|
return d;
|
|
11526
11865
|
});
|
|
11527
|
-
var Declaration$
|
|
11528
|
-
var Declaration$
|
|
11529
|
-
var Declaration$
|
|
11530
|
-
var Declaration$
|
|
11531
|
-
var Declaration$$ = [Declaration$0, Declaration$1, Declaration$2, Declaration$3, Declaration$4, Declaration$5, Declaration$6];
|
|
11866
|
+
var Declaration$4 = TypeDeclaration;
|
|
11867
|
+
var Declaration$5 = EnumDeclaration;
|
|
11868
|
+
var Declaration$6 = OperatorDeclaration;
|
|
11869
|
+
var Declaration$7 = UsingDeclaration;
|
|
11870
|
+
var Declaration$$ = [Declaration$0, Declaration$1, Declaration$2, Declaration$3, Declaration$4, Declaration$5, Declaration$6, Declaration$7];
|
|
11532
11871
|
function Declaration(ctx, state) {
|
|
11533
11872
|
return $EVENT_C(ctx, state, "Declaration", Declaration$$);
|
|
11534
11873
|
}
|
|
@@ -12477,37 +12816,43 @@ ${input.slice(result.pos)}
|
|
|
12477
12816
|
function Operator(ctx, state) {
|
|
12478
12817
|
return $EVENT(ctx, state, "Operator", Operator$0);
|
|
12479
12818
|
}
|
|
12480
|
-
var
|
|
12819
|
+
var Override$0 = $TS($S($EXPECT($L173, 'Override "override"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
12820
|
+
return { $loc, token: $1, ts: true };
|
|
12821
|
+
});
|
|
12822
|
+
function Override(ctx, state) {
|
|
12823
|
+
return $EVENT(ctx, state, "Override", Override$0);
|
|
12824
|
+
}
|
|
12825
|
+
var Own$0 = $TS($S($EXPECT($L174, 'Own "own"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
12481
12826
|
return { $loc, token: $1 };
|
|
12482
12827
|
});
|
|
12483
12828
|
function Own(ctx, state) {
|
|
12484
12829
|
return $EVENT(ctx, state, "Own", Own$0);
|
|
12485
12830
|
}
|
|
12486
|
-
var Public$0 = $TS($S($EXPECT($
|
|
12831
|
+
var Public$0 = $TS($S($EXPECT($L175, 'Public "public"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
12487
12832
|
return { $loc, token: $1 };
|
|
12488
12833
|
});
|
|
12489
12834
|
function Public(ctx, state) {
|
|
12490
12835
|
return $EVENT(ctx, state, "Public", Public$0);
|
|
12491
12836
|
}
|
|
12492
|
-
var Private$0 = $TS($S($EXPECT($
|
|
12837
|
+
var Private$0 = $TS($S($EXPECT($L176, 'Private "private"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
12493
12838
|
return { $loc, token: $1 };
|
|
12494
12839
|
});
|
|
12495
12840
|
function Private(ctx, state) {
|
|
12496
12841
|
return $EVENT(ctx, state, "Private", Private$0);
|
|
12497
12842
|
}
|
|
12498
|
-
var Protected$0 = $TS($S($EXPECT($
|
|
12843
|
+
var Protected$0 = $TS($S($EXPECT($L177, 'Protected "protected"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
12499
12844
|
return { $loc, token: $1 };
|
|
12500
12845
|
});
|
|
12501
12846
|
function Protected(ctx, state) {
|
|
12502
12847
|
return $EVENT(ctx, state, "Protected", Protected$0);
|
|
12503
12848
|
}
|
|
12504
|
-
var Pipe$0 = $TV($C($EXPECT($
|
|
12849
|
+
var Pipe$0 = $TV($C($EXPECT($L178, 'Pipe "||>"'), $EXPECT($L179, 'Pipe "|\u25B7"')), function($skip, $loc, $0, $1) {
|
|
12505
12850
|
return { $loc, token: "||>" };
|
|
12506
12851
|
});
|
|
12507
|
-
var Pipe$1 = $TV($C($EXPECT($
|
|
12852
|
+
var Pipe$1 = $TV($C($EXPECT($L180, 'Pipe "|>="'), $EXPECT($L181, 'Pipe "\u25B7="')), function($skip, $loc, $0, $1) {
|
|
12508
12853
|
return { $loc, token: "|>=" };
|
|
12509
12854
|
});
|
|
12510
|
-
var Pipe$2 = $TV($C($EXPECT($
|
|
12855
|
+
var Pipe$2 = $TV($C($EXPECT($L182, 'Pipe "|>"'), $EXPECT($L183, 'Pipe "\u25B7"')), function($skip, $loc, $0, $1) {
|
|
12511
12856
|
return { $loc, token: "|>" };
|
|
12512
12857
|
});
|
|
12513
12858
|
var Pipe$$ = [Pipe$0, Pipe$1, Pipe$2];
|
|
@@ -12520,19 +12865,19 @@ ${input.slice(result.pos)}
|
|
|
12520
12865
|
function QuestionMark(ctx, state) {
|
|
12521
12866
|
return $EVENT(ctx, state, "QuestionMark", QuestionMark$0);
|
|
12522
12867
|
}
|
|
12523
|
-
var Readonly$0 = $TS($S($EXPECT($
|
|
12868
|
+
var Readonly$0 = $TS($S($EXPECT($L184, 'Readonly "readonly"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
12524
12869
|
return { $loc, token: $1, ts: true };
|
|
12525
12870
|
});
|
|
12526
12871
|
function Readonly(ctx, state) {
|
|
12527
12872
|
return $EVENT(ctx, state, "Readonly", Readonly$0);
|
|
12528
12873
|
}
|
|
12529
|
-
var Return$0 = $TS($S($EXPECT($
|
|
12874
|
+
var Return$0 = $TS($S($EXPECT($L185, 'Return "return"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
12530
12875
|
return { $loc, token: $1 };
|
|
12531
12876
|
});
|
|
12532
12877
|
function Return(ctx, state) {
|
|
12533
12878
|
return $EVENT(ctx, state, "Return", Return$0);
|
|
12534
12879
|
}
|
|
12535
|
-
var Satisfies$0 = $TS($S($EXPECT($
|
|
12880
|
+
var Satisfies$0 = $TS($S($EXPECT($L186, 'Satisfies "satisfies"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
12536
12881
|
return { $loc, token: $1 };
|
|
12537
12882
|
});
|
|
12538
12883
|
function Satisfies(ctx, state) {
|
|
@@ -12544,7 +12889,7 @@ ${input.slice(result.pos)}
|
|
|
12544
12889
|
function Semicolon(ctx, state) {
|
|
12545
12890
|
return $EVENT(ctx, state, "Semicolon", Semicolon$0);
|
|
12546
12891
|
}
|
|
12547
|
-
var SingleQuote$0 = $TV($EXPECT($
|
|
12892
|
+
var SingleQuote$0 = $TV($EXPECT($L187, `SingleQuote "'"`), function($skip, $loc, $0, $1) {
|
|
12548
12893
|
return { $loc, token: $1 };
|
|
12549
12894
|
});
|
|
12550
12895
|
function SingleQuote(ctx, state) {
|
|
@@ -12556,7 +12901,7 @@ ${input.slice(result.pos)}
|
|
|
12556
12901
|
function Star(ctx, state) {
|
|
12557
12902
|
return $EVENT(ctx, state, "Star", Star$0);
|
|
12558
12903
|
}
|
|
12559
|
-
var Static$0 = $TS($S($EXPECT($
|
|
12904
|
+
var Static$0 = $TS($S($EXPECT($L188, 'Static "static"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
12560
12905
|
return { $loc, token: $1 };
|
|
12561
12906
|
});
|
|
12562
12907
|
var Static$1 = $TS($S($EXPECT($L129, 'Static "@"'), $N($C($EXPECT($L4, 'Static "("'), $EXPECT($L129, 'Static "@"')))), function($skip, $loc, $0, $1, $2) {
|
|
@@ -12566,127 +12911,127 @@ ${input.slice(result.pos)}
|
|
|
12566
12911
|
function Static(ctx, state) {
|
|
12567
12912
|
return $EVENT_C(ctx, state, "Static", Static$$);
|
|
12568
12913
|
}
|
|
12569
|
-
var SubstitutionStart$0 = $TV($EXPECT($
|
|
12914
|
+
var SubstitutionStart$0 = $TV($EXPECT($L189, 'SubstitutionStart "${"'), function($skip, $loc, $0, $1) {
|
|
12570
12915
|
return { $loc, token: $1 };
|
|
12571
12916
|
});
|
|
12572
12917
|
function SubstitutionStart(ctx, state) {
|
|
12573
12918
|
return $EVENT(ctx, state, "SubstitutionStart", SubstitutionStart$0);
|
|
12574
12919
|
}
|
|
12575
|
-
var Super$0 = $TS($S($EXPECT($
|
|
12920
|
+
var Super$0 = $TS($S($EXPECT($L190, 'Super "super"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
12576
12921
|
return { $loc, token: $1 };
|
|
12577
12922
|
});
|
|
12578
12923
|
function Super(ctx, state) {
|
|
12579
12924
|
return $EVENT(ctx, state, "Super", Super$0);
|
|
12580
12925
|
}
|
|
12581
|
-
var Switch$0 = $TS($S($EXPECT($
|
|
12926
|
+
var Switch$0 = $TS($S($EXPECT($L191, 'Switch "switch"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
12582
12927
|
return { $loc, token: $1 };
|
|
12583
12928
|
});
|
|
12584
12929
|
function Switch(ctx, state) {
|
|
12585
12930
|
return $EVENT(ctx, state, "Switch", Switch$0);
|
|
12586
12931
|
}
|
|
12587
|
-
var Target$0 = $TS($S($EXPECT($
|
|
12932
|
+
var Target$0 = $TS($S($EXPECT($L192, 'Target "target"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
12588
12933
|
return { $loc, token: $1 };
|
|
12589
12934
|
});
|
|
12590
12935
|
function Target(ctx, state) {
|
|
12591
12936
|
return $EVENT(ctx, state, "Target", Target$0);
|
|
12592
12937
|
}
|
|
12593
|
-
var Then$0 = $TS($S(__, $EXPECT($
|
|
12938
|
+
var Then$0 = $TS($S(__, $EXPECT($L193, 'Then "then"'), NonIdContinue), function($skip, $loc, $0, $1, $2, $3) {
|
|
12594
12939
|
return { $loc, token: "" };
|
|
12595
12940
|
});
|
|
12596
12941
|
function Then(ctx, state) {
|
|
12597
12942
|
return $EVENT(ctx, state, "Then", Then$0);
|
|
12598
12943
|
}
|
|
12599
|
-
var This$0 = $TS($S($EXPECT($
|
|
12944
|
+
var This$0 = $TS($S($EXPECT($L194, 'This "this"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
12600
12945
|
return { $loc, token: $1 };
|
|
12601
12946
|
});
|
|
12602
12947
|
function This(ctx, state) {
|
|
12603
12948
|
return $EVENT(ctx, state, "This", This$0);
|
|
12604
12949
|
}
|
|
12605
|
-
var Throw$0 = $TS($S($EXPECT($
|
|
12950
|
+
var Throw$0 = $TS($S($EXPECT($L195, 'Throw "throw"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
12606
12951
|
return { $loc, token: $1 };
|
|
12607
12952
|
});
|
|
12608
12953
|
function Throw(ctx, state) {
|
|
12609
12954
|
return $EVENT(ctx, state, "Throw", Throw$0);
|
|
12610
12955
|
}
|
|
12611
|
-
var TripleDoubleQuote$0 = $TV($EXPECT($
|
|
12956
|
+
var TripleDoubleQuote$0 = $TV($EXPECT($L196, 'TripleDoubleQuote "\\\\\\"\\\\\\"\\\\\\""'), function($skip, $loc, $0, $1) {
|
|
12612
12957
|
return { $loc, token: "`" };
|
|
12613
12958
|
});
|
|
12614
12959
|
function TripleDoubleQuote(ctx, state) {
|
|
12615
12960
|
return $EVENT(ctx, state, "TripleDoubleQuote", TripleDoubleQuote$0);
|
|
12616
12961
|
}
|
|
12617
|
-
var TripleSingleQuote$0 = $TV($EXPECT($
|
|
12962
|
+
var TripleSingleQuote$0 = $TV($EXPECT($L197, `TripleSingleQuote "'''"`), function($skip, $loc, $0, $1) {
|
|
12618
12963
|
return { $loc, token: "`" };
|
|
12619
12964
|
});
|
|
12620
12965
|
function TripleSingleQuote(ctx, state) {
|
|
12621
12966
|
return $EVENT(ctx, state, "TripleSingleQuote", TripleSingleQuote$0);
|
|
12622
12967
|
}
|
|
12623
|
-
var TripleSlash$0 = $TV($EXPECT($
|
|
12968
|
+
var TripleSlash$0 = $TV($EXPECT($L198, 'TripleSlash "///"'), function($skip, $loc, $0, $1) {
|
|
12624
12969
|
return { $loc, token: "/" };
|
|
12625
12970
|
});
|
|
12626
12971
|
function TripleSlash(ctx, state) {
|
|
12627
12972
|
return $EVENT(ctx, state, "TripleSlash", TripleSlash$0);
|
|
12628
12973
|
}
|
|
12629
|
-
var TripleTick$0 = $TV($EXPECT($
|
|
12974
|
+
var TripleTick$0 = $TV($EXPECT($L199, 'TripleTick "```"'), function($skip, $loc, $0, $1) {
|
|
12630
12975
|
return { $loc, token: "`" };
|
|
12631
12976
|
});
|
|
12632
12977
|
function TripleTick(ctx, state) {
|
|
12633
12978
|
return $EVENT(ctx, state, "TripleTick", TripleTick$0);
|
|
12634
12979
|
}
|
|
12635
|
-
var Try$0 = $TS($S($EXPECT($
|
|
12980
|
+
var Try$0 = $TS($S($EXPECT($L200, 'Try "try"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
12636
12981
|
return { $loc, token: $1 };
|
|
12637
12982
|
});
|
|
12638
12983
|
function Try(ctx, state) {
|
|
12639
12984
|
return $EVENT(ctx, state, "Try", Try$0);
|
|
12640
12985
|
}
|
|
12641
|
-
var Typeof$0 = $TS($S($EXPECT($
|
|
12986
|
+
var Typeof$0 = $TS($S($EXPECT($L201, 'Typeof "typeof"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
12642
12987
|
return { $loc, token: $1 };
|
|
12643
12988
|
});
|
|
12644
12989
|
function Typeof(ctx, state) {
|
|
12645
12990
|
return $EVENT(ctx, state, "Typeof", Typeof$0);
|
|
12646
12991
|
}
|
|
12647
|
-
var Unless$0 = $TS($S($EXPECT($
|
|
12992
|
+
var Unless$0 = $TS($S($EXPECT($L202, 'Unless "unless"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
12648
12993
|
return { $loc, token: $1, negated: true };
|
|
12649
12994
|
});
|
|
12650
12995
|
function Unless(ctx, state) {
|
|
12651
12996
|
return $EVENT(ctx, state, "Unless", Unless$0);
|
|
12652
12997
|
}
|
|
12653
|
-
var Until$0 = $TS($S($EXPECT($
|
|
12998
|
+
var Until$0 = $TS($S($EXPECT($L203, 'Until "until"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
12654
12999
|
return { $loc, token: $1 };
|
|
12655
13000
|
});
|
|
12656
13001
|
function Until(ctx, state) {
|
|
12657
13002
|
return $EVENT(ctx, state, "Until", Until$0);
|
|
12658
13003
|
}
|
|
12659
|
-
var Using$0 = $TS($S($EXPECT($
|
|
13004
|
+
var Using$0 = $TS($S($EXPECT($L204, 'Using "using"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
12660
13005
|
return { $loc, token: $1 };
|
|
12661
13006
|
});
|
|
12662
13007
|
function Using(ctx, state) {
|
|
12663
13008
|
return $EVENT(ctx, state, "Using", Using$0);
|
|
12664
13009
|
}
|
|
12665
|
-
var Var$0 = $TS($S($EXPECT($
|
|
13010
|
+
var Var$0 = $TS($S($EXPECT($L205, 'Var "var"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
12666
13011
|
return { $loc, token: $1 };
|
|
12667
13012
|
});
|
|
12668
13013
|
function Var(ctx, state) {
|
|
12669
13014
|
return $EVENT(ctx, state, "Var", Var$0);
|
|
12670
13015
|
}
|
|
12671
|
-
var Void$0 = $TS($S($EXPECT($
|
|
13016
|
+
var Void$0 = $TS($S($EXPECT($L206, 'Void "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
12672
13017
|
return { $loc, token: $1 };
|
|
12673
13018
|
});
|
|
12674
13019
|
function Void(ctx, state) {
|
|
12675
13020
|
return $EVENT(ctx, state, "Void", Void$0);
|
|
12676
13021
|
}
|
|
12677
|
-
var When$0 = $TS($S($EXPECT($
|
|
13022
|
+
var When$0 = $TS($S($EXPECT($L207, 'When "when"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
12678
13023
|
return { $loc, token: "case" };
|
|
12679
13024
|
});
|
|
12680
13025
|
function When(ctx, state) {
|
|
12681
13026
|
return $EVENT(ctx, state, "When", When$0);
|
|
12682
13027
|
}
|
|
12683
|
-
var While$0 = $TS($S($EXPECT($
|
|
13028
|
+
var While$0 = $TS($S($EXPECT($L208, 'While "while"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
12684
13029
|
return { $loc, token: $1 };
|
|
12685
13030
|
});
|
|
12686
13031
|
function While(ctx, state) {
|
|
12687
13032
|
return $EVENT(ctx, state, "While", While$0);
|
|
12688
13033
|
}
|
|
12689
|
-
var Yield$0 = $TS($S($EXPECT($
|
|
13034
|
+
var Yield$0 = $TS($S($EXPECT($L209, 'Yield "yield"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
12690
13035
|
return { $loc, token: $1, type: "Yield" };
|
|
12691
13036
|
});
|
|
12692
13037
|
function Yield(ctx, state) {
|
|
@@ -12765,7 +13110,7 @@ ${input.slice(result.pos)}
|
|
|
12765
13110
|
function JSXElement(ctx, state) {
|
|
12766
13111
|
return $EVENT_C(ctx, state, "JSXElement", JSXElement$$);
|
|
12767
13112
|
}
|
|
12768
|
-
var JSXSelfClosingElement$0 = $TS($S($EXPECT($L17, 'JSXSelfClosingElement "<"'), JSXElementName, $E(TypeArguments), $E(JSXAttributes), $E(Whitespace), $EXPECT($
|
|
13113
|
+
var JSXSelfClosingElement$0 = $TS($S($EXPECT($L17, 'JSXSelfClosingElement "<"'), JSXElementName, $E(TypeArguments), $E(JSXAttributes), $E(Whitespace), $EXPECT($L210, 'JSXSelfClosingElement "/>"')), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
12769
13114
|
return { type: "JSXElement", children: $0, tag: $2 };
|
|
12770
13115
|
});
|
|
12771
13116
|
function JSXSelfClosingElement(ctx, state) {
|
|
@@ -12799,7 +13144,7 @@ ${input.slice(result.pos)}
|
|
|
12799
13144
|
function JSXOptionalClosingElement(ctx, state) {
|
|
12800
13145
|
return $EVENT_C(ctx, state, "JSXOptionalClosingElement", JSXOptionalClosingElement$$);
|
|
12801
13146
|
}
|
|
12802
|
-
var JSXClosingElement$0 = $S($EXPECT($
|
|
13147
|
+
var JSXClosingElement$0 = $S($EXPECT($L211, 'JSXClosingElement "</"'), $E(Whitespace), JSXElementName, $E(Whitespace), $EXPECT($L45, 'JSXClosingElement ">"'));
|
|
12803
13148
|
function JSXClosingElement(ctx, state) {
|
|
12804
13149
|
return $EVENT(ctx, state, "JSXClosingElement", JSXClosingElement$0);
|
|
12805
13150
|
}
|
|
@@ -12820,7 +13165,7 @@ ${input.slice(result.pos)}
|
|
|
12820
13165
|
];
|
|
12821
13166
|
return { type: "JSXFragment", children: parts, jsxChildren: children.jsxChildren };
|
|
12822
13167
|
});
|
|
12823
|
-
var JSXFragment$1 = $TS($S(CoffeeJSXEnabled, $EXPECT($
|
|
13168
|
+
var JSXFragment$1 = $TS($S(CoffeeJSXEnabled, $EXPECT($L212, 'JSXFragment "<>"'), $E(JSXChildren), $E(Whitespace), JSXClosingFragment), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
12824
13169
|
var children = $3;
|
|
12825
13170
|
$0 = $0.slice(1);
|
|
12826
13171
|
return {
|
|
@@ -12833,7 +13178,7 @@ ${input.slice(result.pos)}
|
|
|
12833
13178
|
function JSXFragment(ctx, state) {
|
|
12834
13179
|
return $EVENT_C(ctx, state, "JSXFragment", JSXFragment$$);
|
|
12835
13180
|
}
|
|
12836
|
-
var PushJSXOpeningFragment$0 = $TV($EXPECT($
|
|
13181
|
+
var PushJSXOpeningFragment$0 = $TV($EXPECT($L212, 'PushJSXOpeningFragment "<>"'), function($skip, $loc, $0, $1) {
|
|
12837
13182
|
module.JSXTagStack.push("");
|
|
12838
13183
|
return $1;
|
|
12839
13184
|
});
|
|
@@ -12850,7 +13195,7 @@ ${input.slice(result.pos)}
|
|
|
12850
13195
|
function JSXOptionalClosingFragment(ctx, state) {
|
|
12851
13196
|
return $EVENT_C(ctx, state, "JSXOptionalClosingFragment", JSXOptionalClosingFragment$$);
|
|
12852
13197
|
}
|
|
12853
|
-
var JSXClosingFragment$0 = $EXPECT($
|
|
13198
|
+
var JSXClosingFragment$0 = $EXPECT($L213, 'JSXClosingFragment "</>"');
|
|
12854
13199
|
function JSXClosingFragment(ctx, state) {
|
|
12855
13200
|
return $EVENT(ctx, state, "JSXClosingFragment", JSXClosingFragment$0);
|
|
12856
13201
|
}
|
|
@@ -13329,7 +13674,7 @@ ${input.slice(result.pos)}
|
|
|
13329
13674
|
function JSXChild(ctx, state) {
|
|
13330
13675
|
return $EVENT_C(ctx, state, "JSXChild", JSXChild$$);
|
|
13331
13676
|
}
|
|
13332
|
-
var JSXComment$0 = $TS($S($EXPECT($
|
|
13677
|
+
var JSXComment$0 = $TS($S($EXPECT($L214, 'JSXComment "<!--"'), JSXCommentContent, $EXPECT($L215, 'JSXComment "-->"')), function($skip, $loc, $0, $1, $2, $3) {
|
|
13333
13678
|
return ["{/*", $2, "*/}"];
|
|
13334
13679
|
});
|
|
13335
13680
|
function JSXComment(ctx, state) {
|
|
@@ -13516,37 +13861,37 @@ ${input.slice(result.pos)}
|
|
|
13516
13861
|
function InterfaceExtendsTarget(ctx, state) {
|
|
13517
13862
|
return $EVENT(ctx, state, "InterfaceExtendsTarget", InterfaceExtendsTarget$0);
|
|
13518
13863
|
}
|
|
13519
|
-
var TypeKeyword$0 = $TS($S($EXPECT($
|
|
13864
|
+
var TypeKeyword$0 = $TS($S($EXPECT($L216, 'TypeKeyword "type"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
13520
13865
|
return { $loc, token: $1 };
|
|
13521
13866
|
});
|
|
13522
13867
|
function TypeKeyword(ctx, state) {
|
|
13523
13868
|
return $EVENT(ctx, state, "TypeKeyword", TypeKeyword$0);
|
|
13524
13869
|
}
|
|
13525
|
-
var Enum$0 = $TS($S($EXPECT($
|
|
13870
|
+
var Enum$0 = $TS($S($EXPECT($L217, 'Enum "enum"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
13526
13871
|
return { $loc, token: $1 };
|
|
13527
13872
|
});
|
|
13528
13873
|
function Enum(ctx, state) {
|
|
13529
13874
|
return $EVENT(ctx, state, "Enum", Enum$0);
|
|
13530
13875
|
}
|
|
13531
|
-
var Interface$0 = $TS($S($EXPECT($
|
|
13876
|
+
var Interface$0 = $TS($S($EXPECT($L218, 'Interface "interface"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
13532
13877
|
return { $loc, token: $1 };
|
|
13533
13878
|
});
|
|
13534
13879
|
function Interface(ctx, state) {
|
|
13535
13880
|
return $EVENT(ctx, state, "Interface", Interface$0);
|
|
13536
13881
|
}
|
|
13537
|
-
var Global$0 = $TS($S($EXPECT($
|
|
13882
|
+
var Global$0 = $TS($S($EXPECT($L219, 'Global "global"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
13538
13883
|
return { $loc, token: $1 };
|
|
13539
13884
|
});
|
|
13540
13885
|
function Global(ctx, state) {
|
|
13541
13886
|
return $EVENT(ctx, state, "Global", Global$0);
|
|
13542
13887
|
}
|
|
13543
|
-
var Module$0 = $TS($S($EXPECT($
|
|
13888
|
+
var Module$0 = $TS($S($EXPECT($L220, 'Module "module"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
13544
13889
|
return { $loc, token: $1 };
|
|
13545
13890
|
});
|
|
13546
13891
|
function Module(ctx, state) {
|
|
13547
13892
|
return $EVENT(ctx, state, "Module", Module$0);
|
|
13548
13893
|
}
|
|
13549
|
-
var Namespace$0 = $TS($S($EXPECT($
|
|
13894
|
+
var Namespace$0 = $TS($S($EXPECT($L221, 'Namespace "namespace"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
13550
13895
|
return { $loc, token: $1 };
|
|
13551
13896
|
});
|
|
13552
13897
|
function Namespace(ctx, state) {
|
|
@@ -13820,7 +14165,7 @@ ${input.slice(result.pos)}
|
|
|
13820
14165
|
function ReturnTypeSuffix(ctx, state) {
|
|
13821
14166
|
return $EVENT(ctx, state, "ReturnTypeSuffix", ReturnTypeSuffix$0);
|
|
13822
14167
|
}
|
|
13823
|
-
var ReturnType$0 = $TS($S($E($S(__, $EXPECT($
|
|
14168
|
+
var ReturnType$0 = $TS($S($E($S(__, $EXPECT($L222, 'ReturnType "asserts"'), NonIdContinue)), TypePredicate), function($skip, $loc, $0, $1, $2) {
|
|
13824
14169
|
var asserts = $1;
|
|
13825
14170
|
var t = $2;
|
|
13826
14171
|
if (asserts) {
|
|
@@ -13899,8 +14244,8 @@ ${input.slice(result.pos)}
|
|
|
13899
14244
|
function TypeUnarySuffix(ctx, state) {
|
|
13900
14245
|
return $EVENT_C(ctx, state, "TypeUnarySuffix", TypeUnarySuffix$$);
|
|
13901
14246
|
}
|
|
13902
|
-
var TypeUnaryOp$0 = $S($EXPECT($
|
|
13903
|
-
var TypeUnaryOp$1 = $S($EXPECT($
|
|
14247
|
+
var TypeUnaryOp$0 = $S($EXPECT($L223, 'TypeUnaryOp "keyof"'), NonIdContinue);
|
|
14248
|
+
var TypeUnaryOp$1 = $S($EXPECT($L184, 'TypeUnaryOp "readonly"'), NonIdContinue);
|
|
13904
14249
|
var TypeUnaryOp$$ = [TypeUnaryOp$0, TypeUnaryOp$1];
|
|
13905
14250
|
function TypeUnaryOp(ctx, state) {
|
|
13906
14251
|
return $EVENT_C(ctx, state, "TypeUnaryOp", TypeUnaryOp$$);
|
|
@@ -13930,7 +14275,7 @@ ${input.slice(result.pos)}
|
|
|
13930
14275
|
function TypeIndexedAccess(ctx, state) {
|
|
13931
14276
|
return $EVENT_C(ctx, state, "TypeIndexedAccess", TypeIndexedAccess$$);
|
|
13932
14277
|
}
|
|
13933
|
-
var UnknownAlias$0 = $TV($EXPECT($
|
|
14278
|
+
var UnknownAlias$0 = $TV($EXPECT($L224, 'UnknownAlias "???"'), function($skip, $loc, $0, $1) {
|
|
13934
14279
|
return { $loc, token: "unknown" };
|
|
13935
14280
|
});
|
|
13936
14281
|
function UnknownAlias(ctx, state) {
|
|
@@ -14136,13 +14481,20 @@ ${input.slice(result.pos)}
|
|
|
14136
14481
|
}
|
|
14137
14482
|
var TypeLiteral$0 = TypeTemplateLiteral;
|
|
14138
14483
|
var TypeLiteral$1 = Literal;
|
|
14139
|
-
var TypeLiteral$2 = $TS($S($EXPECT($
|
|
14484
|
+
var TypeLiteral$2 = $TS($S($EXPECT($R17, "TypeLiteral /[+-]/"), NumericLiteral), function($skip, $loc, $0, $1, $2) {
|
|
14485
|
+
var sign = $1;
|
|
14486
|
+
var num = $2;
|
|
14487
|
+
if (sign[0] === "+")
|
|
14488
|
+
return num;
|
|
14489
|
+
return $0;
|
|
14490
|
+
});
|
|
14491
|
+
var TypeLiteral$3 = $TS($S($EXPECT($L206, 'TypeLiteral "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
14140
14492
|
return { type: "VoidType", $loc, token: $1 };
|
|
14141
14493
|
});
|
|
14142
|
-
var TypeLiteral$
|
|
14494
|
+
var TypeLiteral$4 = $TV($EXPECT($L225, 'TypeLiteral "[]"'), function($skip, $loc, $0, $1) {
|
|
14143
14495
|
return { $loc, token: "[]" };
|
|
14144
14496
|
});
|
|
14145
|
-
var TypeLiteral$$ = [TypeLiteral$0, TypeLiteral$1, TypeLiteral$2, TypeLiteral$3];
|
|
14497
|
+
var TypeLiteral$$ = [TypeLiteral$0, TypeLiteral$1, TypeLiteral$2, TypeLiteral$3, TypeLiteral$4];
|
|
14146
14498
|
function TypeLiteral(ctx, state) {
|
|
14147
14499
|
return $EVENT_C(ctx, state, "TypeLiteral", TypeLiteral$$);
|
|
14148
14500
|
}
|
|
@@ -14265,7 +14617,7 @@ ${input.slice(result.pos)}
|
|
|
14265
14617
|
function CivetPrologue(ctx, state) {
|
|
14266
14618
|
return $EVENT_C(ctx, state, "CivetPrologue", CivetPrologue$$);
|
|
14267
14619
|
}
|
|
14268
|
-
var CivetPrologueContent$0 = $TS($S($EXPECT($
|
|
14620
|
+
var CivetPrologueContent$0 = $TS($S($EXPECT($L226, 'CivetPrologueContent "civet"'), NonIdContinue, $Q(CivetOption), $EXPECT($R86, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
14269
14621
|
var options = $3;
|
|
14270
14622
|
return {
|
|
14271
14623
|
type: "CivetPrologue",
|
|
@@ -14851,9 +15203,9 @@ ${input.slice(result.pos)}
|
|
|
14851
15203
|
}
|
|
14852
15204
|
}
|
|
14853
15205
|
});
|
|
14854
|
-
if (typeof
|
|
14855
|
-
Object.assign(module.config,
|
|
14856
|
-
|
|
15206
|
+
if (typeof parse !== "undefined") {
|
|
15207
|
+
Object.assign(module.config, parse.config);
|
|
15208
|
+
parse.config = module.config;
|
|
14857
15209
|
} else {
|
|
14858
15210
|
Object.assign(module.config, exports.parse.config);
|
|
14859
15211
|
exports.parse.config = module.config;
|
|
@@ -15004,7 +15356,7 @@ ${input.slice(result.pos)}
|
|
|
15004
15356
|
};
|
|
15005
15357
|
}();
|
|
15006
15358
|
exports.default = parser;
|
|
15007
|
-
|
|
15359
|
+
exports.parse = parser.parse;
|
|
15008
15360
|
exports.Program = Program;
|
|
15009
15361
|
exports.TopLevelStatements = TopLevelStatements;
|
|
15010
15362
|
exports.NestedTopLevelStatements = NestedTopLevelStatements;
|
|
@@ -15506,6 +15858,7 @@ ${input.slice(result.pos)}
|
|
|
15506
15858
|
exports.OpenBracket = OpenBracket;
|
|
15507
15859
|
exports.OpenParen = OpenParen;
|
|
15508
15860
|
exports.Operator = Operator;
|
|
15861
|
+
exports.Override = Override;
|
|
15509
15862
|
exports.Own = Own;
|
|
15510
15863
|
exports.Public = Public;
|
|
15511
15864
|
exports.Private = Private;
|