@danielx/civet 0.7.26 → 0.7.27
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 +6 -0
- package/dist/browser.js +248 -40
- package/dist/main.js +248 -40
- package/dist/main.mjs +248 -40
- package/package.json +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,12 @@ 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.7.27 (2024-08-29, [diff](https://github.com/DanielXMoore/Civet/compare/v0.7.26...v0.7.27), [commits](https://github.com/DanielXMoore/Civet/commits/v0.7.27))
|
|
8
|
+
* Add `repository` to `package.json`, fixing Dependabot changelog detection [[#1380](https://github.com/DanielXMoore/Civet/pull/1380)]
|
|
9
|
+
* Fix glob accessor `.{a,b}` shorthand for `&.{a,b}` [[#1379](https://github.com/DanielXMoore/Civet/pull/1379)]
|
|
10
|
+
* Typing of object/array pattern components via `::` [[#1383](https://github.com/DanielXMoore/Civet/pull/1383)]
|
|
11
|
+
* JSX attributes with unbraced indented values, code children with `>` [[#1381](https://github.com/DanielXMoore/Civet/pull/1381)]
|
|
12
|
+
|
|
7
13
|
## 0.7.26 (2024-08-26, [diff](https://github.com/DanielXMoore/Civet/compare/v0.7.25...v0.7.26), [commits](https://github.com/DanielXMoore/Civet/commits/v0.7.26))
|
|
8
14
|
* Hyphenated object keys like `Content-Type:` [[#1377](https://github.com/DanielXMoore/Civet/pull/1377)]
|
|
9
15
|
* Fix unplugin `parseOptions`, fix eslint plugin for Node 22 [[#1378](https://github.com/DanielXMoore/Civet/pull/1378)]
|
package/dist/browser.js
CHANGED
|
@@ -531,6 +531,7 @@ ${body}`;
|
|
|
531
531
|
expressionizeTypeIf: () => expressionizeTypeIf,
|
|
532
532
|
forRange: () => forRange,
|
|
533
533
|
gatherBindingCode: () => gatherBindingCode,
|
|
534
|
+
gatherBindingPatternTypeSuffix: () => gatherBindingPatternTypeSuffix,
|
|
534
535
|
gatherRecursive: () => gatherRecursive,
|
|
535
536
|
gatherRecursiveAll: () => gatherRecursiveAll,
|
|
536
537
|
gatherRecursiveWithinFunction: () => gatherRecursiveWithinFunction,
|
|
@@ -1334,7 +1335,7 @@ ${body}`;
|
|
|
1334
1335
|
|
|
1335
1336
|
// source/parser/binding.civet
|
|
1336
1337
|
function adjustAtBindings(statements, asThis = false) {
|
|
1337
|
-
gatherRecursiveAll(statements, (
|
|
1338
|
+
gatherRecursiveAll(statements, ($) => $.type === "AtBindingProperty").forEach((binding) => {
|
|
1338
1339
|
const { ref } = binding;
|
|
1339
1340
|
if (asThis) {
|
|
1340
1341
|
const atBinding = binding.binding;
|
|
@@ -1353,17 +1354,19 @@ ${body}`;
|
|
|
1353
1354
|
});
|
|
1354
1355
|
}
|
|
1355
1356
|
function adjustBindingElements(elements) {
|
|
1356
|
-
const names = elements.flatMap((
|
|
1357
|
+
const names = elements.flatMap(($1) => $1.names || []);
|
|
1358
|
+
const { length } = elements;
|
|
1357
1359
|
let blockPrefix, restIndex = -1, restCount = 0;
|
|
1358
|
-
|
|
1360
|
+
for (let i1 = 0, len3 = elements.length; i1 < len3; i1++) {
|
|
1361
|
+
const i = i1;
|
|
1362
|
+
const { type } = elements[i1];
|
|
1359
1363
|
if (type === "BindingRestElement") {
|
|
1360
|
-
if (restIndex < 0)
|
|
1364
|
+
if (restIndex < 0) {
|
|
1361
1365
|
restIndex = i;
|
|
1362
|
-
|
|
1366
|
+
}
|
|
1367
|
+
restCount++;
|
|
1363
1368
|
}
|
|
1364
|
-
|
|
1365
|
-
return;
|
|
1366
|
-
});
|
|
1369
|
+
}
|
|
1367
1370
|
if (restCount === 0) {
|
|
1368
1371
|
return {
|
|
1369
1372
|
children: elements,
|
|
@@ -1382,7 +1385,7 @@ ${body}`;
|
|
|
1382
1385
|
l++;
|
|
1383
1386
|
blockPrefix = {
|
|
1384
1387
|
type: "PostRestBindingElements",
|
|
1385
|
-
children: ["[",
|
|
1388
|
+
children: ["[", trimFirstSpace(after), "] = ", restIdentifier, ".splice(-", l.toString(), ")"],
|
|
1386
1389
|
names: after.flatMap((p) => p.names)
|
|
1387
1390
|
};
|
|
1388
1391
|
}
|
|
@@ -1442,6 +1445,100 @@ ${body}`;
|
|
|
1442
1445
|
const lastChild = (ref1 = elementNode.children)[ref1.length - 1];
|
|
1443
1446
|
return lastChild && lastChild[lastChild.length - 1]?.token === ",";
|
|
1444
1447
|
}
|
|
1448
|
+
function gatherBindingPatternTypeSuffix(pattern) {
|
|
1449
|
+
if (pattern.typeSuffix != null) {
|
|
1450
|
+
return pattern;
|
|
1451
|
+
}
|
|
1452
|
+
let count = 0;
|
|
1453
|
+
switch (pattern.type) {
|
|
1454
|
+
case "ArrayBindingPattern": {
|
|
1455
|
+
const results = [];
|
|
1456
|
+
for (let ref2 = pattern.elements, i2 = 0, len1 = ref2.length; i2 < len1; i2++) {
|
|
1457
|
+
const elem = ref2[i2];
|
|
1458
|
+
let { typeSuffix } = elem;
|
|
1459
|
+
typeSuffix ??= elem.binding?.typeSuffix;
|
|
1460
|
+
if (typeSuffix) {
|
|
1461
|
+
count++;
|
|
1462
|
+
}
|
|
1463
|
+
let typeElement = [typeSuffix?.t, elem.delim];
|
|
1464
|
+
if (typeSuffix?.optional) {
|
|
1465
|
+
typeElement[0] = parenthesizeType(typeElement[0]);
|
|
1466
|
+
typeElement.unshift("undefined |");
|
|
1467
|
+
}
|
|
1468
|
+
if (elem.type === "BindingRestElement") {
|
|
1469
|
+
typeElement[0] ??= "unknown[]";
|
|
1470
|
+
typeElement.unshift(elem.dots);
|
|
1471
|
+
} else {
|
|
1472
|
+
typeElement[0] ??= "unknown";
|
|
1473
|
+
}
|
|
1474
|
+
results.push(typeElement);
|
|
1475
|
+
}
|
|
1476
|
+
;
|
|
1477
|
+
const types = results;
|
|
1478
|
+
if (count) {
|
|
1479
|
+
const t = [": [", types, "]"];
|
|
1480
|
+
pattern.typeSuffix = {
|
|
1481
|
+
type: "TypeSuffix",
|
|
1482
|
+
ts: true,
|
|
1483
|
+
t,
|
|
1484
|
+
children: [t]
|
|
1485
|
+
};
|
|
1486
|
+
}
|
|
1487
|
+
;
|
|
1488
|
+
break;
|
|
1489
|
+
}
|
|
1490
|
+
case "ObjectBindingPattern": {
|
|
1491
|
+
let restType;
|
|
1492
|
+
const results1 = [];
|
|
1493
|
+
for (let ref3 = pattern.properties, i3 = 0, len22 = ref3.length; i3 < len22; i3++) {
|
|
1494
|
+
const prop = ref3[i3];
|
|
1495
|
+
let { typeSuffix } = prop;
|
|
1496
|
+
typeSuffix ??= prop.value?.typeSuffix;
|
|
1497
|
+
if (typeSuffix) {
|
|
1498
|
+
count++;
|
|
1499
|
+
}
|
|
1500
|
+
typeSuffix ??= {
|
|
1501
|
+
type: "TypeSuffix",
|
|
1502
|
+
ts: true,
|
|
1503
|
+
children: [": unknown"]
|
|
1504
|
+
};
|
|
1505
|
+
switch (prop.type) {
|
|
1506
|
+
case "BindingProperty": {
|
|
1507
|
+
const ws = prop.children.slice(0, prop.children.indexOf(prop.name));
|
|
1508
|
+
results1.push([...ws, prop.name, typeSuffix, prop.delim]);
|
|
1509
|
+
break;
|
|
1510
|
+
}
|
|
1511
|
+
case "AtBindingProperty": {
|
|
1512
|
+
const ws = prop.children.slice(0, prop.children.indexOf(prop.binding));
|
|
1513
|
+
results1.push([...ws, prop.ref.id, typeSuffix, prop.delim]);
|
|
1514
|
+
break;
|
|
1515
|
+
}
|
|
1516
|
+
case "BindingRestProperty": {
|
|
1517
|
+
restType = prop.typeSuffix?.t;
|
|
1518
|
+
continue;
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
;
|
|
1523
|
+
const types = results1;
|
|
1524
|
+
if (count) {
|
|
1525
|
+
const t = ["{", types, "}"];
|
|
1526
|
+
if (restType != null) {
|
|
1527
|
+
t.push(" & ", parenthesizeType(trimFirstSpace(restType)));
|
|
1528
|
+
}
|
|
1529
|
+
pattern.typeSuffix = {
|
|
1530
|
+
type: "TypeSuffix",
|
|
1531
|
+
ts: true,
|
|
1532
|
+
t,
|
|
1533
|
+
children: [": ", t]
|
|
1534
|
+
};
|
|
1535
|
+
}
|
|
1536
|
+
;
|
|
1537
|
+
break;
|
|
1538
|
+
}
|
|
1539
|
+
}
|
|
1540
|
+
return pattern;
|
|
1541
|
+
}
|
|
1445
1542
|
|
|
1446
1543
|
// source/parser/function.civet
|
|
1447
1544
|
function isVoidType(t) {
|
|
@@ -3271,6 +3368,9 @@ ${body}`;
|
|
|
3271
3368
|
let [splices, assignments] = gatherBindingCode(pattern);
|
|
3272
3369
|
splices = splices.map((s) => [", ", s]);
|
|
3273
3370
|
const thisAssignments = assignments.map((a) => ["", a, ";"]);
|
|
3371
|
+
if ("typeSuffix" in pattern) {
|
|
3372
|
+
suffix ??= pattern.typeSuffix;
|
|
3373
|
+
}
|
|
3274
3374
|
const initializer = makeNode({
|
|
3275
3375
|
type: "Initializer",
|
|
3276
3376
|
expression: e,
|
|
@@ -6556,6 +6656,7 @@ ${js}`
|
|
|
6556
6656
|
NestedBindingPropertyList,
|
|
6557
6657
|
BindingProperty,
|
|
6558
6658
|
BindingRestProperty,
|
|
6659
|
+
BindingTypeSuffix,
|
|
6559
6660
|
NestedBindingElements,
|
|
6560
6661
|
BindingElement,
|
|
6561
6662
|
BindingRestElement,
|
|
@@ -6893,6 +6994,7 @@ ${js}`
|
|
|
6893
6994
|
DotDot,
|
|
6894
6995
|
DotDotDot,
|
|
6895
6996
|
DoubleColon,
|
|
6997
|
+
DoubleColonAsColon,
|
|
6896
6998
|
DoubleQuote,
|
|
6897
6999
|
Each,
|
|
6898
7000
|
Else,
|
|
@@ -7007,6 +7109,8 @@ ${js}`
|
|
|
7007
7109
|
JSXChildExpression,
|
|
7008
7110
|
IndentedJSXChildExpression,
|
|
7009
7111
|
NestedJSXChildExpression,
|
|
7112
|
+
JSXAngleChild,
|
|
7113
|
+
JSXAngleChildExpression,
|
|
7010
7114
|
UsingDeclaration,
|
|
7011
7115
|
UsingBinding,
|
|
7012
7116
|
UsingJSModeError,
|
|
@@ -7399,7 +7503,7 @@ ${js}`
|
|
|
7399
7503
|
var $R3 = (0, import_lib3.$R)(new RegExp("[0-9]", "suy"));
|
|
7400
7504
|
var $R4 = (0, import_lib3.$R)(new RegExp("(?!\\p{ID_Start}|[_$0-9(\\[{])", "suy"));
|
|
7401
7505
|
var $R5 = (0, import_lib3.$R)(new RegExp("[ \\t]", "suy"));
|
|
7402
|
-
var $R6 = (0, import_lib3.$R)(new RegExp("\\p{ID_Continue}|[\\u200C\\u200D$.#]", "suy"));
|
|
7506
|
+
var $R6 = (0, import_lib3.$R)(new RegExp("\\p{ID_Continue}|[\\u200C\\u200D$.#{]", "suy"));
|
|
7403
7507
|
var $R7 = (0, import_lib3.$R)(new RegExp("[&=]", "suy"));
|
|
7404
7508
|
var $R8 = (0, import_lib3.$R)(new RegExp("(?=['\"`])", "suy"));
|
|
7405
7509
|
var $R9 = (0, import_lib3.$R)(new RegExp("(?=[\\/?])", "suy"));
|
|
@@ -8385,7 +8489,7 @@ ${js}`
|
|
|
8385
8489
|
function ParenthesizedExpression(ctx, state2) {
|
|
8386
8490
|
return (0, import_lib3.$EVENT)(ctx, state2, "ParenthesizedExpression", ParenthesizedExpression$0);
|
|
8387
8491
|
}
|
|
8388
|
-
var Placeholder$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Dot, (0, import_lib3.$N)((0, import_lib3.$EXPECT)($R6, "Placeholder /\\p{ID_Continue}|[\\u200C\\u200D$.#]/")), (0, import_lib3.$E)(PlaceholderTypeSuffix)), function($skip, $loc, $0, $1, $2, $3) {
|
|
8492
|
+
var Placeholder$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Dot, (0, import_lib3.$N)((0, import_lib3.$EXPECT)($R6, "Placeholder /\\p{ID_Continue}|[\\u200C\\u200D$.#{]/")), (0, import_lib3.$E)(PlaceholderTypeSuffix)), function($skip, $loc, $0, $1, $2, $3) {
|
|
8389
8493
|
var dot = $1;
|
|
8390
8494
|
var typeSuffix = $3;
|
|
8391
8495
|
return {
|
|
@@ -8405,7 +8509,7 @@ ${js}`
|
|
|
8405
8509
|
children: [amp]
|
|
8406
8510
|
};
|
|
8407
8511
|
});
|
|
8408
|
-
var Placeholder$2 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$Y)(ExplicitAccessStart), (0, import_lib3.$Y)(PropertyAccess), (0, import_lib3.$N)(NumericLiteral)), function($skip, $loc, $0, $1, $2, $3) {
|
|
8512
|
+
var Placeholder$2 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$Y)(ExplicitAccessStart), (0, import_lib3.$Y)((0, import_lib3.$C)(PropertyAccess, PropertyGlob)), (0, import_lib3.$N)(NumericLiteral)), function($skip, $loc, $0, $1, $2, $3) {
|
|
8409
8513
|
return {
|
|
8410
8514
|
type: "Placeholder",
|
|
8411
8515
|
subtype: "&",
|
|
@@ -9474,9 +9578,10 @@ ${js}`
|
|
|
9474
9578
|
var typeSuffix = $5;
|
|
9475
9579
|
var initializer = $6;
|
|
9476
9580
|
var delim = $7;
|
|
9581
|
+
typeSuffix ??= binding.typeSuffix;
|
|
9477
9582
|
return {
|
|
9478
9583
|
type: "Parameter",
|
|
9479
|
-
children: $
|
|
9584
|
+
children: [$1, accessModifier, $3, binding, typeSuffix, initializer, delim],
|
|
9480
9585
|
names: binding.names,
|
|
9481
9586
|
typeSuffix,
|
|
9482
9587
|
accessModifier,
|
|
@@ -9592,12 +9697,13 @@ ${js}`
|
|
|
9592
9697
|
var c = $3;
|
|
9593
9698
|
var ws2 = $4;
|
|
9594
9699
|
var close = $5;
|
|
9595
|
-
|
|
9700
|
+
const properties = c.children;
|
|
9701
|
+
return gatherBindingPatternTypeSuffix({
|
|
9596
9702
|
type: "ObjectBindingPattern",
|
|
9597
|
-
children: [ws1, open,
|
|
9703
|
+
children: [ws1, open, properties, ws2, close],
|
|
9598
9704
|
names: c.names,
|
|
9599
|
-
properties
|
|
9600
|
-
};
|
|
9705
|
+
properties
|
|
9706
|
+
});
|
|
9601
9707
|
});
|
|
9602
9708
|
function ObjectBindingPattern(ctx, state2) {
|
|
9603
9709
|
return (0, import_lib3.$EVENT)(ctx, state2, "ObjectBindingPattern", ObjectBindingPattern$0);
|
|
@@ -9632,13 +9738,13 @@ ${js}`
|
|
|
9632
9738
|
var c = $3;
|
|
9633
9739
|
var ws2 = $4;
|
|
9634
9740
|
var close = $5;
|
|
9635
|
-
return {
|
|
9741
|
+
return gatherBindingPatternTypeSuffix({
|
|
9636
9742
|
...c,
|
|
9637
9743
|
// names, blockPrefix, length
|
|
9638
9744
|
type: "ArrayBindingPattern",
|
|
9639
9745
|
elements: c.children,
|
|
9640
9746
|
children: [ws1, open, c.children, ws2, close]
|
|
9641
|
-
};
|
|
9747
|
+
});
|
|
9642
9748
|
});
|
|
9643
9749
|
function ArrayBindingPattern(ctx, state2) {
|
|
9644
9750
|
return (0, import_lib3.$EVENT)(ctx, state2, "ArrayBindingPattern", ArrayBindingPattern$0);
|
|
@@ -9659,6 +9765,7 @@ ${js}`
|
|
|
9659
9765
|
return elements.map(([element, delim]) => {
|
|
9660
9766
|
return {
|
|
9661
9767
|
...element,
|
|
9768
|
+
delim,
|
|
9662
9769
|
// BindingElement.children is a tuple of the form [ws, element]
|
|
9663
9770
|
children: [...element.children, delim]
|
|
9664
9771
|
};
|
|
@@ -9709,38 +9816,57 @@ ${js}`
|
|
|
9709
9816
|
return (0, import_lib3.$EVENT)(ctx, state2, "NestedBindingPropertyList", NestedBindingPropertyList$0);
|
|
9710
9817
|
}
|
|
9711
9818
|
var BindingProperty$0 = BindingRestProperty;
|
|
9712
|
-
var BindingProperty$1 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_), PropertyName, (0, import_lib3.$E)(_), Colon, (0, import_lib3.$E)(_), (0, import_lib3.$C)(BindingIdentifier, BindingPattern), (0, import_lib3.$E)(Initializer)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
|
|
9819
|
+
var BindingProperty$1 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_), PropertyName, (0, import_lib3.$E)(_), Colon, (0, import_lib3.$E)(_), (0, import_lib3.$C)(BindingIdentifier, BindingPattern), (0, import_lib3.$E)(BindingTypeSuffix), (0, import_lib3.$E)(Initializer)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8) {
|
|
9713
9820
|
var name = $2;
|
|
9714
9821
|
var value = $6;
|
|
9715
|
-
var
|
|
9822
|
+
var typeSuffix = $7;
|
|
9823
|
+
var initializer = $8;
|
|
9716
9824
|
return {
|
|
9717
9825
|
type: "BindingProperty",
|
|
9718
|
-
children: $
|
|
9826
|
+
children: [$1, name, $3, $4, $5, value, initializer],
|
|
9827
|
+
// omit typeSuffix
|
|
9719
9828
|
name,
|
|
9720
9829
|
value,
|
|
9830
|
+
typeSuffix,
|
|
9721
9831
|
initializer,
|
|
9722
9832
|
names: value.names
|
|
9723
9833
|
};
|
|
9724
9834
|
});
|
|
9725
|
-
var BindingProperty$2 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_), (0, import_lib3.$E)(Caret), BindingIdentifier, (0, import_lib3.$E)(Initializer)), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
9835
|
+
var BindingProperty$2 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_), (0, import_lib3.$E)(Caret), BindingIdentifier, (0, import_lib3.$E)(BindingTypeSuffix), (0, import_lib3.$E)(Initializer)), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
9726
9836
|
var ws = $1;
|
|
9727
9837
|
var pin = $2;
|
|
9728
9838
|
var binding = $3;
|
|
9729
|
-
var
|
|
9839
|
+
var typeSuffix = $4;
|
|
9840
|
+
var initializer = $5;
|
|
9841
|
+
let children = [ws, binding, initializer];
|
|
9730
9842
|
if (binding.type === "AtBinding") {
|
|
9731
9843
|
return {
|
|
9732
9844
|
type: "AtBindingProperty",
|
|
9733
|
-
children
|
|
9845
|
+
children,
|
|
9734
9846
|
binding,
|
|
9847
|
+
typeSuffix,
|
|
9735
9848
|
ref: binding.ref,
|
|
9736
9849
|
initializer,
|
|
9737
9850
|
names: []
|
|
9738
9851
|
};
|
|
9739
9852
|
}
|
|
9740
9853
|
if (pin) {
|
|
9854
|
+
children = [ws, binding];
|
|
9855
|
+
if (typeSuffix) {
|
|
9856
|
+
children.push({
|
|
9857
|
+
type: "Error",
|
|
9858
|
+
message: "Pinned properties cannot have type annotations"
|
|
9859
|
+
});
|
|
9860
|
+
}
|
|
9861
|
+
if (initializer) {
|
|
9862
|
+
children.push({
|
|
9863
|
+
type: "Error",
|
|
9864
|
+
message: "Pinned properties cannot have initializers"
|
|
9865
|
+
});
|
|
9866
|
+
}
|
|
9741
9867
|
return {
|
|
9742
9868
|
type: "PinProperty",
|
|
9743
|
-
children
|
|
9869
|
+
children,
|
|
9744
9870
|
name: binding,
|
|
9745
9871
|
value: {
|
|
9746
9872
|
type: "PinPattern",
|
|
@@ -9750,9 +9876,10 @@ ${js}`
|
|
|
9750
9876
|
}
|
|
9751
9877
|
return {
|
|
9752
9878
|
type: "BindingProperty",
|
|
9753
|
-
children
|
|
9879
|
+
children,
|
|
9754
9880
|
name: binding,
|
|
9755
9881
|
value: void 0,
|
|
9882
|
+
typeSuffix,
|
|
9756
9883
|
initializer,
|
|
9757
9884
|
names: binding.names,
|
|
9758
9885
|
identifier: binding
|
|
@@ -9762,13 +9889,15 @@ ${js}`
|
|
|
9762
9889
|
function BindingProperty(ctx, state2) {
|
|
9763
9890
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "BindingProperty", BindingProperty$$);
|
|
9764
9891
|
}
|
|
9765
|
-
var BindingRestProperty$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_), DotDotDot, BindingIdentifier), function($skip, $loc, $0, $1, $2, $3) {
|
|
9892
|
+
var BindingRestProperty$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_), DotDotDot, BindingIdentifier, (0, import_lib3.$E)(BindingTypeSuffix)), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
9766
9893
|
var ws = $1;
|
|
9767
9894
|
var dots = $2;
|
|
9768
9895
|
var id = $3;
|
|
9896
|
+
var typeSuffix = $4;
|
|
9769
9897
|
return {
|
|
9770
9898
|
...id,
|
|
9771
9899
|
type: "BindingRestProperty",
|
|
9900
|
+
typeSuffix,
|
|
9772
9901
|
children: [...ws || [], dots, ...id.children]
|
|
9773
9902
|
};
|
|
9774
9903
|
});
|
|
@@ -9779,6 +9908,7 @@ ${js}`
|
|
|
9779
9908
|
return {
|
|
9780
9909
|
...id,
|
|
9781
9910
|
type: "BindingRestProperty",
|
|
9911
|
+
typeSuffix: void 0,
|
|
9782
9912
|
children: [...ws || [], dots, ...id.children]
|
|
9783
9913
|
};
|
|
9784
9914
|
});
|
|
@@ -9786,6 +9916,21 @@ ${js}`
|
|
|
9786
9916
|
function BindingRestProperty(ctx, state2) {
|
|
9787
9917
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "BindingRestProperty", BindingRestProperty$$);
|
|
9788
9918
|
}
|
|
9919
|
+
var BindingTypeSuffix$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_), (0, import_lib3.$E)(QuestionMark), (0, import_lib3.$E)(_), DoubleColonAsColon, MaybeNestedType), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
9920
|
+
var optional = $2;
|
|
9921
|
+
var colon = $4;
|
|
9922
|
+
var t = $5;
|
|
9923
|
+
return {
|
|
9924
|
+
type: "TypeSuffix",
|
|
9925
|
+
ts: true,
|
|
9926
|
+
optional,
|
|
9927
|
+
t,
|
|
9928
|
+
children: $0
|
|
9929
|
+
};
|
|
9930
|
+
});
|
|
9931
|
+
function BindingTypeSuffix(ctx, state2) {
|
|
9932
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "BindingTypeSuffix", BindingTypeSuffix$0);
|
|
9933
|
+
}
|
|
9789
9934
|
var NestedBindingElements$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(PushIndent, (0, import_lib3.$Q)(NestedBindingElementList), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
|
|
9790
9935
|
var elements = $2;
|
|
9791
9936
|
if (!elements.length)
|
|
@@ -9796,10 +9941,11 @@ ${js}`
|
|
|
9796
9941
|
return (0, import_lib3.$EVENT)(ctx, state2, "NestedBindingElements", NestedBindingElements$0);
|
|
9797
9942
|
}
|
|
9798
9943
|
var BindingElement$0 = BindingRestElement;
|
|
9799
|
-
var BindingElement$1 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_), (0, import_lib3.$C)(BindingIdentifier, BindingPattern), (0, import_lib3.$E)(Initializer)), function($skip, $loc, $0, $1, $2, $3) {
|
|
9944
|
+
var BindingElement$1 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_), (0, import_lib3.$C)(BindingIdentifier, BindingPattern), (0, import_lib3.$E)(BindingTypeSuffix), (0, import_lib3.$E)(Initializer)), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
9800
9945
|
var ws = $1;
|
|
9801
9946
|
var binding = $2;
|
|
9802
|
-
var
|
|
9947
|
+
var typeSuffix = $3;
|
|
9948
|
+
var initializer = $4;
|
|
9803
9949
|
if (binding.children) {
|
|
9804
9950
|
binding = {
|
|
9805
9951
|
...binding,
|
|
@@ -9808,16 +9954,17 @@ ${js}`
|
|
|
9808
9954
|
};
|
|
9809
9955
|
}
|
|
9810
9956
|
return {
|
|
9957
|
+
type: "BindingElement",
|
|
9811
9958
|
names: binding.names,
|
|
9959
|
+
typeSuffix,
|
|
9960
|
+
binding,
|
|
9812
9961
|
children: [ws, binding]
|
|
9813
9962
|
};
|
|
9814
9963
|
});
|
|
9815
9964
|
var BindingElement$2 = (0, import_lib3.$TV)((0, import_lib3.$Y)((0, import_lib3.$S)((0, import_lib3.$E)(_), (0, import_lib3.$EXPECT)($L17, 'BindingElement ","'))), function($skip, $loc, $0, $1) {
|
|
9816
9965
|
return {
|
|
9817
|
-
|
|
9818
|
-
|
|
9819
|
-
children: [""]
|
|
9820
|
-
}],
|
|
9966
|
+
type: "ElisionElement",
|
|
9967
|
+
children: [""],
|
|
9821
9968
|
names: []
|
|
9822
9969
|
};
|
|
9823
9970
|
});
|
|
@@ -9825,14 +9972,17 @@ ${js}`
|
|
|
9825
9972
|
function BindingElement(ctx, state2) {
|
|
9826
9973
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "BindingElement", BindingElement$$);
|
|
9827
9974
|
}
|
|
9828
|
-
var BindingRestElement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_), DotDotDot, (0, import_lib3.$C)(BindingIdentifier, BindingPattern, EmptyBindingPattern)), function($skip, $loc, $0, $1, $2, $3) {
|
|
9975
|
+
var BindingRestElement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_), DotDotDot, (0, import_lib3.$C)(BindingIdentifier, BindingPattern, EmptyBindingPattern), (0, import_lib3.$E)(BindingTypeSuffix)), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
9829
9976
|
var ws = $1;
|
|
9830
9977
|
var dots = $2;
|
|
9831
9978
|
var binding = $3;
|
|
9979
|
+
var typeSuffix = $4;
|
|
9832
9980
|
return {
|
|
9833
9981
|
type: "BindingRestElement",
|
|
9834
9982
|
children: [ws, [dots, binding]],
|
|
9983
|
+
dots,
|
|
9835
9984
|
binding,
|
|
9985
|
+
typeSuffix,
|
|
9836
9986
|
name: binding.name,
|
|
9837
9987
|
names: binding.names,
|
|
9838
9988
|
rest: true
|
|
@@ -9845,6 +9995,7 @@ ${js}`
|
|
|
9845
9995
|
return {
|
|
9846
9996
|
type: "BindingRestElement",
|
|
9847
9997
|
children: [...ws || [], dots, binding],
|
|
9998
|
+
dots,
|
|
9848
9999
|
binding,
|
|
9849
10000
|
name: binding.name,
|
|
9850
10001
|
names: binding.names,
|
|
@@ -13939,9 +14090,10 @@ ${js}`
|
|
|
13939
14090
|
var suffix = $2;
|
|
13940
14091
|
var initializer = $3;
|
|
13941
14092
|
const [splices, thisAssignments] = gatherBindingCode(pattern);
|
|
14093
|
+
suffix ??= pattern.typeSuffix;
|
|
13942
14094
|
return {
|
|
13943
14095
|
type: "Binding",
|
|
13944
|
-
children:
|
|
14096
|
+
children: [pattern, suffix, initializer],
|
|
13945
14097
|
names: pattern.names,
|
|
13946
14098
|
pattern,
|
|
13947
14099
|
suffix,
|
|
@@ -14661,6 +14813,12 @@ ${js}`
|
|
|
14661
14813
|
function DoubleColon(ctx, state2) {
|
|
14662
14814
|
return (0, import_lib3.$EVENT)(ctx, state2, "DoubleColon", DoubleColon$0);
|
|
14663
14815
|
}
|
|
14816
|
+
var DoubleColonAsColon$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L155, 'DoubleColonAsColon "::"'), function($skip, $loc, $0, $1) {
|
|
14817
|
+
return { $loc, token: ":" };
|
|
14818
|
+
});
|
|
14819
|
+
function DoubleColonAsColon(ctx, state2) {
|
|
14820
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "DoubleColonAsColon", DoubleColonAsColon$0);
|
|
14821
|
+
}
|
|
14664
14822
|
var DoubleQuote$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L156, 'DoubleQuote "\\\\\\""'), function($skip, $loc, $0, $1) {
|
|
14665
14823
|
return { $loc, token: $1 };
|
|
14666
14824
|
});
|
|
@@ -15461,9 +15619,22 @@ ${js}`
|
|
|
15461
15619
|
function JSXAttributeName(ctx, state2) {
|
|
15462
15620
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "JSXAttributeName", JSXAttributeName$$);
|
|
15463
15621
|
}
|
|
15464
|
-
var JSXAttributeInitializer$0 = (0, import_lib3.$S)((0, import_lib3.$E)(Whitespace), Equals, (0, import_lib3.$E)(
|
|
15622
|
+
var JSXAttributeInitializer$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$N)(CoffeeJSXEnabled), (0, import_lib3.$E)(Whitespace), Equals, (0, import_lib3.$Y)((0, import_lib3.$S)((0, import_lib3.$Q)(NonNewlineWhitespace), EOL)), InsertInlineOpenBrace, PushIndent, (0, import_lib3.$E)(PostfixedExpression), PopIndent, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
|
|
15623
|
+
var ws1 = $2;
|
|
15624
|
+
var equals = $3;
|
|
15625
|
+
var ws2 = $4;
|
|
15626
|
+
var open = $5;
|
|
15627
|
+
var indent = $6;
|
|
15628
|
+
var expression = $7;
|
|
15629
|
+
var close = $9;
|
|
15630
|
+
if (!expression)
|
|
15631
|
+
return $skip;
|
|
15632
|
+
return [ws1, equals, ws2, open, indent, expression, close];
|
|
15633
|
+
});
|
|
15634
|
+
var JSXAttributeInitializer$1 = (0, import_lib3.$S)((0, import_lib3.$E)(Whitespace), Equals, (0, import_lib3.$E)(Whitespace), JSXAttributeValue);
|
|
15635
|
+
var JSXAttributeInitializer$$ = [JSXAttributeInitializer$0, JSXAttributeInitializer$1];
|
|
15465
15636
|
function JSXAttributeInitializer(ctx, state2) {
|
|
15466
|
-
return (0, import_lib3.$
|
|
15637
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "JSXAttributeInitializer", JSXAttributeInitializer$$);
|
|
15467
15638
|
}
|
|
15468
15639
|
var JSXAttributeValue$0 = (0, import_lib3.$S)(OpenBrace, PostfixedExpression, (0, import_lib3.$E)(Whitespace), CloseBrace);
|
|
15469
15640
|
var JSXAttributeValue$1 = JSXElement;
|
|
@@ -15712,8 +15883,9 @@ ${js}`
|
|
|
15712
15883
|
expression
|
|
15713
15884
|
};
|
|
15714
15885
|
});
|
|
15715
|
-
var JSXChild$6 =
|
|
15716
|
-
var JSXChild
|
|
15886
|
+
var JSXChild$6 = JSXAngleChild;
|
|
15887
|
+
var JSXChild$7 = JSXText;
|
|
15888
|
+
var JSXChild$$ = [JSXChild$0, JSXChild$1, JSXChild$2, JSXChild$3, JSXChild$4, JSXChild$5, JSXChild$6, JSXChild$7];
|
|
15717
15889
|
function JSXChild(ctx, state2) {
|
|
15718
15890
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "JSXChild", JSXChild$$);
|
|
15719
15891
|
}
|
|
@@ -15755,6 +15927,42 @@ ${js}`
|
|
|
15755
15927
|
function NestedJSXChildExpression(ctx, state2) {
|
|
15756
15928
|
return (0, import_lib3.$EVENT)(ctx, state2, "NestedJSXChildExpression", NestedJSXChildExpression$0);
|
|
15757
15929
|
}
|
|
15930
|
+
var JSXAngleChild$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(CloseAngleBracket, InsertInlineOpenBrace, JSXAngleChildExpression, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
15931
|
+
var open = $2;
|
|
15932
|
+
var expression = $3;
|
|
15933
|
+
var close = $4;
|
|
15934
|
+
if (!expression)
|
|
15935
|
+
return $skip;
|
|
15936
|
+
return [open, expression, close];
|
|
15937
|
+
});
|
|
15938
|
+
function JSXAngleChild(ctx, state2) {
|
|
15939
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "JSXAngleChild", JSXAngleChild$0);
|
|
15940
|
+
}
|
|
15941
|
+
var JSXAngleChildExpression$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$N)(JSXEOS), ForbidNewlineBinaryOp, (0, import_lib3.$E)(JSXChildExpression), RestoreNewlineBinaryOp), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
15942
|
+
var expression = $3;
|
|
15943
|
+
if (!expression)
|
|
15944
|
+
return $skip;
|
|
15945
|
+
return expression;
|
|
15946
|
+
});
|
|
15947
|
+
var JSXAngleChildExpression$1 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$Y)(JSXEOS), ImplicitNestedBlock), function($skip, $loc, $0, $1, $2) {
|
|
15948
|
+
var block = $2;
|
|
15949
|
+
if (!block)
|
|
15950
|
+
return $skip;
|
|
15951
|
+
const statement = {
|
|
15952
|
+
type: "DoStatement",
|
|
15953
|
+
children: [block],
|
|
15954
|
+
block
|
|
15955
|
+
};
|
|
15956
|
+
return {
|
|
15957
|
+
type: "StatementExpression",
|
|
15958
|
+
statement,
|
|
15959
|
+
children: [statement]
|
|
15960
|
+
};
|
|
15961
|
+
});
|
|
15962
|
+
var JSXAngleChildExpression$$ = [JSXAngleChildExpression$0, JSXAngleChildExpression$1];
|
|
15963
|
+
function JSXAngleChildExpression(ctx, state2) {
|
|
15964
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "JSXAngleChildExpression", JSXAngleChildExpression$$);
|
|
15965
|
+
}
|
|
15758
15966
|
var UsingDeclaration$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Using, (0, import_lib3.$E)(_), UsingBinding, (0, import_lib3.$Q)((0, import_lib3.$S)(__, Comma, __, UsingBinding)), UsingJSModeError), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
15759
15967
|
var decl = $1;
|
|
15760
15968
|
var binding = $3;
|