@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/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,14 @@ 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.34 (2024-10-06, [diff](https://github.com/DanielXMoore/Civet/compare/v0.7.33...v0.7.34), [commits](https://github.com/DanielXMoore/Civet/commits/v0.7.34))
|
|
8
|
+
* Use new Civet icon in VSCode extension [[#1420](https://github.com/DanielXMoore/Civet/pull/1420)]
|
|
9
|
+
* `"civet globals"` directive to prevent some auto declarations [[#1423](https://github.com/DanielXMoore/Civet/pull/1423)]
|
|
10
|
+
* Fix arrow type with `?` postfix [[#1425](https://github.com/DanielXMoore/Civet/pull/1425)]
|
|
11
|
+
* Enable `worker.civet?worker` import in Vite [[#1426](https://github.com/DanielXMoore/Civet/pull/1426)]
|
|
12
|
+
* Fix missing semicolon in if/unless followed by else [[#1428](https://github.com/DanielXMoore/Civet/pull/1428)]
|
|
13
|
+
* Support `export default` in `declare` blocks [[#1427](https://github.com/DanielXMoore/Civet/pull/1427)]
|
|
14
|
+
|
|
7
15
|
## 0.7.33 (2024-10-05, [diff](https://github.com/DanielXMoore/Civet/compare/v0.7.32...v0.7.33), [commits](https://github.com/DanielXMoore/Civet/commits/v0.7.33))
|
|
8
16
|
* VSCode plugin ignores CoffeeScript files [[#1409](https://github.com/DanielXMoore/Civet/pull/1409)]
|
|
9
17
|
* Add syntax highlighting support for /d, /s and /v RegExp flags [[#1413](https://github.com/DanielXMoore/Civet/pull/1413)]
|
package/dist/browser.js
CHANGED
|
@@ -38,9 +38,9 @@ var Civet = (() => {
|
|
|
38
38
|
));
|
|
39
39
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
40
40
|
|
|
41
|
-
// node_modules/@danielx/hera/dist/machine.js
|
|
41
|
+
// node_modules/.pnpm/@danielx+hera@0.8.16/node_modules/@danielx/hera/dist/machine.js
|
|
42
42
|
var require_machine = __commonJS({
|
|
43
|
-
"node_modules/@danielx/hera/dist/machine.js"(exports, module) {
|
|
43
|
+
"node_modules/.pnpm/@danielx+hera@0.8.16/node_modules/@danielx/hera/dist/machine.js"(exports, module) {
|
|
44
44
|
"use strict";
|
|
45
45
|
var __defProp2 = Object.defineProperty;
|
|
46
46
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1094,12 +1094,11 @@ ${body}`;
|
|
|
1094
1094
|
]);
|
|
1095
1095
|
}
|
|
1096
1096
|
var typeNeedsNoParens = /* @__PURE__ */ new Set([
|
|
1097
|
-
"
|
|
1097
|
+
"TypeIdentifier",
|
|
1098
1098
|
"ImportType",
|
|
1099
|
-
"
|
|
1099
|
+
"TypeLiteral",
|
|
1100
1100
|
"TupleType",
|
|
1101
|
-
"
|
|
1102
|
-
"UnaryType"
|
|
1101
|
+
"TypeParenthesized"
|
|
1103
1102
|
]);
|
|
1104
1103
|
function parenthesizeType(type) {
|
|
1105
1104
|
if (typeNeedsNoParens.has(type.type)) {
|
|
@@ -1589,16 +1588,16 @@ ${body}`;
|
|
|
1589
1588
|
|
|
1590
1589
|
// source/parser/function.civet
|
|
1591
1590
|
function isVoidType(t) {
|
|
1592
|
-
return t?.type === "
|
|
1591
|
+
return t?.type === "TypeLiteral" && t.t.type === "VoidType";
|
|
1593
1592
|
}
|
|
1594
1593
|
function isPromiseVoidType(t) {
|
|
1595
|
-
return t?.type === "
|
|
1594
|
+
return t?.type === "TypeIdentifier" && t.raw === "Promise" && t.args?.types?.length === 1 && isVoidType(t.args.types[0]);
|
|
1596
1595
|
}
|
|
1597
1596
|
function isGeneratorVoidType(t) {
|
|
1598
|
-
return t?.type === "
|
|
1597
|
+
return t?.type === "TypeIdentifier" && (t.raw === "Iterator" || t.raw === "Generator") && t.args?.types?.length >= 2 && isVoidType(t.args.types[1]);
|
|
1599
1598
|
}
|
|
1600
1599
|
function isAsyncGeneratorVoidType(t) {
|
|
1601
|
-
return t?.type === "
|
|
1600
|
+
return t?.type === "TypeIdentifier" && (t.raw === "AsyncIterator" || t.raw === "AsyncGenerator") && t.args?.types?.length >= 2 && isVoidType(t.args.types[1]);
|
|
1602
1601
|
}
|
|
1603
1602
|
function implicitFunctionBlock(f) {
|
|
1604
1603
|
if (f.abstract || f.block || f.signature?.optional)
|
|
@@ -1796,14 +1795,13 @@ ${body}`;
|
|
|
1796
1795
|
if (isExit(exp)) {
|
|
1797
1796
|
return;
|
|
1798
1797
|
}
|
|
1798
|
+
exp = exp;
|
|
1799
1799
|
const outer = exp;
|
|
1800
|
-
|
|
1801
|
-
if (type === "LabelledStatement") {
|
|
1800
|
+
if (exp.type === "LabelledStatement") {
|
|
1802
1801
|
exp = exp.statement;
|
|
1803
|
-
({ type } = exp);
|
|
1804
1802
|
}
|
|
1805
1803
|
let ref4;
|
|
1806
|
-
switch (type) {
|
|
1804
|
+
switch (exp.type) {
|
|
1807
1805
|
case "BreakStatement":
|
|
1808
1806
|
case "ContinueStatement":
|
|
1809
1807
|
case "DebuggerStatement":
|
|
@@ -3805,9 +3803,6 @@ ${body}`;
|
|
|
3805
3803
|
}
|
|
3806
3804
|
} else {
|
|
3807
3805
|
const block = blockWithPrefix(blockPrefix, s.then);
|
|
3808
|
-
if (block.bare && e && !block.semicolon) {
|
|
3809
|
-
block.children.push(block.semicolon = ";");
|
|
3810
|
-
}
|
|
3811
3806
|
s.children = s.children.map(($2) => $2 === s.then ? block : $2);
|
|
3812
3807
|
s.then = block;
|
|
3813
3808
|
updateParentPointers(s);
|
|
@@ -4516,7 +4511,8 @@ ${body}`;
|
|
|
4516
4511
|
function findDecs(statements) {
|
|
4517
4512
|
const declarations = gatherNodes(statements, ($) => $.type === "Declaration");
|
|
4518
4513
|
const declarationNames = declarations.flatMap((d) => d.names);
|
|
4519
|
-
|
|
4514
|
+
const globals = getConfig().globals || [];
|
|
4515
|
+
return new Set(globals.concat(declarationNames));
|
|
4520
4516
|
}
|
|
4521
4517
|
function createConstLetDecs(statements, scopes, letOrConst) {
|
|
4522
4518
|
function findVarDecs(statements2, decs) {
|
|
@@ -5383,7 +5379,7 @@ ${js}`
|
|
|
5383
5379
|
function expressionizeTypeIf([ifOp, condition, t, e]) {
|
|
5384
5380
|
const children = [
|
|
5385
5381
|
"(",
|
|
5386
|
-
|
|
5382
|
+
trimFirstSpace(condition),
|
|
5387
5383
|
"?"
|
|
5388
5384
|
];
|
|
5389
5385
|
if (!xor(ifOp.negated, condition.negated)) {
|
|
@@ -5566,7 +5562,7 @@ ${js}`
|
|
|
5566
5562
|
[name, value] = [value, name];
|
|
5567
5563
|
}
|
|
5568
5564
|
if (!suppressPrefix) {
|
|
5569
|
-
value = prefix.concat(
|
|
5565
|
+
value = prefix.concat(trimFirstSpace(value));
|
|
5570
5566
|
}
|
|
5571
5567
|
if (wValue)
|
|
5572
5568
|
value.unshift(wValue);
|
|
@@ -5792,7 +5788,7 @@ ${js}`
|
|
|
5792
5788
|
if (part.name.type === "ComputedPropertyName") {
|
|
5793
5789
|
rest.push(part);
|
|
5794
5790
|
} else {
|
|
5795
|
-
parts.push([part.name, "={",
|
|
5791
|
+
parts.push([part.name, "={", trimFirstSpace(part.value), "}"]);
|
|
5796
5792
|
}
|
|
5797
5793
|
break;
|
|
5798
5794
|
case "SpreadProperty":
|
|
@@ -5817,7 +5813,7 @@ ${js}`
|
|
|
5817
5813
|
}
|
|
5818
5814
|
function makeGetterMethod(name, ws, value, returnType, block, kind = { token: "get" }, autoReturn = true) {
|
|
5819
5815
|
const { token } = kind;
|
|
5820
|
-
ws =
|
|
5816
|
+
ws = trimFirstSpace(ws);
|
|
5821
5817
|
let setVal;
|
|
5822
5818
|
const parameters = token === "get" ? {
|
|
5823
5819
|
type: "Parameters",
|
|
@@ -6178,7 +6174,7 @@ ${js}`
|
|
|
6178
6174
|
}
|
|
6179
6175
|
}
|
|
6180
6176
|
function processTypes(node) {
|
|
6181
|
-
return gatherRecursiveAll(node, (n) => n.type === "
|
|
6177
|
+
return gatherRecursiveAll(node, (n) => n.type === "TypeUnary").forEach((unary) => {
|
|
6182
6178
|
let last;
|
|
6183
6179
|
let count = 0;
|
|
6184
6180
|
let ref10;
|
|
@@ -6189,6 +6185,12 @@ ${js}`
|
|
|
6189
6185
|
if (!count) {
|
|
6190
6186
|
return;
|
|
6191
6187
|
}
|
|
6188
|
+
let ref11;
|
|
6189
|
+
if (unary.suffix.length || unary.prefix.length)
|
|
6190
|
+
ref11 = unary;
|
|
6191
|
+
else
|
|
6192
|
+
ref11 = unary.t;
|
|
6193
|
+
const t = ref11;
|
|
6192
6194
|
if (unary.parent?.type === "TypeTuple") {
|
|
6193
6195
|
if (count === 1) {
|
|
6194
6196
|
unary.suffix.push(last);
|
|
@@ -6197,18 +6199,22 @@ ${js}`
|
|
|
6197
6199
|
replaceNode(unary, [
|
|
6198
6200
|
getTrimmingSpace(unary),
|
|
6199
6201
|
"(",
|
|
6200
|
-
parenthesizeType(
|
|
6202
|
+
parenthesizeType(trimFirstSpace(t)),
|
|
6201
6203
|
" | null)",
|
|
6202
6204
|
last
|
|
6203
6205
|
]);
|
|
6204
6206
|
} else {
|
|
6205
|
-
replaceNode(unary,
|
|
6206
|
-
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
|
|
6211
|
-
|
|
6207
|
+
replaceNode(unary, {
|
|
6208
|
+
type: "TypeParenthesized",
|
|
6209
|
+
ts: true,
|
|
6210
|
+
children: [
|
|
6211
|
+
getTrimmingSpace(unary),
|
|
6212
|
+
"(",
|
|
6213
|
+
parenthesizeType(trimFirstSpace(t)),
|
|
6214
|
+
count === 1 ? " | undefined" : " | undefined | null",
|
|
6215
|
+
")"
|
|
6216
|
+
]
|
|
6217
|
+
});
|
|
6212
6218
|
}
|
|
6213
6219
|
});
|
|
6214
6220
|
}
|
|
@@ -6216,11 +6222,11 @@ ${js}`
|
|
|
6216
6222
|
gatherRecursiveAll(statements, ($7) => $7.type === "StatementExpression").forEach((_exp) => {
|
|
6217
6223
|
const exp = _exp;
|
|
6218
6224
|
const { statement } = exp;
|
|
6219
|
-
let
|
|
6225
|
+
let ref12;
|
|
6220
6226
|
switch (statement.type) {
|
|
6221
6227
|
case "IfStatement": {
|
|
6222
|
-
if (
|
|
6223
|
-
const expression =
|
|
6228
|
+
if (ref12 = expressionizeIfStatement(statement)) {
|
|
6229
|
+
const expression = ref12;
|
|
6224
6230
|
return replaceNode(statement, expression, exp);
|
|
6225
6231
|
} else {
|
|
6226
6232
|
return replaceNode(statement, wrapIIFE([["", statement]]), exp);
|
|
@@ -6448,8 +6454,8 @@ ${js}`
|
|
|
6448
6454
|
for (let i4 = 0, len3 = placeholders.length; i4 < len3; i4++) {
|
|
6449
6455
|
const placeholder = placeholders[i4];
|
|
6450
6456
|
typeSuffix ??= placeholder.typeSuffix;
|
|
6451
|
-
let
|
|
6452
|
-
replaceNode((
|
|
6457
|
+
let ref13;
|
|
6458
|
+
replaceNode((ref13 = placeholder.children)[ref13.length - 1], ref);
|
|
6453
6459
|
}
|
|
6454
6460
|
const { parent } = ancestor;
|
|
6455
6461
|
const body = maybeUnwrap(ancestor);
|
|
@@ -6466,16 +6472,16 @@ ${js}`
|
|
|
6466
6472
|
}
|
|
6467
6473
|
case "PipelineExpression": {
|
|
6468
6474
|
const i = findChildIndex(parent, ancestor);
|
|
6469
|
-
let
|
|
6475
|
+
let ref14;
|
|
6470
6476
|
if (i === 1) {
|
|
6471
|
-
|
|
6477
|
+
ref14 = ancestor === parent.children[i];
|
|
6472
6478
|
} else if (i === 2) {
|
|
6473
|
-
|
|
6479
|
+
ref14 = ancestor === parent.children[i][findChildIndex(parent.children[i], ancestor)][3];
|
|
6474
6480
|
} else {
|
|
6475
|
-
|
|
6481
|
+
ref14 = void 0;
|
|
6476
6482
|
}
|
|
6477
6483
|
;
|
|
6478
|
-
outer =
|
|
6484
|
+
outer = ref14;
|
|
6479
6485
|
break;
|
|
6480
6486
|
}
|
|
6481
6487
|
case "AssignmentExpression":
|
|
@@ -6490,9 +6496,9 @@ ${js}`
|
|
|
6490
6496
|
fnExp = makeLeftHandSideExpression(fnExp);
|
|
6491
6497
|
}
|
|
6492
6498
|
replaceNode(ancestor, fnExp, parent);
|
|
6493
|
-
let
|
|
6494
|
-
if (
|
|
6495
|
-
const ws =
|
|
6499
|
+
let ref15;
|
|
6500
|
+
if (ref15 = getTrimmingSpace(body)) {
|
|
6501
|
+
const ws = ref15;
|
|
6496
6502
|
inplaceInsertTrimmingSpace(body, "");
|
|
6497
6503
|
inplacePrepend(ws, fnExp);
|
|
6498
6504
|
}
|
|
@@ -6537,8 +6543,8 @@ ${js}`
|
|
|
6537
6543
|
}
|
|
6538
6544
|
];
|
|
6539
6545
|
}
|
|
6540
|
-
let
|
|
6541
|
-
if (Array.isArray(rest.delim) && (
|
|
6546
|
+
let ref16;
|
|
6547
|
+
if (Array.isArray(rest.delim) && (ref16 = rest.delim)[ref16.length - 1]?.token === ",") {
|
|
6542
6548
|
rest.delim = rest.delim.slice(0, -1);
|
|
6543
6549
|
rest.children = [...rest.children.slice(0, -1), rest.delim];
|
|
6544
6550
|
}
|
|
@@ -7302,6 +7308,7 @@ ${js}`
|
|
|
7302
7308
|
NamespaceDeclaration,
|
|
7303
7309
|
OptionalEquals,
|
|
7304
7310
|
TypeLexicalDeclaration,
|
|
7311
|
+
TypeLetOrConstDeclaration,
|
|
7305
7312
|
TypeDeclarationBinding,
|
|
7306
7313
|
InterfaceExtendsClause,
|
|
7307
7314
|
InterfaceExtendsTarget,
|
|
@@ -7795,7 +7802,7 @@ ${js}`
|
|
|
7795
7802
|
var $R91 = (0, import_lib3.$R)(new RegExp("#![^\\r\\n]*", "suy"));
|
|
7796
7803
|
var $R92 = (0, import_lib3.$R)(new RegExp("[\\t ]*", "suy"));
|
|
7797
7804
|
var $R93 = (0, import_lib3.$R)(new RegExp("[\\s]*", "suy"));
|
|
7798
|
-
var $R94 = (0, import_lib3.$R)(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([
|
|
7805
|
+
var $R94 = (0, import_lib3.$R)(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([\\p{ID_Continue}.,+-]*))?", "suy"));
|
|
7799
7806
|
var $R95 = (0, import_lib3.$R)(new RegExp("\\/\\/\\/[^\\r\\n]*", "suy"));
|
|
7800
7807
|
var $R96 = (0, import_lib3.$R)(new RegExp("(?=[ \\t\\r\\n\\/#]|$)", "suy"));
|
|
7801
7808
|
var $R97 = (0, import_lib3.$R)(new RegExp("\\r\\n|\\n|\\r|$", "suy"));
|
|
@@ -12732,6 +12739,14 @@ ${js}`
|
|
|
12732
12739
|
kind = { ...kind, token: "if" };
|
|
12733
12740
|
condition = negateCondition(condition);
|
|
12734
12741
|
}
|
|
12742
|
+
if (block.bare && e) {
|
|
12743
|
+
const semicolon = ";";
|
|
12744
|
+
block = {
|
|
12745
|
+
...block,
|
|
12746
|
+
semicolon,
|
|
12747
|
+
children: [...block.children, semicolon]
|
|
12748
|
+
};
|
|
12749
|
+
}
|
|
12735
12750
|
return {
|
|
12736
12751
|
type: "IfStatement",
|
|
12737
12752
|
children: [kind, ws, condition, block, e],
|
|
@@ -12745,6 +12760,13 @@ ${js}`
|
|
|
12745
12760
|
var clause = $1;
|
|
12746
12761
|
var block = $2;
|
|
12747
12762
|
var e = $3;
|
|
12763
|
+
if (block.bare && e) {
|
|
12764
|
+
block = {
|
|
12765
|
+
...block,
|
|
12766
|
+
semicolon: ";",
|
|
12767
|
+
children: [...block.children, ";"]
|
|
12768
|
+
};
|
|
12769
|
+
}
|
|
12748
12770
|
return {
|
|
12749
12771
|
type: "IfStatement",
|
|
12750
12772
|
children: [...clause.children, block, e],
|
|
@@ -16421,7 +16443,17 @@ ${js}`
|
|
|
16421
16443
|
function OptionalEquals(ctx, state2) {
|
|
16422
16444
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "OptionalEquals", OptionalEquals$$);
|
|
16423
16445
|
}
|
|
16424
|
-
var TypeLexicalDeclaration$0 =
|
|
16446
|
+
var TypeLexicalDeclaration$0 = TypeLetOrConstDeclaration;
|
|
16447
|
+
var TypeLexicalDeclaration$1 = (0, import_lib3.$S)(__, EnumDeclaration);
|
|
16448
|
+
var TypeLexicalDeclaration$2 = ClassSignature;
|
|
16449
|
+
var TypeLexicalDeclaration$3 = (0, import_lib3.$S)(Namespace, (0, import_lib3.$E)(_), IdentifierName, DeclareBlock);
|
|
16450
|
+
var TypeLexicalDeclaration$4 = (0, import_lib3.$S)(Module, _, StringLiteral, (0, import_lib3.$E)(DeclareBlock));
|
|
16451
|
+
var TypeLexicalDeclaration$5 = (0, import_lib3.$S)(Global, (0, import_lib3.$E)(DeclareBlock));
|
|
16452
|
+
var TypeLexicalDeclaration$$ = [TypeLexicalDeclaration$0, TypeLexicalDeclaration$1, TypeLexicalDeclaration$2, TypeLexicalDeclaration$3, TypeLexicalDeclaration$4, TypeLexicalDeclaration$5];
|
|
16453
|
+
function TypeLexicalDeclaration(ctx, state2) {
|
|
16454
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeLexicalDeclaration", TypeLexicalDeclaration$$);
|
|
16455
|
+
}
|
|
16456
|
+
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) {
|
|
16425
16457
|
var first = $3;
|
|
16426
16458
|
var rest = $4;
|
|
16427
16459
|
const names = first.names.concat(...rest.map((b) => b[2].names));
|
|
@@ -16432,14 +16464,8 @@ ${js}`
|
|
|
16432
16464
|
names
|
|
16433
16465
|
};
|
|
16434
16466
|
});
|
|
16435
|
-
|
|
16436
|
-
|
|
16437
|
-
var TypeLexicalDeclaration$3 = (0, import_lib3.$S)(Namespace, (0, import_lib3.$E)(_), IdentifierName, DeclareBlock);
|
|
16438
|
-
var TypeLexicalDeclaration$4 = (0, import_lib3.$S)(Module, _, StringLiteral, (0, import_lib3.$E)(DeclareBlock));
|
|
16439
|
-
var TypeLexicalDeclaration$5 = (0, import_lib3.$S)(Global, (0, import_lib3.$E)(DeclareBlock));
|
|
16440
|
-
var TypeLexicalDeclaration$$ = [TypeLexicalDeclaration$0, TypeLexicalDeclaration$1, TypeLexicalDeclaration$2, TypeLexicalDeclaration$3, TypeLexicalDeclaration$4, TypeLexicalDeclaration$5];
|
|
16441
|
-
function TypeLexicalDeclaration(ctx, state2) {
|
|
16442
|
-
return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeLexicalDeclaration", TypeLexicalDeclaration$$);
|
|
16467
|
+
function TypeLetOrConstDeclaration(ctx, state2) {
|
|
16468
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "TypeLetOrConstDeclaration", TypeLetOrConstDeclaration$0);
|
|
16443
16469
|
}
|
|
16444
16470
|
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) {
|
|
16445
16471
|
return {
|
|
@@ -16583,13 +16609,14 @@ ${js}`
|
|
|
16583
16609
|
function NestedDeclareElement(ctx, state2) {
|
|
16584
16610
|
return (0, import_lib3.$EVENT)(ctx, state2, "NestedDeclareElement", NestedDeclareElement$0);
|
|
16585
16611
|
}
|
|
16586
|
-
var DeclareElement$0 = (0, import_lib3.$
|
|
16612
|
+
var DeclareElement$0 = (0, import_lib3.$S)((0, import_lib3.$E)(Decorators), Export, __, Default, __, (0, import_lib3.$C)(Identifier, ClassSignature, InterfaceDeclaration));
|
|
16613
|
+
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) {
|
|
16587
16614
|
return { "ts": true, "children": value };
|
|
16588
16615
|
});
|
|
16589
|
-
var DeclareElement$
|
|
16616
|
+
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) {
|
|
16590
16617
|
return { "ts": true, "children": value };
|
|
16591
16618
|
});
|
|
16592
|
-
var DeclareElement$$ = [DeclareElement$0, DeclareElement$1];
|
|
16619
|
+
var DeclareElement$$ = [DeclareElement$0, DeclareElement$1, DeclareElement$2];
|
|
16593
16620
|
function DeclareElement(ctx, state2) {
|
|
16594
16621
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "DeclareElement", DeclareElement$$);
|
|
16595
16622
|
}
|
|
@@ -16859,7 +16886,7 @@ ${js}`
|
|
|
16859
16886
|
if (!prefix.length && !suffix.length)
|
|
16860
16887
|
return t;
|
|
16861
16888
|
return {
|
|
16862
|
-
type: "
|
|
16889
|
+
type: "TypeUnary",
|
|
16863
16890
|
prefix,
|
|
16864
16891
|
suffix,
|
|
16865
16892
|
t,
|
|
@@ -16937,14 +16964,14 @@ ${js}`
|
|
|
16937
16964
|
var TypePrimary$7 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_), TypeLiteral), function($skip, $loc, $0, $1, $2) {
|
|
16938
16965
|
var t = $2;
|
|
16939
16966
|
return {
|
|
16940
|
-
type: "
|
|
16967
|
+
type: "TypeLiteral",
|
|
16941
16968
|
t,
|
|
16942
16969
|
children: $0
|
|
16943
16970
|
};
|
|
16944
16971
|
});
|
|
16945
16972
|
var TypePrimary$8 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_), UnknownAlias), function($skip, $loc, $0, $1, $2) {
|
|
16946
16973
|
return {
|
|
16947
|
-
type: "
|
|
16974
|
+
type: "TypeIdentifier",
|
|
16948
16975
|
children: $0,
|
|
16949
16976
|
raw: $2.token,
|
|
16950
16977
|
args: void 0
|
|
@@ -16953,7 +16980,7 @@ ${js}`
|
|
|
16953
16980
|
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) {
|
|
16954
16981
|
var args = $4;
|
|
16955
16982
|
return {
|
|
16956
|
-
type: "
|
|
16983
|
+
type: "TypeIdentifier",
|
|
16957
16984
|
children: $0,
|
|
16958
16985
|
raw: [$2.name, ...$3.map(([dot, id]) => dot.token + id.name)].join(""),
|
|
16959
16986
|
args
|
|
@@ -16963,7 +16990,7 @@ ${js}`
|
|
|
16963
16990
|
if (!$4)
|
|
16964
16991
|
return $skip;
|
|
16965
16992
|
return {
|
|
16966
|
-
type: "
|
|
16993
|
+
type: "TypeParenthesized",
|
|
16967
16994
|
children: [$1, $2, $4, $6, $7]
|
|
16968
16995
|
// omit AllowAll/RestoreAll
|
|
16969
16996
|
};
|
|
@@ -17329,16 +17356,20 @@ ${js}`
|
|
|
17329
17356
|
}
|
|
17330
17357
|
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) {
|
|
17331
17358
|
var type = $6;
|
|
17332
|
-
const
|
|
17359
|
+
const children = [...$0];
|
|
17333
17360
|
if ($1 && !$2) {
|
|
17334
|
-
|
|
17361
|
+
children[1] = {
|
|
17335
17362
|
type: "Error",
|
|
17336
17363
|
message: "abstract function types must be constructors (abstract new)"
|
|
17337
17364
|
};
|
|
17338
17365
|
}
|
|
17339
17366
|
if (!type)
|
|
17340
|
-
|
|
17341
|
-
return
|
|
17367
|
+
children.push("void");
|
|
17368
|
+
return {
|
|
17369
|
+
type: "TypeFunction",
|
|
17370
|
+
children,
|
|
17371
|
+
ts: true
|
|
17372
|
+
};
|
|
17342
17373
|
});
|
|
17343
17374
|
function TypeFunction(ctx, state2) {
|
|
17344
17375
|
return (0, import_lib3.$EVENT)(ctx, state2, "TypeFunction", TypeFunction$0);
|
|
@@ -17520,17 +17551,22 @@ ${js}`
|
|
|
17520
17551
|
function CivetPrologueContent(ctx, state2) {
|
|
17521
17552
|
return (0, import_lib3.$EVENT)(ctx, state2, "CivetPrologueContent", CivetPrologueContent$0);
|
|
17522
17553
|
}
|
|
17523
|
-
var CivetOption$0 = (0, import_lib3.$TR)((0, import_lib3.$EXPECT)($R94, "CivetOption /\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([
|
|
17554
|
+
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) {
|
|
17524
17555
|
const optionName = $2.replace(/-+([a-z]?)/g, (_2, l) => {
|
|
17525
17556
|
if (l)
|
|
17526
17557
|
return l.toUpperCase();
|
|
17527
17558
|
return "";
|
|
17528
17559
|
});
|
|
17529
17560
|
let value = $3 ? $4 : $1 === "-" ? false : true;
|
|
17530
|
-
|
|
17531
|
-
|
|
17532
|
-
|
|
17533
|
-
value
|
|
17561
|
+
switch (optionName) {
|
|
17562
|
+
case "tab":
|
|
17563
|
+
value = parseFloat(value);
|
|
17564
|
+
if (isNaN(value))
|
|
17565
|
+
value = 0;
|
|
17566
|
+
break;
|
|
17567
|
+
case "globals":
|
|
17568
|
+
value = value.split(",").filter(Boolean);
|
|
17569
|
+
break;
|
|
17534
17570
|
}
|
|
17535
17571
|
return [optionName, value];
|
|
17536
17572
|
});
|
|
@@ -17883,6 +17919,7 @@ ${js}`
|
|
|
17883
17919
|
coffeeOf: false,
|
|
17884
17920
|
coffeePrototype: false,
|
|
17885
17921
|
defaultElement: "div",
|
|
17922
|
+
globals: [],
|
|
17886
17923
|
implicitReturns: true,
|
|
17887
17924
|
jsxCode: false,
|
|
17888
17925
|
objectIs: false,
|