@danielx/civet 0.7.33 → 0.7.34
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 +8 -0
- package/dist/browser.js +110 -73
- package/dist/config.js +7182 -1
- package/dist/config.mjs +7205 -1
- package/dist/main.js +110 -73
- package/dist/main.mjs +110 -73
- package/dist/types.d.ts +1 -0
- package/dist/unplugin/unplugin.js +17 -4
- package/dist/unplugin/unplugin.mjs +17 -4
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -30,9 +30,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
));
|
|
31
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
32
|
|
|
33
|
-
// node_modules/@danielx/hera/dist/machine.js
|
|
33
|
+
// node_modules/.pnpm/@danielx+hera@0.8.16/node_modules/@danielx/hera/dist/machine.js
|
|
34
34
|
var require_machine = __commonJS({
|
|
35
|
-
"node_modules/@danielx/hera/dist/machine.js"(exports2, module2) {
|
|
35
|
+
"node_modules/.pnpm/@danielx+hera@0.8.16/node_modules/@danielx/hera/dist/machine.js"(exports2, module2) {
|
|
36
36
|
"use strict";
|
|
37
37
|
var __defProp2 = Object.defineProperty;
|
|
38
38
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1085,12 +1085,11 @@ function convertOptionalType(suffix) {
|
|
|
1085
1085
|
]);
|
|
1086
1086
|
}
|
|
1087
1087
|
var typeNeedsNoParens = /* @__PURE__ */ new Set([
|
|
1088
|
-
"
|
|
1088
|
+
"TypeIdentifier",
|
|
1089
1089
|
"ImportType",
|
|
1090
|
-
"
|
|
1090
|
+
"TypeLiteral",
|
|
1091
1091
|
"TupleType",
|
|
1092
|
-
"
|
|
1093
|
-
"UnaryType"
|
|
1092
|
+
"TypeParenthesized"
|
|
1094
1093
|
]);
|
|
1095
1094
|
function parenthesizeType(type) {
|
|
1096
1095
|
if (typeNeedsNoParens.has(type.type)) {
|
|
@@ -1580,16 +1579,16 @@ function gatherBindingPatternTypeSuffix(pattern) {
|
|
|
1580
1579
|
|
|
1581
1580
|
// source/parser/function.civet
|
|
1582
1581
|
function isVoidType(t) {
|
|
1583
|
-
return t?.type === "
|
|
1582
|
+
return t?.type === "TypeLiteral" && t.t.type === "VoidType";
|
|
1584
1583
|
}
|
|
1585
1584
|
function isPromiseVoidType(t) {
|
|
1586
|
-
return t?.type === "
|
|
1585
|
+
return t?.type === "TypeIdentifier" && t.raw === "Promise" && t.args?.types?.length === 1 && isVoidType(t.args.types[0]);
|
|
1587
1586
|
}
|
|
1588
1587
|
function isGeneratorVoidType(t) {
|
|
1589
|
-
return t?.type === "
|
|
1588
|
+
return t?.type === "TypeIdentifier" && (t.raw === "Iterator" || t.raw === "Generator") && t.args?.types?.length >= 2 && isVoidType(t.args.types[1]);
|
|
1590
1589
|
}
|
|
1591
1590
|
function isAsyncGeneratorVoidType(t) {
|
|
1592
|
-
return t?.type === "
|
|
1591
|
+
return t?.type === "TypeIdentifier" && (t.raw === "AsyncIterator" || t.raw === "AsyncGenerator") && t.args?.types?.length >= 2 && isVoidType(t.args.types[1]);
|
|
1593
1592
|
}
|
|
1594
1593
|
function implicitFunctionBlock(f) {
|
|
1595
1594
|
if (f.abstract || f.block || f.signature?.optional)
|
|
@@ -1787,14 +1786,13 @@ function assignResults(node, collect) {
|
|
|
1787
1786
|
if (isExit(exp)) {
|
|
1788
1787
|
return;
|
|
1789
1788
|
}
|
|
1789
|
+
exp = exp;
|
|
1790
1790
|
const outer = exp;
|
|
1791
|
-
|
|
1792
|
-
if (type === "LabelledStatement") {
|
|
1791
|
+
if (exp.type === "LabelledStatement") {
|
|
1793
1792
|
exp = exp.statement;
|
|
1794
|
-
({ type } = exp);
|
|
1795
1793
|
}
|
|
1796
1794
|
let ref4;
|
|
1797
|
-
switch (type) {
|
|
1795
|
+
switch (exp.type) {
|
|
1798
1796
|
case "BreakStatement":
|
|
1799
1797
|
case "ContinueStatement":
|
|
1800
1798
|
case "DebuggerStatement":
|
|
@@ -3796,9 +3794,6 @@ function processDeclarationConditionStatement(s) {
|
|
|
3796
3794
|
}
|
|
3797
3795
|
} else {
|
|
3798
3796
|
const block = blockWithPrefix(blockPrefix, s.then);
|
|
3799
|
-
if (block.bare && e && !block.semicolon) {
|
|
3800
|
-
block.children.push(block.semicolon = ";");
|
|
3801
|
-
}
|
|
3802
3797
|
s.children = s.children.map(($2) => $2 === s.then ? block : $2);
|
|
3803
3798
|
s.then = block;
|
|
3804
3799
|
updateParentPointers(s);
|
|
@@ -4507,7 +4502,8 @@ var concatAssign = (lhs, rhs) => (rhs?.[Symbol.isConcatSpreadable] ?? Array.isAr
|
|
|
4507
4502
|
function findDecs(statements) {
|
|
4508
4503
|
const declarations = gatherNodes(statements, ($) => $.type === "Declaration");
|
|
4509
4504
|
const declarationNames = declarations.flatMap((d) => d.names);
|
|
4510
|
-
|
|
4505
|
+
const globals = getConfig().globals || [];
|
|
4506
|
+
return new Set(globals.concat(declarationNames));
|
|
4511
4507
|
}
|
|
4512
4508
|
function createConstLetDecs(statements, scopes, letOrConst) {
|
|
4513
4509
|
function findVarDecs(statements2, decs) {
|
|
@@ -5359,7 +5355,7 @@ function expressionizeIfStatement(statement) {
|
|
|
5359
5355
|
function expressionizeTypeIf([ifOp, condition, t, e]) {
|
|
5360
5356
|
const children = [
|
|
5361
5357
|
"(",
|
|
5362
|
-
|
|
5358
|
+
trimFirstSpace(condition),
|
|
5363
5359
|
"?"
|
|
5364
5360
|
];
|
|
5365
5361
|
if (!xor(ifOp.negated, condition.negated)) {
|
|
@@ -5542,7 +5538,7 @@ function processCallMemberExpression(node) {
|
|
|
5542
5538
|
[name, value] = [value, name];
|
|
5543
5539
|
}
|
|
5544
5540
|
if (!suppressPrefix) {
|
|
5545
|
-
value = prefix.concat(
|
|
5541
|
+
value = prefix.concat(trimFirstSpace(value));
|
|
5546
5542
|
}
|
|
5547
5543
|
if (wValue)
|
|
5548
5544
|
value.unshift(wValue);
|
|
@@ -5768,7 +5764,7 @@ function convertObjectToJSXAttributes(obj) {
|
|
|
5768
5764
|
if (part.name.type === "ComputedPropertyName") {
|
|
5769
5765
|
rest.push(part);
|
|
5770
5766
|
} else {
|
|
5771
|
-
parts.push([part.name, "={",
|
|
5767
|
+
parts.push([part.name, "={", trimFirstSpace(part.value), "}"]);
|
|
5772
5768
|
}
|
|
5773
5769
|
break;
|
|
5774
5770
|
case "SpreadProperty":
|
|
@@ -5793,7 +5789,7 @@ function convertObjectToJSXAttributes(obj) {
|
|
|
5793
5789
|
}
|
|
5794
5790
|
function makeGetterMethod(name, ws, value, returnType, block, kind = { token: "get" }, autoReturn = true) {
|
|
5795
5791
|
const { token } = kind;
|
|
5796
|
-
ws =
|
|
5792
|
+
ws = trimFirstSpace(ws);
|
|
5797
5793
|
let setVal;
|
|
5798
5794
|
const parameters = token === "get" ? {
|
|
5799
5795
|
type: "Parameters",
|
|
@@ -6154,7 +6150,7 @@ function attachPostfixStatementAsExpression(exp, post) {
|
|
|
6154
6150
|
}
|
|
6155
6151
|
}
|
|
6156
6152
|
function processTypes(node) {
|
|
6157
|
-
return gatherRecursiveAll(node, (n) => n.type === "
|
|
6153
|
+
return gatherRecursiveAll(node, (n) => n.type === "TypeUnary").forEach((unary) => {
|
|
6158
6154
|
let last;
|
|
6159
6155
|
let count = 0;
|
|
6160
6156
|
let ref10;
|
|
@@ -6165,6 +6161,12 @@ function processTypes(node) {
|
|
|
6165
6161
|
if (!count) {
|
|
6166
6162
|
return;
|
|
6167
6163
|
}
|
|
6164
|
+
let ref11;
|
|
6165
|
+
if (unary.suffix.length || unary.prefix.length)
|
|
6166
|
+
ref11 = unary;
|
|
6167
|
+
else
|
|
6168
|
+
ref11 = unary.t;
|
|
6169
|
+
const t = ref11;
|
|
6168
6170
|
if (unary.parent?.type === "TypeTuple") {
|
|
6169
6171
|
if (count === 1) {
|
|
6170
6172
|
unary.suffix.push(last);
|
|
@@ -6173,18 +6175,22 @@ function processTypes(node) {
|
|
|
6173
6175
|
replaceNode(unary, [
|
|
6174
6176
|
getTrimmingSpace(unary),
|
|
6175
6177
|
"(",
|
|
6176
|
-
parenthesizeType(
|
|
6178
|
+
parenthesizeType(trimFirstSpace(t)),
|
|
6177
6179
|
" | null)",
|
|
6178
6180
|
last
|
|
6179
6181
|
]);
|
|
6180
6182
|
} else {
|
|
6181
|
-
replaceNode(unary,
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
|
-
|
|
6185
|
-
|
|
6186
|
-
|
|
6187
|
-
|
|
6183
|
+
replaceNode(unary, {
|
|
6184
|
+
type: "TypeParenthesized",
|
|
6185
|
+
ts: true,
|
|
6186
|
+
children: [
|
|
6187
|
+
getTrimmingSpace(unary),
|
|
6188
|
+
"(",
|
|
6189
|
+
parenthesizeType(trimFirstSpace(t)),
|
|
6190
|
+
count === 1 ? " | undefined" : " | undefined | null",
|
|
6191
|
+
")"
|
|
6192
|
+
]
|
|
6193
|
+
});
|
|
6188
6194
|
}
|
|
6189
6195
|
});
|
|
6190
6196
|
}
|
|
@@ -6192,11 +6198,11 @@ function processStatementExpressions(statements) {
|
|
|
6192
6198
|
gatherRecursiveAll(statements, ($7) => $7.type === "StatementExpression").forEach((_exp) => {
|
|
6193
6199
|
const exp = _exp;
|
|
6194
6200
|
const { statement } = exp;
|
|
6195
|
-
let
|
|
6201
|
+
let ref12;
|
|
6196
6202
|
switch (statement.type) {
|
|
6197
6203
|
case "IfStatement": {
|
|
6198
|
-
if (
|
|
6199
|
-
const expression =
|
|
6204
|
+
if (ref12 = expressionizeIfStatement(statement)) {
|
|
6205
|
+
const expression = ref12;
|
|
6200
6206
|
return replaceNode(statement, expression, exp);
|
|
6201
6207
|
} else {
|
|
6202
6208
|
return replaceNode(statement, wrapIIFE([["", statement]]), exp);
|
|
@@ -6424,8 +6430,8 @@ function processPlaceholders(statements) {
|
|
|
6424
6430
|
for (let i4 = 0, len3 = placeholders.length; i4 < len3; i4++) {
|
|
6425
6431
|
const placeholder = placeholders[i4];
|
|
6426
6432
|
typeSuffix ??= placeholder.typeSuffix;
|
|
6427
|
-
let
|
|
6428
|
-
replaceNode((
|
|
6433
|
+
let ref13;
|
|
6434
|
+
replaceNode((ref13 = placeholder.children)[ref13.length - 1], ref);
|
|
6429
6435
|
}
|
|
6430
6436
|
const { parent } = ancestor;
|
|
6431
6437
|
const body = maybeUnwrap(ancestor);
|
|
@@ -6442,16 +6448,16 @@ function processPlaceholders(statements) {
|
|
|
6442
6448
|
}
|
|
6443
6449
|
case "PipelineExpression": {
|
|
6444
6450
|
const i = findChildIndex(parent, ancestor);
|
|
6445
|
-
let
|
|
6451
|
+
let ref14;
|
|
6446
6452
|
if (i === 1) {
|
|
6447
|
-
|
|
6453
|
+
ref14 = ancestor === parent.children[i];
|
|
6448
6454
|
} else if (i === 2) {
|
|
6449
|
-
|
|
6455
|
+
ref14 = ancestor === parent.children[i][findChildIndex(parent.children[i], ancestor)][3];
|
|
6450
6456
|
} else {
|
|
6451
|
-
|
|
6457
|
+
ref14 = void 0;
|
|
6452
6458
|
}
|
|
6453
6459
|
;
|
|
6454
|
-
outer =
|
|
6460
|
+
outer = ref14;
|
|
6455
6461
|
break;
|
|
6456
6462
|
}
|
|
6457
6463
|
case "AssignmentExpression":
|
|
@@ -6466,9 +6472,9 @@ function processPlaceholders(statements) {
|
|
|
6466
6472
|
fnExp = makeLeftHandSideExpression(fnExp);
|
|
6467
6473
|
}
|
|
6468
6474
|
replaceNode(ancestor, fnExp, parent);
|
|
6469
|
-
let
|
|
6470
|
-
if (
|
|
6471
|
-
const ws =
|
|
6475
|
+
let ref15;
|
|
6476
|
+
if (ref15 = getTrimmingSpace(body)) {
|
|
6477
|
+
const ws = ref15;
|
|
6472
6478
|
inplaceInsertTrimmingSpace(body, "");
|
|
6473
6479
|
inplacePrepend(ws, fnExp);
|
|
6474
6480
|
}
|
|
@@ -6513,8 +6519,8 @@ function reorderBindingRestProperty(props) {
|
|
|
6513
6519
|
}
|
|
6514
6520
|
];
|
|
6515
6521
|
}
|
|
6516
|
-
let
|
|
6517
|
-
if (Array.isArray(rest.delim) && (
|
|
6522
|
+
let ref16;
|
|
6523
|
+
if (Array.isArray(rest.delim) && (ref16 = rest.delim)[ref16.length - 1]?.token === ",") {
|
|
6518
6524
|
rest.delim = rest.delim.slice(0, -1);
|
|
6519
6525
|
rest.children = [...rest.children.slice(0, -1), rest.delim];
|
|
6520
6526
|
}
|
|
@@ -7278,6 +7284,7 @@ var grammar = {
|
|
|
7278
7284
|
NamespaceDeclaration,
|
|
7279
7285
|
OptionalEquals,
|
|
7280
7286
|
TypeLexicalDeclaration,
|
|
7287
|
+
TypeLetOrConstDeclaration,
|
|
7281
7288
|
TypeDeclarationBinding,
|
|
7282
7289
|
InterfaceExtendsClause,
|
|
7283
7290
|
InterfaceExtendsTarget,
|
|
@@ -7771,7 +7778,7 @@ var $R90 = (0, import_lib3.$R)(new RegExp("(extends|not|is)(?!\\p{ID_Continue}|[
|
|
|
7771
7778
|
var $R91 = (0, import_lib3.$R)(new RegExp("#![^\\r\\n]*", "suy"));
|
|
7772
7779
|
var $R92 = (0, import_lib3.$R)(new RegExp("[\\t ]*", "suy"));
|
|
7773
7780
|
var $R93 = (0, import_lib3.$R)(new RegExp("[\\s]*", "suy"));
|
|
7774
|
-
var $R94 = (0, import_lib3.$R)(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([
|
|
7781
|
+
var $R94 = (0, import_lib3.$R)(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([\\p{ID_Continue}.,+-]*))?", "suy"));
|
|
7775
7782
|
var $R95 = (0, import_lib3.$R)(new RegExp("\\/\\/\\/[^\\r\\n]*", "suy"));
|
|
7776
7783
|
var $R96 = (0, import_lib3.$R)(new RegExp("(?=[ \\t\\r\\n\\/#]|$)", "suy"));
|
|
7777
7784
|
var $R97 = (0, import_lib3.$R)(new RegExp("\\r\\n|\\n|\\r|$", "suy"));
|
|
@@ -12708,6 +12715,14 @@ var IfStatement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$C)
|
|
|
12708
12715
|
kind = { ...kind, token: "if" };
|
|
12709
12716
|
condition = negateCondition(condition);
|
|
12710
12717
|
}
|
|
12718
|
+
if (block.bare && e) {
|
|
12719
|
+
const semicolon = ";";
|
|
12720
|
+
block = {
|
|
12721
|
+
...block,
|
|
12722
|
+
semicolon,
|
|
12723
|
+
children: [...block.children, semicolon]
|
|
12724
|
+
};
|
|
12725
|
+
}
|
|
12711
12726
|
return {
|
|
12712
12727
|
type: "IfStatement",
|
|
12713
12728
|
children: [kind, ws, condition, block, e],
|
|
@@ -12721,6 +12736,13 @@ var IfStatement$1 = (0, import_lib3.$TS)((0, import_lib3.$S)(IfClause, BlockOrEm
|
|
|
12721
12736
|
var clause = $1;
|
|
12722
12737
|
var block = $2;
|
|
12723
12738
|
var e = $3;
|
|
12739
|
+
if (block.bare && e) {
|
|
12740
|
+
block = {
|
|
12741
|
+
...block,
|
|
12742
|
+
semicolon: ";",
|
|
12743
|
+
children: [...block.children, ";"]
|
|
12744
|
+
};
|
|
12745
|
+
}
|
|
12724
12746
|
return {
|
|
12725
12747
|
type: "IfStatement",
|
|
12726
12748
|
children: [...clause.children, block, e],
|
|
@@ -16397,7 +16419,17 @@ var OptionalEquals$$ = [OptionalEquals$0, OptionalEquals$1];
|
|
|
16397
16419
|
function OptionalEquals(ctx, state2) {
|
|
16398
16420
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "OptionalEquals", OptionalEquals$$);
|
|
16399
16421
|
}
|
|
16400
|
-
var TypeLexicalDeclaration$0 =
|
|
16422
|
+
var TypeLexicalDeclaration$0 = TypeLetOrConstDeclaration;
|
|
16423
|
+
var TypeLexicalDeclaration$1 = (0, import_lib3.$S)(__, EnumDeclaration);
|
|
16424
|
+
var TypeLexicalDeclaration$2 = ClassSignature;
|
|
16425
|
+
var TypeLexicalDeclaration$3 = (0, import_lib3.$S)(Namespace, (0, import_lib3.$E)(_), IdentifierName, DeclareBlock);
|
|
16426
|
+
var TypeLexicalDeclaration$4 = (0, import_lib3.$S)(Module, _, StringLiteral, (0, import_lib3.$E)(DeclareBlock));
|
|
16427
|
+
var TypeLexicalDeclaration$5 = (0, import_lib3.$S)(Global, (0, import_lib3.$E)(DeclareBlock));
|
|
16428
|
+
var TypeLexicalDeclaration$$ = [TypeLexicalDeclaration$0, TypeLexicalDeclaration$1, TypeLexicalDeclaration$2, TypeLexicalDeclaration$3, TypeLexicalDeclaration$4, TypeLexicalDeclaration$5];
|
|
16429
|
+
function TypeLexicalDeclaration(ctx, state2) {
|
|
16430
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeLexicalDeclaration", TypeLexicalDeclaration$$);
|
|
16431
|
+
}
|
|
16432
|
+
var TypeLetOrConstDeclaration$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(__, LetOrConstOrVar, TypeDeclarationBinding, (0, import_lib3.$Q)((0, import_lib3.$S)(CommaDelimiter, __, TypeDeclarationBinding))), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
16401
16433
|
var first = $3;
|
|
16402
16434
|
var rest = $4;
|
|
16403
16435
|
const names = first.names.concat(...rest.map((b) => b[2].names));
|
|
@@ -16408,14 +16440,8 @@ var TypeLexicalDeclaration$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(__, LetO
|
|
|
16408
16440
|
names
|
|
16409
16441
|
};
|
|
16410
16442
|
});
|
|
16411
|
-
|
|
16412
|
-
|
|
16413
|
-
var TypeLexicalDeclaration$3 = (0, import_lib3.$S)(Namespace, (0, import_lib3.$E)(_), IdentifierName, DeclareBlock);
|
|
16414
|
-
var TypeLexicalDeclaration$4 = (0, import_lib3.$S)(Module, _, StringLiteral, (0, import_lib3.$E)(DeclareBlock));
|
|
16415
|
-
var TypeLexicalDeclaration$5 = (0, import_lib3.$S)(Global, (0, import_lib3.$E)(DeclareBlock));
|
|
16416
|
-
var TypeLexicalDeclaration$$ = [TypeLexicalDeclaration$0, TypeLexicalDeclaration$1, TypeLexicalDeclaration$2, TypeLexicalDeclaration$3, TypeLexicalDeclaration$4, TypeLexicalDeclaration$5];
|
|
16417
|
-
function TypeLexicalDeclaration(ctx, state2) {
|
|
16418
|
-
return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeLexicalDeclaration", TypeLexicalDeclaration$$);
|
|
16443
|
+
function TypeLetOrConstDeclaration(ctx, state2) {
|
|
16444
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "TypeLetOrConstDeclaration", TypeLetOrConstDeclaration$0);
|
|
16419
16445
|
}
|
|
16420
16446
|
var TypeDeclarationBinding$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$C)(BindingPattern, BindingIdentifier), (0, import_lib3.$E)(TypeSuffix)), function($skip, $loc, $0, $1, $2) {
|
|
16421
16447
|
return {
|
|
@@ -16559,13 +16585,14 @@ var NestedDeclareElement$0 = (0, import_lib3.$S)(Nested, DeclareElement, Interfa
|
|
|
16559
16585
|
function NestedDeclareElement(ctx, state2) {
|
|
16560
16586
|
return (0, import_lib3.$EVENT)(ctx, state2, "NestedDeclareElement", NestedDeclareElement$0);
|
|
16561
16587
|
}
|
|
16562
|
-
var DeclareElement$0 = (0, import_lib3.$
|
|
16588
|
+
var DeclareElement$0 = (0, import_lib3.$S)((0, import_lib3.$E)(Decorators), Export, __, Default, __, (0, import_lib3.$C)(Identifier, ClassSignature, InterfaceDeclaration));
|
|
16589
|
+
var DeclareElement$1 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$E)(Decorators), (0, import_lib3.$E)((0, import_lib3.$S)(Export, (0, import_lib3.$E)(_))), TypeLexicalDeclaration), function(value) {
|
|
16563
16590
|
return { "ts": true, "children": value };
|
|
16564
16591
|
});
|
|
16565
|
-
var DeclareElement$
|
|
16592
|
+
var DeclareElement$2 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$E)((0, import_lib3.$S)(Export, (0, import_lib3.$E)(_))), TypeDeclarationRest), function(value) {
|
|
16566
16593
|
return { "ts": true, "children": value };
|
|
16567
16594
|
});
|
|
16568
|
-
var DeclareElement$$ = [DeclareElement$0, DeclareElement$1];
|
|
16595
|
+
var DeclareElement$$ = [DeclareElement$0, DeclareElement$1, DeclareElement$2];
|
|
16569
16596
|
function DeclareElement(ctx, state2) {
|
|
16570
16597
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "DeclareElement", DeclareElement$$);
|
|
16571
16598
|
}
|
|
@@ -16835,7 +16862,7 @@ var TypeUnary$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$Q)((
|
|
|
16835
16862
|
if (!prefix.length && !suffix.length)
|
|
16836
16863
|
return t;
|
|
16837
16864
|
return {
|
|
16838
|
-
type: "
|
|
16865
|
+
type: "TypeUnary",
|
|
16839
16866
|
prefix,
|
|
16840
16867
|
suffix,
|
|
16841
16868
|
t,
|
|
@@ -16913,14 +16940,14 @@ var TypePrimary$6 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)
|
|
|
16913
16940
|
var TypePrimary$7 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_), TypeLiteral), function($skip, $loc, $0, $1, $2) {
|
|
16914
16941
|
var t = $2;
|
|
16915
16942
|
return {
|
|
16916
|
-
type: "
|
|
16943
|
+
type: "TypeLiteral",
|
|
16917
16944
|
t,
|
|
16918
16945
|
children: $0
|
|
16919
16946
|
};
|
|
16920
16947
|
});
|
|
16921
16948
|
var TypePrimary$8 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_), UnknownAlias), function($skip, $loc, $0, $1, $2) {
|
|
16922
16949
|
return {
|
|
16923
|
-
type: "
|
|
16950
|
+
type: "TypeIdentifier",
|
|
16924
16951
|
children: $0,
|
|
16925
16952
|
raw: $2.token,
|
|
16926
16953
|
args: void 0
|
|
@@ -16929,7 +16956,7 @@ var TypePrimary$8 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)
|
|
|
16929
16956
|
var TypePrimary$9 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_), Identifier, (0, import_lib3.$Q)((0, import_lib3.$S)(Dot, IdentifierName)), (0, import_lib3.$E)((0, import_lib3.$C)(TypeArguments, ImplicitTypeArguments))), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
16930
16957
|
var args = $4;
|
|
16931
16958
|
return {
|
|
16932
|
-
type: "
|
|
16959
|
+
type: "TypeIdentifier",
|
|
16933
16960
|
children: $0,
|
|
16934
16961
|
raw: [$2.name, ...$3.map(([dot, id]) => dot.token + id.name)].join(""),
|
|
16935
16962
|
args
|
|
@@ -16939,7 +16966,7 @@ var TypePrimary$10 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E
|
|
|
16939
16966
|
if (!$4)
|
|
16940
16967
|
return $skip;
|
|
16941
16968
|
return {
|
|
16942
|
-
type: "
|
|
16969
|
+
type: "TypeParenthesized",
|
|
16943
16970
|
children: [$1, $2, $4, $6, $7]
|
|
16944
16971
|
// omit AllowAll/RestoreAll
|
|
16945
16972
|
};
|
|
@@ -17305,16 +17332,20 @@ function TypeBinaryOp(ctx, state2) {
|
|
|
17305
17332
|
}
|
|
17306
17333
|
var TypeFunction$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)((0, import_lib3.$S)(Abstract, (0, import_lib3.$E)(_))), (0, import_lib3.$E)((0, import_lib3.$S)(New, (0, import_lib3.$E)(_))), Parameters, __, TypeArrowFunction, (0, import_lib3.$E)(ReturnType)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
17307
17334
|
var type = $6;
|
|
17308
|
-
const
|
|
17335
|
+
const children = [...$0];
|
|
17309
17336
|
if ($1 && !$2) {
|
|
17310
|
-
|
|
17337
|
+
children[1] = {
|
|
17311
17338
|
type: "Error",
|
|
17312
17339
|
message: "abstract function types must be constructors (abstract new)"
|
|
17313
17340
|
};
|
|
17314
17341
|
}
|
|
17315
17342
|
if (!type)
|
|
17316
|
-
|
|
17317
|
-
return
|
|
17343
|
+
children.push("void");
|
|
17344
|
+
return {
|
|
17345
|
+
type: "TypeFunction",
|
|
17346
|
+
children,
|
|
17347
|
+
ts: true
|
|
17348
|
+
};
|
|
17318
17349
|
});
|
|
17319
17350
|
function TypeFunction(ctx, state2) {
|
|
17320
17351
|
return (0, import_lib3.$EVENT)(ctx, state2, "TypeFunction", TypeFunction$0);
|
|
@@ -17496,17 +17527,22 @@ var CivetPrologueContent$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import
|
|
|
17496
17527
|
function CivetPrologueContent(ctx, state2) {
|
|
17497
17528
|
return (0, import_lib3.$EVENT)(ctx, state2, "CivetPrologueContent", CivetPrologueContent$0);
|
|
17498
17529
|
}
|
|
17499
|
-
var CivetOption$0 = (0, import_lib3.$TR)((0, import_lib3.$EXPECT)($R94, "CivetOption /\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([
|
|
17530
|
+
var CivetOption$0 = (0, import_lib3.$TR)((0, import_lib3.$EXPECT)($R94, "CivetOption /\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([\\p{ID_Continue}.,+-]*))?/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
|
|
17500
17531
|
const optionName = $2.replace(/-+([a-z]?)/g, (_2, l) => {
|
|
17501
17532
|
if (l)
|
|
17502
17533
|
return l.toUpperCase();
|
|
17503
17534
|
return "";
|
|
17504
17535
|
});
|
|
17505
17536
|
let value = $3 ? $4 : $1 === "-" ? false : true;
|
|
17506
|
-
|
|
17507
|
-
|
|
17508
|
-
|
|
17509
|
-
value
|
|
17537
|
+
switch (optionName) {
|
|
17538
|
+
case "tab":
|
|
17539
|
+
value = parseFloat(value);
|
|
17540
|
+
if (isNaN(value))
|
|
17541
|
+
value = 0;
|
|
17542
|
+
break;
|
|
17543
|
+
case "globals":
|
|
17544
|
+
value = value.split(",").filter(Boolean);
|
|
17545
|
+
break;
|
|
17510
17546
|
}
|
|
17511
17547
|
return [optionName, value];
|
|
17512
17548
|
});
|
|
@@ -17859,6 +17895,7 @@ var Reset$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'Reset ""'), fu
|
|
|
17859
17895
|
coffeeOf: false,
|
|
17860
17896
|
coffeePrototype: false,
|
|
17861
17897
|
defaultElement: "div",
|
|
17898
|
+
globals: [],
|
|
17862
17899
|
implicitReturns: true,
|
|
17863
17900
|
jsxCode: false,
|
|
17864
17901
|
objectIs: false,
|