@danielx/civet 0.8.6 → 0.8.8
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 +11 -0
- package/dist/browser.js +150 -45
- package/dist/main.js +150 -45
- package/dist/main.mjs +150 -45
- package/dist/types.d.ts +1 -0
- package/dist/unplugin/unplugin.js +47 -22
- package/dist/unplugin/unplugin.mjs +47 -22
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,17 @@ 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.8 (2024-10-24, [diff](https://github.com/DanielXMoore/Civet/compare/v0.8.7...v0.8.8), [commits](https://github.com/DanielXMoore/Civet/commits/v0.8.8))
|
|
8
|
+
* `:symbol` shorthand for `Symbol.symbol` or `Symbol.for("symbol")` [[#1498](https://github.com/DanielXMoore/Civet/pull/1498)]
|
|
9
|
+
* preventExtensions on comptime functions [[#1494](https://github.com/DanielXMoore/Civet/pull/1494)]
|
|
10
|
+
* Fix unplugin's webpack mode: `resolve.alias`, virtual modules [[#1501](https://github.com/DanielXMoore/Civet/pull/1501)]
|
|
11
|
+
* `for` loops can filter via `when` conditions (not just in CoffeeScript mode) [[#1502](https://github.com/DanielXMoore/Civet/pull/1502)]
|
|
12
|
+
|
|
13
|
+
## 0.8.7 (2024-10-22, [diff](https://github.com/DanielXMoore/Civet/compare/v0.8.6...v0.8.7), [commits](https://github.com/DanielXMoore/Civet/commits/v0.8.7))
|
|
14
|
+
* Fix one-line arrow functions with `@` arguments [[#1490](https://github.com/DanielXMoore/Civet/pull/1490)]
|
|
15
|
+
* Fix `Promise<void>` detection with implicit type arguments [[#1491](https://github.com/DanielXMoore/Civet/pull/1491)]
|
|
16
|
+
* Fix await with array member expression [[#1492](https://github.com/DanielXMoore/Civet/pull/1492)]
|
|
17
|
+
|
|
7
18
|
## 0.8.6 (2024-10-21, [diff](https://github.com/DanielXMoore/Civet/compare/v0.8.5...v0.8.6), [commits](https://github.com/DanielXMoore/Civet/commits/v0.8.6))
|
|
8
19
|
* Fix CLI with complex `NODE_OPTIONS`, LSP cleanup [[#1482](https://github.com/DanielXMoore/Civet/pull/1482)]
|
|
9
20
|
* `if` conditions continued by binary op on next line [[#1483](https://github.com/DanielXMoore/Civet/pull/1483)]
|
package/dist/browser.js
CHANGED
|
@@ -547,6 +547,7 @@ ${body}`;
|
|
|
547
547
|
hasImportDeclaration: () => hasImportDeclaration,
|
|
548
548
|
hasYield: () => hasYield,
|
|
549
549
|
insertTrimmingSpace: () => insertTrimmingSpace,
|
|
550
|
+
isComma: () => isComma,
|
|
550
551
|
isEmptyBareBlock: () => isEmptyBareBlock,
|
|
551
552
|
isFunction: () => isFunction,
|
|
552
553
|
isWhitespaceOrEmpty: () => isWhitespaceOrEmpty,
|
|
@@ -2164,6 +2165,9 @@ ${js}`
|
|
|
2164
2165
|
throw new TypeError("cannot serialize native function");
|
|
2165
2166
|
}
|
|
2166
2167
|
if (/^class[\s{]/u.test(string)) {
|
|
2168
|
+
if (!Object.isExtensible(val)) {
|
|
2169
|
+
string = `Object.preventExtensions(${string})`;
|
|
2170
|
+
}
|
|
2167
2171
|
return string;
|
|
2168
2172
|
}
|
|
2169
2173
|
if (stack.has(val)) {
|
|
@@ -2191,6 +2195,9 @@ ${js}`
|
|
|
2191
2195
|
}
|
|
2192
2196
|
string = `Object.defineProperties(${string},${recurse(props)})`;
|
|
2193
2197
|
}
|
|
2198
|
+
if (!Object.isExtensible(val)) {
|
|
2199
|
+
string = `Object.preventExtensions(${string})`;
|
|
2200
|
+
}
|
|
2194
2201
|
stack.delete(val);
|
|
2195
2202
|
return string;
|
|
2196
2203
|
} else if (typeof val === "symbol") {
|
|
@@ -2344,11 +2351,21 @@ ${js}`
|
|
|
2344
2351
|
}
|
|
2345
2352
|
|
|
2346
2353
|
// source/parser/function.civet
|
|
2354
|
+
function getTypeArguments(args) {
|
|
2355
|
+
while (typeof args === "object" && args != null && "args" in args) {
|
|
2356
|
+
args = args.args;
|
|
2357
|
+
}
|
|
2358
|
+
if (!Array.isArray(args)) {
|
|
2359
|
+
throw new Error("getTypeArguments could not find relevant array");
|
|
2360
|
+
}
|
|
2361
|
+
return args.filter((a) => typeof a === "object" && a != null && "type" in a && a.type === "TypeArgument");
|
|
2362
|
+
}
|
|
2347
2363
|
function isVoidType(t) {
|
|
2348
|
-
return t
|
|
2364
|
+
return typeof t === "object" && t != null && "type" in t && t.type === "TypeLiteral" && "t" in t && typeof t.t === "object" && t.t != null && "type" in t.t && t.t.type === "VoidType";
|
|
2349
2365
|
}
|
|
2350
2366
|
function isPromiseVoidType(t) {
|
|
2351
|
-
|
|
2367
|
+
let args;
|
|
2368
|
+
return typeof t === "object" && t != null && "type" in t && t.type === "TypeIdentifier" && "raw" in t && t.raw === "Promise" && (args = getTypeArguments(t.args?.args)).length === 1 && isVoidType(args[0].t);
|
|
2352
2369
|
}
|
|
2353
2370
|
function implicitFunctionBlock(f) {
|
|
2354
2371
|
if (f.abstract || f.block || f.signature?.optional)
|
|
@@ -2934,7 +2951,7 @@ ${js}`
|
|
|
2934
2951
|
if (isConstructor) {
|
|
2935
2952
|
const { ancestor } = findAncestor(f, ($5) => $5.type === "ClassExpression");
|
|
2936
2953
|
if (ancestor != null) {
|
|
2937
|
-
const fields = new Set(gatherRecursiveWithinFunction(ancestor, ($6) => $6.type === "FieldDefinition").map(($7) => $7.id).filter((
|
|
2954
|
+
const fields = new Set(gatherRecursiveWithinFunction(ancestor, ($6) => $6.type === "FieldDefinition").map(($7) => $7.id).filter((a1) => typeof a1 === "object" && a1 != null && "type" in a1 && a1.type === "Identifier").map(($8) => $8.name));
|
|
2938
2955
|
const classExpressions = ancestor.body.expressions;
|
|
2939
2956
|
let index = findChildIndex(classExpressions, f);
|
|
2940
2957
|
assert.notEqual(index, -1, "Could not find constructor in class");
|
|
@@ -2986,10 +3003,10 @@ ${js}`
|
|
|
2986
3003
|
if (isConstructor) {
|
|
2987
3004
|
const superCalls = gatherNodes(
|
|
2988
3005
|
expressions,
|
|
2989
|
-
(
|
|
3006
|
+
(a2) => typeof a2 === "object" && a2 != null && "type" in a2 && a2.type === "CallExpression" && "children" in a2 && Array.isArray(a2.children) && a2.children.length >= 1 && typeof a2.children[0] === "object" && a2.children[0] != null && "token" in a2.children[0] && a2.children[0].token === "super"
|
|
2990
3007
|
);
|
|
2991
3008
|
if (superCalls.length) {
|
|
2992
|
-
const { child } = findAncestor(superCalls[0], (
|
|
3009
|
+
const { child } = findAncestor(superCalls[0], (a3) => a3 === block);
|
|
2993
3010
|
const index = findChildIndex(expressions, child);
|
|
2994
3011
|
if (index < 0) {
|
|
2995
3012
|
throw new Error("Could not find super call within top-level expressions");
|
|
@@ -2999,6 +3016,7 @@ ${js}`
|
|
|
2999
3016
|
}
|
|
3000
3017
|
}
|
|
3001
3018
|
expressions.unshift(...prefix);
|
|
3019
|
+
braceBlock(block);
|
|
3002
3020
|
}
|
|
3003
3021
|
function processSignature(f) {
|
|
3004
3022
|
const { block, signature } = f;
|
|
@@ -3121,11 +3139,11 @@ ${js}`
|
|
|
3121
3139
|
parameter = {
|
|
3122
3140
|
...parameter,
|
|
3123
3141
|
initializer: void 0,
|
|
3124
|
-
children: parameter.children.filter((
|
|
3142
|
+
children: parameter.children.filter((a4) => a4 !== initializer)
|
|
3125
3143
|
};
|
|
3126
3144
|
} else {
|
|
3127
3145
|
args.push(parameter.children.filter(
|
|
3128
|
-
(
|
|
3146
|
+
(a5) => a5 !== parameter.typeSuffix
|
|
3129
3147
|
));
|
|
3130
3148
|
}
|
|
3131
3149
|
}
|
|
@@ -3198,7 +3216,7 @@ ${js}`
|
|
|
3198
3216
|
}
|
|
3199
3217
|
if (gatherRecursiveWithinFunction(
|
|
3200
3218
|
block,
|
|
3201
|
-
(
|
|
3219
|
+
(a6) => a6 === ref
|
|
3202
3220
|
).length > 1) {
|
|
3203
3221
|
fn.ampersandBlock = false;
|
|
3204
3222
|
}
|
|
@@ -7573,6 +7591,8 @@ ${js}`
|
|
|
7573
7591
|
BooleanLiteral,
|
|
7574
7592
|
_BooleanLiteral,
|
|
7575
7593
|
CoffeeScriptBooleanLiteral,
|
|
7594
|
+
SymbolLiteral,
|
|
7595
|
+
SymbolElement,
|
|
7576
7596
|
Identifier,
|
|
7577
7597
|
IdentifierName,
|
|
7578
7598
|
IdentifierReference,
|
|
@@ -7673,6 +7693,7 @@ ${js}`
|
|
|
7673
7693
|
WhileClause,
|
|
7674
7694
|
ForStatement,
|
|
7675
7695
|
ForClause,
|
|
7696
|
+
ForStatementControlWithWhen,
|
|
7676
7697
|
ForStatementControl,
|
|
7677
7698
|
WhenCondition,
|
|
7678
7699
|
CoffeeForStatementParameters,
|
|
@@ -8095,6 +8116,7 @@ ${js}`
|
|
|
8095
8116
|
NestedTypeArgumentList,
|
|
8096
8117
|
NestedTypeArgument,
|
|
8097
8118
|
SingleLineTypeArgumentList,
|
|
8119
|
+
WTypeArgument,
|
|
8098
8120
|
TypeArgumentDelimited,
|
|
8099
8121
|
TypeArgument,
|
|
8100
8122
|
TypeArgumentDelimiter,
|
|
@@ -8956,10 +8978,10 @@ ${js}`
|
|
|
8956
8978
|
function RHS(ctx, state2) {
|
|
8957
8979
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "RHS", RHS$$);
|
|
8958
8980
|
}
|
|
8959
|
-
var UnaryExpression$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(IndentedApplicationAllowed, (0, import_lib4.$P)(UnaryOp), (0, import_lib4.$C)(ArrayLiteral, NestedArgumentList), (0, import_lib4.$E)(UnaryPostfix)), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
8981
|
+
var UnaryExpression$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(IndentedApplicationAllowed, (0, import_lib4.$P)(UnaryOp), (0, import_lib4.$C)(ArrayLiteral, NestedArgumentList), (0, import_lib4.$N)(CallExpressionRest), (0, import_lib4.$E)(UnaryPostfix)), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
8960
8982
|
var pre = $2;
|
|
8961
8983
|
var args = $3;
|
|
8962
|
-
var post = $
|
|
8984
|
+
var post = $5;
|
|
8963
8985
|
return processUnaryNestedExpression(pre, args, post) ?? $skip;
|
|
8964
8986
|
});
|
|
8965
8987
|
var UnaryExpression$1 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$Q)(UnaryOp), UnaryBody, (0, import_lib4.$E)(UnaryPostfix)), function($skip, $loc, $0, $1, $2, $3) {
|
|
@@ -9406,8 +9428,9 @@ ${js}`
|
|
|
9406
9428
|
var PrimaryExpression$8 = RegularExpressionLiteral;
|
|
9407
9429
|
var PrimaryExpression$9 = ParenthesizedExpression;
|
|
9408
9430
|
var PrimaryExpression$10 = Placeholder;
|
|
9409
|
-
var PrimaryExpression$11 =
|
|
9410
|
-
var PrimaryExpression
|
|
9431
|
+
var PrimaryExpression$11 = SymbolLiteral;
|
|
9432
|
+
var PrimaryExpression$12 = JSXImplicitFragment;
|
|
9433
|
+
var PrimaryExpression$$ = [PrimaryExpression$0, PrimaryExpression$1, PrimaryExpression$2, PrimaryExpression$3, PrimaryExpression$4, PrimaryExpression$5, PrimaryExpression$6, PrimaryExpression$7, PrimaryExpression$8, PrimaryExpression$9, PrimaryExpression$10, PrimaryExpression$11, PrimaryExpression$12];
|
|
9411
9434
|
function PrimaryExpression(ctx, state2) {
|
|
9412
9435
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "PrimaryExpression", PrimaryExpression$$);
|
|
9413
9436
|
}
|
|
@@ -10236,7 +10259,7 @@ ${js}`
|
|
|
10236
10259
|
function PropertyAccessModifier(ctx, state2) {
|
|
10237
10260
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "PropertyAccessModifier", PropertyAccessModifier$$);
|
|
10238
10261
|
}
|
|
10239
|
-
var PropertyAccess$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(AccessStart, (0, import_lib4.$C)(TemplateLiteral, StringLiteral, IntegerLiteral)), function($skip, $loc, $0, $1, $2) {
|
|
10262
|
+
var PropertyAccess$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(AccessStart, (0, import_lib4.$C)(TemplateLiteral, StringLiteral, IntegerLiteral, SymbolLiteral)), function($skip, $loc, $0, $1, $2) {
|
|
10240
10263
|
var dot = $1;
|
|
10241
10264
|
var literal = $2;
|
|
10242
10265
|
return {
|
|
@@ -11780,6 +11803,40 @@ ${js}`
|
|
|
11780
11803
|
function CoffeeScriptBooleanLiteral(ctx, state2) {
|
|
11781
11804
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "CoffeeScriptBooleanLiteral", CoffeeScriptBooleanLiteral$$);
|
|
11782
11805
|
}
|
|
11806
|
+
var SymbolLiteral$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(Colon, IdentifierName), function($skip, $loc, $0, $1, $2) {
|
|
11807
|
+
var colon = $1;
|
|
11808
|
+
var id = $2;
|
|
11809
|
+
const { name, children: [token] } = id;
|
|
11810
|
+
if (config.symbols.includes(name)) {
|
|
11811
|
+
return {
|
|
11812
|
+
type: "SymbolLiteral",
|
|
11813
|
+
children: [
|
|
11814
|
+
{ ...colon, token: "Symbol." },
|
|
11815
|
+
token
|
|
11816
|
+
],
|
|
11817
|
+
name
|
|
11818
|
+
};
|
|
11819
|
+
} else {
|
|
11820
|
+
return {
|
|
11821
|
+
type: "SymbolLiteral",
|
|
11822
|
+
children: [
|
|
11823
|
+
{ ...colon, token: 'Symbol.for("' },
|
|
11824
|
+
token,
|
|
11825
|
+
'")'
|
|
11826
|
+
],
|
|
11827
|
+
name
|
|
11828
|
+
};
|
|
11829
|
+
}
|
|
11830
|
+
});
|
|
11831
|
+
function SymbolLiteral(ctx, state2) {
|
|
11832
|
+
return (0, import_lib4.$EVENT)(ctx, state2, "SymbolLiteral", SymbolLiteral$0);
|
|
11833
|
+
}
|
|
11834
|
+
var SymbolElement$0 = (0, import_lib4.$T)((0, import_lib4.$S)(SymbolLiteral), function(value) {
|
|
11835
|
+
return ["[", value[0], "]"];
|
|
11836
|
+
});
|
|
11837
|
+
function SymbolElement(ctx, state2) {
|
|
11838
|
+
return (0, import_lib4.$EVENT)(ctx, state2, "SymbolElement", SymbolElement$0);
|
|
11839
|
+
}
|
|
11783
11840
|
var Identifier$0 = (0, import_lib4.$T)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($R17, "Identifier /(?=\\p{ID_Start}|[_$])/"), (0, import_lib4.$N)(ReservedWord), IdentifierName), function(value) {
|
|
11784
11841
|
var id = value[2];
|
|
11785
11842
|
return id;
|
|
@@ -12527,7 +12584,8 @@ ${js}`
|
|
|
12527
12584
|
});
|
|
12528
12585
|
var PropertyName$4 = IdentifierName;
|
|
12529
12586
|
var PropertyName$5 = LengthShorthand;
|
|
12530
|
-
var PropertyName
|
|
12587
|
+
var PropertyName$6 = SymbolElement;
|
|
12588
|
+
var PropertyName$$ = [PropertyName$0, PropertyName$1, PropertyName$2, PropertyName$3, PropertyName$4, PropertyName$5, PropertyName$6];
|
|
12531
12589
|
function PropertyName(ctx, state2) {
|
|
12532
12590
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "PropertyName", PropertyName$$);
|
|
12533
12591
|
}
|
|
@@ -12789,7 +12847,8 @@ ${js}`
|
|
|
12789
12847
|
var ClassElementName$0 = PropertyName;
|
|
12790
12848
|
var ClassElementName$1 = LengthShorthand;
|
|
12791
12849
|
var ClassElementName$2 = PrivateIdentifier;
|
|
12792
|
-
var ClassElementName
|
|
12850
|
+
var ClassElementName$3 = SymbolElement;
|
|
12851
|
+
var ClassElementName$$ = [ClassElementName$0, ClassElementName$1, ClassElementName$2, ClassElementName$3];
|
|
12793
12852
|
function ClassElementName(ctx, state2) {
|
|
12794
12853
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "ClassElementName", ClassElementName$$);
|
|
12795
12854
|
}
|
|
@@ -13746,7 +13805,7 @@ ${js}`
|
|
|
13746
13805
|
function ForStatement(ctx, state2) {
|
|
13747
13806
|
return (0, import_lib4.$EVENT)(ctx, state2, "ForStatement", ForStatement$0);
|
|
13748
13807
|
}
|
|
13749
|
-
var ForClause$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(For, (0, import_lib4.$E)((0, import_lib4.$S)((0, import_lib4.$E)(_), Star)), __,
|
|
13808
|
+
var ForClause$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(For, (0, import_lib4.$E)((0, import_lib4.$S)((0, import_lib4.$E)(_), Star)), __, ForStatementControlWithWhen), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
13750
13809
|
var generator = $2;
|
|
13751
13810
|
var c = $4;
|
|
13752
13811
|
const { children, declaration } = c;
|
|
@@ -13763,26 +13822,41 @@ ${js}`
|
|
|
13763
13822
|
function ForClause(ctx, state2) {
|
|
13764
13823
|
return (0, import_lib4.$EVENT)(ctx, state2, "ForClause", ForClause$0);
|
|
13765
13824
|
}
|
|
13825
|
+
var ForStatementControlWithWhen$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(ForStatementControl, (0, import_lib4.$E)(WhenCondition)), function($skip, $loc, $0, $1, $2) {
|
|
13826
|
+
var control = $1;
|
|
13827
|
+
var condition = $2;
|
|
13828
|
+
if (!condition)
|
|
13829
|
+
return control;
|
|
13830
|
+
const expressions = [["", {
|
|
13831
|
+
type: "ContinueStatement",
|
|
13832
|
+
children: ["continue"]
|
|
13833
|
+
}]];
|
|
13834
|
+
const block = {
|
|
13835
|
+
type: "BlockStatement",
|
|
13836
|
+
expressions,
|
|
13837
|
+
children: [expressions],
|
|
13838
|
+
bare: true
|
|
13839
|
+
};
|
|
13840
|
+
return {
|
|
13841
|
+
...control,
|
|
13842
|
+
blockPrefix: [
|
|
13843
|
+
...control.blockPrefix,
|
|
13844
|
+
["", {
|
|
13845
|
+
type: "IfStatement",
|
|
13846
|
+
then: block,
|
|
13847
|
+
children: ["if (!", makeLeftHandSideExpression(trimFirstSpace(condition)), ") ", block]
|
|
13848
|
+
}, ";"]
|
|
13849
|
+
]
|
|
13850
|
+
};
|
|
13851
|
+
});
|
|
13852
|
+
function ForStatementControlWithWhen(ctx, state2) {
|
|
13853
|
+
return (0, import_lib4.$EVENT)(ctx, state2, "ForStatementControlWithWhen", ForStatementControlWithWhen$0);
|
|
13854
|
+
}
|
|
13766
13855
|
var ForStatementControl$0 = (0, import_lib4.$T)((0, import_lib4.$S)((0, import_lib4.$N)(CoffeeForLoopsEnabled), ForStatementParameters), function(value) {
|
|
13767
13856
|
return value[1];
|
|
13768
13857
|
});
|
|
13769
|
-
var ForStatementControl$1 = (0, import_lib4.$
|
|
13770
|
-
|
|
13771
|
-
if (condition) {
|
|
13772
|
-
const block = "continue";
|
|
13773
|
-
$2 = {
|
|
13774
|
-
...$2,
|
|
13775
|
-
blockPrefix: [
|
|
13776
|
-
...$2.blockPrefix,
|
|
13777
|
-
["", {
|
|
13778
|
-
type: "IfStatement",
|
|
13779
|
-
then: block,
|
|
13780
|
-
children: ["if (!(", trimFirstSpace(condition), ")) ", block]
|
|
13781
|
-
}, ";"]
|
|
13782
|
-
]
|
|
13783
|
-
};
|
|
13784
|
-
}
|
|
13785
|
-
return $2;
|
|
13858
|
+
var ForStatementControl$1 = (0, import_lib4.$T)((0, import_lib4.$S)(CoffeeForLoopsEnabled, CoffeeForStatementParameters), function(value) {
|
|
13859
|
+
return value[1];
|
|
13786
13860
|
});
|
|
13787
13861
|
var ForStatementControl$$ = [ForStatementControl$0, ForStatementControl$1];
|
|
13788
13862
|
function ForStatementControl(ctx, state2) {
|
|
@@ -18362,11 +18436,12 @@ ${js}`
|
|
|
18362
18436
|
}
|
|
18363
18437
|
var TypeArguments$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(OpenAngleBracket, (0, import_lib4.$P)((0, import_lib4.$S)(__, TypeArgumentDelimited)), __, CloseAngleBracket), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
18364
18438
|
var args = $2;
|
|
18365
|
-
args = args.
|
|
18439
|
+
args = args.flatMap(([ws, [arg, delim]]) => [prepend(ws, arg), delim]);
|
|
18440
|
+
args.pop();
|
|
18366
18441
|
return {
|
|
18367
18442
|
type: "TypeArguments",
|
|
18368
18443
|
ts: true,
|
|
18369
|
-
|
|
18444
|
+
args,
|
|
18370
18445
|
children: $0
|
|
18371
18446
|
};
|
|
18372
18447
|
});
|
|
@@ -18378,10 +18453,15 @@ ${js}`
|
|
|
18378
18453
|
var ws = $3;
|
|
18379
18454
|
var args = $4;
|
|
18380
18455
|
var close = $5;
|
|
18381
|
-
|
|
18382
|
-
if (last
|
|
18456
|
+
const last = args[args.length - 1];
|
|
18457
|
+
if (isComma(last))
|
|
18383
18458
|
args = args.slice(0, -1);
|
|
18384
|
-
return
|
|
18459
|
+
return {
|
|
18460
|
+
type: "TypeArguments",
|
|
18461
|
+
ts: true,
|
|
18462
|
+
args,
|
|
18463
|
+
children: [open, ws, args, close]
|
|
18464
|
+
};
|
|
18385
18465
|
});
|
|
18386
18466
|
function ImplicitTypeArguments(ctx, state2) {
|
|
18387
18467
|
return (0, import_lib4.$EVENT)(ctx, state2, "ImplicitTypeArguments", ImplicitTypeArguments$0);
|
|
@@ -18399,10 +18479,10 @@ ${js}`
|
|
|
18399
18479
|
function ForbiddenImplicitTypeCalls(ctx, state2) {
|
|
18400
18480
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "ForbiddenImplicitTypeCalls", ForbiddenImplicitTypeCalls$$);
|
|
18401
18481
|
}
|
|
18402
|
-
var TypeArgumentList$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$N)(EOS), TypeArgument, (0, import_lib4.$Q)((0, import_lib4.$S)(CommaDelimiter, (0, import_lib4.$N)(EOS),
|
|
18482
|
+
var TypeArgumentList$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$N)(EOS), TypeArgument, (0, import_lib4.$Q)((0, import_lib4.$S)(CommaDelimiter, (0, import_lib4.$N)(EOS), WTypeArgument)), (0, import_lib4.$P)((0, import_lib4.$S)(CommaDelimiter, (0, import_lib4.$C)(NestedTypeBulletedTuple, NestedInterfaceBlock, NestedTypeArgumentList)))), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
18403
18483
|
return [
|
|
18404
18484
|
$2,
|
|
18405
|
-
...$3.flatMap(([comma, eos,
|
|
18485
|
+
...$3.flatMap(([comma, eos, arg]) => [comma, arg]),
|
|
18406
18486
|
...$4.flatMap(
|
|
18407
18487
|
([comma, args]) => Array.isArray(args) ? [comma, ...args] : [comma, args]
|
|
18408
18488
|
)
|
|
@@ -18417,10 +18497,10 @@ ${js}`
|
|
|
18417
18497
|
];
|
|
18418
18498
|
});
|
|
18419
18499
|
var TypeArgumentList$2 = NestedTypeArgumentList;
|
|
18420
|
-
var TypeArgumentList$3 = (0, import_lib4.$TS)((0, import_lib4.$S)(TypeArgument, (0, import_lib4.$Q)((0, import_lib4.$S)(CommaDelimiter,
|
|
18500
|
+
var TypeArgumentList$3 = (0, import_lib4.$TS)((0, import_lib4.$S)(TypeArgument, (0, import_lib4.$Q)((0, import_lib4.$S)(CommaDelimiter, WTypeArgument))), function($skip, $loc, $0, $1, $2) {
|
|
18421
18501
|
return [
|
|
18422
18502
|
$1,
|
|
18423
|
-
...$2.flatMap(([comma,
|
|
18503
|
+
...$2.flatMap(([comma, arg]) => [comma, arg])
|
|
18424
18504
|
];
|
|
18425
18505
|
});
|
|
18426
18506
|
var TypeArgumentList$$ = [TypeArgumentList$0, TypeArgumentList$1, TypeArgumentList$2, TypeArgumentList$3];
|
|
@@ -18447,17 +18527,25 @@ ${js}`
|
|
|
18447
18527
|
function NestedTypeArgument(ctx, state2) {
|
|
18448
18528
|
return (0, import_lib4.$EVENT)(ctx, state2, "NestedTypeArgument", NestedTypeArgument$0);
|
|
18449
18529
|
}
|
|
18450
|
-
var SingleLineTypeArgumentList$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(
|
|
18451
|
-
return [$1, ...$2
|
|
18530
|
+
var SingleLineTypeArgumentList$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(WTypeArgument, (0, import_lib4.$Q)((0, import_lib4.$S)((0, import_lib4.$S)((0, import_lib4.$E)(_), Comma), WTypeArgument))), function($skip, $loc, $0, $1, $2) {
|
|
18531
|
+
return [$1, ...$2];
|
|
18452
18532
|
});
|
|
18453
18533
|
function SingleLineTypeArgumentList(ctx, state2) {
|
|
18454
18534
|
return (0, import_lib4.$EVENT)(ctx, state2, "SingleLineTypeArgumentList", SingleLineTypeArgumentList$0);
|
|
18455
18535
|
}
|
|
18536
|
+
var WTypeArgument$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)(_), TypeArgument), function($skip, $loc, $0, $1, $2) {
|
|
18537
|
+
return prepend($1, $2);
|
|
18538
|
+
});
|
|
18539
|
+
function WTypeArgument(ctx, state2) {
|
|
18540
|
+
return (0, import_lib4.$EVENT)(ctx, state2, "WTypeArgument", WTypeArgument$0);
|
|
18541
|
+
}
|
|
18456
18542
|
var TypeArgumentDelimited$0 = (0, import_lib4.$S)(TypeArgument, TypeArgumentDelimiter);
|
|
18457
18543
|
function TypeArgumentDelimited(ctx, state2) {
|
|
18458
18544
|
return (0, import_lib4.$EVENT)(ctx, state2, "TypeArgumentDelimited", TypeArgumentDelimited$0);
|
|
18459
18545
|
}
|
|
18460
|
-
var TypeArgument$0 = Type
|
|
18546
|
+
var TypeArgument$0 = (0, import_lib4.$T)(Type, function(value) {
|
|
18547
|
+
return { "type": "TypeArgument", "ts": true, "t": value, "children": [value] };
|
|
18548
|
+
});
|
|
18461
18549
|
function TypeArgument(ctx, state2) {
|
|
18462
18550
|
return (0, import_lib4.$EVENT)(ctx, state2, "TypeArgument", TypeArgument$0);
|
|
18463
18551
|
}
|
|
@@ -18545,6 +18633,7 @@ ${js}`
|
|
|
18545
18633
|
value = 0;
|
|
18546
18634
|
break;
|
|
18547
18635
|
case "globals":
|
|
18636
|
+
case "symbols":
|
|
18548
18637
|
value = value.split(",").filter(Boolean);
|
|
18549
18638
|
break;
|
|
18550
18639
|
}
|
|
@@ -18920,6 +19009,7 @@ ${js}`
|
|
|
18920
19009
|
repl: false,
|
|
18921
19010
|
rewriteTsImports: true,
|
|
18922
19011
|
server: false,
|
|
19012
|
+
symbols: wellKnownSymbols,
|
|
18923
19013
|
tab: void 0,
|
|
18924
19014
|
// default behavior = same as space
|
|
18925
19015
|
verbose: false
|
|
@@ -19216,6 +19306,21 @@ ${js}`
|
|
|
19216
19306
|
});
|
|
19217
19307
|
}
|
|
19218
19308
|
}
|
|
19309
|
+
var wellKnownSymbols = [
|
|
19310
|
+
"asyncIterator",
|
|
19311
|
+
"hasInstance",
|
|
19312
|
+
"isConcatSpreadable",
|
|
19313
|
+
"iterator",
|
|
19314
|
+
"match",
|
|
19315
|
+
"matchAll",
|
|
19316
|
+
"replace",
|
|
19317
|
+
"search",
|
|
19318
|
+
"species",
|
|
19319
|
+
"split",
|
|
19320
|
+
"toPrimitive",
|
|
19321
|
+
"toStringTag",
|
|
19322
|
+
"unscopables"
|
|
19323
|
+
];
|
|
19219
19324
|
|
|
19220
19325
|
// source/sourcemap.civet
|
|
19221
19326
|
var sourcemap_exports = {};
|