@danielx/civet 0.8.10 → 0.8.11
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 +10 -0
- package/dist/browser.js +140 -70
- package/dist/main.js +140 -70
- package/dist/main.mjs +140 -70
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,16 @@ This changelog is generated automatically by [`build/changelog.civet`](build/cha
|
|
|
4
4
|
For each version of Civet, it lists and links to all incorporated PRs,
|
|
5
5
|
as well as a full diff and commit list.
|
|
6
6
|
|
|
7
|
+
## 0.8.11 (2024-10-30, [diff](https://github.com/DanielXMoore/Civet/compare/v0.8.10...v0.8.11), [commits](https://github.com/DanielXMoore/Civet/commits/v0.8.11))
|
|
8
|
+
* Placeholders lift through reverse slice operators [[#1537](https://github.com/DanielXMoore/Civet/pull/1537)]
|
|
9
|
+
* Playground `comptime` restarts playground worker and resets toggle after editing [[#1538](https://github.com/DanielXMoore/Civet/pull/1538)]
|
|
10
|
+
* "civet strict" directive to enable JS strict mode [[#1539](https://github.com/DanielXMoore/Civet/pull/1539)]
|
|
11
|
+
* Fix reverse slices handling of extreme indices, trailing member access [[#1545](https://github.com/DanielXMoore/Civet/pull/1545)]
|
|
12
|
+
* Fix `& &` disambiguation (placeholder vs. bitwise and) [[#1546](https://github.com/DanielXMoore/Civet/pull/1546)]
|
|
13
|
+
* Inequality slicing without `..`: `x[<i]` etc. [[#1547](https://github.com/DanielXMoore/Civet/pull/1547)]
|
|
14
|
+
* Allow multiple indented blocks of arguments in function call [[#1548](https://github.com/DanielXMoore/Civet/pull/1548)]
|
|
15
|
+
* Restart LSP when `package.json` or Civet config file changes [[#1544](https://github.com/DanielXMoore/Civet/pull/1544)]
|
|
16
|
+
|
|
7
17
|
## 0.8.10 (2024-10-28, [diff](https://github.com/DanielXMoore/Civet/compare/v0.8.9...v0.8.10), [commits](https://github.com/DanielXMoore/Civet/commits/v0.8.10))
|
|
8
18
|
* Fix `sum`/`count`/`each`/`own`/etc. as loop iteration variables [[#1531](https://github.com/DanielXMoore/Civet/pull/1531)]
|
|
9
19
|
* Fix parenthesized `for` expression without body [[#1532](https://github.com/DanielXMoore/Civet/pull/1532)]
|
package/dist/browser.js
CHANGED
|
@@ -1849,17 +1849,14 @@ ${body}`;
|
|
|
1849
1849
|
preludeVar,
|
|
1850
1850
|
rsliceRef,
|
|
1851
1851
|
ts([": <R, T extends string | ", RSliceable, "<R>>(a: T, start?: number, end?: number) => T extends string ? string : T extends ", RSliceable, "<infer R> ? R : never"]),
|
|
1852
|
-
" = ((a, start, end) => {\n",
|
|
1852
|
+
" = ((a, start = -1, end = -1) => {\n",
|
|
1853
1853
|
" const l = a.length\n",
|
|
1854
|
-
" start
|
|
1855
|
-
|
|
1856
|
-
"(start ?? -1, l)\n",
|
|
1857
|
-
" end = ",
|
|
1858
|
-
getHelperRef("modulo"),
|
|
1859
|
-
"((end ?? -1) + 1, l)\n",
|
|
1854
|
+
" if (start < 0) start += l\n",
|
|
1855
|
+
" if (++end < 0) end += l\n",
|
|
1860
1856
|
" if (typeof a === 'string') {\n",
|
|
1861
|
-
|
|
1862
|
-
|
|
1857
|
+
' let r = ""\n',
|
|
1858
|
+
" if (start > l-1) start = l-1\n",
|
|
1859
|
+
" if (end < 0) end = 0\n",
|
|
1863
1860
|
" for (let i = start; i >= end; --i) r += a[i]\n",
|
|
1864
1861
|
" return r",
|
|
1865
1862
|
asAny,
|
|
@@ -6227,7 +6224,7 @@ ${js}`
|
|
|
6227
6224
|
let [t, , b, cs, e, f] = $0;
|
|
6228
6225
|
let c;
|
|
6229
6226
|
let m;
|
|
6230
|
-
if (cs.some(($) => (m =
|
|
6227
|
+
if (cs.some(($3) => (m = $3.binding?.parameter, typeof m === "object" && m != null && "type" in m && m.type === "CatchPattern"))) {
|
|
6231
6228
|
const ref = makeRef("e");
|
|
6232
6229
|
const binding = {
|
|
6233
6230
|
type: "CatchBinding",
|
|
@@ -6576,26 +6573,33 @@ ${js}`
|
|
|
6576
6573
|
...glob.children.slice(1, -1)
|
|
6577
6574
|
];
|
|
6578
6575
|
let ref3;
|
|
6579
|
-
|
|
6580
|
-
|
|
6576
|
+
const rsliceCall = makeNode({
|
|
6577
|
+
type: "CallExpression",
|
|
6578
|
+
implicit: true,
|
|
6581
6579
|
children: [
|
|
6582
|
-
|
|
6583
|
-
|
|
6580
|
+
getHelperRef("rslice"),
|
|
6581
|
+
makeNode({
|
|
6582
|
+
type: "Call",
|
|
6583
|
+
args,
|
|
6584
6584
|
children: [
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6588
|
-
args,
|
|
6589
|
-
children: [
|
|
6590
|
-
"(",
|
|
6591
|
-
args,
|
|
6592
|
-
(ref3 = glob.children)[ref3.length - 1]
|
|
6593
|
-
]
|
|
6594
|
-
})
|
|
6585
|
+
"(",
|
|
6586
|
+
args,
|
|
6587
|
+
(ref3 = glob.children)[ref3.length - 1]
|
|
6595
6588
|
]
|
|
6596
|
-
}
|
|
6589
|
+
})
|
|
6597
6590
|
]
|
|
6598
6591
|
});
|
|
6592
|
+
if (i + 1 >= children.length) {
|
|
6593
|
+
return rsliceCall;
|
|
6594
|
+
}
|
|
6595
|
+
return processCallMemberExpression(makeNode({
|
|
6596
|
+
// in case there are more
|
|
6597
|
+
...node,
|
|
6598
|
+
children: [
|
|
6599
|
+
rsliceCall,
|
|
6600
|
+
...children.slice(i + 1)
|
|
6601
|
+
]
|
|
6602
|
+
}));
|
|
6599
6603
|
}
|
|
6600
6604
|
}
|
|
6601
6605
|
return node;
|
|
@@ -6820,7 +6824,7 @@ ${js}`
|
|
|
6820
6824
|
tail.push(...splices.map((s) => [", ", s]), ...thisAssignments.map((a) => [", ", a]));
|
|
6821
6825
|
}
|
|
6822
6826
|
function processAssignments(statements) {
|
|
6823
|
-
for (let ref6 = gatherRecursiveAll(statements, ($
|
|
6827
|
+
for (let ref6 = gatherRecursiveAll(statements, ($4) => $4.type === "AssignmentExpression" || $4.type === "UpdateExpression"), i5 = 0, len4 = ref6.length; i5 < len4; i5++) {
|
|
6824
6828
|
let extractAssignment2 = function(lhs) {
|
|
6825
6829
|
let expr = lhs;
|
|
6826
6830
|
while (expr.type === "ParenthesizedExpression") {
|
|
@@ -6881,7 +6885,7 @@ ${js}`
|
|
|
6881
6885
|
const { assigned } = exp;
|
|
6882
6886
|
const ref = makeRef();
|
|
6883
6887
|
const newMemberExp = unchainOptionalMemberExpression(assigned, ref, (children) => {
|
|
6884
|
-
return exp.children.map(($
|
|
6888
|
+
return exp.children.map(($5) => $5 === assigned ? children : $5);
|
|
6885
6889
|
});
|
|
6886
6890
|
if (newMemberExp !== assigned) {
|
|
6887
6891
|
if (newMemberExp.usesRef) {
|
|
@@ -6895,7 +6899,7 @@ ${js}`
|
|
|
6895
6899
|
}
|
|
6896
6900
|
}
|
|
6897
6901
|
}
|
|
6898
|
-
for (let ref10 = gatherRecursiveAll(statements, ($
|
|
6902
|
+
for (let ref10 = gatherRecursiveAll(statements, ($6) => $6.type === "AssignmentExpression"), i7 = 0, len6 = ref10.length; i7 < len6; i7++) {
|
|
6899
6903
|
const exp = ref10[i7];
|
|
6900
6904
|
if (!(exp.names === null)) {
|
|
6901
6905
|
continue;
|
|
@@ -6911,14 +6915,14 @@ ${js}`
|
|
|
6911
6915
|
block
|
|
6912
6916
|
)) {
|
|
6913
6917
|
const ref = ref12;
|
|
6914
|
-
exp.children = exp.children.map(($
|
|
6918
|
+
exp.children = exp.children.map(($7) => $7 === $2 ? ref : $7);
|
|
6915
6919
|
$2 = ref;
|
|
6916
6920
|
} else {
|
|
6917
6921
|
block = void 0;
|
|
6918
6922
|
}
|
|
6919
6923
|
}
|
|
6920
6924
|
let ref13;
|
|
6921
|
-
if ($1.some(($
|
|
6925
|
+
if ($1.some(($8) => (ref13 = $8)[ref13.length - 1].special)) {
|
|
6922
6926
|
if ($1.length !== 1)
|
|
6923
6927
|
throw new Error("Only one assignment with id= is allowed");
|
|
6924
6928
|
const [, lhs, , op] = $1[0];
|
|
@@ -6963,13 +6967,6 @@ ${js}`
|
|
|
6963
6967
|
if (lhs.type === "MemberExpression") {
|
|
6964
6968
|
const members = lhs.children;
|
|
6965
6969
|
const lastMember = members[members.length - 1];
|
|
6966
|
-
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")) {
|
|
6967
|
-
lastMember.children.push({
|
|
6968
|
-
type: "Error",
|
|
6969
|
-
message: "Slice range cannot be decreasing in assignment"
|
|
6970
|
-
});
|
|
6971
|
-
break;
|
|
6972
|
-
}
|
|
6973
6970
|
if (lastMember.type === "SliceExpression") {
|
|
6974
6971
|
const { start, end, children: c } = lastMember;
|
|
6975
6972
|
c[0].token = ".splice(";
|
|
@@ -6992,9 +6989,15 @@ ${js}`
|
|
|
6992
6989
|
exp.names = [];
|
|
6993
6990
|
break;
|
|
6994
6991
|
}
|
|
6992
|
+
} else if (typeof lhs === "object" && lhs != null && "type" in lhs && lhs.type === "CallExpression" && "children" in lhs && Array.isArray(lhs.children) && lhs.children.length >= 1 && lhs.children[0] === peekHelperRef("rslice")) {
|
|
6993
|
+
lhs.children.push({
|
|
6994
|
+
type: "Error",
|
|
6995
|
+
message: "Slice range cannot be decreasing in assignment"
|
|
6996
|
+
});
|
|
6997
|
+
break;
|
|
6995
6998
|
} else if (m3 = lhs.type, m3 === "ObjectBindingPattern" || m3 === "ArrayBindingPattern") {
|
|
6996
6999
|
processBindingPatternLHS(lhs, tail);
|
|
6997
|
-
gatherRecursiveAll(lhs, ($
|
|
7000
|
+
gatherRecursiveAll(lhs, ($9) => $9.type === "Ref").forEach(refsToDeclare.add.bind(refsToDeclare));
|
|
6998
7001
|
}
|
|
6999
7002
|
}
|
|
7000
7003
|
i--;
|
|
@@ -7026,7 +7029,7 @@ ${js}`
|
|
|
7026
7029
|
}
|
|
7027
7030
|
if (refsToDeclare.size) {
|
|
7028
7031
|
if (exp.hoistDec) {
|
|
7029
|
-
exp.hoistDec.children.push([...refsToDeclare].map(($
|
|
7032
|
+
exp.hoistDec.children.push([...refsToDeclare].map(($10) => [",", $10]));
|
|
7030
7033
|
} else {
|
|
7031
7034
|
exp.hoistDec = {
|
|
7032
7035
|
type: "Declaration",
|
|
@@ -7217,7 +7220,7 @@ ${js}`
|
|
|
7217
7220
|
});
|
|
7218
7221
|
}
|
|
7219
7222
|
function processStatementExpressions(statements) {
|
|
7220
|
-
for (let ref21 = gatherRecursiveAll(statements, ($
|
|
7223
|
+
for (let ref21 = gatherRecursiveAll(statements, ($11) => $11.type === "StatementExpression"), i8 = 0, len7 = ref21.length; i8 < len7; i8++) {
|
|
7221
7224
|
const exp = ref21[i8];
|
|
7222
7225
|
const { maybe, statement } = exp;
|
|
7223
7226
|
if ((maybe || statement.type === "ThrowStatement") && blockContainingStatement(exp)) {
|
|
@@ -7299,7 +7302,7 @@ ${js}`
|
|
|
7299
7302
|
if (config2.iife || config2.repl) {
|
|
7300
7303
|
rootIIFE = wrapIIFE(root.expressions, root.topLevelAwait);
|
|
7301
7304
|
const newExpressions = [["", rootIIFE]];
|
|
7302
|
-
root.children = root.children.map(($
|
|
7305
|
+
root.children = root.children.map(($12) => $12 === root.expressions ? newExpressions : $12);
|
|
7303
7306
|
root.expressions = newExpressions;
|
|
7304
7307
|
}
|
|
7305
7308
|
addParentPointers(root);
|
|
@@ -7339,16 +7342,16 @@ ${js}`
|
|
|
7339
7342
|
await processComptime(statements);
|
|
7340
7343
|
}
|
|
7341
7344
|
function processRepl(root, rootIIFE) {
|
|
7342
|
-
const topBlock = gatherRecursive(rootIIFE, ($
|
|
7345
|
+
const topBlock = gatherRecursive(rootIIFE, ($13) => $13.type === "BlockStatement")[0];
|
|
7343
7346
|
let i = 0;
|
|
7344
|
-
for (let ref23 = gatherRecursiveWithinFunction(topBlock, ($
|
|
7347
|
+
for (let ref23 = gatherRecursiveWithinFunction(topBlock, ($14) => $14.type === "Declaration"), i9 = 0, len8 = ref23.length; i9 < len8; i9++) {
|
|
7345
7348
|
const decl = ref23[i9];
|
|
7346
7349
|
if (decl.parent === topBlock || decl.decl === "var") {
|
|
7347
7350
|
decl.children.shift();
|
|
7348
7351
|
root.expressions.splice(i++, 0, ["", `var ${decl.names.join(",")};`]);
|
|
7349
7352
|
}
|
|
7350
7353
|
}
|
|
7351
|
-
for (let ref24 = gatherRecursive(topBlock, ($
|
|
7354
|
+
for (let ref24 = gatherRecursive(topBlock, ($15) => $15.type === "FunctionExpression"), i10 = 0, len9 = ref24.length; i10 < len9; i10++) {
|
|
7352
7355
|
const func = ref24[i10];
|
|
7353
7356
|
if (func.name && func.parent?.type === "BlockStatement") {
|
|
7354
7357
|
if (func.parent === topBlock) {
|
|
@@ -7361,7 +7364,7 @@ ${js}`
|
|
|
7361
7364
|
}
|
|
7362
7365
|
}
|
|
7363
7366
|
}
|
|
7364
|
-
for (let ref25 = gatherRecursiveWithinFunction(topBlock, ($
|
|
7367
|
+
for (let ref25 = gatherRecursiveWithinFunction(topBlock, ($16) => $16.type === "ClassExpression"), i11 = 0, len10 = ref25.length; i11 < len10; i11++) {
|
|
7365
7368
|
const classExp = ref25[i11];
|
|
7366
7369
|
let m5;
|
|
7367
7370
|
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)) {
|
|
@@ -7371,7 +7374,7 @@ ${js}`
|
|
|
7371
7374
|
}
|
|
7372
7375
|
}
|
|
7373
7376
|
function populateRefs(statements) {
|
|
7374
|
-
const refNodes = gatherRecursive(statements, ($
|
|
7377
|
+
const refNodes = gatherRecursive(statements, ($17) => $17.type === "Ref");
|
|
7375
7378
|
if (refNodes.length) {
|
|
7376
7379
|
const ids = gatherRecursive(statements, (s) => s.type === "Identifier");
|
|
7377
7380
|
const names = new Set(ids.flatMap(({ names: names2 }) => names2 || []));
|
|
@@ -7394,11 +7397,14 @@ ${js}`
|
|
|
7394
7397
|
function processPlaceholders(statements) {
|
|
7395
7398
|
const placeholderMap = /* @__PURE__ */ new Map();
|
|
7396
7399
|
const liftedIfs = /* @__PURE__ */ new Set();
|
|
7397
|
-
for (let ref26 = gatherRecursiveAll(statements, ($
|
|
7400
|
+
for (let ref26 = gatherRecursiveAll(statements, ($18) => $18.type === "Placeholder"), i12 = 0, len11 = ref26.length; i12 < len11; i12++) {
|
|
7398
7401
|
const exp = ref26[i12];
|
|
7399
7402
|
let ancestor;
|
|
7400
7403
|
if (exp.subtype === ".") {
|
|
7401
|
-
({ ancestor } = findAncestor(
|
|
7404
|
+
({ ancestor } = findAncestor(
|
|
7405
|
+
exp,
|
|
7406
|
+
($) => $.type === "Call" && !$.parent?.implicit
|
|
7407
|
+
));
|
|
7402
7408
|
ancestor = ancestor?.parent;
|
|
7403
7409
|
let m6;
|
|
7404
7410
|
while (ancestor?.parent != null && (m6 = ancestor.parent.type, m6 === "UnaryExpression" || m6 === "NewExpression" || m6 === "AwaitExpression" || m6 === "ThrowStatement" || m6 === "StatementExpression")) {
|
|
@@ -7420,7 +7426,7 @@ ${js}`
|
|
|
7420
7426
|
}
|
|
7421
7427
|
let m7;
|
|
7422
7428
|
let m8;
|
|
7423
|
-
return type === "Call" || // Block, except for if/else blocks when condition already lifted
|
|
7429
|
+
return type === "Call" && !ancestor2.parent?.implicit || // Block, except for if/else blocks when condition already lifted
|
|
7424
7430
|
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
|
|
7425
7431
|
type === "Initializer" || // Right-hand side of assignment
|
|
7426
7432
|
type === "AssignmentExpression" && findChildIndex(ancestor2, child2) === ancestor2.children.indexOf(ancestor2.expression) || type === "ReturnStatement" || type === "YieldExpression";
|
|
@@ -7722,7 +7728,9 @@ ${js}`
|
|
|
7722
7728
|
TrailingCallExpressions,
|
|
7723
7729
|
AllowedTrailingCallExpressions,
|
|
7724
7730
|
CommaDelimiter,
|
|
7731
|
+
OptionalCommaDelimiter,
|
|
7725
7732
|
ArgumentList,
|
|
7733
|
+
NestedArguments,
|
|
7726
7734
|
NestedArgumentList,
|
|
7727
7735
|
NestedArgument,
|
|
7728
7736
|
SingleLineArgumentExpressions,
|
|
@@ -7920,6 +7928,7 @@ ${js}`
|
|
|
7920
7928
|
ArrayLiteral,
|
|
7921
7929
|
_ArrayLiteral,
|
|
7922
7930
|
RangeDots,
|
|
7931
|
+
OptionalRangeEnd,
|
|
7923
7932
|
RangeEnd,
|
|
7924
7933
|
RangeExpression,
|
|
7925
7934
|
ArrayLiteralContent,
|
|
@@ -7936,6 +7945,7 @@ ${js}`
|
|
|
7936
7945
|
ArrayBullet,
|
|
7937
7946
|
ArrayBulletDelimiter,
|
|
7938
7947
|
BulletIndent,
|
|
7948
|
+
Bullet,
|
|
7939
7949
|
BulletedArrayWithTrailing,
|
|
7940
7950
|
ObjectLiteral,
|
|
7941
7951
|
BracedObjectLiteral,
|
|
@@ -9028,7 +9038,6 @@ ${js}`
|
|
|
9028
9038
|
return $skip;
|
|
9029
9039
|
if (skipImplicitArguments(args))
|
|
9030
9040
|
return $skip;
|
|
9031
|
-
args = stripTrailingImplicitComma(args);
|
|
9032
9041
|
return {
|
|
9033
9042
|
type: "Call",
|
|
9034
9043
|
args,
|
|
@@ -9069,7 +9078,7 @@ ${js}`
|
|
|
9069
9078
|
}
|
|
9070
9079
|
var ForbiddenImplicitCalls$0 = ReservedBinary;
|
|
9071
9080
|
var ForbiddenImplicitCalls$1 = (0, import_lib5.$EXPECT)($L2, 'ForbiddenImplicitCalls "/ "');
|
|
9072
|
-
var ForbiddenImplicitCalls$2 = (0, import_lib5.$S)((0, import_lib5.$Y)((0, import_lib5.$S)((0, import_lib5.$R$0)((0, import_lib5.$EXPECT)($R1, "ForbiddenImplicitCalls /&(?=\\s)/")), (0, import_lib5.$N)((0, import_lib5.$S)(NotDedented, (0, import_lib5.$
|
|
9081
|
+
var ForbiddenImplicitCalls$2 = (0, import_lib5.$S)((0, import_lib5.$Y)((0, import_lib5.$S)((0, import_lib5.$R$0)((0, import_lib5.$EXPECT)($R1, "ForbiddenImplicitCalls /&(?=\\s)/")), (0, import_lib5.$N)((0, import_lib5.$S)(NotDedented, ReservedBinary)), (0, import_lib5.$N)((0, import_lib5.$S)((0, import_lib5.$Y)((0, import_lib5.$S)(NotDedented, Ampersand, (0, import_lib5.$C)(IndentedFurther, (0, import_lib5.$N)(EOS)))), BinaryOpRHS)), (0, import_lib5.$C)(IndentedFurther, (0, import_lib5.$N)(EOS)))), BinaryOpRHS);
|
|
9073
9082
|
var ForbiddenImplicitCalls$3 = (0, import_lib5.$S)(ClassImplicitCallForbidden, (0, import_lib5.$C)(Class, AtAt));
|
|
9074
9083
|
var ForbiddenImplicitCalls$4 = (0, import_lib5.$S)(Identifier, (0, import_lib5.$EXPECT)($L3, 'ForbiddenImplicitCalls "="'), Whitespace);
|
|
9075
9084
|
var ForbiddenImplicitCalls$5 = (0, import_lib5.$TS)((0, import_lib5.$S)(Identifier, (0, import_lib5.$N)((0, import_lib5.$EXPECT)($L4, 'ForbiddenImplicitCalls "("'))), function($skip, $loc, $0, $1, $2) {
|
|
@@ -9138,47 +9147,64 @@ ${js}`
|
|
|
9138
9147
|
function CommaDelimiter(ctx, state2) {
|
|
9139
9148
|
return (0, import_lib5.$EVENT)(ctx, state2, "CommaDelimiter", CommaDelimiter$0);
|
|
9140
9149
|
}
|
|
9141
|
-
var
|
|
9150
|
+
var OptionalCommaDelimiter$0 = CommaDelimiter;
|
|
9151
|
+
var OptionalCommaDelimiter$1 = (0, import_lib5.$T)((0, import_lib5.$S)((0, import_lib5.$Y)(EOS), InsertComma), function(value) {
|
|
9152
|
+
return value[1];
|
|
9153
|
+
});
|
|
9154
|
+
var OptionalCommaDelimiter$$ = [OptionalCommaDelimiter$0, OptionalCommaDelimiter$1];
|
|
9155
|
+
function OptionalCommaDelimiter(ctx, state2) {
|
|
9156
|
+
return (0, import_lib5.$EVENT_C)(ctx, state2, "OptionalCommaDelimiter", OptionalCommaDelimiter$$);
|
|
9157
|
+
}
|
|
9158
|
+
var ArgumentList$0 = (0, import_lib5.$TS)((0, import_lib5.$S)((0, import_lib5.$N)(EOS), ArgumentPart, (0, import_lib5.$Q)((0, import_lib5.$S)(CommaDelimiter, (0, import_lib5.$N)(EOS), (0, import_lib5.$E)(_), ArgumentPart)), (0, import_lib5.$S)(CommaDelimiter, NestedArguments), (0, import_lib5.$Q)((0, import_lib5.$S)(OptionalCommaDelimiter, NestedArguments))), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
9142
9159
|
return [
|
|
9143
9160
|
$2,
|
|
9144
9161
|
...$3.flatMap(([comma, eos, ws, arg]) => [comma, prepend(ws, arg)]),
|
|
9145
|
-
...$4
|
|
9162
|
+
...Array.isArray($4[1]) ? [$4[0], ...$4[1]] : $4,
|
|
9163
|
+
...$5.flatMap(
|
|
9146
9164
|
([comma, args]) => Array.isArray(args) ? [comma, ...args] : [comma, args]
|
|
9147
9165
|
)
|
|
9148
9166
|
];
|
|
9149
9167
|
});
|
|
9150
|
-
var ArgumentList$1 = (0, import_lib5.$TS)((0, import_lib5.$S)(
|
|
9168
|
+
var ArgumentList$1 = (0, import_lib5.$TS)((0, import_lib5.$S)(NestedArguments, (0, import_lib5.$Q)((0, import_lib5.$S)(OptionalCommaDelimiter, NestedArguments))), function($skip, $loc, $0, $1, $2) {
|
|
9169
|
+
if (!Array.isArray($1))
|
|
9170
|
+
$1 = [$1];
|
|
9151
9171
|
return [
|
|
9152
|
-
trimFirstSpace($1),
|
|
9172
|
+
...trimFirstSpace($1),
|
|
9153
9173
|
...$2.flatMap(
|
|
9154
9174
|
([comma, args]) => Array.isArray(args) ? [comma, ...args] : [comma, args]
|
|
9155
9175
|
)
|
|
9156
9176
|
];
|
|
9157
9177
|
});
|
|
9158
|
-
var ArgumentList$2 =
|
|
9159
|
-
var ArgumentList$3 = (0, import_lib5.$TS)((0, import_lib5.$S)((0, import_lib5.$E)(_), ArgumentPart, (0, import_lib5.$Q)((0, import_lib5.$S)(CommaDelimiter, (0, import_lib5.$E)(_), ArgumentPart))), function($skip, $loc, $0, $1, $2, $3) {
|
|
9178
|
+
var ArgumentList$2 = (0, import_lib5.$TS)((0, import_lib5.$S)((0, import_lib5.$E)(_), ArgumentPart, (0, import_lib5.$Q)((0, import_lib5.$S)(CommaDelimiter, (0, import_lib5.$E)(_), ArgumentPart))), function($skip, $loc, $0, $1, $2, $3) {
|
|
9160
9179
|
return [
|
|
9161
9180
|
prepend($1, $2),
|
|
9162
9181
|
...$3.flatMap(([comma, ws, arg]) => [comma, prepend(ws, arg)])
|
|
9163
9182
|
];
|
|
9164
9183
|
});
|
|
9165
|
-
var ArgumentList$$ = [ArgumentList$0, ArgumentList$1, ArgumentList$2
|
|
9184
|
+
var ArgumentList$$ = [ArgumentList$0, ArgumentList$1, ArgumentList$2];
|
|
9166
9185
|
function ArgumentList(ctx, state2) {
|
|
9167
9186
|
return (0, import_lib5.$EVENT_C)(ctx, state2, "ArgumentList", ArgumentList$$);
|
|
9168
9187
|
}
|
|
9188
|
+
var NestedArguments$0 = NestedBulletedArray;
|
|
9189
|
+
var NestedArguments$1 = NestedImplicitObjectLiteral;
|
|
9190
|
+
var NestedArguments$2 = NestedArgumentList;
|
|
9191
|
+
var NestedArguments$$ = [NestedArguments$0, NestedArguments$1, NestedArguments$2];
|
|
9192
|
+
function NestedArguments(ctx, state2) {
|
|
9193
|
+
return (0, import_lib5.$EVENT_C)(ctx, state2, "NestedArguments", NestedArguments$$);
|
|
9194
|
+
}
|
|
9169
9195
|
var NestedArgumentList$0 = (0, import_lib5.$TS)((0, import_lib5.$S)(PushIndent, AllowPipeline, AllowTrailingMemberProperty, (0, import_lib5.$Q)(NestedArgument), RestoreTrailingMemberProperty, RestorePipeline, PopIndent), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
|
|
9170
9196
|
var args = $4;
|
|
9171
9197
|
if (!args.length)
|
|
9172
9198
|
return $skip;
|
|
9173
|
-
return args.flat();
|
|
9199
|
+
return stripTrailingImplicitComma(args.flat());
|
|
9174
9200
|
});
|
|
9175
9201
|
function NestedArgumentList(ctx, state2) {
|
|
9176
9202
|
return (0, import_lib5.$EVENT)(ctx, state2, "NestedArgumentList", NestedArgumentList$0);
|
|
9177
9203
|
}
|
|
9178
|
-
var NestedArgument$0 = (0, import_lib5.$TS)((0, import_lib5.$S)(Nested, SingleLineArgumentExpressions, ParameterElementDelimiter), function($skip, $loc, $0, $1, $2, $3) {
|
|
9204
|
+
var NestedArgument$0 = (0, import_lib5.$TS)((0, import_lib5.$S)(Nested, (0, import_lib5.$N)(Bullet), SingleLineArgumentExpressions, ParameterElementDelimiter), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
9179
9205
|
var indent = $1;
|
|
9180
|
-
var args = $
|
|
9181
|
-
var comma = $
|
|
9206
|
+
var args = $3;
|
|
9207
|
+
var comma = $4;
|
|
9182
9208
|
let [arg0, ...rest] = args;
|
|
9183
9209
|
arg0 = prepend(indent, arg0);
|
|
9184
9210
|
return [arg0, ...rest, comma];
|
|
@@ -10529,8 +10555,38 @@ ${js}`
|
|
|
10529
10555
|
children
|
|
10530
10556
|
};
|
|
10531
10557
|
});
|
|
10558
|
+
var SliceParameters$1 = (0, import_lib5.$TS)((0, import_lib5.$S)(Loc, RangeEnd, Expression), function($skip, $loc, $0, $1, $2, $3) {
|
|
10559
|
+
var l = $1;
|
|
10560
|
+
var rend = $2;
|
|
10561
|
+
var e = $3;
|
|
10562
|
+
let start, end, children;
|
|
10563
|
+
if (rend.increasing) {
|
|
10564
|
+
end = e;
|
|
10565
|
+
if (rend.inclusive) {
|
|
10566
|
+
end = [makeLeftHandSideExpression(end), ` + 1`];
|
|
10567
|
+
}
|
|
10568
|
+
start = {
|
|
10569
|
+
$loc: l.$loc,
|
|
10570
|
+
token: "0"
|
|
10571
|
+
};
|
|
10572
|
+
children = [start, ", ", end];
|
|
10573
|
+
} else {
|
|
10574
|
+
start = e;
|
|
10575
|
+
if (!rend.inclusive) {
|
|
10576
|
+
start = [makeLeftHandSideExpression(start), ` + 1`];
|
|
10577
|
+
}
|
|
10578
|
+
children = [start];
|
|
10579
|
+
}
|
|
10580
|
+
return {
|
|
10581
|
+
type: "SliceParameters",
|
|
10582
|
+
start,
|
|
10583
|
+
end,
|
|
10584
|
+
children
|
|
10585
|
+
};
|
|
10586
|
+
});
|
|
10587
|
+
var SliceParameters$$ = [SliceParameters$0, SliceParameters$1];
|
|
10532
10588
|
function SliceParameters(ctx, state2) {
|
|
10533
|
-
return (0, import_lib5.$
|
|
10589
|
+
return (0, import_lib5.$EVENT_C)(ctx, state2, "SliceParameters", SliceParameters$$);
|
|
10534
10590
|
}
|
|
10535
10591
|
var AccessStart$0 = (0, import_lib5.$TS)((0, import_lib5.$S)((0, import_lib5.$E)(PropertyAccessModifier), Dot, (0, import_lib5.$N)((0, import_lib5.$EXPECT)($R11, "AccessStart /[.\\s]/"))), function($skip, $loc, $0, $1, $2, $3) {
|
|
10536
10592
|
var modifier = $1;
|
|
@@ -12254,7 +12310,7 @@ ${js}`
|
|
|
12254
12310
|
children: []
|
|
12255
12311
|
};
|
|
12256
12312
|
});
|
|
12257
|
-
var RangeDots$1 = (0, import_lib5.$TS)((0, import_lib5.$S)(
|
|
12313
|
+
var RangeDots$1 = (0, import_lib5.$TS)((0, import_lib5.$S)(OptionalRangeEnd, (0, import_lib5.$E)(_), DotDot, (0, import_lib5.$E)(_), OptionalRangeEnd), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
12258
12314
|
var left = $1;
|
|
12259
12315
|
var ws1 = $2;
|
|
12260
12316
|
var dots = $3;
|
|
@@ -12290,6 +12346,14 @@ ${js}`
|
|
|
12290
12346
|
function RangeDots(ctx, state2) {
|
|
12291
12347
|
return (0, import_lib5.$EVENT_C)(ctx, state2, "RangeDots", RangeDots$$);
|
|
12292
12348
|
}
|
|
12349
|
+
var OptionalRangeEnd$0 = RangeEnd;
|
|
12350
|
+
var OptionalRangeEnd$1 = (0, import_lib5.$T)((0, import_lib5.$EXPECT)($L0, 'OptionalRangeEnd ""'), function(value) {
|
|
12351
|
+
return { "increasing": void 0, "inclusive": true, "raw": "" };
|
|
12352
|
+
});
|
|
12353
|
+
var OptionalRangeEnd$$ = [OptionalRangeEnd$0, OptionalRangeEnd$1];
|
|
12354
|
+
function OptionalRangeEnd(ctx, state2) {
|
|
12355
|
+
return (0, import_lib5.$EVENT_C)(ctx, state2, "OptionalRangeEnd", OptionalRangeEnd$$);
|
|
12356
|
+
}
|
|
12293
12357
|
var RangeEnd$0 = (0, import_lib5.$TR)((0, import_lib5.$EXPECT)($R20, "RangeEnd /([<>])(=?)|([\u2264\u2265])/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
|
|
12294
12358
|
let dir = $1, equal = $2, unicode = $3;
|
|
12295
12359
|
if (unicode) {
|
|
@@ -12306,12 +12370,8 @@ ${js}`
|
|
|
12306
12370
|
raw: $0
|
|
12307
12371
|
};
|
|
12308
12372
|
});
|
|
12309
|
-
var RangeEnd$1 = (0, import_lib5.$T)((0, import_lib5.$EXPECT)($L0, 'RangeEnd ""'), function(value) {
|
|
12310
|
-
return { "increasing": void 0, "inclusive": true, "raw": "" };
|
|
12311
|
-
});
|
|
12312
|
-
var RangeEnd$$ = [RangeEnd$0, RangeEnd$1];
|
|
12313
12373
|
function RangeEnd(ctx, state2) {
|
|
12314
|
-
return (0, import_lib5.$
|
|
12374
|
+
return (0, import_lib5.$EVENT)(ctx, state2, "RangeEnd", RangeEnd$0);
|
|
12315
12375
|
}
|
|
12316
12376
|
var RangeExpression$0 = (0, import_lib5.$TS)((0, import_lib5.$S)(Expression, __, RangeDots, Expression), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
12317
12377
|
var start = $1;
|
|
@@ -12551,7 +12611,7 @@ ${js}`
|
|
|
12551
12611
|
function ArrayBulletDelimiter(ctx, state2) {
|
|
12552
12612
|
return (0, import_lib5.$EVENT_C)(ctx, state2, "ArrayBulletDelimiter", ArrayBulletDelimiter$$);
|
|
12553
12613
|
}
|
|
12554
|
-
var BulletIndent$0 = (0, import_lib5.$
|
|
12614
|
+
var BulletIndent$0 = (0, import_lib5.$TS)((0, import_lib5.$S)(Bullet), function($skip, $loc, $0, $1) {
|
|
12555
12615
|
const [bullet, ws] = $1;
|
|
12556
12616
|
const indent = {
|
|
12557
12617
|
token: " " + ws,
|
|
@@ -12566,6 +12626,12 @@ ${js}`
|
|
|
12566
12626
|
function BulletIndent(ctx, state2) {
|
|
12567
12627
|
return (0, import_lib5.$EVENT)(ctx, state2, "BulletIndent", BulletIndent$0);
|
|
12568
12628
|
}
|
|
12629
|
+
var Bullet$0 = (0, import_lib5.$S)((0, import_lib5.$EXPECT)($L47, 'Bullet "\u2022"'), (0, import_lib5.$R$0)((0, import_lib5.$EXPECT)($R21, "Bullet /[ \\t]*/")));
|
|
12630
|
+
var Bullet$1 = (0, import_lib5.$S)((0, import_lib5.$EXPECT)($L7, 'Bullet "."'), (0, import_lib5.$R$0)((0, import_lib5.$EXPECT)($R22, "Bullet /[ \\t]+/")));
|
|
12631
|
+
var Bullet$$ = [Bullet$0, Bullet$1];
|
|
12632
|
+
function Bullet(ctx, state2) {
|
|
12633
|
+
return (0, import_lib5.$EVENT_C)(ctx, state2, "Bullet", Bullet$$);
|
|
12634
|
+
}
|
|
12569
12635
|
var BulletedArrayWithTrailing$0 = (0, import_lib5.$TS)((0, import_lib5.$S)(BulletedArray, (0, import_lib5.$E)(AllowedTrailingCallExpressions), (0, import_lib5.$Q)((0, import_lib5.$S)(NotDedented, Pipe, __, PipelineTailItem))), function($skip, $loc, $0, $1, $2, $3) {
|
|
12570
12636
|
var array = $1;
|
|
12571
12637
|
var trailing = $2;
|
|
@@ -19423,6 +19489,7 @@ ${js}`
|
|
|
19423
19489
|
repl: false,
|
|
19424
19490
|
rewriteTsImports: true,
|
|
19425
19491
|
server: false,
|
|
19492
|
+
strict: false,
|
|
19426
19493
|
symbols: wellKnownSymbols,
|
|
19427
19494
|
tab: void 0,
|
|
19428
19495
|
// default behavior = same as space
|
|
@@ -19483,6 +19550,9 @@ ${js}`
|
|
|
19483
19550
|
Object.assign(config, directive.config);
|
|
19484
19551
|
}
|
|
19485
19552
|
});
|
|
19553
|
+
if (config.strict) {
|
|
19554
|
+
$0 = [...$0, '"use strict";\n'];
|
|
19555
|
+
}
|
|
19486
19556
|
return $0;
|
|
19487
19557
|
});
|
|
19488
19558
|
function Init(ctx, state2) {
|