@danielx/civet 0.7.27 → 0.7.29
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 +12 -0
- package/dist/browser.js +616 -160
- package/dist/main.js +616 -160
- package/dist/main.mjs +616 -160
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
package/dist/main.mjs
CHANGED
|
@@ -60,7 +60,7 @@ var require_machine = __commonJS({
|
|
|
60
60
|
$N: () => $N2,
|
|
61
61
|
$P: () => $P2,
|
|
62
62
|
$Q: () => $Q2,
|
|
63
|
-
$R: () => $
|
|
63
|
+
$R: () => $R100,
|
|
64
64
|
$R$0: () => $R$02,
|
|
65
65
|
$S: () => $S2,
|
|
66
66
|
$T: () => $T2,
|
|
@@ -97,7 +97,7 @@ var require_machine = __commonJS({
|
|
|
97
97
|
return;
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
|
-
function $
|
|
100
|
+
function $R100(regExp) {
|
|
101
101
|
return function(_ctx, state2) {
|
|
102
102
|
const { input, pos } = state2;
|
|
103
103
|
regExp.lastIndex = state2.pos;
|
|
@@ -491,6 +491,7 @@ __export(lib_exports, {
|
|
|
491
491
|
addPostfixStatement: () => addPostfixStatement,
|
|
492
492
|
adjustBindingElements: () => adjustBindingElements,
|
|
493
493
|
adjustIndexAccess: () => adjustIndexAccess,
|
|
494
|
+
append: () => append,
|
|
494
495
|
attachPostfixStatementAsExpression: () => attachPostfixStatementAsExpression,
|
|
495
496
|
blockWithPrefix: () => blockWithPrefix,
|
|
496
497
|
convertNamedImportsToObject: () => convertNamedImportsToObject,
|
|
@@ -779,7 +780,7 @@ function getTrimmingSpace(target) {
|
|
|
779
780
|
return;
|
|
780
781
|
}
|
|
781
782
|
function prepend(prefix, node) {
|
|
782
|
-
if (!(prefix && prefix
|
|
783
|
+
if (!prefix || Array.isArray(prefix) && len(prefix, 0)) {
|
|
783
784
|
return node;
|
|
784
785
|
}
|
|
785
786
|
if (Array.isArray(node)) {
|
|
@@ -793,6 +794,21 @@ function prepend(prefix, node) {
|
|
|
793
794
|
return [prefix, node];
|
|
794
795
|
}
|
|
795
796
|
}
|
|
797
|
+
function append(node, suffix) {
|
|
798
|
+
if (!suffix || Array.isArray(suffix) && len(suffix, 0)) {
|
|
799
|
+
return node;
|
|
800
|
+
}
|
|
801
|
+
if (Array.isArray(node)) {
|
|
802
|
+
return [...node, suffix];
|
|
803
|
+
} else if (isParent(node)) {
|
|
804
|
+
return {
|
|
805
|
+
...node,
|
|
806
|
+
children: [...node.children, suffix]
|
|
807
|
+
};
|
|
808
|
+
} else {
|
|
809
|
+
return [node, suffix];
|
|
810
|
+
}
|
|
811
|
+
}
|
|
796
812
|
function inplacePrepend(prefix, node) {
|
|
797
813
|
if (!prefix) {
|
|
798
814
|
return;
|
|
@@ -3031,12 +3047,14 @@ function getPatternConditions(pattern, ref, conditions = []) {
|
|
|
3031
3047
|
});
|
|
3032
3048
|
const { blockPrefix } = pattern;
|
|
3033
3049
|
if (blockPrefix) {
|
|
3034
|
-
const postElements = blockPrefix.children[1]
|
|
3050
|
+
const postElements = blockPrefix.children[1];
|
|
3051
|
+
const { length: postLength } = postElements;
|
|
3035
3052
|
postElements.forEach(({ children: [, e] }, i) => {
|
|
3036
3053
|
const subRef = [ref, "[", ref, ".length - ", (postLength + i).toString(), "]"];
|
|
3037
3054
|
return getPatternConditions(e, subRef, conditions);
|
|
3038
3055
|
});
|
|
3039
3056
|
}
|
|
3057
|
+
;
|
|
3040
3058
|
break;
|
|
3041
3059
|
}
|
|
3042
3060
|
case "ObjectBindingPattern": {
|
|
@@ -3044,34 +3062,46 @@ function getPatternConditions(pattern, ref, conditions = []) {
|
|
|
3044
3062
|
["typeof ", ref, " === 'object'"],
|
|
3045
3063
|
[ref, " != null"]
|
|
3046
3064
|
);
|
|
3047
|
-
pattern.properties.
|
|
3065
|
+
for (let ref1 = pattern.properties, i4 = 0, len3 = ref1.length; i4 < len3; i4++) {
|
|
3066
|
+
const p = ref1[i4];
|
|
3048
3067
|
switch (p.type) {
|
|
3049
3068
|
case "PinProperty":
|
|
3050
3069
|
case "BindingProperty": {
|
|
3051
3070
|
const { name, value } = p;
|
|
3052
3071
|
let subRef;
|
|
3053
3072
|
switch (name.type) {
|
|
3054
|
-
case "ComputedPropertyName":
|
|
3073
|
+
case "ComputedPropertyName": {
|
|
3055
3074
|
conditions.push([name.expression, " in ", ref]);
|
|
3056
3075
|
subRef = [ref, name];
|
|
3057
3076
|
break;
|
|
3077
|
+
}
|
|
3058
3078
|
case "Literal":
|
|
3059
3079
|
case "StringLiteral":
|
|
3060
|
-
case "NumericLiteral":
|
|
3080
|
+
case "NumericLiteral": {
|
|
3061
3081
|
conditions.push([name, " in ", ref]);
|
|
3062
3082
|
subRef = [ref, "[", name, "]"];
|
|
3063
3083
|
break;
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3084
|
+
}
|
|
3085
|
+
case "Identifier": {
|
|
3086
|
+
conditions.push(["'", name.name, "' in ", ref]);
|
|
3087
|
+
subRef = [ref, ".", name.name];
|
|
3088
|
+
break;
|
|
3089
|
+
}
|
|
3090
|
+
case "AtBinding": {
|
|
3091
|
+
conditions.push(["'", name.ref.id, "' in ", ref]);
|
|
3092
|
+
subRef = [ref, ".", name.ref.id];
|
|
3093
|
+
break;
|
|
3094
|
+
}
|
|
3067
3095
|
}
|
|
3068
3096
|
if (value) {
|
|
3069
3097
|
getPatternConditions(value, subRef, conditions);
|
|
3070
3098
|
}
|
|
3099
|
+
;
|
|
3071
3100
|
break;
|
|
3072
3101
|
}
|
|
3073
3102
|
}
|
|
3074
|
-
}
|
|
3103
|
+
}
|
|
3104
|
+
;
|
|
3075
3105
|
break;
|
|
3076
3106
|
}
|
|
3077
3107
|
case "ConditionFragment": {
|
|
@@ -3095,22 +3125,22 @@ function getPatternConditions(pattern, ref, conditions = []) {
|
|
|
3095
3125
|
);
|
|
3096
3126
|
break;
|
|
3097
3127
|
}
|
|
3098
|
-
case "PinPattern":
|
|
3128
|
+
case "PinPattern": {
|
|
3099
3129
|
conditions.push([
|
|
3100
3130
|
ref,
|
|
3101
3131
|
" === ",
|
|
3102
3132
|
pattern.expression
|
|
3103
3133
|
]);
|
|
3104
3134
|
break;
|
|
3105
|
-
|
|
3135
|
+
}
|
|
3136
|
+
case "Literal": {
|
|
3106
3137
|
conditions.push([
|
|
3107
3138
|
ref,
|
|
3108
3139
|
" === ",
|
|
3109
3140
|
pattern
|
|
3110
3141
|
]);
|
|
3111
3142
|
break;
|
|
3112
|
-
|
|
3113
|
-
break;
|
|
3143
|
+
}
|
|
3114
3144
|
}
|
|
3115
3145
|
return conditions;
|
|
3116
3146
|
}
|
|
@@ -3243,26 +3273,24 @@ function nonMatcherBindings(pattern) {
|
|
|
3243
3273
|
function aggregateDuplicateBindings(bindings) {
|
|
3244
3274
|
const props = gatherRecursiveAll(bindings, ($10) => $10.type === "BindingProperty");
|
|
3245
3275
|
const arrayBindings = gatherRecursiveAll(bindings, ($11) => $11.type === "ArrayBindingPattern");
|
|
3246
|
-
arrayBindings.
|
|
3247
|
-
const { elements } =
|
|
3248
|
-
|
|
3276
|
+
for (let i5 = 0, len4 = arrayBindings.length; i5 < len4; i5++) {
|
|
3277
|
+
const { elements } = arrayBindings[i5];
|
|
3278
|
+
for (let i6 = 0, len5 = elements.length; i6 < len5; i6++) {
|
|
3279
|
+
const element = elements[i6];
|
|
3249
3280
|
if (Array.isArray(element)) {
|
|
3250
3281
|
const [, e] = element;
|
|
3251
3282
|
if (e.type === "Identifier") {
|
|
3252
|
-
|
|
3283
|
+
props.push(e);
|
|
3253
3284
|
} else if (e.type === "BindingRestElement") {
|
|
3254
|
-
|
|
3285
|
+
props.push(e);
|
|
3255
3286
|
}
|
|
3256
|
-
;
|
|
3257
|
-
return;
|
|
3258
3287
|
}
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
});
|
|
3262
|
-
});
|
|
3288
|
+
}
|
|
3289
|
+
}
|
|
3263
3290
|
const declarations = [];
|
|
3264
3291
|
const propsGroupedByName = /* @__PURE__ */ new Map();
|
|
3265
|
-
for (
|
|
3292
|
+
for (let i7 = 0, len6 = props.length; i7 < len6; i7++) {
|
|
3293
|
+
const p = props[i7];
|
|
3266
3294
|
const { name, value } = p;
|
|
3267
3295
|
let m1;
|
|
3268
3296
|
if (m1 = value?.type, m1 === "ArrayBindingPattern" || m1 === "ObjectBindingPattern") {
|
|
@@ -3284,9 +3312,10 @@ function aggregateDuplicateBindings(bindings) {
|
|
|
3284
3312
|
pos: 0,
|
|
3285
3313
|
input: key
|
|
3286
3314
|
})) {
|
|
3287
|
-
shared.
|
|
3288
|
-
|
|
3289
|
-
|
|
3315
|
+
for (let i8 = 0, len7 = shared.length; i8 < len7; i8++) {
|
|
3316
|
+
const p = shared[i8];
|
|
3317
|
+
aliasBinding(p, makeRef(`_${key}`, key));
|
|
3318
|
+
}
|
|
3290
3319
|
return;
|
|
3291
3320
|
}
|
|
3292
3321
|
if (shared.length === 1) {
|
|
@@ -5164,9 +5193,8 @@ function expressionizeIfStatement(statement) {
|
|
|
5164
5193
|
children
|
|
5165
5194
|
});
|
|
5166
5195
|
}
|
|
5167
|
-
function expressionizeTypeIf([
|
|
5196
|
+
function expressionizeTypeIf([ifOp, condition, t, e]) {
|
|
5168
5197
|
const children = [
|
|
5169
|
-
ws,
|
|
5170
5198
|
"(",
|
|
5171
5199
|
insertTrimmingSpace(condition, ""),
|
|
5172
5200
|
"?"
|
|
@@ -7056,11 +7084,15 @@ var grammar = {
|
|
|
7056
7084
|
InlineJSXMemberExpressionRest,
|
|
7057
7085
|
InlineJSXPrimaryExpression,
|
|
7058
7086
|
JSXMixedChildren,
|
|
7087
|
+
JSXSameLineChildren,
|
|
7059
7088
|
JSXChildren,
|
|
7060
7089
|
JSXNestedChildren,
|
|
7061
7090
|
JSXEOS,
|
|
7062
7091
|
JSXNested,
|
|
7063
7092
|
JSXChild,
|
|
7093
|
+
JSXChildForcedCode,
|
|
7094
|
+
JSXChildForcedNoCode,
|
|
7095
|
+
JSXChildGeneral,
|
|
7064
7096
|
JSXComment,
|
|
7065
7097
|
JSXCommentContent,
|
|
7066
7098
|
JSXText,
|
|
@@ -7068,7 +7100,8 @@ var grammar = {
|
|
|
7068
7100
|
IndentedJSXChildExpression,
|
|
7069
7101
|
NestedJSXChildExpression,
|
|
7070
7102
|
JSXAngleChild,
|
|
7071
|
-
|
|
7103
|
+
JSXCodeChild,
|
|
7104
|
+
JSXCodeChildExpression,
|
|
7072
7105
|
UsingDeclaration,
|
|
7073
7106
|
UsingBinding,
|
|
7074
7107
|
UsingJSModeError,
|
|
@@ -7118,6 +7151,8 @@ var grammar = {
|
|
|
7118
7151
|
TypePredicate,
|
|
7119
7152
|
Type,
|
|
7120
7153
|
TypeBinary,
|
|
7154
|
+
NestedTypeBinaryChain,
|
|
7155
|
+
NestedTypeBinary,
|
|
7121
7156
|
TypeUnary,
|
|
7122
7157
|
TypeUnarySuffix,
|
|
7123
7158
|
TypeUnaryOp,
|
|
@@ -7126,13 +7161,21 @@ var grammar = {
|
|
|
7126
7161
|
TypePrimary,
|
|
7127
7162
|
ImportType,
|
|
7128
7163
|
TypeTuple,
|
|
7129
|
-
|
|
7164
|
+
TypeTupleContent,
|
|
7165
|
+
TypeElementListWithIndentedApplicationForbidden,
|
|
7166
|
+
TypeElementList,
|
|
7130
7167
|
TypeElement,
|
|
7131
|
-
|
|
7132
|
-
|
|
7168
|
+
NestedTypeElementList,
|
|
7169
|
+
NestedTypeElement,
|
|
7170
|
+
NestedTypeBulletedTuple,
|
|
7171
|
+
TypeBulletedTuple,
|
|
7172
|
+
NestedTypeBullet,
|
|
7173
|
+
TypeBullet,
|
|
7174
|
+
TypeWithPostfix,
|
|
7133
7175
|
TypeConditional,
|
|
7134
7176
|
TypeCondition,
|
|
7135
7177
|
TypeIfThenElse,
|
|
7178
|
+
TypeIfClause,
|
|
7136
7179
|
TypeElse,
|
|
7137
7180
|
TypeBlock,
|
|
7138
7181
|
TypeTemplateSubstitution,
|
|
@@ -7147,6 +7190,14 @@ var grammar = {
|
|
|
7147
7190
|
TypeFunction,
|
|
7148
7191
|
TypeArrowFunction,
|
|
7149
7192
|
TypeArguments,
|
|
7193
|
+
ImplicitTypeArguments,
|
|
7194
|
+
TypeApplicationStart,
|
|
7195
|
+
ForbiddenImplicitTypeCalls,
|
|
7196
|
+
TypeArgumentList,
|
|
7197
|
+
NestedTypeArgumentList,
|
|
7198
|
+
NestedTypeArgument,
|
|
7199
|
+
SingleLineTypeArgumentList,
|
|
7200
|
+
TypeArgumentDelimited,
|
|
7150
7201
|
TypeArgument,
|
|
7151
7202
|
TypeArgumentDelimiter,
|
|
7152
7203
|
TypeParameters,
|
|
@@ -7175,6 +7226,8 @@ var grammar = {
|
|
|
7175
7226
|
InsertCloseBrace,
|
|
7176
7227
|
InsertOpenBracket,
|
|
7177
7228
|
InsertCloseBracket,
|
|
7229
|
+
InsertOpenAngleBracket,
|
|
7230
|
+
InsertCloseAngleBracket,
|
|
7178
7231
|
InsertComma,
|
|
7179
7232
|
InsertSpaceEquals,
|
|
7180
7233
|
InsertConst,
|
|
@@ -7201,6 +7254,8 @@ var grammar = {
|
|
|
7201
7254
|
CoffeeNotEnabled,
|
|
7202
7255
|
CoffeeOfEnabled,
|
|
7203
7256
|
CoffeePrototypeEnabled,
|
|
7257
|
+
JSXCodeNestedEnabled,
|
|
7258
|
+
JSXCodeSameLineEnabled,
|
|
7204
7259
|
ObjectIsEnabled,
|
|
7205
7260
|
Reset,
|
|
7206
7261
|
Init,
|
|
@@ -7214,7 +7269,8 @@ var grammar = {
|
|
|
7214
7269
|
IndentedFurther,
|
|
7215
7270
|
IndentedAtLeast,
|
|
7216
7271
|
NotDedented,
|
|
7217
|
-
Dedented
|
|
7272
|
+
Dedented,
|
|
7273
|
+
PushExtraIndent1
|
|
7218
7274
|
};
|
|
7219
7275
|
var $L0 = (0, import_lib3.$L)("");
|
|
7220
7276
|
var $L1 = (0, import_lib3.$L)("{");
|
|
@@ -7461,7 +7517,7 @@ var $R2 = (0, import_lib3.$R)(new RegExp("(as|of|satisfies|then|when|implements|
|
|
|
7461
7517
|
var $R3 = (0, import_lib3.$R)(new RegExp("[0-9]", "suy"));
|
|
7462
7518
|
var $R4 = (0, import_lib3.$R)(new RegExp("(?!\\p{ID_Start}|[_$0-9(\\[{])", "suy"));
|
|
7463
7519
|
var $R5 = (0, import_lib3.$R)(new RegExp("[ \\t]", "suy"));
|
|
7464
|
-
var $R6 = (0, import_lib3.$R)(new RegExp("\\p{ID_Continue}|[\\u200C\\u200D$.#{]", "suy"));
|
|
7520
|
+
var $R6 = (0, import_lib3.$R)(new RegExp("\\p{ID_Continue}|[\\u200C\\u200D$.#{=]", "suy"));
|
|
7465
7521
|
var $R7 = (0, import_lib3.$R)(new RegExp("[&=]", "suy"));
|
|
7466
7522
|
var $R8 = (0, import_lib3.$R)(new RegExp("(?=['\"`])", "suy"));
|
|
7467
7523
|
var $R9 = (0, import_lib3.$R)(new RegExp("(?=[\\/?])", "suy"));
|
|
@@ -7545,14 +7601,16 @@ var $R86 = (0, import_lib3.$R)(new RegExp("(?:-[^-]|[^-]*)*", "suy"));
|
|
|
7545
7601
|
var $R87 = (0, import_lib3.$R)(new RegExp("[^{}<>\\r\\n]+", "suy"));
|
|
7546
7602
|
var $R88 = (0, import_lib3.$R)(new RegExp("[+-]?", "suy"));
|
|
7547
7603
|
var $R89 = (0, import_lib3.$R)(new RegExp("(?=if|unless)", "suy"));
|
|
7548
|
-
var $R90 = (0, import_lib3.$R)(new RegExp("
|
|
7549
|
-
var $R91 = (0, import_lib3.$R)(new RegExp("[\\
|
|
7550
|
-
var $R92 = (0, import_lib3.$R)(new RegExp("[\\
|
|
7551
|
-
var $R93 = (0, import_lib3.$R)(new RegExp("
|
|
7552
|
-
var $R94 = (0, import_lib3.$R)(new RegExp("
|
|
7553
|
-
var $R95 = (0, import_lib3.$R)(new RegExp("(
|
|
7554
|
-
var $R96 = (0, import_lib3.$R)(new RegExp("
|
|
7555
|
-
var $R97 = (0, import_lib3.$R)(new RegExp("[
|
|
7604
|
+
var $R90 = (0, import_lib3.$R)(new RegExp("[|&<!=\\-\u21D2\u2192]", "suy"));
|
|
7605
|
+
var $R91 = (0, import_lib3.$R)(new RegExp("(extends|not|is)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
|
|
7606
|
+
var $R92 = (0, import_lib3.$R)(new RegExp("#![^\\r\\n]*", "suy"));
|
|
7607
|
+
var $R93 = (0, import_lib3.$R)(new RegExp("[\\t ]*", "suy"));
|
|
7608
|
+
var $R94 = (0, import_lib3.$R)(new RegExp("[\\s]*", "suy"));
|
|
7609
|
+
var $R95 = (0, import_lib3.$R)(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?", "suy"));
|
|
7610
|
+
var $R96 = (0, import_lib3.$R)(new RegExp("\\/\\/\\/[^\\r\\n]*", "suy"));
|
|
7611
|
+
var $R97 = (0, import_lib3.$R)(new RegExp("(?=[ \\t\\r\\n\\/#]|$)", "suy"));
|
|
7612
|
+
var $R98 = (0, import_lib3.$R)(new RegExp("\\r\\n|\\n|\\r|$", "suy"));
|
|
7613
|
+
var $R99 = (0, import_lib3.$R)(new RegExp("[^]*", "suy"));
|
|
7556
7614
|
var Program$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Reset, Init, (0, import_lib3.$E)(EOS), TopLevelStatements, __), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
7557
7615
|
var reset = $1;
|
|
7558
7616
|
var init = $2;
|
|
@@ -7739,6 +7797,9 @@ var ImplicitArguments$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(ApplicationSt
|
|
|
7739
7797
|
var close = $5;
|
|
7740
7798
|
if (skipImplicitArguments(args))
|
|
7741
7799
|
return $skip;
|
|
7800
|
+
let last = args[args.length - 1];
|
|
7801
|
+
if (last?.token === "," && last.implicit)
|
|
7802
|
+
args = args.slice(0, -1);
|
|
7742
7803
|
return {
|
|
7743
7804
|
type: "Call",
|
|
7744
7805
|
args,
|
|
@@ -8093,7 +8154,7 @@ var NWTypePostfix$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(As, _, Tuple), fu
|
|
|
8093
8154
|
children: [{ $loc: $1.$loc, token: "satisfies" }, $2, $3]
|
|
8094
8155
|
};
|
|
8095
8156
|
});
|
|
8096
|
-
var NWTypePostfix$1 = (0, import_lib3.$TS)((0, import_lib3.$S)(As, (0, import_lib3.$E)(ExclamationPoint), Type), function($skip, $loc, $0, $1, $2, $3) {
|
|
8157
|
+
var NWTypePostfix$1 = (0, import_lib3.$TS)((0, import_lib3.$S)(As, (0, import_lib3.$E)(ExclamationPoint), (0, import_lib3.$C)(Type, (0, import_lib3.$S)(__, Const))), function($skip, $loc, $0, $1, $2, $3) {
|
|
8097
8158
|
var as = $1;
|
|
8098
8159
|
var ex = $2;
|
|
8099
8160
|
var type = $3;
|
|
@@ -8447,7 +8508,7 @@ var ParenthesizedExpression$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(OpenPar
|
|
|
8447
8508
|
function ParenthesizedExpression(ctx, state2) {
|
|
8448
8509
|
return (0, import_lib3.$EVENT)(ctx, state2, "ParenthesizedExpression", ParenthesizedExpression$0);
|
|
8449
8510
|
}
|
|
8450
|
-
var Placeholder$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Dot, (0, import_lib3.$N)((0, import_lib3.$EXPECT)($R6, "Placeholder /\\p{ID_Continue}|[\\u200C\\u200D$.#{]/")), (0, import_lib3.$E)(PlaceholderTypeSuffix)), function($skip, $loc, $0, $1, $2, $3) {
|
|
8511
|
+
var Placeholder$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Dot, (0, import_lib3.$N)((0, import_lib3.$EXPECT)($R6, "Placeholder /\\p{ID_Continue}|[\\u200C\\u200D$.#{=]/")), (0, import_lib3.$E)(PlaceholderTypeSuffix)), function($skip, $loc, $0, $1, $2, $3) {
|
|
8451
8512
|
var dot = $1;
|
|
8452
8513
|
var typeSuffix = $3;
|
|
8453
8514
|
return {
|
|
@@ -9400,18 +9461,18 @@ var NonEmptyParameters$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_l
|
|
|
9400
9461
|
var params = $3;
|
|
9401
9462
|
var close = $4;
|
|
9402
9463
|
let tt, before = [], rest, after = [], errors = [];
|
|
9403
|
-
function
|
|
9464
|
+
function append2(p) {
|
|
9404
9465
|
(rest ? after : before).push(p);
|
|
9405
9466
|
}
|
|
9406
9467
|
for (const param of params) {
|
|
9407
9468
|
switch (param.type) {
|
|
9408
9469
|
case "ThisType":
|
|
9409
9470
|
if (tt) {
|
|
9410
|
-
|
|
9471
|
+
append2({
|
|
9411
9472
|
type: "Error",
|
|
9412
9473
|
message: "Only one typed this parameter is allowed"
|
|
9413
9474
|
});
|
|
9414
|
-
|
|
9475
|
+
append2(param);
|
|
9415
9476
|
} else {
|
|
9416
9477
|
tt = trimFirstSpace(param);
|
|
9417
9478
|
if (before.length || rest) {
|
|
@@ -9429,17 +9490,17 @@ var NonEmptyParameters$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_l
|
|
|
9429
9490
|
break;
|
|
9430
9491
|
case "FunctionRestParameter":
|
|
9431
9492
|
if (rest) {
|
|
9432
|
-
|
|
9493
|
+
append2({
|
|
9433
9494
|
type: "Error",
|
|
9434
9495
|
message: "Only one rest parameter is allowed"
|
|
9435
9496
|
});
|
|
9436
|
-
|
|
9497
|
+
append2(param);
|
|
9437
9498
|
} else {
|
|
9438
9499
|
rest = param;
|
|
9439
9500
|
}
|
|
9440
9501
|
break;
|
|
9441
9502
|
default:
|
|
9442
|
-
|
|
9503
|
+
append2(param);
|
|
9443
9504
|
}
|
|
9444
9505
|
}
|
|
9445
9506
|
const names = before.flatMap((p) => p.names);
|
|
@@ -10944,15 +11005,10 @@ var NestedElement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Nested, ElementLi
|
|
|
10944
11005
|
if (!length)
|
|
10945
11006
|
return $skip;
|
|
10946
11007
|
return list.map((e, i) => {
|
|
10947
|
-
if (i === 0
|
|
10948
|
-
|
|
10949
|
-
|
|
10950
|
-
|
|
10951
|
-
return { ...e, children: [indent, ...e.children] };
|
|
10952
|
-
}
|
|
10953
|
-
if (i === length - 1) {
|
|
10954
|
-
return { ...e, children: [...e.children, delimiter] };
|
|
10955
|
-
}
|
|
11008
|
+
if (i === 0)
|
|
11009
|
+
e = prepend(indent, e);
|
|
11010
|
+
if (i === length - 1)
|
|
11011
|
+
e = append(e, delimiter);
|
|
10956
11012
|
return e;
|
|
10957
11013
|
});
|
|
10958
11014
|
});
|
|
@@ -10982,19 +11038,13 @@ var ElementList$0 = (0, import_lib3.$T)((0, import_lib3.$S)(BulletedArray), func
|
|
|
10982
11038
|
var ElementList$1 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$N)(EOS), ArrayElementExpression, (0, import_lib3.$Q)(ElementListRest)), function($skip, $loc, $0, $1, $2, $3) {
|
|
10983
11039
|
var first = $2;
|
|
10984
11040
|
var rest = $3;
|
|
10985
|
-
if (rest.length)
|
|
10986
|
-
return [
|
|
10987
|
-
|
|
10988
|
-
|
|
10989
|
-
|
|
10990
|
-
|
|
10991
|
-
|
|
10992
|
-
...e,
|
|
10993
|
-
children: [...e.children, delim]
|
|
10994
|
-
};
|
|
10995
|
-
}));
|
|
10996
|
-
}
|
|
10997
|
-
return [first];
|
|
11041
|
+
if (!rest.length)
|
|
11042
|
+
return [first];
|
|
11043
|
+
return [
|
|
11044
|
+
append(first, rest[0][0])
|
|
11045
|
+
].concat(
|
|
11046
|
+
rest.map(([_2, e], i) => append(e, rest[i + 1]?.[0]))
|
|
11047
|
+
);
|
|
10998
11048
|
});
|
|
10999
11049
|
var ElementList$$ = [ElementList$0, ElementList$1];
|
|
11000
11050
|
function ElementList(ctx, state2) {
|
|
@@ -11055,9 +11105,10 @@ var NestedBulletedArray$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_
|
|
|
11055
11105
|
if (!content.length)
|
|
11056
11106
|
return $skip;
|
|
11057
11107
|
content = content.flat();
|
|
11058
|
-
const
|
|
11059
|
-
if (children
|
|
11060
|
-
children.
|
|
11108
|
+
const last = content[content.length - 1];
|
|
11109
|
+
if (last.children?.at(-1)?.implicit) {
|
|
11110
|
+
last.children = last.children.slice(0, -1);
|
|
11111
|
+
}
|
|
11061
11112
|
return {
|
|
11062
11113
|
type: "ArrayExpression",
|
|
11063
11114
|
children: [...open, ...content, close]
|
|
@@ -11077,9 +11128,10 @@ var BulletedArray$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(InsertOpenBracket
|
|
|
11077
11128
|
// replace first space with bracket
|
|
11078
11129
|
...content[1].flat()
|
|
11079
11130
|
];
|
|
11080
|
-
const
|
|
11081
|
-
if (children
|
|
11082
|
-
children.
|
|
11131
|
+
const last = content[content.length - 1];
|
|
11132
|
+
if (last.children?.at(-1)?.implicit) {
|
|
11133
|
+
last.children = last.children.slice(0, -1);
|
|
11134
|
+
}
|
|
11083
11135
|
return {
|
|
11084
11136
|
type: "ArrayExpression",
|
|
11085
11137
|
children: [open, ...content, close]
|
|
@@ -11091,7 +11143,7 @@ function BulletedArray(ctx, state2) {
|
|
|
11091
11143
|
var NestedArrayBullet$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Nested, ArrayBullet), function($skip, $loc, $0, $1, $2) {
|
|
11092
11144
|
var indent = $1;
|
|
11093
11145
|
var list = $2;
|
|
11094
|
-
return list.map((e, i) => i === 0 ?
|
|
11146
|
+
return list.map((e, i) => i === 0 ? prepend(indent, e) : e);
|
|
11095
11147
|
});
|
|
11096
11148
|
function NestedArrayBullet(ctx, state2) {
|
|
11097
11149
|
return (0, import_lib3.$EVENT)(ctx, state2, "NestedArrayBullet", NestedArrayBullet$0);
|
|
@@ -11102,15 +11154,13 @@ var ArrayBullet$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(BulletIndent, (0, i
|
|
|
11102
11154
|
if (!content)
|
|
11103
11155
|
return $skip;
|
|
11104
11156
|
let [list, delimiter] = content;
|
|
11105
|
-
if (list.type === "ArrayExpression")
|
|
11106
|
-
list = [list];
|
|
11107
11157
|
if (!list.length)
|
|
11108
11158
|
return $skip;
|
|
11109
11159
|
list = list.slice();
|
|
11110
|
-
list[0] =
|
|
11160
|
+
list[0] = prepend(bullet, list[0]);
|
|
11111
11161
|
if (delimiter) {
|
|
11112
11162
|
const last = list.length - 1;
|
|
11113
|
-
list[last] =
|
|
11163
|
+
list[last] = append(list[last], delimiter);
|
|
11114
11164
|
}
|
|
11115
11165
|
return list;
|
|
11116
11166
|
});
|
|
@@ -15762,7 +15812,7 @@ var InlineJSXPrimaryExpression$$ = [InlineJSXPrimaryExpression$0, InlineJSXPrima
|
|
|
15762
15812
|
function InlineJSXPrimaryExpression(ctx, state2) {
|
|
15763
15813
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "InlineJSXPrimaryExpression", InlineJSXPrimaryExpression$$);
|
|
15764
15814
|
}
|
|
15765
|
-
var JSXMixedChildren$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(
|
|
15815
|
+
var JSXMixedChildren$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(JSXSameLineChildren, JSXNestedChildren), function($skip, $loc, $0, $1, $2) {
|
|
15766
15816
|
var c1 = $1;
|
|
15767
15817
|
var c2 = $2;
|
|
15768
15818
|
return {
|
|
@@ -15773,6 +15823,18 @@ var JSXMixedChildren$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib
|
|
|
15773
15823
|
function JSXMixedChildren(ctx, state2) {
|
|
15774
15824
|
return (0, import_lib3.$EVENT)(ctx, state2, "JSXMixedChildren", JSXMixedChildren$0);
|
|
15775
15825
|
}
|
|
15826
|
+
var JSXSameLineChildren$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(JSXCodeSameLineEnabled, (0, import_lib3.$Q)((0, import_lib3.$S)((0, import_lib3.$E)(NonNewlineWhitespace), (0, import_lib3.$N)(EOL), JSXChildForcedCode))), function($skip, $loc, $0, $1, $2) {
|
|
15827
|
+
var children = $2;
|
|
15828
|
+
return children.map(([, , c]) => c);
|
|
15829
|
+
});
|
|
15830
|
+
var JSXSameLineChildren$1 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$N)(JSXCodeSameLineEnabled), (0, import_lib3.$Q)(JSXChildForcedNoCode)), function(value) {
|
|
15831
|
+
var children = value[1];
|
|
15832
|
+
return children;
|
|
15833
|
+
});
|
|
15834
|
+
var JSXSameLineChildren$$ = [JSXSameLineChildren$0, JSXSameLineChildren$1];
|
|
15835
|
+
function JSXSameLineChildren(ctx, state2) {
|
|
15836
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "JSXSameLineChildren", JSXSameLineChildren$$);
|
|
15837
|
+
}
|
|
15776
15838
|
var JSXChildren$0 = (0, import_lib3.$TV)((0, import_lib3.$Q)((0, import_lib3.$S)((0, import_lib3.$Q)((0, import_lib3.$S)((0, import_lib3.$E)(NonNewlineWhitespace), EOL, (0, import_lib3.$E)(NonNewlineWhitespace))), JSXChild)), function($skip, $loc, $0, $1) {
|
|
15777
15839
|
return {
|
|
15778
15840
|
children: $1,
|
|
@@ -15814,10 +15876,33 @@ var JSXNested$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(JSXEOS, Indent), func
|
|
|
15814
15876
|
function JSXNested(ctx, state2) {
|
|
15815
15877
|
return (0, import_lib3.$EVENT)(ctx, state2, "JSXNested", JSXNested$0);
|
|
15816
15878
|
}
|
|
15817
|
-
var JSXChild$0 =
|
|
15818
|
-
var JSXChild$1 =
|
|
15819
|
-
|
|
15820
|
-
|
|
15879
|
+
var JSXChild$0 = JSXChildGeneral;
|
|
15880
|
+
var JSXChild$1 = (0, import_lib3.$T)((0, import_lib3.$S)(JSXCodeNestedEnabled, JSXCodeChild), function(value) {
|
|
15881
|
+
return value[1];
|
|
15882
|
+
});
|
|
15883
|
+
var JSXChild$2 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$N)(JSXCodeNestedEnabled), JSXText), function(value) {
|
|
15884
|
+
return value[1];
|
|
15885
|
+
});
|
|
15886
|
+
var JSXChild$$ = [JSXChild$0, JSXChild$1, JSXChild$2];
|
|
15887
|
+
function JSXChild(ctx, state2) {
|
|
15888
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "JSXChild", JSXChild$$);
|
|
15889
|
+
}
|
|
15890
|
+
var JSXChildForcedCode$0 = JSXChildGeneral;
|
|
15891
|
+
var JSXChildForcedCode$1 = JSXCodeChild;
|
|
15892
|
+
var JSXChildForcedCode$$ = [JSXChildForcedCode$0, JSXChildForcedCode$1];
|
|
15893
|
+
function JSXChildForcedCode(ctx, state2) {
|
|
15894
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "JSXChildForcedCode", JSXChildForcedCode$$);
|
|
15895
|
+
}
|
|
15896
|
+
var JSXChildForcedNoCode$0 = JSXChildGeneral;
|
|
15897
|
+
var JSXChildForcedNoCode$1 = JSXText;
|
|
15898
|
+
var JSXChildForcedNoCode$$ = [JSXChildForcedNoCode$0, JSXChildForcedNoCode$1];
|
|
15899
|
+
function JSXChildForcedNoCode(ctx, state2) {
|
|
15900
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "JSXChildForcedNoCode", JSXChildForcedNoCode$$);
|
|
15901
|
+
}
|
|
15902
|
+
var JSXChildGeneral$0 = JSXElement;
|
|
15903
|
+
var JSXChildGeneral$1 = JSXFragment;
|
|
15904
|
+
var JSXChildGeneral$2 = JSXComment;
|
|
15905
|
+
var JSXChildGeneral$3 = (0, import_lib3.$TS)((0, import_lib3.$S)(OpenBrace, IndentedJSXChildExpression, __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
15821
15906
|
var expression = $2;
|
|
15822
15907
|
return {
|
|
15823
15908
|
type: "JSXChildExpression",
|
|
@@ -15825,7 +15910,7 @@ var JSXChild$3 = (0, import_lib3.$TS)((0, import_lib3.$S)(OpenBrace, IndentedJSX
|
|
|
15825
15910
|
expression
|
|
15826
15911
|
};
|
|
15827
15912
|
});
|
|
15828
|
-
var
|
|
15913
|
+
var JSXChildGeneral$4 = (0, import_lib3.$TS)((0, import_lib3.$S)(OpenBrace, (0, import_lib3.$E)(JSXChildExpression), __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
15829
15914
|
var expression = $2;
|
|
15830
15915
|
return {
|
|
15831
15916
|
type: "JSXChildExpression",
|
|
@@ -15833,7 +15918,7 @@ var JSXChild$4 = (0, import_lib3.$TS)((0, import_lib3.$S)(OpenBrace, (0, import_
|
|
|
15833
15918
|
expression
|
|
15834
15919
|
};
|
|
15835
15920
|
});
|
|
15836
|
-
var
|
|
15921
|
+
var JSXChildGeneral$5 = (0, import_lib3.$TS)((0, import_lib3.$S)(InsertInlineOpenBrace, ArrowFunction, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3) {
|
|
15837
15922
|
var expression = $2;
|
|
15838
15923
|
return {
|
|
15839
15924
|
type: "JSXChildExpression",
|
|
@@ -15841,11 +15926,10 @@ var JSXChild$5 = (0, import_lib3.$TS)((0, import_lib3.$S)(InsertInlineOpenBrace,
|
|
|
15841
15926
|
expression
|
|
15842
15927
|
};
|
|
15843
15928
|
});
|
|
15844
|
-
var
|
|
15845
|
-
var
|
|
15846
|
-
|
|
15847
|
-
|
|
15848
|
-
return (0, import_lib3.$EVENT_C)(ctx, state2, "JSXChild", JSXChild$$);
|
|
15929
|
+
var JSXChildGeneral$6 = JSXAngleChild;
|
|
15930
|
+
var JSXChildGeneral$$ = [JSXChildGeneral$0, JSXChildGeneral$1, JSXChildGeneral$2, JSXChildGeneral$3, JSXChildGeneral$4, JSXChildGeneral$5, JSXChildGeneral$6];
|
|
15931
|
+
function JSXChildGeneral(ctx, state2) {
|
|
15932
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "JSXChildGeneral", JSXChildGeneral$$);
|
|
15849
15933
|
}
|
|
15850
15934
|
var JSXComment$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($L224, 'JSXComment "<!--"'), JSXCommentContent, (0, import_lib3.$EXPECT)($L225, 'JSXComment "-->"')), function($skip, $loc, $0, $1, $2, $3) {
|
|
15851
15935
|
return ["{/*", $2, "*/}"];
|
|
@@ -15869,9 +15953,42 @@ var JSXText$0 = (0, import_lib3.$TR)((0, import_lib3.$EXPECT)($R87, "JSXText /[^
|
|
|
15869
15953
|
function JSXText(ctx, state2) {
|
|
15870
15954
|
return (0, import_lib3.$EVENT)(ctx, state2, "JSXText", JSXText$0);
|
|
15871
15955
|
}
|
|
15872
|
-
var JSXChildExpression$0 = (0, import_lib3.$
|
|
15956
|
+
var JSXChildExpression$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(Whitespace), LexicalDeclaration), function($skip, $loc, $0, $1, $2) {
|
|
15957
|
+
var d = $2;
|
|
15958
|
+
let names = d.names.concat(
|
|
15959
|
+
d.thisAssignments.map((a) => a[1][1])
|
|
15960
|
+
);
|
|
15961
|
+
names.sort();
|
|
15962
|
+
names = names.filter((name, i) => i === 0 || name !== names[i - 1]);
|
|
15963
|
+
d = {
|
|
15964
|
+
...d,
|
|
15965
|
+
hoistDec: {
|
|
15966
|
+
type: "Declaration",
|
|
15967
|
+
children: [
|
|
15968
|
+
"let ",
|
|
15969
|
+
names.map((n, i) => i === 0 ? [n] : [",", n]).flat()
|
|
15970
|
+
]
|
|
15971
|
+
},
|
|
15972
|
+
children: d.children.slice(1)
|
|
15973
|
+
// drop LetOrConst
|
|
15974
|
+
};
|
|
15975
|
+
if (d.thisAssignments?.length) {
|
|
15976
|
+
d.children.push(...d.splices, ",", ...d.thisAssignments.map(
|
|
15977
|
+
(a, i) => a[a.length - 1] === ";" ? [
|
|
15978
|
+
...a.slice(0, -1),
|
|
15979
|
+
i === d.thisAssignments.length - 1 ? "" : ","
|
|
15980
|
+
] : a
|
|
15981
|
+
));
|
|
15982
|
+
} else if (d.splices?.length) {
|
|
15983
|
+
d.children.push(...d.splices);
|
|
15984
|
+
}
|
|
15985
|
+
d.children.push(",void 0");
|
|
15986
|
+
return d;
|
|
15987
|
+
});
|
|
15988
|
+
var JSXChildExpression$1 = (0, import_lib3.$S)((0, import_lib3.$E)(Whitespace), (0, import_lib3.$E)((0, import_lib3.$S)(DotDotDot, (0, import_lib3.$E)(Whitespace))), PostfixedExpression);
|
|
15989
|
+
var JSXChildExpression$$ = [JSXChildExpression$0, JSXChildExpression$1];
|
|
15873
15990
|
function JSXChildExpression(ctx, state2) {
|
|
15874
|
-
return (0, import_lib3.$
|
|
15991
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "JSXChildExpression", JSXChildExpression$$);
|
|
15875
15992
|
}
|
|
15876
15993
|
var IndentedJSXChildExpression$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(PushIndent, (0, import_lib3.$E)(NestedJSXChildExpression), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
|
|
15877
15994
|
if (!$2)
|
|
@@ -15885,24 +16002,30 @@ var NestedJSXChildExpression$0 = (0, import_lib3.$S)(JSXNested, JSXChildExpressi
|
|
|
15885
16002
|
function NestedJSXChildExpression(ctx, state2) {
|
|
15886
16003
|
return (0, import_lib3.$EVENT)(ctx, state2, "NestedJSXChildExpression", NestedJSXChildExpression$0);
|
|
15887
16004
|
}
|
|
15888
|
-
var JSXAngleChild$0 = (0, import_lib3.$
|
|
15889
|
-
|
|
15890
|
-
|
|
15891
|
-
|
|
16005
|
+
var JSXAngleChild$0 = (0, import_lib3.$T)((0, import_lib3.$S)(CloseAngleBracket, JSXCodeChild), function(value) {
|
|
16006
|
+
return value[1];
|
|
16007
|
+
});
|
|
16008
|
+
function JSXAngleChild(ctx, state2) {
|
|
16009
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "JSXAngleChild", JSXAngleChild$0);
|
|
16010
|
+
}
|
|
16011
|
+
var JSXCodeChild$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(InsertInlineOpenBrace, JSXCodeChildExpression, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3) {
|
|
16012
|
+
var open = $1;
|
|
16013
|
+
var expression = $2;
|
|
16014
|
+
var close = $3;
|
|
15892
16015
|
if (!expression)
|
|
15893
16016
|
return $skip;
|
|
15894
16017
|
return [open, expression, close];
|
|
15895
16018
|
});
|
|
15896
|
-
function
|
|
15897
|
-
return (0, import_lib3.$EVENT)(ctx, state2, "
|
|
16019
|
+
function JSXCodeChild(ctx, state2) {
|
|
16020
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "JSXCodeChild", JSXCodeChild$0);
|
|
15898
16021
|
}
|
|
15899
|
-
var
|
|
16022
|
+
var JSXCodeChildExpression$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$N)(JSXEOS), ForbidNewlineBinaryOp, (0, import_lib3.$E)(JSXChildExpression), RestoreNewlineBinaryOp), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
15900
16023
|
var expression = $3;
|
|
15901
16024
|
if (!expression)
|
|
15902
16025
|
return $skip;
|
|
15903
16026
|
return expression;
|
|
15904
16027
|
});
|
|
15905
|
-
var
|
|
16028
|
+
var JSXCodeChildExpression$1 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$Y)(JSXEOS), ImplicitNestedBlock), function($skip, $loc, $0, $1, $2) {
|
|
15906
16029
|
var block = $2;
|
|
15907
16030
|
if (!block)
|
|
15908
16031
|
return $skip;
|
|
@@ -15917,9 +16040,9 @@ var JSXAngleChildExpression$1 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, imp
|
|
|
15917
16040
|
children: [statement]
|
|
15918
16041
|
};
|
|
15919
16042
|
});
|
|
15920
|
-
var
|
|
15921
|
-
function
|
|
15922
|
-
return (0, import_lib3.$EVENT_C)(ctx, state2, "
|
|
16043
|
+
var JSXCodeChildExpression$$ = [JSXCodeChildExpression$0, JSXCodeChildExpression$1];
|
|
16044
|
+
function JSXCodeChildExpression(ctx, state2) {
|
|
16045
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "JSXCodeChildExpression", JSXCodeChildExpression$$);
|
|
15923
16046
|
}
|
|
15924
16047
|
var UsingDeclaration$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Using, (0, import_lib3.$E)(_), UsingBinding, (0, import_lib3.$Q)((0, import_lib3.$S)(__, Comma, __, UsingBinding)), UsingJSModeError), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
15925
16048
|
var decl = $1;
|
|
@@ -16362,14 +16485,16 @@ var TypeSuffix$$ = [TypeSuffix$0, TypeSuffix$1, TypeSuffix$2];
|
|
|
16362
16485
|
function TypeSuffix(ctx, state2) {
|
|
16363
16486
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeSuffix", TypeSuffix$$);
|
|
16364
16487
|
}
|
|
16365
|
-
var MaybeNestedType$0 =
|
|
16366
|
-
var MaybeNestedType$1 =
|
|
16488
|
+
var MaybeNestedType$0 = NestedTypeBulletedTuple;
|
|
16489
|
+
var MaybeNestedType$1 = NestedInterfaceBlock;
|
|
16490
|
+
var MaybeNestedType$2 = NestedTypeBinaryChain;
|
|
16491
|
+
var MaybeNestedType$3 = (0, import_lib3.$TS)((0, import_lib3.$S)(PushIndent, (0, import_lib3.$E)((0, import_lib3.$S)(Nested, Type)), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
|
|
16367
16492
|
if (!$2)
|
|
16368
16493
|
return $skip;
|
|
16369
16494
|
return $2;
|
|
16370
16495
|
});
|
|
16371
|
-
var MaybeNestedType$
|
|
16372
|
-
var MaybeNestedType$$ = [MaybeNestedType$0, MaybeNestedType$1, MaybeNestedType$2];
|
|
16496
|
+
var MaybeNestedType$4 = Type;
|
|
16497
|
+
var MaybeNestedType$$ = [MaybeNestedType$0, MaybeNestedType$1, MaybeNestedType$2, MaybeNestedType$3, MaybeNestedType$4];
|
|
16373
16498
|
function MaybeNestedType(ctx, state2) {
|
|
16374
16499
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "MaybeNestedType", MaybeNestedType$$);
|
|
16375
16500
|
}
|
|
@@ -16385,9 +16510,11 @@ var ReturnTypeSuffix$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib
|
|
|
16385
16510
|
function ReturnTypeSuffix(ctx, state2) {
|
|
16386
16511
|
return (0, import_lib3.$EVENT)(ctx, state2, "ReturnTypeSuffix", ReturnTypeSuffix$0);
|
|
16387
16512
|
}
|
|
16388
|
-
var ReturnType$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)((0, import_lib3.$S)(__, (0, import_lib3.$EXPECT)($L232, 'ReturnType "asserts"'), NonIdContinue)), TypePredicate), function($skip, $loc, $0, $1, $2) {
|
|
16513
|
+
var ReturnType$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)((0, import_lib3.$S)(__, (0, import_lib3.$EXPECT)($L232, 'ReturnType "asserts"'), NonIdContinue)), ForbidIndentedApplication, (0, import_lib3.$E)(TypePredicate), RestoreIndentedApplication), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
16389
16514
|
var asserts = $1;
|
|
16390
|
-
var t = $
|
|
16515
|
+
var t = $3;
|
|
16516
|
+
if (!t)
|
|
16517
|
+
return $skip;
|
|
16391
16518
|
if (asserts) {
|
|
16392
16519
|
t = {
|
|
16393
16520
|
type: "AssertsType",
|
|
@@ -16406,7 +16533,7 @@ var ReturnType$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(
|
|
|
16406
16533
|
function ReturnType(ctx, state2) {
|
|
16407
16534
|
return (0, import_lib3.$EVENT)(ctx, state2, "ReturnType", ReturnType$0);
|
|
16408
16535
|
}
|
|
16409
|
-
var TypePredicate$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(MaybeNestedType, (0, import_lib3.$E)((0, import_lib3.$S)(__,
|
|
16536
|
+
var TypePredicate$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(MaybeNestedType, (0, import_lib3.$E)((0, import_lib3.$S)(__, Is, Type))), function($skip, $loc, $0, $1, $2) {
|
|
16410
16537
|
var lhs = $1;
|
|
16411
16538
|
var rhs = $2;
|
|
16412
16539
|
if (!rhs)
|
|
@@ -16421,11 +16548,11 @@ var TypePredicate$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(MaybeNestedType,
|
|
|
16421
16548
|
function TypePredicate(ctx, state2) {
|
|
16422
16549
|
return (0, import_lib3.$EVENT)(ctx, state2, "TypePredicate", TypePredicate$0);
|
|
16423
16550
|
}
|
|
16424
|
-
var Type$0 =
|
|
16551
|
+
var Type$0 = TypeWithPostfix;
|
|
16425
16552
|
function Type(ctx, state2) {
|
|
16426
16553
|
return (0, import_lib3.$EVENT)(ctx, state2, "Type", Type$0);
|
|
16427
16554
|
}
|
|
16428
|
-
var TypeBinary$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)((0, import_lib3.$S)(
|
|
16555
|
+
var TypeBinary$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)((0, import_lib3.$S)(NotDedented, TypeBinaryOp, __)), TypeUnary, (0, import_lib3.$Q)((0, import_lib3.$S)(NotDedented, TypeBinaryOp, __, TypeUnary))), function($skip, $loc, $0, $1, $2, $3) {
|
|
16429
16556
|
var optionalPrefix = $1;
|
|
16430
16557
|
var t = $2;
|
|
16431
16558
|
var ops = $3;
|
|
@@ -16440,6 +16567,25 @@ var TypeBinary$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(
|
|
|
16440
16567
|
function TypeBinary(ctx, state2) {
|
|
16441
16568
|
return (0, import_lib3.$EVENT)(ctx, state2, "TypeBinary", TypeBinary$0);
|
|
16442
16569
|
}
|
|
16570
|
+
var NestedTypeBinaryChain$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(PushIndent, (0, import_lib3.$Q)(NestedTypeBinary), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
|
|
16571
|
+
if (!$2.length)
|
|
16572
|
+
return $skip;
|
|
16573
|
+
return $2;
|
|
16574
|
+
});
|
|
16575
|
+
function NestedTypeBinaryChain(ctx, state2) {
|
|
16576
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeBinaryChain", NestedTypeBinaryChain$0);
|
|
16577
|
+
}
|
|
16578
|
+
var NestedTypeBinary$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Nested, TypeBinaryOp, PushExtraIndent1, (0, import_lib3.$E)(TypeUnary), PopIndent), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
16579
|
+
var indent = $1;
|
|
16580
|
+
var op = $2;
|
|
16581
|
+
var t = $4;
|
|
16582
|
+
if (!t)
|
|
16583
|
+
return $skip;
|
|
16584
|
+
return [indent, op, t];
|
|
16585
|
+
});
|
|
16586
|
+
function NestedTypeBinary(ctx, state2) {
|
|
16587
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeBinary", NestedTypeBinary$0);
|
|
16588
|
+
}
|
|
16443
16589
|
var TypeUnary$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$Q)((0, import_lib3.$S)(__, TypeUnaryOp)), TypePrimary, (0, import_lib3.$Q)(TypeUnarySuffix)), function($skip, $loc, $0, $1, $2, $3) {
|
|
16444
16590
|
var prefix = $1;
|
|
16445
16591
|
var t = $2;
|
|
@@ -16509,7 +16655,7 @@ var TypePrimary$1 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)
|
|
|
16509
16655
|
};
|
|
16510
16656
|
});
|
|
16511
16657
|
var TypePrimary$2 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_), TypeTuple), function($skip, $loc, $0, $1, $2) {
|
|
16512
|
-
return
|
|
16658
|
+
return prepend($1, $2);
|
|
16513
16659
|
});
|
|
16514
16660
|
var TypePrimary$3 = InterfaceBlock;
|
|
16515
16661
|
var TypePrimary$4 = (0, import_lib3.$S)((0, import_lib3.$E)(_), TypeFunction);
|
|
@@ -16538,7 +16684,7 @@ var TypePrimary$8 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)
|
|
|
16538
16684
|
args: void 0
|
|
16539
16685
|
};
|
|
16540
16686
|
});
|
|
16541
|
-
var TypePrimary$9 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_),
|
|
16687
|
+
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) {
|
|
16542
16688
|
var args = $4;
|
|
16543
16689
|
return {
|
|
16544
16690
|
type: "IdentifierType",
|
|
@@ -16547,10 +16693,13 @@ var TypePrimary$9 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)
|
|
|
16547
16693
|
args
|
|
16548
16694
|
};
|
|
16549
16695
|
});
|
|
16550
|
-
var TypePrimary$10 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_), OpenParen, (0, import_lib3.$C)(Type, (0, import_lib3.$S)(EOS, Type)), __, CloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
16696
|
+
var TypePrimary$10 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_), OpenParen, AllowAll, (0, import_lib3.$E)((0, import_lib3.$C)(Type, (0, import_lib3.$S)(EOS, Type))), RestoreAll, __, CloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
|
|
16697
|
+
if (!$4)
|
|
16698
|
+
return $skip;
|
|
16551
16699
|
return {
|
|
16552
16700
|
type: "ParenthesizedType",
|
|
16553
|
-
children: $
|
|
16701
|
+
children: [$1, $2, $4, $6, $7]
|
|
16702
|
+
// omit AllowAll/RestoreAll
|
|
16554
16703
|
};
|
|
16555
16704
|
});
|
|
16556
16705
|
var TypePrimary$$ = [TypePrimary$0, TypePrimary$1, TypePrimary$2, TypePrimary$3, TypePrimary$4, TypePrimary$5, TypePrimary$6, TypePrimary$7, TypePrimary$8, TypePrimary$9, TypePrimary$10];
|
|
@@ -16563,18 +16712,58 @@ var ImportType$$ = [ImportType$0, ImportType$1];
|
|
|
16563
16712
|
function ImportType(ctx, state2) {
|
|
16564
16713
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "ImportType", ImportType$$);
|
|
16565
16714
|
}
|
|
16566
|
-
var TypeTuple$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(OpenBracket, (0, import_lib3.$
|
|
16715
|
+
var TypeTuple$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(OpenBracket, AllowAll, (0, import_lib3.$E)((0, import_lib3.$S)(TypeTupleContent, __, CloseBracket)), RestoreAll), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
16716
|
+
if (!$3)
|
|
16717
|
+
return $skip;
|
|
16567
16718
|
return {
|
|
16568
16719
|
type: "TypeTuple",
|
|
16569
|
-
children: $
|
|
16720
|
+
children: [$1, ...$3]
|
|
16570
16721
|
};
|
|
16571
16722
|
});
|
|
16572
16723
|
function TypeTuple(ctx, state2) {
|
|
16573
16724
|
return (0, import_lib3.$EVENT)(ctx, state2, "TypeTuple", TypeTuple$0);
|
|
16574
16725
|
}
|
|
16575
|
-
var
|
|
16576
|
-
|
|
16577
|
-
|
|
16726
|
+
var TypeTupleContent$0 = (0, import_lib3.$S)(NestedTypeElementList, (0, import_lib3.$Y)((0, import_lib3.$S)(__, CloseBracket)));
|
|
16727
|
+
var TypeTupleContent$1 = (0, import_lib3.$TS)((0, import_lib3.$S)(TypeElementListWithIndentedApplicationForbidden, ArrayElementDelimiter, (0, import_lib3.$E)(NestedTypeElementList), (0, import_lib3.$Y)((0, import_lib3.$S)(__, CloseBracket))), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
16728
|
+
var list = $1;
|
|
16729
|
+
var delimiter = $2;
|
|
16730
|
+
var nested = $3;
|
|
16731
|
+
if (!nested)
|
|
16732
|
+
return list;
|
|
16733
|
+
return [...list, delimiter, ...nested];
|
|
16734
|
+
});
|
|
16735
|
+
var TypeTupleContent$2 = (0, import_lib3.$TV)((0, import_lib3.$Q)((0, import_lib3.$S)(__, TypeElementListWithIndentedApplicationForbidden, ArrayElementDelimiter)), function($skip, $loc, $0, $1) {
|
|
16736
|
+
return $1.flat();
|
|
16737
|
+
});
|
|
16738
|
+
var TypeTupleContent$$ = [TypeTupleContent$0, TypeTupleContent$1, TypeTupleContent$2];
|
|
16739
|
+
function TypeTupleContent(ctx, state2) {
|
|
16740
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeTupleContent", TypeTupleContent$$);
|
|
16741
|
+
}
|
|
16742
|
+
var TypeElementListWithIndentedApplicationForbidden$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(ForbidIndentedApplication, (0, import_lib3.$E)(TypeElementList), RestoreIndentedApplication), function($skip, $loc, $0, $1, $2, $3) {
|
|
16743
|
+
if ($2)
|
|
16744
|
+
return $2;
|
|
16745
|
+
return $skip;
|
|
16746
|
+
});
|
|
16747
|
+
function TypeElementListWithIndentedApplicationForbidden(ctx, state2) {
|
|
16748
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "TypeElementListWithIndentedApplicationForbidden", TypeElementListWithIndentedApplicationForbidden$0);
|
|
16749
|
+
}
|
|
16750
|
+
var TypeElementList$0 = (0, import_lib3.$T)((0, import_lib3.$S)(TypeBulletedTuple), function(value) {
|
|
16751
|
+
return [value[0]];
|
|
16752
|
+
});
|
|
16753
|
+
var TypeElementList$1 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$N)(EOS), TypeElement, (0, import_lib3.$Q)((0, import_lib3.$S)((0, import_lib3.$S)((0, import_lib3.$E)(_), Comma, (0, import_lib3.$N)(EOS)), TypeElement))), function($skip, $loc, $0, $1, $2, $3) {
|
|
16754
|
+
var first = $2;
|
|
16755
|
+
var rest = $3;
|
|
16756
|
+
if (!rest.length)
|
|
16757
|
+
return [first];
|
|
16758
|
+
return [
|
|
16759
|
+
append(first, rest[0][0])
|
|
16760
|
+
].concat(
|
|
16761
|
+
rest.map(([_2, e], i) => append(e, rest[i + 1]?.[0]))
|
|
16762
|
+
);
|
|
16763
|
+
});
|
|
16764
|
+
var TypeElementList$$ = [TypeElementList$0, TypeElementList$1];
|
|
16765
|
+
function TypeElementList(ctx, state2) {
|
|
16766
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeElementList", TypeElementList$$);
|
|
16578
16767
|
}
|
|
16579
16768
|
var TypeElement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(__, (0, import_lib3.$E)((0, import_lib3.$S)(DotDotDot, __)), IdentifierName, (0, import_lib3.$E)((0, import_lib3.$S)((0, import_lib3.$E)(_), DotDotDot)), (0, import_lib3.$S)(__, (0, import_lib3.$E)((0, import_lib3.$S)(QuestionMark, (0, import_lib3.$E)(_))), Colon, __), Type), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
16580
16769
|
var ws = $1;
|
|
@@ -16608,21 +16797,129 @@ var TypeElement$$ = [TypeElement$0, TypeElement$1, TypeElement$2];
|
|
|
16608
16797
|
function TypeElement(ctx, state2) {
|
|
16609
16798
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeElement", TypeElement$$);
|
|
16610
16799
|
}
|
|
16611
|
-
var
|
|
16800
|
+
var NestedTypeElementList$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(PushIndent, (0, import_lib3.$Q)(NestedTypeElement), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
|
|
16612
16801
|
var types = $2;
|
|
16613
16802
|
if (types.length)
|
|
16614
16803
|
return types;
|
|
16615
16804
|
return $skip;
|
|
16616
16805
|
});
|
|
16617
|
-
function
|
|
16618
|
-
return (0, import_lib3.$EVENT)(ctx, state2, "
|
|
16806
|
+
function NestedTypeElementList(ctx, state2) {
|
|
16807
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeElementList", NestedTypeElementList$0);
|
|
16619
16808
|
}
|
|
16620
|
-
var
|
|
16621
|
-
|
|
16622
|
-
|
|
16809
|
+
var NestedTypeElement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Nested, TypeElementList, ArrayElementDelimiter), function($skip, $loc, $0, $1, $2, $3) {
|
|
16810
|
+
var indent = $1;
|
|
16811
|
+
var list = $2;
|
|
16812
|
+
var delimiter = $3;
|
|
16813
|
+
const { length } = list;
|
|
16814
|
+
if (!length)
|
|
16815
|
+
return $skip;
|
|
16816
|
+
return list.map((e, i) => {
|
|
16817
|
+
if (i === 0)
|
|
16818
|
+
e = prepend(indent, e);
|
|
16819
|
+
if (i === length - 1)
|
|
16820
|
+
e = append(e, delimiter);
|
|
16821
|
+
return e;
|
|
16822
|
+
});
|
|
16823
|
+
});
|
|
16824
|
+
function NestedTypeElement(ctx, state2) {
|
|
16825
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeElement", NestedTypeElement$0);
|
|
16826
|
+
}
|
|
16827
|
+
var NestedTypeBulletedTuple$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$S)(InsertSpace, InsertOpenBracket), PushIndent, (0, import_lib3.$Q)(NestedTypeBullet), InsertCloseBracket, PopIndent), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
16828
|
+
var open = $1;
|
|
16829
|
+
var content = $3;
|
|
16830
|
+
var close = $4;
|
|
16831
|
+
if (!content.length)
|
|
16832
|
+
return $skip;
|
|
16833
|
+
content = content.flat();
|
|
16834
|
+
const last = content[content.length - 1];
|
|
16835
|
+
let children = Array.isArray(last) ? last : last?.children;
|
|
16836
|
+
if (children?.at(-1).implicit) {
|
|
16837
|
+
children = children.slice(0, -1);
|
|
16838
|
+
if (Array.isArray(last)) {
|
|
16839
|
+
content[content.length - 1] = children;
|
|
16840
|
+
} else {
|
|
16841
|
+
content[content.length - 1] = { ...last, children };
|
|
16842
|
+
}
|
|
16843
|
+
}
|
|
16844
|
+
return {
|
|
16845
|
+
type: "TypeTuple",
|
|
16846
|
+
children: [...open, ...content, close]
|
|
16847
|
+
};
|
|
16848
|
+
});
|
|
16849
|
+
function NestedTypeBulletedTuple(ctx, state2) {
|
|
16850
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeBulletedTuple", NestedTypeBulletedTuple$0);
|
|
16851
|
+
}
|
|
16852
|
+
var TypeBulletedTuple$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(InsertOpenBracket, (0, import_lib3.$E)((0, import_lib3.$S)(TypeBullet, (0, import_lib3.$Q)(NestedTypeBullet))), InsertCloseBracket), function($skip, $loc, $0, $1, $2, $3) {
|
|
16853
|
+
var open = $1;
|
|
16854
|
+
var content = $2;
|
|
16855
|
+
var close = $3;
|
|
16856
|
+
if (!content)
|
|
16857
|
+
return $skip;
|
|
16858
|
+
content = [
|
|
16859
|
+
...trimFirstSpace(content[0]),
|
|
16860
|
+
// replace first space with bracket
|
|
16861
|
+
...content[1].flat()
|
|
16862
|
+
];
|
|
16863
|
+
const last = content[content.length - 1];
|
|
16864
|
+
let children = Array.isArray(last) ? last : last?.children;
|
|
16865
|
+
if (children?.at(-1).implicit) {
|
|
16866
|
+
children = children.slice(0, -1);
|
|
16867
|
+
if (Array.isArray(last)) {
|
|
16868
|
+
content[content.length - 1] = children;
|
|
16869
|
+
} else {
|
|
16870
|
+
content[content.length - 1] = { ...last, children };
|
|
16871
|
+
}
|
|
16872
|
+
}
|
|
16873
|
+
return {
|
|
16874
|
+
type: "TypeTuple",
|
|
16875
|
+
children: [open, ...content, close]
|
|
16876
|
+
};
|
|
16877
|
+
});
|
|
16878
|
+
function TypeBulletedTuple(ctx, state2) {
|
|
16879
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "TypeBulletedTuple", TypeBulletedTuple$0);
|
|
16880
|
+
}
|
|
16881
|
+
var NestedTypeBullet$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Nested, TypeBullet), function($skip, $loc, $0, $1, $2) {
|
|
16882
|
+
var indent = $1;
|
|
16883
|
+
var list = $2;
|
|
16884
|
+
return list.map((e, i) => i === 0 ? prepend(indent, e) : e);
|
|
16885
|
+
});
|
|
16886
|
+
function NestedTypeBullet(ctx, state2) {
|
|
16887
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeBullet", NestedTypeBullet$0);
|
|
16888
|
+
}
|
|
16889
|
+
var TypeBullet$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(BulletIndent, (0, import_lib3.$E)((0, import_lib3.$S)(TypeElementList, ArrayBulletDelimiter)), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
|
|
16890
|
+
var bullet = $1;
|
|
16891
|
+
var content = $2;
|
|
16892
|
+
if (!content)
|
|
16893
|
+
return $skip;
|
|
16894
|
+
let [list, delimiter] = content;
|
|
16895
|
+
if (!list.length)
|
|
16896
|
+
return $skip;
|
|
16897
|
+
list = list.slice();
|
|
16898
|
+
list[0] = prepend(bullet, list[0]);
|
|
16899
|
+
if (delimiter) {
|
|
16900
|
+
const last = list.length - 1;
|
|
16901
|
+
list[last] = append(list[last], delimiter);
|
|
16902
|
+
}
|
|
16903
|
+
return list;
|
|
16904
|
+
});
|
|
16905
|
+
function TypeBullet(ctx, state2) {
|
|
16906
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "TypeBullet", TypeBullet$0);
|
|
16907
|
+
}
|
|
16908
|
+
var TypeWithPostfix$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(TypeConditional, (0, import_lib3.$E)((0, import_lib3.$S)((0, import_lib3.$E)((0, import_lib3.$C)(_, IndentedFurther)), TypeIfClause))), function($skip, $loc, $0, $1, $2) {
|
|
16909
|
+
var t = $1;
|
|
16910
|
+
var postfix = $2;
|
|
16911
|
+
if (!postfix)
|
|
16912
|
+
return t;
|
|
16913
|
+
return prepend(
|
|
16914
|
+
postfix[0],
|
|
16915
|
+
expressionizeTypeIf([...postfix[1], $1, void 0])
|
|
16916
|
+
);
|
|
16917
|
+
});
|
|
16918
|
+
function TypeWithPostfix(ctx, state2) {
|
|
16919
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "TypeWithPostfix", TypeWithPostfix$0);
|
|
16623
16920
|
}
|
|
16624
16921
|
var TypeConditional$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_), (0, import_lib3.$EXPECT)($R89, "TypeConditional /(?=if|unless)/"), TypeIfThenElse), function($skip, $loc, $0, $1, $2, $3) {
|
|
16625
|
-
return
|
|
16922
|
+
return prepend($1, expressionizeTypeIf($3));
|
|
16626
16923
|
});
|
|
16627
16924
|
var TypeConditional$1 = (0, import_lib3.$TS)((0, import_lib3.$S)(TypeCondition, NotDedented, QuestionMark, __, Type, __, Colon, __, Type), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
|
|
16628
16925
|
if ($1.negated)
|
|
@@ -16634,7 +16931,7 @@ var TypeConditional$$ = [TypeConditional$0, TypeConditional$1, TypeConditional$2
|
|
|
16634
16931
|
function TypeConditional(ctx, state2) {
|
|
16635
16932
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeConditional", TypeConditional$$);
|
|
16636
16933
|
}
|
|
16637
|
-
var TypeCondition$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(TypeBinary, (0, import_lib3.$E)(IndentedFurther), (0, import_lib3.$C)(ExtendsToken, NotExtendsToken),
|
|
16934
|
+
var TypeCondition$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(TypeBinary, (0, import_lib3.$E)(IndentedFurther), (0, import_lib3.$C)(ExtendsToken, NotExtendsToken), TypeConditional), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
16638
16935
|
return {
|
|
16639
16936
|
type: "TypeCondition",
|
|
16640
16937
|
negated: $3.negated,
|
|
@@ -16644,13 +16941,27 @@ var TypeCondition$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(TypeBinary, (0, i
|
|
|
16644
16941
|
function TypeCondition(ctx, state2) {
|
|
16645
16942
|
return (0, import_lib3.$EVENT)(ctx, state2, "TypeCondition", TypeCondition$0);
|
|
16646
16943
|
}
|
|
16647
|
-
var TypeIfThenElse$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(
|
|
16648
|
-
return [
|
|
16944
|
+
var TypeIfThenElse$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(TypeIfClause, TypeBlock, (0, import_lib3.$E)(TypeElse)), function($skip, $loc, $0, $1, $2, $3) {
|
|
16945
|
+
return [...$1, $2, $3];
|
|
16649
16946
|
});
|
|
16650
|
-
var TypeIfThenElse$1 = (0, import_lib3.$S)((0, import_lib3.$E)(_), (0, import_lib3.$C)(If, Unless), TypeCondition, TypeBlock, (0, import_lib3.$E)(TypeElse));
|
|
16651
|
-
var TypeIfThenElse$$ = [TypeIfThenElse$0, TypeIfThenElse$1];
|
|
16652
16947
|
function TypeIfThenElse(ctx, state2) {
|
|
16653
|
-
return (0, import_lib3.$
|
|
16948
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "TypeIfThenElse", TypeIfThenElse$0);
|
|
16949
|
+
}
|
|
16950
|
+
var TypeIfClause$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$C)(If, Unless), OpenParen, AllowAll, (0, import_lib3.$E)(TypeCondition), RestoreAll, CloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
16951
|
+
var condition = $4;
|
|
16952
|
+
if (!condition)
|
|
16953
|
+
return $skip;
|
|
16954
|
+
return [$1, condition];
|
|
16955
|
+
});
|
|
16956
|
+
var TypeIfClause$1 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$C)(If, Unless), ForbidIndentedApplication, (0, import_lib3.$E)(TypeCondition), RestoreIndentedApplication), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
16957
|
+
var condition = $3;
|
|
16958
|
+
if (!condition)
|
|
16959
|
+
return $skip;
|
|
16960
|
+
return [$1, condition];
|
|
16961
|
+
});
|
|
16962
|
+
var TypeIfClause$$ = [TypeIfClause$0, TypeIfClause$1];
|
|
16963
|
+
function TypeIfClause(ctx, state2) {
|
|
16964
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeIfClause", TypeIfClause$$);
|
|
16654
16965
|
}
|
|
16655
16966
|
var TypeElse$0 = (0, import_lib3.$S)(NotDedented, Else, TypeBlock);
|
|
16656
16967
|
function TypeElse(ctx, state2) {
|
|
@@ -16750,12 +17061,18 @@ var TypeBinaryOp$$ = [TypeBinaryOp$0, TypeBinaryOp$1];
|
|
|
16750
17061
|
function TypeBinaryOp(ctx, state2) {
|
|
16751
17062
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeBinaryOp", TypeBinaryOp$$);
|
|
16752
17063
|
}
|
|
16753
|
-
var TypeFunction$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)((0, import_lib3.$S)((0, import_lib3.$E)((0, import_lib3.$
|
|
16754
|
-
var type = $
|
|
16755
|
-
|
|
16756
|
-
|
|
17064
|
+
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) {
|
|
17065
|
+
var type = $6;
|
|
17066
|
+
const ret = [...$0];
|
|
17067
|
+
if ($1 && !$2) {
|
|
17068
|
+
ret[1] = {
|
|
17069
|
+
type: "Error",
|
|
17070
|
+
message: "abstract function types must be constructors (abstract new)"
|
|
17071
|
+
};
|
|
16757
17072
|
}
|
|
16758
|
-
|
|
17073
|
+
if (!type)
|
|
17074
|
+
ret.push("void");
|
|
17075
|
+
return ret;
|
|
16759
17076
|
});
|
|
16760
17077
|
function TypeFunction(ctx, state2) {
|
|
16761
17078
|
return (0, import_lib3.$EVENT)(ctx, state2, "TypeFunction", TypeFunction$0);
|
|
@@ -16766,8 +17083,9 @@ var TypeArrowFunction$0 = (0, import_lib3.$TV)((0, import_lib3.$C)((0, import_li
|
|
|
16766
17083
|
function TypeArrowFunction(ctx, state2) {
|
|
16767
17084
|
return (0, import_lib3.$EVENT)(ctx, state2, "TypeArrowFunction", TypeArrowFunction$0);
|
|
16768
17085
|
}
|
|
16769
|
-
var TypeArguments$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(OpenAngleBracket, (0, import_lib3.$P)(
|
|
17086
|
+
var TypeArguments$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(OpenAngleBracket, (0, import_lib3.$P)((0, import_lib3.$S)(__, TypeArgumentDelimited)), __, CloseAngleBracket), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
16770
17087
|
var args = $2;
|
|
17088
|
+
args = args.map(([ws, arg]) => [ws, ...arg]);
|
|
16771
17089
|
return {
|
|
16772
17090
|
type: "TypeArguments",
|
|
16773
17091
|
ts: true,
|
|
@@ -16778,7 +17096,91 @@ var TypeArguments$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(OpenAngleBracket,
|
|
|
16778
17096
|
function TypeArguments(ctx, state2) {
|
|
16779
17097
|
return (0, import_lib3.$EVENT)(ctx, state2, "TypeArguments", TypeArguments$0);
|
|
16780
17098
|
}
|
|
16781
|
-
var
|
|
17099
|
+
var ImplicitTypeArguments$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(TypeApplicationStart, InsertOpenAngleBracket, (0, import_lib3.$E)(Trimmed_), TypeArgumentList, InsertCloseAngleBracket), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
17100
|
+
var open = $2;
|
|
17101
|
+
var ws = $3;
|
|
17102
|
+
var args = $4;
|
|
17103
|
+
var close = $5;
|
|
17104
|
+
let last = args[args.length - 1];
|
|
17105
|
+
if (last?.token === ",")
|
|
17106
|
+
args = args.slice(0, -1);
|
|
17107
|
+
return [open, ws, args, close];
|
|
17108
|
+
});
|
|
17109
|
+
function ImplicitTypeArguments(ctx, state2) {
|
|
17110
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "ImplicitTypeArguments", ImplicitTypeArguments$0);
|
|
17111
|
+
}
|
|
17112
|
+
var TypeApplicationStart$0 = (0, import_lib3.$S)(IndentedApplicationAllowed, (0, import_lib3.$Y)((0, import_lib3.$S)(IndentedFurther, (0, import_lib3.$N)(ForbiddenImplicitTypeCalls))));
|
|
17113
|
+
var TypeApplicationStart$1 = (0, import_lib3.$S)((0, import_lib3.$N)(EOS), (0, import_lib3.$Y)((0, import_lib3.$S)(_, (0, import_lib3.$N)(ForbiddenImplicitTypeCalls))));
|
|
17114
|
+
var TypeApplicationStart$$ = [TypeApplicationStart$0, TypeApplicationStart$1];
|
|
17115
|
+
function TypeApplicationStart(ctx, state2) {
|
|
17116
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeApplicationStart", TypeApplicationStart$$);
|
|
17117
|
+
}
|
|
17118
|
+
var ForbiddenImplicitTypeCalls$0 = ReservedBinary;
|
|
17119
|
+
var ForbiddenImplicitTypeCalls$1 = (0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($R90, "ForbiddenImplicitTypeCalls /[|&<!=\\-\u21D2\u2192]/"));
|
|
17120
|
+
var ForbiddenImplicitTypeCalls$2 = (0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($R91, "ForbiddenImplicitTypeCalls /(extends|not|is)(?!\\p{ID_Continue}|[\\u200C\\u200D$])/"));
|
|
17121
|
+
var ForbiddenImplicitTypeCalls$$ = [ForbiddenImplicitTypeCalls$0, ForbiddenImplicitTypeCalls$1, ForbiddenImplicitTypeCalls$2];
|
|
17122
|
+
function ForbiddenImplicitTypeCalls(ctx, state2) {
|
|
17123
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "ForbiddenImplicitTypeCalls", ForbiddenImplicitTypeCalls$$);
|
|
17124
|
+
}
|
|
17125
|
+
var TypeArgumentList$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$N)(EOS), TypeArgument, (0, import_lib3.$Q)((0, import_lib3.$S)(CommaDelimiter, (0, import_lib3.$N)(EOS), (0, import_lib3.$E)(_), TypeArgument)), (0, import_lib3.$P)((0, import_lib3.$S)(CommaDelimiter, (0, import_lib3.$C)(NestedTypeBulletedTuple, NestedInterfaceBlock, NestedTypeArgumentList)))), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
17126
|
+
return [
|
|
17127
|
+
$2,
|
|
17128
|
+
...$3.flatMap(([comma, eos, ws, arg]) => [comma, prepend(ws, arg)]),
|
|
17129
|
+
...$4.flatMap(
|
|
17130
|
+
([comma, args]) => Array.isArray(args) ? [comma, ...args] : [comma, args]
|
|
17131
|
+
)
|
|
17132
|
+
];
|
|
17133
|
+
});
|
|
17134
|
+
var TypeArgumentList$1 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$C)(NestedTypeBulletedTuple, NestedInterfaceBlock), (0, import_lib3.$Q)((0, import_lib3.$S)(CommaDelimiter, (0, import_lib3.$C)(NestedTypeBulletedTuple, NestedInterfaceBlock, NestedTypeArgumentList)))), function($skip, $loc, $0, $1, $2) {
|
|
17135
|
+
return [
|
|
17136
|
+
trimFirstSpace($1),
|
|
17137
|
+
...$2.flatMap(
|
|
17138
|
+
([comma, args]) => Array.isArray(args) ? [comma, ...args] : [comma, args]
|
|
17139
|
+
)
|
|
17140
|
+
];
|
|
17141
|
+
});
|
|
17142
|
+
var TypeArgumentList$2 = NestedTypeArgumentList;
|
|
17143
|
+
var TypeArgumentList$3 = (0, import_lib3.$TS)((0, import_lib3.$S)(TypeArgument, (0, import_lib3.$Q)((0, import_lib3.$S)(CommaDelimiter, (0, import_lib3.$E)(_), TypeArgument))), function($skip, $loc, $0, $1, $2) {
|
|
17144
|
+
return [
|
|
17145
|
+
$1,
|
|
17146
|
+
...$2.flatMap(([comma, ws, arg]) => [comma, prepend(ws, arg)])
|
|
17147
|
+
];
|
|
17148
|
+
});
|
|
17149
|
+
var TypeArgumentList$$ = [TypeArgumentList$0, TypeArgumentList$1, TypeArgumentList$2, TypeArgumentList$3];
|
|
17150
|
+
function TypeArgumentList(ctx, state2) {
|
|
17151
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeArgumentList", TypeArgumentList$$);
|
|
17152
|
+
}
|
|
17153
|
+
var NestedTypeArgumentList$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(PushIndent, (0, import_lib3.$Q)(NestedTypeArgument), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
|
|
17154
|
+
var args = $2;
|
|
17155
|
+
if (!args.length)
|
|
17156
|
+
return $skip;
|
|
17157
|
+
return args.flat();
|
|
17158
|
+
});
|
|
17159
|
+
function NestedTypeArgumentList(ctx, state2) {
|
|
17160
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeArgumentList", NestedTypeArgumentList$0);
|
|
17161
|
+
}
|
|
17162
|
+
var NestedTypeArgument$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Nested, SingleLineTypeArgumentList, TypeArgumentDelimiter), function($skip, $loc, $0, $1, $2, $3) {
|
|
17163
|
+
var indent = $1;
|
|
17164
|
+
var args = $2;
|
|
17165
|
+
var comma = $3;
|
|
17166
|
+
let [arg0, ...rest] = args;
|
|
17167
|
+
arg0 = prepend(indent, arg0);
|
|
17168
|
+
return [arg0, ...rest, comma];
|
|
17169
|
+
});
|
|
17170
|
+
function NestedTypeArgument(ctx, state2) {
|
|
17171
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeArgument", NestedTypeArgument$0);
|
|
17172
|
+
}
|
|
17173
|
+
var SingleLineTypeArgumentList$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$S)((0, import_lib3.$E)(_), TypeArgument), (0, import_lib3.$Q)((0, import_lib3.$S)((0, import_lib3.$S)((0, import_lib3.$E)(_), Comma), (0, import_lib3.$S)((0, import_lib3.$E)(_), TypeArgument)))), function($skip, $loc, $0, $1, $2) {
|
|
17174
|
+
return [$1, ...$2.flat()];
|
|
17175
|
+
});
|
|
17176
|
+
function SingleLineTypeArgumentList(ctx, state2) {
|
|
17177
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "SingleLineTypeArgumentList", SingleLineTypeArgumentList$0);
|
|
17178
|
+
}
|
|
17179
|
+
var TypeArgumentDelimited$0 = (0, import_lib3.$S)(TypeArgument, TypeArgumentDelimiter);
|
|
17180
|
+
function TypeArgumentDelimited(ctx, state2) {
|
|
17181
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "TypeArgumentDelimited", TypeArgumentDelimited$0);
|
|
17182
|
+
}
|
|
17183
|
+
var TypeArgument$0 = Type;
|
|
16782
17184
|
function TypeArgument(ctx, state2) {
|
|
16783
17185
|
return (0, import_lib3.$EVENT)(ctx, state2, "TypeArgument", TypeArgument$0);
|
|
16784
17186
|
}
|
|
@@ -16825,15 +17227,15 @@ var ThisType$0 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$E)(_),
|
|
|
16825
17227
|
function ThisType(ctx, state2) {
|
|
16826
17228
|
return (0, import_lib3.$EVENT)(ctx, state2, "ThisType", ThisType$0);
|
|
16827
17229
|
}
|
|
16828
|
-
var Shebang$0 = (0, import_lib3.$S)((0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($
|
|
17230
|
+
var Shebang$0 = (0, import_lib3.$S)((0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($R92, "Shebang /#![^\\r\\n]*/")), EOL);
|
|
16829
17231
|
function Shebang(ctx, state2) {
|
|
16830
17232
|
return (0, import_lib3.$EVENT)(ctx, state2, "Shebang", Shebang$0);
|
|
16831
17233
|
}
|
|
16832
|
-
var CivetPrologue$0 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($
|
|
17234
|
+
var CivetPrologue$0 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($R93, "CivetPrologue /[\\t ]*/"), DoubleQuote, CivetPrologueContent, DoubleQuote, SimpleStatementDelimiter, (0, import_lib3.$EXPECT)($R20, "CivetPrologue /[ \\t]*/"), (0, import_lib3.$C)(EOL, (0, import_lib3.$Y)(RestOfLine))), function(value) {
|
|
16833
17235
|
var content = value[2];
|
|
16834
17236
|
return content;
|
|
16835
17237
|
});
|
|
16836
|
-
var CivetPrologue$1 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($
|
|
17238
|
+
var CivetPrologue$1 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($R93, "CivetPrologue /[\\t ]*/"), SingleQuote, CivetPrologueContent, SingleQuote, SimpleStatementDelimiter, (0, import_lib3.$EXPECT)($R20, "CivetPrologue /[ \\t]*/"), (0, import_lib3.$C)(EOL, (0, import_lib3.$Y)(RestOfLine))), function(value) {
|
|
16837
17239
|
var content = value[2];
|
|
16838
17240
|
return content;
|
|
16839
17241
|
});
|
|
@@ -16841,7 +17243,7 @@ var CivetPrologue$$ = [CivetPrologue$0, CivetPrologue$1];
|
|
|
16841
17243
|
function CivetPrologue(ctx, state2) {
|
|
16842
17244
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "CivetPrologue", CivetPrologue$$);
|
|
16843
17245
|
}
|
|
16844
|
-
var CivetPrologueContent$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($L238, 'CivetPrologueContent "civet"'), NonIdContinue, (0, import_lib3.$Q)(CivetOption), (0, import_lib3.$EXPECT)($
|
|
17246
|
+
var CivetPrologueContent$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($L238, 'CivetPrologueContent "civet"'), NonIdContinue, (0, import_lib3.$Q)(CivetOption), (0, import_lib3.$EXPECT)($R94, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
16845
17247
|
var options = $3;
|
|
16846
17248
|
return {
|
|
16847
17249
|
type: "CivetPrologue",
|
|
@@ -16852,7 +17254,7 @@ var CivetPrologueContent$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import
|
|
|
16852
17254
|
function CivetPrologueContent(ctx, state2) {
|
|
16853
17255
|
return (0, import_lib3.$EVENT)(ctx, state2, "CivetPrologueContent", CivetPrologueContent$0);
|
|
16854
17256
|
}
|
|
16855
|
-
var CivetOption$0 = (0, import_lib3.$TR)((0, import_lib3.$EXPECT)($
|
|
17257
|
+
var CivetOption$0 = (0, import_lib3.$TR)((0, import_lib3.$EXPECT)($R95, "CivetOption /\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
|
|
16856
17258
|
const optionName = $2.replace(/-+([a-z]?)/g, (_2, l) => {
|
|
16857
17259
|
if (l)
|
|
16858
17260
|
return l.toUpperCase();
|
|
@@ -16869,11 +17271,11 @@ var CivetOption$0 = (0, import_lib3.$TR)((0, import_lib3.$EXPECT)($R93, "CivetOp
|
|
|
16869
17271
|
function CivetOption(ctx, state2) {
|
|
16870
17272
|
return (0, import_lib3.$EVENT)(ctx, state2, "CivetOption", CivetOption$0);
|
|
16871
17273
|
}
|
|
16872
|
-
var UnknownPrologue$0 = (0, import_lib3.$S)((0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($
|
|
17274
|
+
var UnknownPrologue$0 = (0, import_lib3.$S)((0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($R93, "UnknownPrologue /[\\t ]*/")), StringLiteral, (0, import_lib3.$TEXT)(SimpleStatementDelimiter), EOS);
|
|
16873
17275
|
function UnknownPrologue(ctx, state2) {
|
|
16874
17276
|
return (0, import_lib3.$EVENT)(ctx, state2, "UnknownPrologue", UnknownPrologue$0);
|
|
16875
17277
|
}
|
|
16876
|
-
var TripleSlashDirective$0 = (0, import_lib3.$S)((0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($
|
|
17278
|
+
var TripleSlashDirective$0 = (0, import_lib3.$S)((0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($R96, "TripleSlashDirective /\\/\\/\\/[^\\r\\n]*/")), (0, import_lib3.$E)(EOS));
|
|
16877
17279
|
function TripleSlashDirective(ctx, state2) {
|
|
16878
17280
|
return (0, import_lib3.$EVENT)(ctx, state2, "TripleSlashDirective", TripleSlashDirective$0);
|
|
16879
17281
|
}
|
|
@@ -16889,13 +17291,13 @@ var PrologueString$$ = [PrologueString$0, PrologueString$1];
|
|
|
16889
17291
|
function PrologueString(ctx, state2) {
|
|
16890
17292
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "PrologueString", PrologueString$$);
|
|
16891
17293
|
}
|
|
16892
|
-
var EOS$0 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($
|
|
17294
|
+
var EOS$0 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($R97, "EOS /(?=[ \\t\\r\\n\\/#]|$)/"), (0, import_lib3.$P)(RestOfLine)), function(value) {
|
|
16893
17295
|
return value[1];
|
|
16894
17296
|
});
|
|
16895
17297
|
function EOS(ctx, state2) {
|
|
16896
17298
|
return (0, import_lib3.$EVENT)(ctx, state2, "EOS", EOS$0);
|
|
16897
17299
|
}
|
|
16898
|
-
var EOL$0 = (0, import_lib3.$TR)((0, import_lib3.$EXPECT)($
|
|
17300
|
+
var EOL$0 = (0, import_lib3.$TR)((0, import_lib3.$EXPECT)($R98, "EOL /\\r\\n|\\n|\\r|$/"), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
|
|
16899
17301
|
return { $loc, token: $0 };
|
|
16900
17302
|
});
|
|
16901
17303
|
function EOL(ctx, state2) {
|
|
@@ -16961,6 +17363,18 @@ var InsertCloseBracket$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'I
|
|
|
16961
17363
|
function InsertCloseBracket(ctx, state2) {
|
|
16962
17364
|
return (0, import_lib3.$EVENT)(ctx, state2, "InsertCloseBracket", InsertCloseBracket$0);
|
|
16963
17365
|
}
|
|
17366
|
+
var InsertOpenAngleBracket$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'InsertOpenAngleBracket ""'), function($skip, $loc, $0, $1) {
|
|
17367
|
+
return { $loc, token: "<" };
|
|
17368
|
+
});
|
|
17369
|
+
function InsertOpenAngleBracket(ctx, state2) {
|
|
17370
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "InsertOpenAngleBracket", InsertOpenAngleBracket$0);
|
|
17371
|
+
}
|
|
17372
|
+
var InsertCloseAngleBracket$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'InsertCloseAngleBracket ""'), function($skip, $loc, $0, $1) {
|
|
17373
|
+
return { $loc, token: ">" };
|
|
17374
|
+
});
|
|
17375
|
+
function InsertCloseAngleBracket(ctx, state2) {
|
|
17376
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "InsertCloseAngleBracket", InsertCloseAngleBracket$0);
|
|
17377
|
+
}
|
|
16964
17378
|
var InsertComma$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'InsertComma ""'), function($skip, $loc, $0, $1) {
|
|
16965
17379
|
return { $loc, token: ",", implicit: true };
|
|
16966
17380
|
});
|
|
@@ -17145,6 +17559,22 @@ var CoffeePrototypeEnabled$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0
|
|
|
17145
17559
|
function CoffeePrototypeEnabled(ctx, state2) {
|
|
17146
17560
|
return (0, import_lib3.$EVENT)(ctx, state2, "CoffeePrototypeEnabled", CoffeePrototypeEnabled$0);
|
|
17147
17561
|
}
|
|
17562
|
+
var JSXCodeNestedEnabled$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'JSXCodeNestedEnabled ""'), function($skip, $loc, $0, $1) {
|
|
17563
|
+
if (config.jsxCodeNested)
|
|
17564
|
+
return;
|
|
17565
|
+
return $skip;
|
|
17566
|
+
});
|
|
17567
|
+
function JSXCodeNestedEnabled(ctx, state2) {
|
|
17568
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "JSXCodeNestedEnabled", JSXCodeNestedEnabled$0);
|
|
17569
|
+
}
|
|
17570
|
+
var JSXCodeSameLineEnabled$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'JSXCodeSameLineEnabled ""'), function($skip, $loc, $0, $1) {
|
|
17571
|
+
if (config.jsxCodeSameLine)
|
|
17572
|
+
return;
|
|
17573
|
+
return $skip;
|
|
17574
|
+
});
|
|
17575
|
+
function JSXCodeSameLineEnabled(ctx, state2) {
|
|
17576
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "JSXCodeSameLineEnabled", JSXCodeSameLineEnabled$0);
|
|
17577
|
+
}
|
|
17148
17578
|
var ObjectIsEnabled$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'ObjectIsEnabled ""'), function($skip, $loc, $0, $1) {
|
|
17149
17579
|
if (config.objectIs)
|
|
17150
17580
|
return;
|
|
@@ -17188,6 +17618,7 @@ var Reset$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'Reset ""'), fu
|
|
|
17188
17618
|
coffeePrototype: false,
|
|
17189
17619
|
defaultElement: "div",
|
|
17190
17620
|
implicitReturns: true,
|
|
17621
|
+
jsxCode: false,
|
|
17191
17622
|
objectIs: false,
|
|
17192
17623
|
react: false,
|
|
17193
17624
|
solid: false,
|
|
@@ -17232,6 +17663,16 @@ var Reset$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'Reset ""'), fu
|
|
|
17232
17663
|
}
|
|
17233
17664
|
}
|
|
17234
17665
|
});
|
|
17666
|
+
Object.defineProperty(config, "jsxCode", {
|
|
17667
|
+
set(b) {
|
|
17668
|
+
for (const option of [
|
|
17669
|
+
"jsxCodeNested",
|
|
17670
|
+
"jsxCodeSameLine"
|
|
17671
|
+
]) {
|
|
17672
|
+
config[option] = b;
|
|
17673
|
+
}
|
|
17674
|
+
}
|
|
17675
|
+
});
|
|
17235
17676
|
Object.assign(config, initialConfig);
|
|
17236
17677
|
return {
|
|
17237
17678
|
type: "ParserMeta",
|
|
@@ -17266,7 +17707,7 @@ var Prologue$0 = (0, import_lib3.$Q)((0, import_lib3.$C)(TripleSlashDirective, (
|
|
|
17266
17707
|
function Prologue(ctx, state2) {
|
|
17267
17708
|
return (0, import_lib3.$EVENT)(ctx, state2, "Prologue", Prologue$0);
|
|
17268
17709
|
}
|
|
17269
|
-
var ProloguePrefix$0 = (0, import_lib3.$S)(Prologue, (0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($
|
|
17710
|
+
var ProloguePrefix$0 = (0, import_lib3.$S)(Prologue, (0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($R99, "ProloguePrefix /[^]*/")));
|
|
17270
17711
|
function ProloguePrefix(ctx, state2) {
|
|
17271
17712
|
return (0, import_lib3.$EVENT)(ctx, state2, "ProloguePrefix", ProloguePrefix$0);
|
|
17272
17713
|
}
|
|
@@ -17356,6 +17797,20 @@ var Dedented$0 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$N)(Ind
|
|
|
17356
17797
|
function Dedented(ctx, state2) {
|
|
17357
17798
|
return (0, import_lib3.$EVENT)(ctx, state2, "Dedented", Dedented$0);
|
|
17358
17799
|
}
|
|
17800
|
+
var PushExtraIndent1$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'PushExtraIndent1 ""'), function($skip, $loc, $0, $1) {
|
|
17801
|
+
const indent = {
|
|
17802
|
+
token: "",
|
|
17803
|
+
$loc,
|
|
17804
|
+
level: state.currentIndent.level + 1
|
|
17805
|
+
};
|
|
17806
|
+
if (config.verbose)
|
|
17807
|
+
console.log("pushing bonus indent", indent);
|
|
17808
|
+
state.indentLevels.push(indent);
|
|
17809
|
+
return indent;
|
|
17810
|
+
});
|
|
17811
|
+
function PushExtraIndent1(ctx, state2) {
|
|
17812
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "PushExtraIndent1", PushExtraIndent1$0);
|
|
17813
|
+
}
|
|
17359
17814
|
var parser = function() {
|
|
17360
17815
|
const { fail, validate, reset } = (0, import_lib3.Validator)();
|
|
17361
17816
|
let ctx = { expectation: "", fail };
|
|
@@ -17815,6 +18270,7 @@ var uncacheable = /* @__PURE__ */ new Set([
|
|
|
17815
18270
|
"PopIndent",
|
|
17816
18271
|
"TrackIndented",
|
|
17817
18272
|
"BulletIndent",
|
|
18273
|
+
"PushExtraIndent1",
|
|
17818
18274
|
// JSX
|
|
17819
18275
|
"PushJSXOpeningElement",
|
|
17820
18276
|
"PushJSXOpeningFragment",
|