@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/dist/main.js
CHANGED
|
@@ -538,6 +538,7 @@ __export(lib_exports, {
|
|
|
538
538
|
hasImportDeclaration: () => hasImportDeclaration,
|
|
539
539
|
hasYield: () => hasYield,
|
|
540
540
|
insertTrimmingSpace: () => insertTrimmingSpace,
|
|
541
|
+
isComma: () => isComma,
|
|
541
542
|
isEmptyBareBlock: () => isEmptyBareBlock,
|
|
542
543
|
isFunction: () => isFunction,
|
|
543
544
|
isWhitespaceOrEmpty: () => isWhitespaceOrEmpty,
|
|
@@ -2140,6 +2141,9 @@ function serialize(value, context) {
|
|
|
2140
2141
|
throw new TypeError("cannot serialize native function");
|
|
2141
2142
|
}
|
|
2142
2143
|
if (/^class[\s{]/u.test(string)) {
|
|
2144
|
+
if (!Object.isExtensible(val)) {
|
|
2145
|
+
string = `Object.preventExtensions(${string})`;
|
|
2146
|
+
}
|
|
2143
2147
|
return string;
|
|
2144
2148
|
}
|
|
2145
2149
|
if (stack.has(val)) {
|
|
@@ -2167,6 +2171,9 @@ function serialize(value, context) {
|
|
|
2167
2171
|
}
|
|
2168
2172
|
string = `Object.defineProperties(${string},${recurse(props)})`;
|
|
2169
2173
|
}
|
|
2174
|
+
if (!Object.isExtensible(val)) {
|
|
2175
|
+
string = `Object.preventExtensions(${string})`;
|
|
2176
|
+
}
|
|
2170
2177
|
stack.delete(val);
|
|
2171
2178
|
return string;
|
|
2172
2179
|
} else if (typeof val === "symbol") {
|
|
@@ -2320,11 +2327,21 @@ function serialize(value, context) {
|
|
|
2320
2327
|
}
|
|
2321
2328
|
|
|
2322
2329
|
// source/parser/function.civet
|
|
2330
|
+
function getTypeArguments(args) {
|
|
2331
|
+
while (typeof args === "object" && args != null && "args" in args) {
|
|
2332
|
+
args = args.args;
|
|
2333
|
+
}
|
|
2334
|
+
if (!Array.isArray(args)) {
|
|
2335
|
+
throw new Error("getTypeArguments could not find relevant array");
|
|
2336
|
+
}
|
|
2337
|
+
return args.filter((a) => typeof a === "object" && a != null && "type" in a && a.type === "TypeArgument");
|
|
2338
|
+
}
|
|
2323
2339
|
function isVoidType(t) {
|
|
2324
|
-
return t
|
|
2340
|
+
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";
|
|
2325
2341
|
}
|
|
2326
2342
|
function isPromiseVoidType(t) {
|
|
2327
|
-
|
|
2343
|
+
let args;
|
|
2344
|
+
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);
|
|
2328
2345
|
}
|
|
2329
2346
|
function implicitFunctionBlock(f) {
|
|
2330
2347
|
if (f.abstract || f.block || f.signature?.optional)
|
|
@@ -2910,7 +2927,7 @@ function processParams(f) {
|
|
|
2910
2927
|
if (isConstructor) {
|
|
2911
2928
|
const { ancestor } = findAncestor(f, ($5) => $5.type === "ClassExpression");
|
|
2912
2929
|
if (ancestor != null) {
|
|
2913
|
-
const fields = new Set(gatherRecursiveWithinFunction(ancestor, ($6) => $6.type === "FieldDefinition").map(($7) => $7.id).filter((
|
|
2930
|
+
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));
|
|
2914
2931
|
const classExpressions = ancestor.body.expressions;
|
|
2915
2932
|
let index = findChildIndex(classExpressions, f);
|
|
2916
2933
|
assert.notEqual(index, -1, "Could not find constructor in class");
|
|
@@ -2962,10 +2979,10 @@ function processParams(f) {
|
|
|
2962
2979
|
if (isConstructor) {
|
|
2963
2980
|
const superCalls = gatherNodes(
|
|
2964
2981
|
expressions,
|
|
2965
|
-
(
|
|
2982
|
+
(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"
|
|
2966
2983
|
);
|
|
2967
2984
|
if (superCalls.length) {
|
|
2968
|
-
const { child } = findAncestor(superCalls[0], (
|
|
2985
|
+
const { child } = findAncestor(superCalls[0], (a3) => a3 === block);
|
|
2969
2986
|
const index = findChildIndex(expressions, child);
|
|
2970
2987
|
if (index < 0) {
|
|
2971
2988
|
throw new Error("Could not find super call within top-level expressions");
|
|
@@ -2975,6 +2992,7 @@ function processParams(f) {
|
|
|
2975
2992
|
}
|
|
2976
2993
|
}
|
|
2977
2994
|
expressions.unshift(...prefix);
|
|
2995
|
+
braceBlock(block);
|
|
2978
2996
|
}
|
|
2979
2997
|
function processSignature(f) {
|
|
2980
2998
|
const { block, signature } = f;
|
|
@@ -3097,11 +3115,11 @@ function processCoffeeDo(ws, expression) {
|
|
|
3097
3115
|
parameter = {
|
|
3098
3116
|
...parameter,
|
|
3099
3117
|
initializer: void 0,
|
|
3100
|
-
children: parameter.children.filter((
|
|
3118
|
+
children: parameter.children.filter((a4) => a4 !== initializer)
|
|
3101
3119
|
};
|
|
3102
3120
|
} else {
|
|
3103
3121
|
args.push(parameter.children.filter(
|
|
3104
|
-
(
|
|
3122
|
+
(a5) => a5 !== parameter.typeSuffix
|
|
3105
3123
|
));
|
|
3106
3124
|
}
|
|
3107
3125
|
}
|
|
@@ -3174,7 +3192,7 @@ function makeAmpersandFunction(rhs) {
|
|
|
3174
3192
|
}
|
|
3175
3193
|
if (gatherRecursiveWithinFunction(
|
|
3176
3194
|
block,
|
|
3177
|
-
(
|
|
3195
|
+
(a6) => a6 === ref
|
|
3178
3196
|
).length > 1) {
|
|
3179
3197
|
fn.ampersandBlock = false;
|
|
3180
3198
|
}
|
|
@@ -7549,6 +7567,8 @@ var grammar = {
|
|
|
7549
7567
|
BooleanLiteral,
|
|
7550
7568
|
_BooleanLiteral,
|
|
7551
7569
|
CoffeeScriptBooleanLiteral,
|
|
7570
|
+
SymbolLiteral,
|
|
7571
|
+
SymbolElement,
|
|
7552
7572
|
Identifier,
|
|
7553
7573
|
IdentifierName,
|
|
7554
7574
|
IdentifierReference,
|
|
@@ -7649,6 +7669,7 @@ var grammar = {
|
|
|
7649
7669
|
WhileClause,
|
|
7650
7670
|
ForStatement,
|
|
7651
7671
|
ForClause,
|
|
7672
|
+
ForStatementControlWithWhen,
|
|
7652
7673
|
ForStatementControl,
|
|
7653
7674
|
WhenCondition,
|
|
7654
7675
|
CoffeeForStatementParameters,
|
|
@@ -8071,6 +8092,7 @@ var grammar = {
|
|
|
8071
8092
|
NestedTypeArgumentList,
|
|
8072
8093
|
NestedTypeArgument,
|
|
8073
8094
|
SingleLineTypeArgumentList,
|
|
8095
|
+
WTypeArgument,
|
|
8074
8096
|
TypeArgumentDelimited,
|
|
8075
8097
|
TypeArgument,
|
|
8076
8098
|
TypeArgumentDelimiter,
|
|
@@ -8932,10 +8954,10 @@ var RHS$$ = [RHS$0, RHS$1];
|
|
|
8932
8954
|
function RHS(ctx, state2) {
|
|
8933
8955
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "RHS", RHS$$);
|
|
8934
8956
|
}
|
|
8935
|
-
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) {
|
|
8957
|
+
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) {
|
|
8936
8958
|
var pre = $2;
|
|
8937
8959
|
var args = $3;
|
|
8938
|
-
var post = $
|
|
8960
|
+
var post = $5;
|
|
8939
8961
|
return processUnaryNestedExpression(pre, args, post) ?? $skip;
|
|
8940
8962
|
});
|
|
8941
8963
|
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) {
|
|
@@ -9382,8 +9404,9 @@ var PrimaryExpression$7 = ClassExpression;
|
|
|
9382
9404
|
var PrimaryExpression$8 = RegularExpressionLiteral;
|
|
9383
9405
|
var PrimaryExpression$9 = ParenthesizedExpression;
|
|
9384
9406
|
var PrimaryExpression$10 = Placeholder;
|
|
9385
|
-
var PrimaryExpression$11 =
|
|
9386
|
-
var PrimaryExpression
|
|
9407
|
+
var PrimaryExpression$11 = SymbolLiteral;
|
|
9408
|
+
var PrimaryExpression$12 = JSXImplicitFragment;
|
|
9409
|
+
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];
|
|
9387
9410
|
function PrimaryExpression(ctx, state2) {
|
|
9388
9411
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "PrimaryExpression", PrimaryExpression$$);
|
|
9389
9412
|
}
|
|
@@ -10212,7 +10235,7 @@ var PropertyAccessModifier$$ = [PropertyAccessModifier$0, PropertyAccessModifier
|
|
|
10212
10235
|
function PropertyAccessModifier(ctx, state2) {
|
|
10213
10236
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "PropertyAccessModifier", PropertyAccessModifier$$);
|
|
10214
10237
|
}
|
|
10215
|
-
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) {
|
|
10238
|
+
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) {
|
|
10216
10239
|
var dot = $1;
|
|
10217
10240
|
var literal = $2;
|
|
10218
10241
|
return {
|
|
@@ -11756,6 +11779,40 @@ var CoffeeScriptBooleanLiteral$$ = [CoffeeScriptBooleanLiteral$0, CoffeeScriptBo
|
|
|
11756
11779
|
function CoffeeScriptBooleanLiteral(ctx, state2) {
|
|
11757
11780
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "CoffeeScriptBooleanLiteral", CoffeeScriptBooleanLiteral$$);
|
|
11758
11781
|
}
|
|
11782
|
+
var SymbolLiteral$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(Colon, IdentifierName), function($skip, $loc, $0, $1, $2) {
|
|
11783
|
+
var colon = $1;
|
|
11784
|
+
var id = $2;
|
|
11785
|
+
const { name, children: [token] } = id;
|
|
11786
|
+
if (config.symbols.includes(name)) {
|
|
11787
|
+
return {
|
|
11788
|
+
type: "SymbolLiteral",
|
|
11789
|
+
children: [
|
|
11790
|
+
{ ...colon, token: "Symbol." },
|
|
11791
|
+
token
|
|
11792
|
+
],
|
|
11793
|
+
name
|
|
11794
|
+
};
|
|
11795
|
+
} else {
|
|
11796
|
+
return {
|
|
11797
|
+
type: "SymbolLiteral",
|
|
11798
|
+
children: [
|
|
11799
|
+
{ ...colon, token: 'Symbol.for("' },
|
|
11800
|
+
token,
|
|
11801
|
+
'")'
|
|
11802
|
+
],
|
|
11803
|
+
name
|
|
11804
|
+
};
|
|
11805
|
+
}
|
|
11806
|
+
});
|
|
11807
|
+
function SymbolLiteral(ctx, state2) {
|
|
11808
|
+
return (0, import_lib4.$EVENT)(ctx, state2, "SymbolLiteral", SymbolLiteral$0);
|
|
11809
|
+
}
|
|
11810
|
+
var SymbolElement$0 = (0, import_lib4.$T)((0, import_lib4.$S)(SymbolLiteral), function(value) {
|
|
11811
|
+
return ["[", value[0], "]"];
|
|
11812
|
+
});
|
|
11813
|
+
function SymbolElement(ctx, state2) {
|
|
11814
|
+
return (0, import_lib4.$EVENT)(ctx, state2, "SymbolElement", SymbolElement$0);
|
|
11815
|
+
}
|
|
11759
11816
|
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) {
|
|
11760
11817
|
var id = value[2];
|
|
11761
11818
|
return id;
|
|
@@ -12503,7 +12560,8 @@ var PropertyName$3 = (0, import_lib4.$TV)((0, import_lib4.$TEXT)((0, import_lib4
|
|
|
12503
12560
|
});
|
|
12504
12561
|
var PropertyName$4 = IdentifierName;
|
|
12505
12562
|
var PropertyName$5 = LengthShorthand;
|
|
12506
|
-
var PropertyName
|
|
12563
|
+
var PropertyName$6 = SymbolElement;
|
|
12564
|
+
var PropertyName$$ = [PropertyName$0, PropertyName$1, PropertyName$2, PropertyName$3, PropertyName$4, PropertyName$5, PropertyName$6];
|
|
12507
12565
|
function PropertyName(ctx, state2) {
|
|
12508
12566
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "PropertyName", PropertyName$$);
|
|
12509
12567
|
}
|
|
@@ -12765,7 +12823,8 @@ function MethodSignature(ctx, state2) {
|
|
|
12765
12823
|
var ClassElementName$0 = PropertyName;
|
|
12766
12824
|
var ClassElementName$1 = LengthShorthand;
|
|
12767
12825
|
var ClassElementName$2 = PrivateIdentifier;
|
|
12768
|
-
var ClassElementName
|
|
12826
|
+
var ClassElementName$3 = SymbolElement;
|
|
12827
|
+
var ClassElementName$$ = [ClassElementName$0, ClassElementName$1, ClassElementName$2, ClassElementName$3];
|
|
12769
12828
|
function ClassElementName(ctx, state2) {
|
|
12770
12829
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "ClassElementName", ClassElementName$$);
|
|
12771
12830
|
}
|
|
@@ -13722,7 +13781,7 @@ var ForStatement$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(ForClause, BlockOr
|
|
|
13722
13781
|
function ForStatement(ctx, state2) {
|
|
13723
13782
|
return (0, import_lib4.$EVENT)(ctx, state2, "ForStatement", ForStatement$0);
|
|
13724
13783
|
}
|
|
13725
|
-
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)), __,
|
|
13784
|
+
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) {
|
|
13726
13785
|
var generator = $2;
|
|
13727
13786
|
var c = $4;
|
|
13728
13787
|
const { children, declaration } = c;
|
|
@@ -13739,26 +13798,41 @@ var ForClause$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(For, (0, import_lib4.
|
|
|
13739
13798
|
function ForClause(ctx, state2) {
|
|
13740
13799
|
return (0, import_lib4.$EVENT)(ctx, state2, "ForClause", ForClause$0);
|
|
13741
13800
|
}
|
|
13801
|
+
var ForStatementControlWithWhen$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(ForStatementControl, (0, import_lib4.$E)(WhenCondition)), function($skip, $loc, $0, $1, $2) {
|
|
13802
|
+
var control = $1;
|
|
13803
|
+
var condition = $2;
|
|
13804
|
+
if (!condition)
|
|
13805
|
+
return control;
|
|
13806
|
+
const expressions = [["", {
|
|
13807
|
+
type: "ContinueStatement",
|
|
13808
|
+
children: ["continue"]
|
|
13809
|
+
}]];
|
|
13810
|
+
const block = {
|
|
13811
|
+
type: "BlockStatement",
|
|
13812
|
+
expressions,
|
|
13813
|
+
children: [expressions],
|
|
13814
|
+
bare: true
|
|
13815
|
+
};
|
|
13816
|
+
return {
|
|
13817
|
+
...control,
|
|
13818
|
+
blockPrefix: [
|
|
13819
|
+
...control.blockPrefix,
|
|
13820
|
+
["", {
|
|
13821
|
+
type: "IfStatement",
|
|
13822
|
+
then: block,
|
|
13823
|
+
children: ["if (!", makeLeftHandSideExpression(trimFirstSpace(condition)), ") ", block]
|
|
13824
|
+
}, ";"]
|
|
13825
|
+
]
|
|
13826
|
+
};
|
|
13827
|
+
});
|
|
13828
|
+
function ForStatementControlWithWhen(ctx, state2) {
|
|
13829
|
+
return (0, import_lib4.$EVENT)(ctx, state2, "ForStatementControlWithWhen", ForStatementControlWithWhen$0);
|
|
13830
|
+
}
|
|
13742
13831
|
var ForStatementControl$0 = (0, import_lib4.$T)((0, import_lib4.$S)((0, import_lib4.$N)(CoffeeForLoopsEnabled), ForStatementParameters), function(value) {
|
|
13743
13832
|
return value[1];
|
|
13744
13833
|
});
|
|
13745
|
-
var ForStatementControl$1 = (0, import_lib4.$
|
|
13746
|
-
|
|
13747
|
-
if (condition) {
|
|
13748
|
-
const block = "continue";
|
|
13749
|
-
$2 = {
|
|
13750
|
-
...$2,
|
|
13751
|
-
blockPrefix: [
|
|
13752
|
-
...$2.blockPrefix,
|
|
13753
|
-
["", {
|
|
13754
|
-
type: "IfStatement",
|
|
13755
|
-
then: block,
|
|
13756
|
-
children: ["if (!(", trimFirstSpace(condition), ")) ", block]
|
|
13757
|
-
}, ";"]
|
|
13758
|
-
]
|
|
13759
|
-
};
|
|
13760
|
-
}
|
|
13761
|
-
return $2;
|
|
13834
|
+
var ForStatementControl$1 = (0, import_lib4.$T)((0, import_lib4.$S)(CoffeeForLoopsEnabled, CoffeeForStatementParameters), function(value) {
|
|
13835
|
+
return value[1];
|
|
13762
13836
|
});
|
|
13763
13837
|
var ForStatementControl$$ = [ForStatementControl$0, ForStatementControl$1];
|
|
13764
13838
|
function ForStatementControl(ctx, state2) {
|
|
@@ -18338,11 +18412,12 @@ function TypeArrowFunction(ctx, state2) {
|
|
|
18338
18412
|
}
|
|
18339
18413
|
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) {
|
|
18340
18414
|
var args = $2;
|
|
18341
|
-
args = args.
|
|
18415
|
+
args = args.flatMap(([ws, [arg, delim]]) => [prepend(ws, arg), delim]);
|
|
18416
|
+
args.pop();
|
|
18342
18417
|
return {
|
|
18343
18418
|
type: "TypeArguments",
|
|
18344
18419
|
ts: true,
|
|
18345
|
-
|
|
18420
|
+
args,
|
|
18346
18421
|
children: $0
|
|
18347
18422
|
};
|
|
18348
18423
|
});
|
|
@@ -18354,10 +18429,15 @@ var ImplicitTypeArguments$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(TypeAppli
|
|
|
18354
18429
|
var ws = $3;
|
|
18355
18430
|
var args = $4;
|
|
18356
18431
|
var close = $5;
|
|
18357
|
-
|
|
18358
|
-
if (last
|
|
18432
|
+
const last = args[args.length - 1];
|
|
18433
|
+
if (isComma(last))
|
|
18359
18434
|
args = args.slice(0, -1);
|
|
18360
|
-
return
|
|
18435
|
+
return {
|
|
18436
|
+
type: "TypeArguments",
|
|
18437
|
+
ts: true,
|
|
18438
|
+
args,
|
|
18439
|
+
children: [open, ws, args, close]
|
|
18440
|
+
};
|
|
18361
18441
|
});
|
|
18362
18442
|
function ImplicitTypeArguments(ctx, state2) {
|
|
18363
18443
|
return (0, import_lib4.$EVENT)(ctx, state2, "ImplicitTypeArguments", ImplicitTypeArguments$0);
|
|
@@ -18375,10 +18455,10 @@ var ForbiddenImplicitTypeCalls$$ = [ForbiddenImplicitTypeCalls$0, ForbiddenImpli
|
|
|
18375
18455
|
function ForbiddenImplicitTypeCalls(ctx, state2) {
|
|
18376
18456
|
return (0, import_lib4.$EVENT_C)(ctx, state2, "ForbiddenImplicitTypeCalls", ForbiddenImplicitTypeCalls$$);
|
|
18377
18457
|
}
|
|
18378
|
-
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),
|
|
18458
|
+
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) {
|
|
18379
18459
|
return [
|
|
18380
18460
|
$2,
|
|
18381
|
-
...$3.flatMap(([comma, eos,
|
|
18461
|
+
...$3.flatMap(([comma, eos, arg]) => [comma, arg]),
|
|
18382
18462
|
...$4.flatMap(
|
|
18383
18463
|
([comma, args]) => Array.isArray(args) ? [comma, ...args] : [comma, args]
|
|
18384
18464
|
)
|
|
@@ -18393,10 +18473,10 @@ var TypeArgumentList$1 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib
|
|
|
18393
18473
|
];
|
|
18394
18474
|
});
|
|
18395
18475
|
var TypeArgumentList$2 = NestedTypeArgumentList;
|
|
18396
|
-
var TypeArgumentList$3 = (0, import_lib4.$TS)((0, import_lib4.$S)(TypeArgument, (0, import_lib4.$Q)((0, import_lib4.$S)(CommaDelimiter,
|
|
18476
|
+
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) {
|
|
18397
18477
|
return [
|
|
18398
18478
|
$1,
|
|
18399
|
-
...$2.flatMap(([comma,
|
|
18479
|
+
...$2.flatMap(([comma, arg]) => [comma, arg])
|
|
18400
18480
|
];
|
|
18401
18481
|
});
|
|
18402
18482
|
var TypeArgumentList$$ = [TypeArgumentList$0, TypeArgumentList$1, TypeArgumentList$2, TypeArgumentList$3];
|
|
@@ -18423,17 +18503,25 @@ var NestedTypeArgument$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(Nested, Sing
|
|
|
18423
18503
|
function NestedTypeArgument(ctx, state2) {
|
|
18424
18504
|
return (0, import_lib4.$EVENT)(ctx, state2, "NestedTypeArgument", NestedTypeArgument$0);
|
|
18425
18505
|
}
|
|
18426
|
-
var SingleLineTypeArgumentList$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(
|
|
18427
|
-
return [$1, ...$2
|
|
18506
|
+
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) {
|
|
18507
|
+
return [$1, ...$2];
|
|
18428
18508
|
});
|
|
18429
18509
|
function SingleLineTypeArgumentList(ctx, state2) {
|
|
18430
18510
|
return (0, import_lib4.$EVENT)(ctx, state2, "SingleLineTypeArgumentList", SingleLineTypeArgumentList$0);
|
|
18431
18511
|
}
|
|
18512
|
+
var WTypeArgument$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)(_), TypeArgument), function($skip, $loc, $0, $1, $2) {
|
|
18513
|
+
return prepend($1, $2);
|
|
18514
|
+
});
|
|
18515
|
+
function WTypeArgument(ctx, state2) {
|
|
18516
|
+
return (0, import_lib4.$EVENT)(ctx, state2, "WTypeArgument", WTypeArgument$0);
|
|
18517
|
+
}
|
|
18432
18518
|
var TypeArgumentDelimited$0 = (0, import_lib4.$S)(TypeArgument, TypeArgumentDelimiter);
|
|
18433
18519
|
function TypeArgumentDelimited(ctx, state2) {
|
|
18434
18520
|
return (0, import_lib4.$EVENT)(ctx, state2, "TypeArgumentDelimited", TypeArgumentDelimited$0);
|
|
18435
18521
|
}
|
|
18436
|
-
var TypeArgument$0 = Type
|
|
18522
|
+
var TypeArgument$0 = (0, import_lib4.$T)(Type, function(value) {
|
|
18523
|
+
return { "type": "TypeArgument", "ts": true, "t": value, "children": [value] };
|
|
18524
|
+
});
|
|
18437
18525
|
function TypeArgument(ctx, state2) {
|
|
18438
18526
|
return (0, import_lib4.$EVENT)(ctx, state2, "TypeArgument", TypeArgument$0);
|
|
18439
18527
|
}
|
|
@@ -18521,6 +18609,7 @@ var CivetOption$0 = (0, import_lib4.$TR)((0, import_lib4.$EXPECT)($R96, "CivetOp
|
|
|
18521
18609
|
value = 0;
|
|
18522
18610
|
break;
|
|
18523
18611
|
case "globals":
|
|
18612
|
+
case "symbols":
|
|
18524
18613
|
value = value.split(",").filter(Boolean);
|
|
18525
18614
|
break;
|
|
18526
18615
|
}
|
|
@@ -18896,6 +18985,7 @@ var Reset$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L0, 'Reset ""'), fu
|
|
|
18896
18985
|
repl: false,
|
|
18897
18986
|
rewriteTsImports: true,
|
|
18898
18987
|
server: false,
|
|
18988
|
+
symbols: wellKnownSymbols,
|
|
18899
18989
|
tab: void 0,
|
|
18900
18990
|
// default behavior = same as space
|
|
18901
18991
|
verbose: false
|
|
@@ -19192,6 +19282,21 @@ function parseProgram(input, options) {
|
|
|
19192
19282
|
});
|
|
19193
19283
|
}
|
|
19194
19284
|
}
|
|
19285
|
+
var wellKnownSymbols = [
|
|
19286
|
+
"asyncIterator",
|
|
19287
|
+
"hasInstance",
|
|
19288
|
+
"isConcatSpreadable",
|
|
19289
|
+
"iterator",
|
|
19290
|
+
"match",
|
|
19291
|
+
"matchAll",
|
|
19292
|
+
"replace",
|
|
19293
|
+
"search",
|
|
19294
|
+
"species",
|
|
19295
|
+
"split",
|
|
19296
|
+
"toPrimitive",
|
|
19297
|
+
"toStringTag",
|
|
19298
|
+
"unscopables"
|
|
19299
|
+
];
|
|
19195
19300
|
|
|
19196
19301
|
// source/sourcemap.civet
|
|
19197
19302
|
var sourcemap_exports = {};
|