@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.js
CHANGED
|
@@ -62,7 +62,7 @@ var require_machine = __commonJS({
|
|
|
62
62
|
$N: () => $N2,
|
|
63
63
|
$P: () => $P2,
|
|
64
64
|
$Q: () => $Q2,
|
|
65
|
-
$R: () => $
|
|
65
|
+
$R: () => $R100,
|
|
66
66
|
$R$0: () => $R$02,
|
|
67
67
|
$S: () => $S2,
|
|
68
68
|
$T: () => $T2,
|
|
@@ -99,7 +99,7 @@ var require_machine = __commonJS({
|
|
|
99
99
|
return;
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
|
-
function $
|
|
102
|
+
function $R100(regExp) {
|
|
103
103
|
return function(_ctx, state2) {
|
|
104
104
|
const { input, pos } = state2;
|
|
105
105
|
regExp.lastIndex = state2.pos;
|
|
@@ -511,6 +511,7 @@ __export(lib_exports, {
|
|
|
511
511
|
addPostfixStatement: () => addPostfixStatement,
|
|
512
512
|
adjustBindingElements: () => adjustBindingElements,
|
|
513
513
|
adjustIndexAccess: () => adjustIndexAccess,
|
|
514
|
+
append: () => append,
|
|
514
515
|
attachPostfixStatementAsExpression: () => attachPostfixStatementAsExpression,
|
|
515
516
|
blockWithPrefix: () => blockWithPrefix,
|
|
516
517
|
convertNamedImportsToObject: () => convertNamedImportsToObject,
|
|
@@ -799,7 +800,7 @@ function getTrimmingSpace(target) {
|
|
|
799
800
|
return;
|
|
800
801
|
}
|
|
801
802
|
function prepend(prefix, node) {
|
|
802
|
-
if (!(prefix && prefix
|
|
803
|
+
if (!prefix || Array.isArray(prefix) && len(prefix, 0)) {
|
|
803
804
|
return node;
|
|
804
805
|
}
|
|
805
806
|
if (Array.isArray(node)) {
|
|
@@ -813,6 +814,21 @@ function prepend(prefix, node) {
|
|
|
813
814
|
return [prefix, node];
|
|
814
815
|
}
|
|
815
816
|
}
|
|
817
|
+
function append(node, suffix) {
|
|
818
|
+
if (!suffix || Array.isArray(suffix) && len(suffix, 0)) {
|
|
819
|
+
return node;
|
|
820
|
+
}
|
|
821
|
+
if (Array.isArray(node)) {
|
|
822
|
+
return [...node, suffix];
|
|
823
|
+
} else if (isParent(node)) {
|
|
824
|
+
return {
|
|
825
|
+
...node,
|
|
826
|
+
children: [...node.children, suffix]
|
|
827
|
+
};
|
|
828
|
+
} else {
|
|
829
|
+
return [node, suffix];
|
|
830
|
+
}
|
|
831
|
+
}
|
|
816
832
|
function inplacePrepend(prefix, node) {
|
|
817
833
|
if (!prefix) {
|
|
818
834
|
return;
|
|
@@ -3051,12 +3067,14 @@ function getPatternConditions(pattern, ref, conditions = []) {
|
|
|
3051
3067
|
});
|
|
3052
3068
|
const { blockPrefix } = pattern;
|
|
3053
3069
|
if (blockPrefix) {
|
|
3054
|
-
const postElements = blockPrefix.children[1]
|
|
3070
|
+
const postElements = blockPrefix.children[1];
|
|
3071
|
+
const { length: postLength } = postElements;
|
|
3055
3072
|
postElements.forEach(({ children: [, e] }, i) => {
|
|
3056
3073
|
const subRef = [ref, "[", ref, ".length - ", (postLength + i).toString(), "]"];
|
|
3057
3074
|
return getPatternConditions(e, subRef, conditions);
|
|
3058
3075
|
});
|
|
3059
3076
|
}
|
|
3077
|
+
;
|
|
3060
3078
|
break;
|
|
3061
3079
|
}
|
|
3062
3080
|
case "ObjectBindingPattern": {
|
|
@@ -3064,34 +3082,46 @@ function getPatternConditions(pattern, ref, conditions = []) {
|
|
|
3064
3082
|
["typeof ", ref, " === 'object'"],
|
|
3065
3083
|
[ref, " != null"]
|
|
3066
3084
|
);
|
|
3067
|
-
pattern.properties.
|
|
3085
|
+
for (let ref1 = pattern.properties, i4 = 0, len3 = ref1.length; i4 < len3; i4++) {
|
|
3086
|
+
const p = ref1[i4];
|
|
3068
3087
|
switch (p.type) {
|
|
3069
3088
|
case "PinProperty":
|
|
3070
3089
|
case "BindingProperty": {
|
|
3071
3090
|
const { name, value } = p;
|
|
3072
3091
|
let subRef;
|
|
3073
3092
|
switch (name.type) {
|
|
3074
|
-
case "ComputedPropertyName":
|
|
3093
|
+
case "ComputedPropertyName": {
|
|
3075
3094
|
conditions.push([name.expression, " in ", ref]);
|
|
3076
3095
|
subRef = [ref, name];
|
|
3077
3096
|
break;
|
|
3097
|
+
}
|
|
3078
3098
|
case "Literal":
|
|
3079
3099
|
case "StringLiteral":
|
|
3080
|
-
case "NumericLiteral":
|
|
3100
|
+
case "NumericLiteral": {
|
|
3081
3101
|
conditions.push([name, " in ", ref]);
|
|
3082
3102
|
subRef = [ref, "[", name, "]"];
|
|
3083
3103
|
break;
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3104
|
+
}
|
|
3105
|
+
case "Identifier": {
|
|
3106
|
+
conditions.push(["'", name.name, "' in ", ref]);
|
|
3107
|
+
subRef = [ref, ".", name.name];
|
|
3108
|
+
break;
|
|
3109
|
+
}
|
|
3110
|
+
case "AtBinding": {
|
|
3111
|
+
conditions.push(["'", name.ref.id, "' in ", ref]);
|
|
3112
|
+
subRef = [ref, ".", name.ref.id];
|
|
3113
|
+
break;
|
|
3114
|
+
}
|
|
3087
3115
|
}
|
|
3088
3116
|
if (value) {
|
|
3089
3117
|
getPatternConditions(value, subRef, conditions);
|
|
3090
3118
|
}
|
|
3119
|
+
;
|
|
3091
3120
|
break;
|
|
3092
3121
|
}
|
|
3093
3122
|
}
|
|
3094
|
-
}
|
|
3123
|
+
}
|
|
3124
|
+
;
|
|
3095
3125
|
break;
|
|
3096
3126
|
}
|
|
3097
3127
|
case "ConditionFragment": {
|
|
@@ -3115,22 +3145,22 @@ function getPatternConditions(pattern, ref, conditions = []) {
|
|
|
3115
3145
|
);
|
|
3116
3146
|
break;
|
|
3117
3147
|
}
|
|
3118
|
-
case "PinPattern":
|
|
3148
|
+
case "PinPattern": {
|
|
3119
3149
|
conditions.push([
|
|
3120
3150
|
ref,
|
|
3121
3151
|
" === ",
|
|
3122
3152
|
pattern.expression
|
|
3123
3153
|
]);
|
|
3124
3154
|
break;
|
|
3125
|
-
|
|
3155
|
+
}
|
|
3156
|
+
case "Literal": {
|
|
3126
3157
|
conditions.push([
|
|
3127
3158
|
ref,
|
|
3128
3159
|
" === ",
|
|
3129
3160
|
pattern
|
|
3130
3161
|
]);
|
|
3131
3162
|
break;
|
|
3132
|
-
|
|
3133
|
-
break;
|
|
3163
|
+
}
|
|
3134
3164
|
}
|
|
3135
3165
|
return conditions;
|
|
3136
3166
|
}
|
|
@@ -3263,26 +3293,24 @@ function nonMatcherBindings(pattern) {
|
|
|
3263
3293
|
function aggregateDuplicateBindings(bindings) {
|
|
3264
3294
|
const props = gatherRecursiveAll(bindings, ($10) => $10.type === "BindingProperty");
|
|
3265
3295
|
const arrayBindings = gatherRecursiveAll(bindings, ($11) => $11.type === "ArrayBindingPattern");
|
|
3266
|
-
arrayBindings.
|
|
3267
|
-
const { elements } =
|
|
3268
|
-
|
|
3296
|
+
for (let i5 = 0, len4 = arrayBindings.length; i5 < len4; i5++) {
|
|
3297
|
+
const { elements } = arrayBindings[i5];
|
|
3298
|
+
for (let i6 = 0, len5 = elements.length; i6 < len5; i6++) {
|
|
3299
|
+
const element = elements[i6];
|
|
3269
3300
|
if (Array.isArray(element)) {
|
|
3270
3301
|
const [, e] = element;
|
|
3271
3302
|
if (e.type === "Identifier") {
|
|
3272
|
-
|
|
3303
|
+
props.push(e);
|
|
3273
3304
|
} else if (e.type === "BindingRestElement") {
|
|
3274
|
-
|
|
3305
|
+
props.push(e);
|
|
3275
3306
|
}
|
|
3276
|
-
;
|
|
3277
|
-
return;
|
|
3278
3307
|
}
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
});
|
|
3282
|
-
});
|
|
3308
|
+
}
|
|
3309
|
+
}
|
|
3283
3310
|
const declarations = [];
|
|
3284
3311
|
const propsGroupedByName = /* @__PURE__ */ new Map();
|
|
3285
|
-
for (
|
|
3312
|
+
for (let i7 = 0, len6 = props.length; i7 < len6; i7++) {
|
|
3313
|
+
const p = props[i7];
|
|
3286
3314
|
const { name, value } = p;
|
|
3287
3315
|
let m1;
|
|
3288
3316
|
if (m1 = value?.type, m1 === "ArrayBindingPattern" || m1 === "ObjectBindingPattern") {
|
|
@@ -3304,9 +3332,10 @@ function aggregateDuplicateBindings(bindings) {
|
|
|
3304
3332
|
pos: 0,
|
|
3305
3333
|
input: key
|
|
3306
3334
|
})) {
|
|
3307
|
-
shared.
|
|
3308
|
-
|
|
3309
|
-
|
|
3335
|
+
for (let i8 = 0, len7 = shared.length; i8 < len7; i8++) {
|
|
3336
|
+
const p = shared[i8];
|
|
3337
|
+
aliasBinding(p, makeRef(`_${key}`, key));
|
|
3338
|
+
}
|
|
3310
3339
|
return;
|
|
3311
3340
|
}
|
|
3312
3341
|
if (shared.length === 1) {
|
|
@@ -5184,9 +5213,8 @@ function expressionizeIfStatement(statement) {
|
|
|
5184
5213
|
children
|
|
5185
5214
|
});
|
|
5186
5215
|
}
|
|
5187
|
-
function expressionizeTypeIf([
|
|
5216
|
+
function expressionizeTypeIf([ifOp, condition, t, e]) {
|
|
5188
5217
|
const children = [
|
|
5189
|
-
ws,
|
|
5190
5218
|
"(",
|
|
5191
5219
|
insertTrimmingSpace(condition, ""),
|
|
5192
5220
|
"?"
|
|
@@ -7076,11 +7104,15 @@ var grammar = {
|
|
|
7076
7104
|
InlineJSXMemberExpressionRest,
|
|
7077
7105
|
InlineJSXPrimaryExpression,
|
|
7078
7106
|
JSXMixedChildren,
|
|
7107
|
+
JSXSameLineChildren,
|
|
7079
7108
|
JSXChildren,
|
|
7080
7109
|
JSXNestedChildren,
|
|
7081
7110
|
JSXEOS,
|
|
7082
7111
|
JSXNested,
|
|
7083
7112
|
JSXChild,
|
|
7113
|
+
JSXChildForcedCode,
|
|
7114
|
+
JSXChildForcedNoCode,
|
|
7115
|
+
JSXChildGeneral,
|
|
7084
7116
|
JSXComment,
|
|
7085
7117
|
JSXCommentContent,
|
|
7086
7118
|
JSXText,
|
|
@@ -7088,7 +7120,8 @@ var grammar = {
|
|
|
7088
7120
|
IndentedJSXChildExpression,
|
|
7089
7121
|
NestedJSXChildExpression,
|
|
7090
7122
|
JSXAngleChild,
|
|
7091
|
-
|
|
7123
|
+
JSXCodeChild,
|
|
7124
|
+
JSXCodeChildExpression,
|
|
7092
7125
|
UsingDeclaration,
|
|
7093
7126
|
UsingBinding,
|
|
7094
7127
|
UsingJSModeError,
|
|
@@ -7138,6 +7171,8 @@ var grammar = {
|
|
|
7138
7171
|
TypePredicate,
|
|
7139
7172
|
Type,
|
|
7140
7173
|
TypeBinary,
|
|
7174
|
+
NestedTypeBinaryChain,
|
|
7175
|
+
NestedTypeBinary,
|
|
7141
7176
|
TypeUnary,
|
|
7142
7177
|
TypeUnarySuffix,
|
|
7143
7178
|
TypeUnaryOp,
|
|
@@ -7146,13 +7181,21 @@ var grammar = {
|
|
|
7146
7181
|
TypePrimary,
|
|
7147
7182
|
ImportType,
|
|
7148
7183
|
TypeTuple,
|
|
7149
|
-
|
|
7184
|
+
TypeTupleContent,
|
|
7185
|
+
TypeElementListWithIndentedApplicationForbidden,
|
|
7186
|
+
TypeElementList,
|
|
7150
7187
|
TypeElement,
|
|
7151
|
-
|
|
7152
|
-
|
|
7188
|
+
NestedTypeElementList,
|
|
7189
|
+
NestedTypeElement,
|
|
7190
|
+
NestedTypeBulletedTuple,
|
|
7191
|
+
TypeBulletedTuple,
|
|
7192
|
+
NestedTypeBullet,
|
|
7193
|
+
TypeBullet,
|
|
7194
|
+
TypeWithPostfix,
|
|
7153
7195
|
TypeConditional,
|
|
7154
7196
|
TypeCondition,
|
|
7155
7197
|
TypeIfThenElse,
|
|
7198
|
+
TypeIfClause,
|
|
7156
7199
|
TypeElse,
|
|
7157
7200
|
TypeBlock,
|
|
7158
7201
|
TypeTemplateSubstitution,
|
|
@@ -7167,6 +7210,14 @@ var grammar = {
|
|
|
7167
7210
|
TypeFunction,
|
|
7168
7211
|
TypeArrowFunction,
|
|
7169
7212
|
TypeArguments,
|
|
7213
|
+
ImplicitTypeArguments,
|
|
7214
|
+
TypeApplicationStart,
|
|
7215
|
+
ForbiddenImplicitTypeCalls,
|
|
7216
|
+
TypeArgumentList,
|
|
7217
|
+
NestedTypeArgumentList,
|
|
7218
|
+
NestedTypeArgument,
|
|
7219
|
+
SingleLineTypeArgumentList,
|
|
7220
|
+
TypeArgumentDelimited,
|
|
7170
7221
|
TypeArgument,
|
|
7171
7222
|
TypeArgumentDelimiter,
|
|
7172
7223
|
TypeParameters,
|
|
@@ -7195,6 +7246,8 @@ var grammar = {
|
|
|
7195
7246
|
InsertCloseBrace,
|
|
7196
7247
|
InsertOpenBracket,
|
|
7197
7248
|
InsertCloseBracket,
|
|
7249
|
+
InsertOpenAngleBracket,
|
|
7250
|
+
InsertCloseAngleBracket,
|
|
7198
7251
|
InsertComma,
|
|
7199
7252
|
InsertSpaceEquals,
|
|
7200
7253
|
InsertConst,
|
|
@@ -7221,6 +7274,8 @@ var grammar = {
|
|
|
7221
7274
|
CoffeeNotEnabled,
|
|
7222
7275
|
CoffeeOfEnabled,
|
|
7223
7276
|
CoffeePrototypeEnabled,
|
|
7277
|
+
JSXCodeNestedEnabled,
|
|
7278
|
+
JSXCodeSameLineEnabled,
|
|
7224
7279
|
ObjectIsEnabled,
|
|
7225
7280
|
Reset,
|
|
7226
7281
|
Init,
|
|
@@ -7234,7 +7289,8 @@ var grammar = {
|
|
|
7234
7289
|
IndentedFurther,
|
|
7235
7290
|
IndentedAtLeast,
|
|
7236
7291
|
NotDedented,
|
|
7237
|
-
Dedented
|
|
7292
|
+
Dedented,
|
|
7293
|
+
PushExtraIndent1
|
|
7238
7294
|
};
|
|
7239
7295
|
var $L0 = (0, import_lib3.$L)("");
|
|
7240
7296
|
var $L1 = (0, import_lib3.$L)("{");
|
|
@@ -7481,7 +7537,7 @@ var $R2 = (0, import_lib3.$R)(new RegExp("(as|of|satisfies|then|when|implements|
|
|
|
7481
7537
|
var $R3 = (0, import_lib3.$R)(new RegExp("[0-9]", "suy"));
|
|
7482
7538
|
var $R4 = (0, import_lib3.$R)(new RegExp("(?!\\p{ID_Start}|[_$0-9(\\[{])", "suy"));
|
|
7483
7539
|
var $R5 = (0, import_lib3.$R)(new RegExp("[ \\t]", "suy"));
|
|
7484
|
-
var $R6 = (0, import_lib3.$R)(new RegExp("\\p{ID_Continue}|[\\u200C\\u200D$.#{]", "suy"));
|
|
7540
|
+
var $R6 = (0, import_lib3.$R)(new RegExp("\\p{ID_Continue}|[\\u200C\\u200D$.#{=]", "suy"));
|
|
7485
7541
|
var $R7 = (0, import_lib3.$R)(new RegExp("[&=]", "suy"));
|
|
7486
7542
|
var $R8 = (0, import_lib3.$R)(new RegExp("(?=['\"`])", "suy"));
|
|
7487
7543
|
var $R9 = (0, import_lib3.$R)(new RegExp("(?=[\\/?])", "suy"));
|
|
@@ -7565,14 +7621,16 @@ var $R86 = (0, import_lib3.$R)(new RegExp("(?:-[^-]|[^-]*)*", "suy"));
|
|
|
7565
7621
|
var $R87 = (0, import_lib3.$R)(new RegExp("[^{}<>\\r\\n]+", "suy"));
|
|
7566
7622
|
var $R88 = (0, import_lib3.$R)(new RegExp("[+-]?", "suy"));
|
|
7567
7623
|
var $R89 = (0, import_lib3.$R)(new RegExp("(?=if|unless)", "suy"));
|
|
7568
|
-
var $R90 = (0, import_lib3.$R)(new RegExp("
|
|
7569
|
-
var $R91 = (0, import_lib3.$R)(new RegExp("[\\
|
|
7570
|
-
var $R92 = (0, import_lib3.$R)(new RegExp("[\\
|
|
7571
|
-
var $R93 = (0, import_lib3.$R)(new RegExp("
|
|
7572
|
-
var $R94 = (0, import_lib3.$R)(new RegExp("
|
|
7573
|
-
var $R95 = (0, import_lib3.$R)(new RegExp("(
|
|
7574
|
-
var $R96 = (0, import_lib3.$R)(new RegExp("
|
|
7575
|
-
var $R97 = (0, import_lib3.$R)(new RegExp("[
|
|
7624
|
+
var $R90 = (0, import_lib3.$R)(new RegExp("[|&<!=\\-\u21D2\u2192]", "suy"));
|
|
7625
|
+
var $R91 = (0, import_lib3.$R)(new RegExp("(extends|not|is)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
|
|
7626
|
+
var $R92 = (0, import_lib3.$R)(new RegExp("#![^\\r\\n]*", "suy"));
|
|
7627
|
+
var $R93 = (0, import_lib3.$R)(new RegExp("[\\t ]*", "suy"));
|
|
7628
|
+
var $R94 = (0, import_lib3.$R)(new RegExp("[\\s]*", "suy"));
|
|
7629
|
+
var $R95 = (0, import_lib3.$R)(new RegExp("\\s+([+-]?)([a-zA-Z0-9-]+)(\\s*=\\s*([a-zA-Z0-9.+-]*))?", "suy"));
|
|
7630
|
+
var $R96 = (0, import_lib3.$R)(new RegExp("\\/\\/\\/[^\\r\\n]*", "suy"));
|
|
7631
|
+
var $R97 = (0, import_lib3.$R)(new RegExp("(?=[ \\t\\r\\n\\/#]|$)", "suy"));
|
|
7632
|
+
var $R98 = (0, import_lib3.$R)(new RegExp("\\r\\n|\\n|\\r|$", "suy"));
|
|
7633
|
+
var $R99 = (0, import_lib3.$R)(new RegExp("[^]*", "suy"));
|
|
7576
7634
|
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) {
|
|
7577
7635
|
var reset = $1;
|
|
7578
7636
|
var init = $2;
|
|
@@ -7759,6 +7817,9 @@ var ImplicitArguments$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(ApplicationSt
|
|
|
7759
7817
|
var close = $5;
|
|
7760
7818
|
if (skipImplicitArguments(args))
|
|
7761
7819
|
return $skip;
|
|
7820
|
+
let last = args[args.length - 1];
|
|
7821
|
+
if (last?.token === "," && last.implicit)
|
|
7822
|
+
args = args.slice(0, -1);
|
|
7762
7823
|
return {
|
|
7763
7824
|
type: "Call",
|
|
7764
7825
|
args,
|
|
@@ -8113,7 +8174,7 @@ var NWTypePostfix$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(As, _, Tuple), fu
|
|
|
8113
8174
|
children: [{ $loc: $1.$loc, token: "satisfies" }, $2, $3]
|
|
8114
8175
|
};
|
|
8115
8176
|
});
|
|
8116
|
-
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) {
|
|
8177
|
+
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) {
|
|
8117
8178
|
var as = $1;
|
|
8118
8179
|
var ex = $2;
|
|
8119
8180
|
var type = $3;
|
|
@@ -8467,7 +8528,7 @@ var ParenthesizedExpression$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(OpenPar
|
|
|
8467
8528
|
function ParenthesizedExpression(ctx, state2) {
|
|
8468
8529
|
return (0, import_lib3.$EVENT)(ctx, state2, "ParenthesizedExpression", ParenthesizedExpression$0);
|
|
8469
8530
|
}
|
|
8470
|
-
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) {
|
|
8531
|
+
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) {
|
|
8471
8532
|
var dot = $1;
|
|
8472
8533
|
var typeSuffix = $3;
|
|
8473
8534
|
return {
|
|
@@ -9420,18 +9481,18 @@ var NonEmptyParameters$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_l
|
|
|
9420
9481
|
var params = $3;
|
|
9421
9482
|
var close = $4;
|
|
9422
9483
|
let tt, before = [], rest, after = [], errors = [];
|
|
9423
|
-
function
|
|
9484
|
+
function append2(p) {
|
|
9424
9485
|
(rest ? after : before).push(p);
|
|
9425
9486
|
}
|
|
9426
9487
|
for (const param of params) {
|
|
9427
9488
|
switch (param.type) {
|
|
9428
9489
|
case "ThisType":
|
|
9429
9490
|
if (tt) {
|
|
9430
|
-
|
|
9491
|
+
append2({
|
|
9431
9492
|
type: "Error",
|
|
9432
9493
|
message: "Only one typed this parameter is allowed"
|
|
9433
9494
|
});
|
|
9434
|
-
|
|
9495
|
+
append2(param);
|
|
9435
9496
|
} else {
|
|
9436
9497
|
tt = trimFirstSpace(param);
|
|
9437
9498
|
if (before.length || rest) {
|
|
@@ -9449,17 +9510,17 @@ var NonEmptyParameters$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_l
|
|
|
9449
9510
|
break;
|
|
9450
9511
|
case "FunctionRestParameter":
|
|
9451
9512
|
if (rest) {
|
|
9452
|
-
|
|
9513
|
+
append2({
|
|
9453
9514
|
type: "Error",
|
|
9454
9515
|
message: "Only one rest parameter is allowed"
|
|
9455
9516
|
});
|
|
9456
|
-
|
|
9517
|
+
append2(param);
|
|
9457
9518
|
} else {
|
|
9458
9519
|
rest = param;
|
|
9459
9520
|
}
|
|
9460
9521
|
break;
|
|
9461
9522
|
default:
|
|
9462
|
-
|
|
9523
|
+
append2(param);
|
|
9463
9524
|
}
|
|
9464
9525
|
}
|
|
9465
9526
|
const names = before.flatMap((p) => p.names);
|
|
@@ -10964,15 +11025,10 @@ var NestedElement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Nested, ElementLi
|
|
|
10964
11025
|
if (!length)
|
|
10965
11026
|
return $skip;
|
|
10966
11027
|
return list.map((e, i) => {
|
|
10967
|
-
if (i === 0
|
|
10968
|
-
|
|
10969
|
-
|
|
10970
|
-
|
|
10971
|
-
return { ...e, children: [indent, ...e.children] };
|
|
10972
|
-
}
|
|
10973
|
-
if (i === length - 1) {
|
|
10974
|
-
return { ...e, children: [...e.children, delimiter] };
|
|
10975
|
-
}
|
|
11028
|
+
if (i === 0)
|
|
11029
|
+
e = prepend(indent, e);
|
|
11030
|
+
if (i === length - 1)
|
|
11031
|
+
e = append(e, delimiter);
|
|
10976
11032
|
return e;
|
|
10977
11033
|
});
|
|
10978
11034
|
});
|
|
@@ -11002,19 +11058,13 @@ var ElementList$0 = (0, import_lib3.$T)((0, import_lib3.$S)(BulletedArray), func
|
|
|
11002
11058
|
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) {
|
|
11003
11059
|
var first = $2;
|
|
11004
11060
|
var rest = $3;
|
|
11005
|
-
if (rest.length)
|
|
11006
|
-
return [
|
|
11007
|
-
|
|
11008
|
-
|
|
11009
|
-
|
|
11010
|
-
|
|
11011
|
-
|
|
11012
|
-
...e,
|
|
11013
|
-
children: [...e.children, delim]
|
|
11014
|
-
};
|
|
11015
|
-
}));
|
|
11016
|
-
}
|
|
11017
|
-
return [first];
|
|
11061
|
+
if (!rest.length)
|
|
11062
|
+
return [first];
|
|
11063
|
+
return [
|
|
11064
|
+
append(first, rest[0][0])
|
|
11065
|
+
].concat(
|
|
11066
|
+
rest.map(([_2, e], i) => append(e, rest[i + 1]?.[0]))
|
|
11067
|
+
);
|
|
11018
11068
|
});
|
|
11019
11069
|
var ElementList$$ = [ElementList$0, ElementList$1];
|
|
11020
11070
|
function ElementList(ctx, state2) {
|
|
@@ -11075,9 +11125,10 @@ var NestedBulletedArray$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_
|
|
|
11075
11125
|
if (!content.length)
|
|
11076
11126
|
return $skip;
|
|
11077
11127
|
content = content.flat();
|
|
11078
|
-
const
|
|
11079
|
-
if (children
|
|
11080
|
-
children.
|
|
11128
|
+
const last = content[content.length - 1];
|
|
11129
|
+
if (last.children?.at(-1)?.implicit) {
|
|
11130
|
+
last.children = last.children.slice(0, -1);
|
|
11131
|
+
}
|
|
11081
11132
|
return {
|
|
11082
11133
|
type: "ArrayExpression",
|
|
11083
11134
|
children: [...open, ...content, close]
|
|
@@ -11097,9 +11148,10 @@ var BulletedArray$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(InsertOpenBracket
|
|
|
11097
11148
|
// replace first space with bracket
|
|
11098
11149
|
...content[1].flat()
|
|
11099
11150
|
];
|
|
11100
|
-
const
|
|
11101
|
-
if (children
|
|
11102
|
-
children.
|
|
11151
|
+
const last = content[content.length - 1];
|
|
11152
|
+
if (last.children?.at(-1)?.implicit) {
|
|
11153
|
+
last.children = last.children.slice(0, -1);
|
|
11154
|
+
}
|
|
11103
11155
|
return {
|
|
11104
11156
|
type: "ArrayExpression",
|
|
11105
11157
|
children: [open, ...content, close]
|
|
@@ -11111,7 +11163,7 @@ function BulletedArray(ctx, state2) {
|
|
|
11111
11163
|
var NestedArrayBullet$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Nested, ArrayBullet), function($skip, $loc, $0, $1, $2) {
|
|
11112
11164
|
var indent = $1;
|
|
11113
11165
|
var list = $2;
|
|
11114
|
-
return list.map((e, i) => i === 0 ?
|
|
11166
|
+
return list.map((e, i) => i === 0 ? prepend(indent, e) : e);
|
|
11115
11167
|
});
|
|
11116
11168
|
function NestedArrayBullet(ctx, state2) {
|
|
11117
11169
|
return (0, import_lib3.$EVENT)(ctx, state2, "NestedArrayBullet", NestedArrayBullet$0);
|
|
@@ -11122,15 +11174,13 @@ var ArrayBullet$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(BulletIndent, (0, i
|
|
|
11122
11174
|
if (!content)
|
|
11123
11175
|
return $skip;
|
|
11124
11176
|
let [list, delimiter] = content;
|
|
11125
|
-
if (list.type === "ArrayExpression")
|
|
11126
|
-
list = [list];
|
|
11127
11177
|
if (!list.length)
|
|
11128
11178
|
return $skip;
|
|
11129
11179
|
list = list.slice();
|
|
11130
|
-
list[0] =
|
|
11180
|
+
list[0] = prepend(bullet, list[0]);
|
|
11131
11181
|
if (delimiter) {
|
|
11132
11182
|
const last = list.length - 1;
|
|
11133
|
-
list[last] =
|
|
11183
|
+
list[last] = append(list[last], delimiter);
|
|
11134
11184
|
}
|
|
11135
11185
|
return list;
|
|
11136
11186
|
});
|
|
@@ -15782,7 +15832,7 @@ var InlineJSXPrimaryExpression$$ = [InlineJSXPrimaryExpression$0, InlineJSXPrima
|
|
|
15782
15832
|
function InlineJSXPrimaryExpression(ctx, state2) {
|
|
15783
15833
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "InlineJSXPrimaryExpression", InlineJSXPrimaryExpression$$);
|
|
15784
15834
|
}
|
|
15785
|
-
var JSXMixedChildren$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(
|
|
15835
|
+
var JSXMixedChildren$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(JSXSameLineChildren, JSXNestedChildren), function($skip, $loc, $0, $1, $2) {
|
|
15786
15836
|
var c1 = $1;
|
|
15787
15837
|
var c2 = $2;
|
|
15788
15838
|
return {
|
|
@@ -15793,6 +15843,18 @@ var JSXMixedChildren$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib
|
|
|
15793
15843
|
function JSXMixedChildren(ctx, state2) {
|
|
15794
15844
|
return (0, import_lib3.$EVENT)(ctx, state2, "JSXMixedChildren", JSXMixedChildren$0);
|
|
15795
15845
|
}
|
|
15846
|
+
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) {
|
|
15847
|
+
var children = $2;
|
|
15848
|
+
return children.map(([, , c]) => c);
|
|
15849
|
+
});
|
|
15850
|
+
var JSXSameLineChildren$1 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$N)(JSXCodeSameLineEnabled), (0, import_lib3.$Q)(JSXChildForcedNoCode)), function(value) {
|
|
15851
|
+
var children = value[1];
|
|
15852
|
+
return children;
|
|
15853
|
+
});
|
|
15854
|
+
var JSXSameLineChildren$$ = [JSXSameLineChildren$0, JSXSameLineChildren$1];
|
|
15855
|
+
function JSXSameLineChildren(ctx, state2) {
|
|
15856
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "JSXSameLineChildren", JSXSameLineChildren$$);
|
|
15857
|
+
}
|
|
15796
15858
|
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) {
|
|
15797
15859
|
return {
|
|
15798
15860
|
children: $1,
|
|
@@ -15834,10 +15896,33 @@ var JSXNested$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(JSXEOS, Indent), func
|
|
|
15834
15896
|
function JSXNested(ctx, state2) {
|
|
15835
15897
|
return (0, import_lib3.$EVENT)(ctx, state2, "JSXNested", JSXNested$0);
|
|
15836
15898
|
}
|
|
15837
|
-
var JSXChild$0 =
|
|
15838
|
-
var JSXChild$1 =
|
|
15839
|
-
|
|
15840
|
-
|
|
15899
|
+
var JSXChild$0 = JSXChildGeneral;
|
|
15900
|
+
var JSXChild$1 = (0, import_lib3.$T)((0, import_lib3.$S)(JSXCodeNestedEnabled, JSXCodeChild), function(value) {
|
|
15901
|
+
return value[1];
|
|
15902
|
+
});
|
|
15903
|
+
var JSXChild$2 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$N)(JSXCodeNestedEnabled), JSXText), function(value) {
|
|
15904
|
+
return value[1];
|
|
15905
|
+
});
|
|
15906
|
+
var JSXChild$$ = [JSXChild$0, JSXChild$1, JSXChild$2];
|
|
15907
|
+
function JSXChild(ctx, state2) {
|
|
15908
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "JSXChild", JSXChild$$);
|
|
15909
|
+
}
|
|
15910
|
+
var JSXChildForcedCode$0 = JSXChildGeneral;
|
|
15911
|
+
var JSXChildForcedCode$1 = JSXCodeChild;
|
|
15912
|
+
var JSXChildForcedCode$$ = [JSXChildForcedCode$0, JSXChildForcedCode$1];
|
|
15913
|
+
function JSXChildForcedCode(ctx, state2) {
|
|
15914
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "JSXChildForcedCode", JSXChildForcedCode$$);
|
|
15915
|
+
}
|
|
15916
|
+
var JSXChildForcedNoCode$0 = JSXChildGeneral;
|
|
15917
|
+
var JSXChildForcedNoCode$1 = JSXText;
|
|
15918
|
+
var JSXChildForcedNoCode$$ = [JSXChildForcedNoCode$0, JSXChildForcedNoCode$1];
|
|
15919
|
+
function JSXChildForcedNoCode(ctx, state2) {
|
|
15920
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "JSXChildForcedNoCode", JSXChildForcedNoCode$$);
|
|
15921
|
+
}
|
|
15922
|
+
var JSXChildGeneral$0 = JSXElement;
|
|
15923
|
+
var JSXChildGeneral$1 = JSXFragment;
|
|
15924
|
+
var JSXChildGeneral$2 = JSXComment;
|
|
15925
|
+
var JSXChildGeneral$3 = (0, import_lib3.$TS)((0, import_lib3.$S)(OpenBrace, IndentedJSXChildExpression, __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
15841
15926
|
var expression = $2;
|
|
15842
15927
|
return {
|
|
15843
15928
|
type: "JSXChildExpression",
|
|
@@ -15845,7 +15930,7 @@ var JSXChild$3 = (0, import_lib3.$TS)((0, import_lib3.$S)(OpenBrace, IndentedJSX
|
|
|
15845
15930
|
expression
|
|
15846
15931
|
};
|
|
15847
15932
|
});
|
|
15848
|
-
var
|
|
15933
|
+
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) {
|
|
15849
15934
|
var expression = $2;
|
|
15850
15935
|
return {
|
|
15851
15936
|
type: "JSXChildExpression",
|
|
@@ -15853,7 +15938,7 @@ var JSXChild$4 = (0, import_lib3.$TS)((0, import_lib3.$S)(OpenBrace, (0, import_
|
|
|
15853
15938
|
expression
|
|
15854
15939
|
};
|
|
15855
15940
|
});
|
|
15856
|
-
var
|
|
15941
|
+
var JSXChildGeneral$5 = (0, import_lib3.$TS)((0, import_lib3.$S)(InsertInlineOpenBrace, ArrowFunction, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3) {
|
|
15857
15942
|
var expression = $2;
|
|
15858
15943
|
return {
|
|
15859
15944
|
type: "JSXChildExpression",
|
|
@@ -15861,11 +15946,10 @@ var JSXChild$5 = (0, import_lib3.$TS)((0, import_lib3.$S)(InsertInlineOpenBrace,
|
|
|
15861
15946
|
expression
|
|
15862
15947
|
};
|
|
15863
15948
|
});
|
|
15864
|
-
var
|
|
15865
|
-
var
|
|
15866
|
-
|
|
15867
|
-
|
|
15868
|
-
return (0, import_lib3.$EVENT_C)(ctx, state2, "JSXChild", JSXChild$$);
|
|
15949
|
+
var JSXChildGeneral$6 = JSXAngleChild;
|
|
15950
|
+
var JSXChildGeneral$$ = [JSXChildGeneral$0, JSXChildGeneral$1, JSXChildGeneral$2, JSXChildGeneral$3, JSXChildGeneral$4, JSXChildGeneral$5, JSXChildGeneral$6];
|
|
15951
|
+
function JSXChildGeneral(ctx, state2) {
|
|
15952
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "JSXChildGeneral", JSXChildGeneral$$);
|
|
15869
15953
|
}
|
|
15870
15954
|
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) {
|
|
15871
15955
|
return ["{/*", $2, "*/}"];
|
|
@@ -15889,9 +15973,42 @@ var JSXText$0 = (0, import_lib3.$TR)((0, import_lib3.$EXPECT)($R87, "JSXText /[^
|
|
|
15889
15973
|
function JSXText(ctx, state2) {
|
|
15890
15974
|
return (0, import_lib3.$EVENT)(ctx, state2, "JSXText", JSXText$0);
|
|
15891
15975
|
}
|
|
15892
|
-
var JSXChildExpression$0 = (0, import_lib3.$
|
|
15976
|
+
var JSXChildExpression$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(Whitespace), LexicalDeclaration), function($skip, $loc, $0, $1, $2) {
|
|
15977
|
+
var d = $2;
|
|
15978
|
+
let names = d.names.concat(
|
|
15979
|
+
d.thisAssignments.map((a) => a[1][1])
|
|
15980
|
+
);
|
|
15981
|
+
names.sort();
|
|
15982
|
+
names = names.filter((name, i) => i === 0 || name !== names[i - 1]);
|
|
15983
|
+
d = {
|
|
15984
|
+
...d,
|
|
15985
|
+
hoistDec: {
|
|
15986
|
+
type: "Declaration",
|
|
15987
|
+
children: [
|
|
15988
|
+
"let ",
|
|
15989
|
+
names.map((n, i) => i === 0 ? [n] : [",", n]).flat()
|
|
15990
|
+
]
|
|
15991
|
+
},
|
|
15992
|
+
children: d.children.slice(1)
|
|
15993
|
+
// drop LetOrConst
|
|
15994
|
+
};
|
|
15995
|
+
if (d.thisAssignments?.length) {
|
|
15996
|
+
d.children.push(...d.splices, ",", ...d.thisAssignments.map(
|
|
15997
|
+
(a, i) => a[a.length - 1] === ";" ? [
|
|
15998
|
+
...a.slice(0, -1),
|
|
15999
|
+
i === d.thisAssignments.length - 1 ? "" : ","
|
|
16000
|
+
] : a
|
|
16001
|
+
));
|
|
16002
|
+
} else if (d.splices?.length) {
|
|
16003
|
+
d.children.push(...d.splices);
|
|
16004
|
+
}
|
|
16005
|
+
d.children.push(",void 0");
|
|
16006
|
+
return d;
|
|
16007
|
+
});
|
|
16008
|
+
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);
|
|
16009
|
+
var JSXChildExpression$$ = [JSXChildExpression$0, JSXChildExpression$1];
|
|
15893
16010
|
function JSXChildExpression(ctx, state2) {
|
|
15894
|
-
return (0, import_lib3.$
|
|
16011
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "JSXChildExpression", JSXChildExpression$$);
|
|
15895
16012
|
}
|
|
15896
16013
|
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) {
|
|
15897
16014
|
if (!$2)
|
|
@@ -15905,24 +16022,30 @@ var NestedJSXChildExpression$0 = (0, import_lib3.$S)(JSXNested, JSXChildExpressi
|
|
|
15905
16022
|
function NestedJSXChildExpression(ctx, state2) {
|
|
15906
16023
|
return (0, import_lib3.$EVENT)(ctx, state2, "NestedJSXChildExpression", NestedJSXChildExpression$0);
|
|
15907
16024
|
}
|
|
15908
|
-
var JSXAngleChild$0 = (0, import_lib3.$
|
|
15909
|
-
|
|
15910
|
-
|
|
15911
|
-
|
|
16025
|
+
var JSXAngleChild$0 = (0, import_lib3.$T)((0, import_lib3.$S)(CloseAngleBracket, JSXCodeChild), function(value) {
|
|
16026
|
+
return value[1];
|
|
16027
|
+
});
|
|
16028
|
+
function JSXAngleChild(ctx, state2) {
|
|
16029
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "JSXAngleChild", JSXAngleChild$0);
|
|
16030
|
+
}
|
|
16031
|
+
var JSXCodeChild$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(InsertInlineOpenBrace, JSXCodeChildExpression, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3) {
|
|
16032
|
+
var open = $1;
|
|
16033
|
+
var expression = $2;
|
|
16034
|
+
var close = $3;
|
|
15912
16035
|
if (!expression)
|
|
15913
16036
|
return $skip;
|
|
15914
16037
|
return [open, expression, close];
|
|
15915
16038
|
});
|
|
15916
|
-
function
|
|
15917
|
-
return (0, import_lib3.$EVENT)(ctx, state2, "
|
|
16039
|
+
function JSXCodeChild(ctx, state2) {
|
|
16040
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "JSXCodeChild", JSXCodeChild$0);
|
|
15918
16041
|
}
|
|
15919
|
-
var
|
|
16042
|
+
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) {
|
|
15920
16043
|
var expression = $3;
|
|
15921
16044
|
if (!expression)
|
|
15922
16045
|
return $skip;
|
|
15923
16046
|
return expression;
|
|
15924
16047
|
});
|
|
15925
|
-
var
|
|
16048
|
+
var JSXCodeChildExpression$1 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$Y)(JSXEOS), ImplicitNestedBlock), function($skip, $loc, $0, $1, $2) {
|
|
15926
16049
|
var block = $2;
|
|
15927
16050
|
if (!block)
|
|
15928
16051
|
return $skip;
|
|
@@ -15937,9 +16060,9 @@ var JSXAngleChildExpression$1 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, imp
|
|
|
15937
16060
|
children: [statement]
|
|
15938
16061
|
};
|
|
15939
16062
|
});
|
|
15940
|
-
var
|
|
15941
|
-
function
|
|
15942
|
-
return (0, import_lib3.$EVENT_C)(ctx, state2, "
|
|
16063
|
+
var JSXCodeChildExpression$$ = [JSXCodeChildExpression$0, JSXCodeChildExpression$1];
|
|
16064
|
+
function JSXCodeChildExpression(ctx, state2) {
|
|
16065
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "JSXCodeChildExpression", JSXCodeChildExpression$$);
|
|
15943
16066
|
}
|
|
15944
16067
|
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) {
|
|
15945
16068
|
var decl = $1;
|
|
@@ -16382,14 +16505,16 @@ var TypeSuffix$$ = [TypeSuffix$0, TypeSuffix$1, TypeSuffix$2];
|
|
|
16382
16505
|
function TypeSuffix(ctx, state2) {
|
|
16383
16506
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeSuffix", TypeSuffix$$);
|
|
16384
16507
|
}
|
|
16385
|
-
var MaybeNestedType$0 =
|
|
16386
|
-
var MaybeNestedType$1 =
|
|
16508
|
+
var MaybeNestedType$0 = NestedTypeBulletedTuple;
|
|
16509
|
+
var MaybeNestedType$1 = NestedInterfaceBlock;
|
|
16510
|
+
var MaybeNestedType$2 = NestedTypeBinaryChain;
|
|
16511
|
+
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) {
|
|
16387
16512
|
if (!$2)
|
|
16388
16513
|
return $skip;
|
|
16389
16514
|
return $2;
|
|
16390
16515
|
});
|
|
16391
|
-
var MaybeNestedType$
|
|
16392
|
-
var MaybeNestedType$$ = [MaybeNestedType$0, MaybeNestedType$1, MaybeNestedType$2];
|
|
16516
|
+
var MaybeNestedType$4 = Type;
|
|
16517
|
+
var MaybeNestedType$$ = [MaybeNestedType$0, MaybeNestedType$1, MaybeNestedType$2, MaybeNestedType$3, MaybeNestedType$4];
|
|
16393
16518
|
function MaybeNestedType(ctx, state2) {
|
|
16394
16519
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "MaybeNestedType", MaybeNestedType$$);
|
|
16395
16520
|
}
|
|
@@ -16405,9 +16530,11 @@ var ReturnTypeSuffix$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib
|
|
|
16405
16530
|
function ReturnTypeSuffix(ctx, state2) {
|
|
16406
16531
|
return (0, import_lib3.$EVENT)(ctx, state2, "ReturnTypeSuffix", ReturnTypeSuffix$0);
|
|
16407
16532
|
}
|
|
16408
|
-
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) {
|
|
16533
|
+
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) {
|
|
16409
16534
|
var asserts = $1;
|
|
16410
|
-
var t = $
|
|
16535
|
+
var t = $3;
|
|
16536
|
+
if (!t)
|
|
16537
|
+
return $skip;
|
|
16411
16538
|
if (asserts) {
|
|
16412
16539
|
t = {
|
|
16413
16540
|
type: "AssertsType",
|
|
@@ -16426,7 +16553,7 @@ var ReturnType$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(
|
|
|
16426
16553
|
function ReturnType(ctx, state2) {
|
|
16427
16554
|
return (0, import_lib3.$EVENT)(ctx, state2, "ReturnType", ReturnType$0);
|
|
16428
16555
|
}
|
|
16429
|
-
var TypePredicate$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(MaybeNestedType, (0, import_lib3.$E)((0, import_lib3.$S)(__,
|
|
16556
|
+
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) {
|
|
16430
16557
|
var lhs = $1;
|
|
16431
16558
|
var rhs = $2;
|
|
16432
16559
|
if (!rhs)
|
|
@@ -16441,11 +16568,11 @@ var TypePredicate$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(MaybeNestedType,
|
|
|
16441
16568
|
function TypePredicate(ctx, state2) {
|
|
16442
16569
|
return (0, import_lib3.$EVENT)(ctx, state2, "TypePredicate", TypePredicate$0);
|
|
16443
16570
|
}
|
|
16444
|
-
var Type$0 =
|
|
16571
|
+
var Type$0 = TypeWithPostfix;
|
|
16445
16572
|
function Type(ctx, state2) {
|
|
16446
16573
|
return (0, import_lib3.$EVENT)(ctx, state2, "Type", Type$0);
|
|
16447
16574
|
}
|
|
16448
|
-
var TypeBinary$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)((0, import_lib3.$S)(
|
|
16575
|
+
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) {
|
|
16449
16576
|
var optionalPrefix = $1;
|
|
16450
16577
|
var t = $2;
|
|
16451
16578
|
var ops = $3;
|
|
@@ -16460,6 +16587,25 @@ var TypeBinary$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(
|
|
|
16460
16587
|
function TypeBinary(ctx, state2) {
|
|
16461
16588
|
return (0, import_lib3.$EVENT)(ctx, state2, "TypeBinary", TypeBinary$0);
|
|
16462
16589
|
}
|
|
16590
|
+
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) {
|
|
16591
|
+
if (!$2.length)
|
|
16592
|
+
return $skip;
|
|
16593
|
+
return $2;
|
|
16594
|
+
});
|
|
16595
|
+
function NestedTypeBinaryChain(ctx, state2) {
|
|
16596
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeBinaryChain", NestedTypeBinaryChain$0);
|
|
16597
|
+
}
|
|
16598
|
+
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) {
|
|
16599
|
+
var indent = $1;
|
|
16600
|
+
var op = $2;
|
|
16601
|
+
var t = $4;
|
|
16602
|
+
if (!t)
|
|
16603
|
+
return $skip;
|
|
16604
|
+
return [indent, op, t];
|
|
16605
|
+
});
|
|
16606
|
+
function NestedTypeBinary(ctx, state2) {
|
|
16607
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeBinary", NestedTypeBinary$0);
|
|
16608
|
+
}
|
|
16463
16609
|
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) {
|
|
16464
16610
|
var prefix = $1;
|
|
16465
16611
|
var t = $2;
|
|
@@ -16529,7 +16675,7 @@ var TypePrimary$1 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)
|
|
|
16529
16675
|
};
|
|
16530
16676
|
});
|
|
16531
16677
|
var TypePrimary$2 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_), TypeTuple), function($skip, $loc, $0, $1, $2) {
|
|
16532
|
-
return
|
|
16678
|
+
return prepend($1, $2);
|
|
16533
16679
|
});
|
|
16534
16680
|
var TypePrimary$3 = InterfaceBlock;
|
|
16535
16681
|
var TypePrimary$4 = (0, import_lib3.$S)((0, import_lib3.$E)(_), TypeFunction);
|
|
@@ -16558,7 +16704,7 @@ var TypePrimary$8 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)
|
|
|
16558
16704
|
args: void 0
|
|
16559
16705
|
};
|
|
16560
16706
|
});
|
|
16561
|
-
var TypePrimary$9 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)(_),
|
|
16707
|
+
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) {
|
|
16562
16708
|
var args = $4;
|
|
16563
16709
|
return {
|
|
16564
16710
|
type: "IdentifierType",
|
|
@@ -16567,10 +16713,13 @@ var TypePrimary$9 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$E)
|
|
|
16567
16713
|
args
|
|
16568
16714
|
};
|
|
16569
16715
|
});
|
|
16570
|
-
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) {
|
|
16716
|
+
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) {
|
|
16717
|
+
if (!$4)
|
|
16718
|
+
return $skip;
|
|
16571
16719
|
return {
|
|
16572
16720
|
type: "ParenthesizedType",
|
|
16573
|
-
children: $
|
|
16721
|
+
children: [$1, $2, $4, $6, $7]
|
|
16722
|
+
// omit AllowAll/RestoreAll
|
|
16574
16723
|
};
|
|
16575
16724
|
});
|
|
16576
16725
|
var TypePrimary$$ = [TypePrimary$0, TypePrimary$1, TypePrimary$2, TypePrimary$3, TypePrimary$4, TypePrimary$5, TypePrimary$6, TypePrimary$7, TypePrimary$8, TypePrimary$9, TypePrimary$10];
|
|
@@ -16583,18 +16732,58 @@ var ImportType$$ = [ImportType$0, ImportType$1];
|
|
|
16583
16732
|
function ImportType(ctx, state2) {
|
|
16584
16733
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "ImportType", ImportType$$);
|
|
16585
16734
|
}
|
|
16586
|
-
var TypeTuple$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(OpenBracket, (0, import_lib3.$
|
|
16735
|
+
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) {
|
|
16736
|
+
if (!$3)
|
|
16737
|
+
return $skip;
|
|
16587
16738
|
return {
|
|
16588
16739
|
type: "TypeTuple",
|
|
16589
|
-
children: $
|
|
16740
|
+
children: [$1, ...$3]
|
|
16590
16741
|
};
|
|
16591
16742
|
});
|
|
16592
16743
|
function TypeTuple(ctx, state2) {
|
|
16593
16744
|
return (0, import_lib3.$EVENT)(ctx, state2, "TypeTuple", TypeTuple$0);
|
|
16594
16745
|
}
|
|
16595
|
-
var
|
|
16596
|
-
|
|
16597
|
-
|
|
16746
|
+
var TypeTupleContent$0 = (0, import_lib3.$S)(NestedTypeElementList, (0, import_lib3.$Y)((0, import_lib3.$S)(__, CloseBracket)));
|
|
16747
|
+
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) {
|
|
16748
|
+
var list = $1;
|
|
16749
|
+
var delimiter = $2;
|
|
16750
|
+
var nested = $3;
|
|
16751
|
+
if (!nested)
|
|
16752
|
+
return list;
|
|
16753
|
+
return [...list, delimiter, ...nested];
|
|
16754
|
+
});
|
|
16755
|
+
var TypeTupleContent$2 = (0, import_lib3.$TV)((0, import_lib3.$Q)((0, import_lib3.$S)(__, TypeElementListWithIndentedApplicationForbidden, ArrayElementDelimiter)), function($skip, $loc, $0, $1) {
|
|
16756
|
+
return $1.flat();
|
|
16757
|
+
});
|
|
16758
|
+
var TypeTupleContent$$ = [TypeTupleContent$0, TypeTupleContent$1, TypeTupleContent$2];
|
|
16759
|
+
function TypeTupleContent(ctx, state2) {
|
|
16760
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeTupleContent", TypeTupleContent$$);
|
|
16761
|
+
}
|
|
16762
|
+
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) {
|
|
16763
|
+
if ($2)
|
|
16764
|
+
return $2;
|
|
16765
|
+
return $skip;
|
|
16766
|
+
});
|
|
16767
|
+
function TypeElementListWithIndentedApplicationForbidden(ctx, state2) {
|
|
16768
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "TypeElementListWithIndentedApplicationForbidden", TypeElementListWithIndentedApplicationForbidden$0);
|
|
16769
|
+
}
|
|
16770
|
+
var TypeElementList$0 = (0, import_lib3.$T)((0, import_lib3.$S)(TypeBulletedTuple), function(value) {
|
|
16771
|
+
return [value[0]];
|
|
16772
|
+
});
|
|
16773
|
+
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) {
|
|
16774
|
+
var first = $2;
|
|
16775
|
+
var rest = $3;
|
|
16776
|
+
if (!rest.length)
|
|
16777
|
+
return [first];
|
|
16778
|
+
return [
|
|
16779
|
+
append(first, rest[0][0])
|
|
16780
|
+
].concat(
|
|
16781
|
+
rest.map(([_2, e], i) => append(e, rest[i + 1]?.[0]))
|
|
16782
|
+
);
|
|
16783
|
+
});
|
|
16784
|
+
var TypeElementList$$ = [TypeElementList$0, TypeElementList$1];
|
|
16785
|
+
function TypeElementList(ctx, state2) {
|
|
16786
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeElementList", TypeElementList$$);
|
|
16598
16787
|
}
|
|
16599
16788
|
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) {
|
|
16600
16789
|
var ws = $1;
|
|
@@ -16628,21 +16817,129 @@ var TypeElement$$ = [TypeElement$0, TypeElement$1, TypeElement$2];
|
|
|
16628
16817
|
function TypeElement(ctx, state2) {
|
|
16629
16818
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeElement", TypeElement$$);
|
|
16630
16819
|
}
|
|
16631
|
-
var
|
|
16820
|
+
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) {
|
|
16632
16821
|
var types = $2;
|
|
16633
16822
|
if (types.length)
|
|
16634
16823
|
return types;
|
|
16635
16824
|
return $skip;
|
|
16636
16825
|
});
|
|
16637
|
-
function
|
|
16638
|
-
return (0, import_lib3.$EVENT)(ctx, state2, "
|
|
16826
|
+
function NestedTypeElementList(ctx, state2) {
|
|
16827
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeElementList", NestedTypeElementList$0);
|
|
16639
16828
|
}
|
|
16640
|
-
var
|
|
16641
|
-
|
|
16642
|
-
|
|
16829
|
+
var NestedTypeElement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Nested, TypeElementList, ArrayElementDelimiter), function($skip, $loc, $0, $1, $2, $3) {
|
|
16830
|
+
var indent = $1;
|
|
16831
|
+
var list = $2;
|
|
16832
|
+
var delimiter = $3;
|
|
16833
|
+
const { length } = list;
|
|
16834
|
+
if (!length)
|
|
16835
|
+
return $skip;
|
|
16836
|
+
return list.map((e, i) => {
|
|
16837
|
+
if (i === 0)
|
|
16838
|
+
e = prepend(indent, e);
|
|
16839
|
+
if (i === length - 1)
|
|
16840
|
+
e = append(e, delimiter);
|
|
16841
|
+
return e;
|
|
16842
|
+
});
|
|
16843
|
+
});
|
|
16844
|
+
function NestedTypeElement(ctx, state2) {
|
|
16845
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeElement", NestedTypeElement$0);
|
|
16846
|
+
}
|
|
16847
|
+
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) {
|
|
16848
|
+
var open = $1;
|
|
16849
|
+
var content = $3;
|
|
16850
|
+
var close = $4;
|
|
16851
|
+
if (!content.length)
|
|
16852
|
+
return $skip;
|
|
16853
|
+
content = content.flat();
|
|
16854
|
+
const last = content[content.length - 1];
|
|
16855
|
+
let children = Array.isArray(last) ? last : last?.children;
|
|
16856
|
+
if (children?.at(-1).implicit) {
|
|
16857
|
+
children = children.slice(0, -1);
|
|
16858
|
+
if (Array.isArray(last)) {
|
|
16859
|
+
content[content.length - 1] = children;
|
|
16860
|
+
} else {
|
|
16861
|
+
content[content.length - 1] = { ...last, children };
|
|
16862
|
+
}
|
|
16863
|
+
}
|
|
16864
|
+
return {
|
|
16865
|
+
type: "TypeTuple",
|
|
16866
|
+
children: [...open, ...content, close]
|
|
16867
|
+
};
|
|
16868
|
+
});
|
|
16869
|
+
function NestedTypeBulletedTuple(ctx, state2) {
|
|
16870
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeBulletedTuple", NestedTypeBulletedTuple$0);
|
|
16871
|
+
}
|
|
16872
|
+
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) {
|
|
16873
|
+
var open = $1;
|
|
16874
|
+
var content = $2;
|
|
16875
|
+
var close = $3;
|
|
16876
|
+
if (!content)
|
|
16877
|
+
return $skip;
|
|
16878
|
+
content = [
|
|
16879
|
+
...trimFirstSpace(content[0]),
|
|
16880
|
+
// replace first space with bracket
|
|
16881
|
+
...content[1].flat()
|
|
16882
|
+
];
|
|
16883
|
+
const last = content[content.length - 1];
|
|
16884
|
+
let children = Array.isArray(last) ? last : last?.children;
|
|
16885
|
+
if (children?.at(-1).implicit) {
|
|
16886
|
+
children = children.slice(0, -1);
|
|
16887
|
+
if (Array.isArray(last)) {
|
|
16888
|
+
content[content.length - 1] = children;
|
|
16889
|
+
} else {
|
|
16890
|
+
content[content.length - 1] = { ...last, children };
|
|
16891
|
+
}
|
|
16892
|
+
}
|
|
16893
|
+
return {
|
|
16894
|
+
type: "TypeTuple",
|
|
16895
|
+
children: [open, ...content, close]
|
|
16896
|
+
};
|
|
16897
|
+
});
|
|
16898
|
+
function TypeBulletedTuple(ctx, state2) {
|
|
16899
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "TypeBulletedTuple", TypeBulletedTuple$0);
|
|
16900
|
+
}
|
|
16901
|
+
var NestedTypeBullet$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Nested, TypeBullet), function($skip, $loc, $0, $1, $2) {
|
|
16902
|
+
var indent = $1;
|
|
16903
|
+
var list = $2;
|
|
16904
|
+
return list.map((e, i) => i === 0 ? prepend(indent, e) : e);
|
|
16905
|
+
});
|
|
16906
|
+
function NestedTypeBullet(ctx, state2) {
|
|
16907
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeBullet", NestedTypeBullet$0);
|
|
16908
|
+
}
|
|
16909
|
+
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) {
|
|
16910
|
+
var bullet = $1;
|
|
16911
|
+
var content = $2;
|
|
16912
|
+
if (!content)
|
|
16913
|
+
return $skip;
|
|
16914
|
+
let [list, delimiter] = content;
|
|
16915
|
+
if (!list.length)
|
|
16916
|
+
return $skip;
|
|
16917
|
+
list = list.slice();
|
|
16918
|
+
list[0] = prepend(bullet, list[0]);
|
|
16919
|
+
if (delimiter) {
|
|
16920
|
+
const last = list.length - 1;
|
|
16921
|
+
list[last] = append(list[last], delimiter);
|
|
16922
|
+
}
|
|
16923
|
+
return list;
|
|
16924
|
+
});
|
|
16925
|
+
function TypeBullet(ctx, state2) {
|
|
16926
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "TypeBullet", TypeBullet$0);
|
|
16927
|
+
}
|
|
16928
|
+
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) {
|
|
16929
|
+
var t = $1;
|
|
16930
|
+
var postfix = $2;
|
|
16931
|
+
if (!postfix)
|
|
16932
|
+
return t;
|
|
16933
|
+
return prepend(
|
|
16934
|
+
postfix[0],
|
|
16935
|
+
expressionizeTypeIf([...postfix[1], $1, void 0])
|
|
16936
|
+
);
|
|
16937
|
+
});
|
|
16938
|
+
function TypeWithPostfix(ctx, state2) {
|
|
16939
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "TypeWithPostfix", TypeWithPostfix$0);
|
|
16643
16940
|
}
|
|
16644
16941
|
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) {
|
|
16645
|
-
return
|
|
16942
|
+
return prepend($1, expressionizeTypeIf($3));
|
|
16646
16943
|
});
|
|
16647
16944
|
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) {
|
|
16648
16945
|
if ($1.negated)
|
|
@@ -16654,7 +16951,7 @@ var TypeConditional$$ = [TypeConditional$0, TypeConditional$1, TypeConditional$2
|
|
|
16654
16951
|
function TypeConditional(ctx, state2) {
|
|
16655
16952
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeConditional", TypeConditional$$);
|
|
16656
16953
|
}
|
|
16657
|
-
var TypeCondition$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(TypeBinary, (0, import_lib3.$E)(IndentedFurther), (0, import_lib3.$C)(ExtendsToken, NotExtendsToken),
|
|
16954
|
+
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) {
|
|
16658
16955
|
return {
|
|
16659
16956
|
type: "TypeCondition",
|
|
16660
16957
|
negated: $3.negated,
|
|
@@ -16664,13 +16961,27 @@ var TypeCondition$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(TypeBinary, (0, i
|
|
|
16664
16961
|
function TypeCondition(ctx, state2) {
|
|
16665
16962
|
return (0, import_lib3.$EVENT)(ctx, state2, "TypeCondition", TypeCondition$0);
|
|
16666
16963
|
}
|
|
16667
|
-
var TypeIfThenElse$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(
|
|
16668
|
-
return [
|
|
16964
|
+
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) {
|
|
16965
|
+
return [...$1, $2, $3];
|
|
16669
16966
|
});
|
|
16670
|
-
var TypeIfThenElse$1 = (0, import_lib3.$S)((0, import_lib3.$E)(_), (0, import_lib3.$C)(If, Unless), TypeCondition, TypeBlock, (0, import_lib3.$E)(TypeElse));
|
|
16671
|
-
var TypeIfThenElse$$ = [TypeIfThenElse$0, TypeIfThenElse$1];
|
|
16672
16967
|
function TypeIfThenElse(ctx, state2) {
|
|
16673
|
-
return (0, import_lib3.$
|
|
16968
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "TypeIfThenElse", TypeIfThenElse$0);
|
|
16969
|
+
}
|
|
16970
|
+
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) {
|
|
16971
|
+
var condition = $4;
|
|
16972
|
+
if (!condition)
|
|
16973
|
+
return $skip;
|
|
16974
|
+
return [$1, condition];
|
|
16975
|
+
});
|
|
16976
|
+
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) {
|
|
16977
|
+
var condition = $3;
|
|
16978
|
+
if (!condition)
|
|
16979
|
+
return $skip;
|
|
16980
|
+
return [$1, condition];
|
|
16981
|
+
});
|
|
16982
|
+
var TypeIfClause$$ = [TypeIfClause$0, TypeIfClause$1];
|
|
16983
|
+
function TypeIfClause(ctx, state2) {
|
|
16984
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeIfClause", TypeIfClause$$);
|
|
16674
16985
|
}
|
|
16675
16986
|
var TypeElse$0 = (0, import_lib3.$S)(NotDedented, Else, TypeBlock);
|
|
16676
16987
|
function TypeElse(ctx, state2) {
|
|
@@ -16770,12 +17081,18 @@ var TypeBinaryOp$$ = [TypeBinaryOp$0, TypeBinaryOp$1];
|
|
|
16770
17081
|
function TypeBinaryOp(ctx, state2) {
|
|
16771
17082
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeBinaryOp", TypeBinaryOp$$);
|
|
16772
17083
|
}
|
|
16773
|
-
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.$
|
|
16774
|
-
var type = $
|
|
16775
|
-
|
|
16776
|
-
|
|
17084
|
+
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) {
|
|
17085
|
+
var type = $6;
|
|
17086
|
+
const ret = [...$0];
|
|
17087
|
+
if ($1 && !$2) {
|
|
17088
|
+
ret[1] = {
|
|
17089
|
+
type: "Error",
|
|
17090
|
+
message: "abstract function types must be constructors (abstract new)"
|
|
17091
|
+
};
|
|
16777
17092
|
}
|
|
16778
|
-
|
|
17093
|
+
if (!type)
|
|
17094
|
+
ret.push("void");
|
|
17095
|
+
return ret;
|
|
16779
17096
|
});
|
|
16780
17097
|
function TypeFunction(ctx, state2) {
|
|
16781
17098
|
return (0, import_lib3.$EVENT)(ctx, state2, "TypeFunction", TypeFunction$0);
|
|
@@ -16786,8 +17103,9 @@ var TypeArrowFunction$0 = (0, import_lib3.$TV)((0, import_lib3.$C)((0, import_li
|
|
|
16786
17103
|
function TypeArrowFunction(ctx, state2) {
|
|
16787
17104
|
return (0, import_lib3.$EVENT)(ctx, state2, "TypeArrowFunction", TypeArrowFunction$0);
|
|
16788
17105
|
}
|
|
16789
|
-
var TypeArguments$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(OpenAngleBracket, (0, import_lib3.$P)(
|
|
17106
|
+
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) {
|
|
16790
17107
|
var args = $2;
|
|
17108
|
+
args = args.map(([ws, arg]) => [ws, ...arg]);
|
|
16791
17109
|
return {
|
|
16792
17110
|
type: "TypeArguments",
|
|
16793
17111
|
ts: true,
|
|
@@ -16798,7 +17116,91 @@ var TypeArguments$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(OpenAngleBracket,
|
|
|
16798
17116
|
function TypeArguments(ctx, state2) {
|
|
16799
17117
|
return (0, import_lib3.$EVENT)(ctx, state2, "TypeArguments", TypeArguments$0);
|
|
16800
17118
|
}
|
|
16801
|
-
var
|
|
17119
|
+
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) {
|
|
17120
|
+
var open = $2;
|
|
17121
|
+
var ws = $3;
|
|
17122
|
+
var args = $4;
|
|
17123
|
+
var close = $5;
|
|
17124
|
+
let last = args[args.length - 1];
|
|
17125
|
+
if (last?.token === ",")
|
|
17126
|
+
args = args.slice(0, -1);
|
|
17127
|
+
return [open, ws, args, close];
|
|
17128
|
+
});
|
|
17129
|
+
function ImplicitTypeArguments(ctx, state2) {
|
|
17130
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "ImplicitTypeArguments", ImplicitTypeArguments$0);
|
|
17131
|
+
}
|
|
17132
|
+
var TypeApplicationStart$0 = (0, import_lib3.$S)(IndentedApplicationAllowed, (0, import_lib3.$Y)((0, import_lib3.$S)(IndentedFurther, (0, import_lib3.$N)(ForbiddenImplicitTypeCalls))));
|
|
17133
|
+
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))));
|
|
17134
|
+
var TypeApplicationStart$$ = [TypeApplicationStart$0, TypeApplicationStart$1];
|
|
17135
|
+
function TypeApplicationStart(ctx, state2) {
|
|
17136
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeApplicationStart", TypeApplicationStart$$);
|
|
17137
|
+
}
|
|
17138
|
+
var ForbiddenImplicitTypeCalls$0 = ReservedBinary;
|
|
17139
|
+
var ForbiddenImplicitTypeCalls$1 = (0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($R90, "ForbiddenImplicitTypeCalls /[|&<!=\\-\u21D2\u2192]/"));
|
|
17140
|
+
var ForbiddenImplicitTypeCalls$2 = (0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($R91, "ForbiddenImplicitTypeCalls /(extends|not|is)(?!\\p{ID_Continue}|[\\u200C\\u200D$])/"));
|
|
17141
|
+
var ForbiddenImplicitTypeCalls$$ = [ForbiddenImplicitTypeCalls$0, ForbiddenImplicitTypeCalls$1, ForbiddenImplicitTypeCalls$2];
|
|
17142
|
+
function ForbiddenImplicitTypeCalls(ctx, state2) {
|
|
17143
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "ForbiddenImplicitTypeCalls", ForbiddenImplicitTypeCalls$$);
|
|
17144
|
+
}
|
|
17145
|
+
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) {
|
|
17146
|
+
return [
|
|
17147
|
+
$2,
|
|
17148
|
+
...$3.flatMap(([comma, eos, ws, arg]) => [comma, prepend(ws, arg)]),
|
|
17149
|
+
...$4.flatMap(
|
|
17150
|
+
([comma, args]) => Array.isArray(args) ? [comma, ...args] : [comma, args]
|
|
17151
|
+
)
|
|
17152
|
+
];
|
|
17153
|
+
});
|
|
17154
|
+
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) {
|
|
17155
|
+
return [
|
|
17156
|
+
trimFirstSpace($1),
|
|
17157
|
+
...$2.flatMap(
|
|
17158
|
+
([comma, args]) => Array.isArray(args) ? [comma, ...args] : [comma, args]
|
|
17159
|
+
)
|
|
17160
|
+
];
|
|
17161
|
+
});
|
|
17162
|
+
var TypeArgumentList$2 = NestedTypeArgumentList;
|
|
17163
|
+
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) {
|
|
17164
|
+
return [
|
|
17165
|
+
$1,
|
|
17166
|
+
...$2.flatMap(([comma, ws, arg]) => [comma, prepend(ws, arg)])
|
|
17167
|
+
];
|
|
17168
|
+
});
|
|
17169
|
+
var TypeArgumentList$$ = [TypeArgumentList$0, TypeArgumentList$1, TypeArgumentList$2, TypeArgumentList$3];
|
|
17170
|
+
function TypeArgumentList(ctx, state2) {
|
|
17171
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeArgumentList", TypeArgumentList$$);
|
|
17172
|
+
}
|
|
17173
|
+
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) {
|
|
17174
|
+
var args = $2;
|
|
17175
|
+
if (!args.length)
|
|
17176
|
+
return $skip;
|
|
17177
|
+
return args.flat();
|
|
17178
|
+
});
|
|
17179
|
+
function NestedTypeArgumentList(ctx, state2) {
|
|
17180
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeArgumentList", NestedTypeArgumentList$0);
|
|
17181
|
+
}
|
|
17182
|
+
var NestedTypeArgument$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(Nested, SingleLineTypeArgumentList, TypeArgumentDelimiter), function($skip, $loc, $0, $1, $2, $3) {
|
|
17183
|
+
var indent = $1;
|
|
17184
|
+
var args = $2;
|
|
17185
|
+
var comma = $3;
|
|
17186
|
+
let [arg0, ...rest] = args;
|
|
17187
|
+
arg0 = prepend(indent, arg0);
|
|
17188
|
+
return [arg0, ...rest, comma];
|
|
17189
|
+
});
|
|
17190
|
+
function NestedTypeArgument(ctx, state2) {
|
|
17191
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "NestedTypeArgument", NestedTypeArgument$0);
|
|
17192
|
+
}
|
|
17193
|
+
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) {
|
|
17194
|
+
return [$1, ...$2.flat()];
|
|
17195
|
+
});
|
|
17196
|
+
function SingleLineTypeArgumentList(ctx, state2) {
|
|
17197
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "SingleLineTypeArgumentList", SingleLineTypeArgumentList$0);
|
|
17198
|
+
}
|
|
17199
|
+
var TypeArgumentDelimited$0 = (0, import_lib3.$S)(TypeArgument, TypeArgumentDelimiter);
|
|
17200
|
+
function TypeArgumentDelimited(ctx, state2) {
|
|
17201
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "TypeArgumentDelimited", TypeArgumentDelimited$0);
|
|
17202
|
+
}
|
|
17203
|
+
var TypeArgument$0 = Type;
|
|
16802
17204
|
function TypeArgument(ctx, state2) {
|
|
16803
17205
|
return (0, import_lib3.$EVENT)(ctx, state2, "TypeArgument", TypeArgument$0);
|
|
16804
17206
|
}
|
|
@@ -16845,15 +17247,15 @@ var ThisType$0 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$E)(_),
|
|
|
16845
17247
|
function ThisType(ctx, state2) {
|
|
16846
17248
|
return (0, import_lib3.$EVENT)(ctx, state2, "ThisType", ThisType$0);
|
|
16847
17249
|
}
|
|
16848
|
-
var Shebang$0 = (0, import_lib3.$S)((0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($
|
|
17250
|
+
var Shebang$0 = (0, import_lib3.$S)((0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($R92, "Shebang /#![^\\r\\n]*/")), EOL);
|
|
16849
17251
|
function Shebang(ctx, state2) {
|
|
16850
17252
|
return (0, import_lib3.$EVENT)(ctx, state2, "Shebang", Shebang$0);
|
|
16851
17253
|
}
|
|
16852
|
-
var CivetPrologue$0 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($
|
|
17254
|
+
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) {
|
|
16853
17255
|
var content = value[2];
|
|
16854
17256
|
return content;
|
|
16855
17257
|
});
|
|
16856
|
-
var CivetPrologue$1 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($
|
|
17258
|
+
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) {
|
|
16857
17259
|
var content = value[2];
|
|
16858
17260
|
return content;
|
|
16859
17261
|
});
|
|
@@ -16861,7 +17263,7 @@ var CivetPrologue$$ = [CivetPrologue$0, CivetPrologue$1];
|
|
|
16861
17263
|
function CivetPrologue(ctx, state2) {
|
|
16862
17264
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "CivetPrologue", CivetPrologue$$);
|
|
16863
17265
|
}
|
|
16864
|
-
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)($
|
|
17266
|
+
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) {
|
|
16865
17267
|
var options = $3;
|
|
16866
17268
|
return {
|
|
16867
17269
|
type: "CivetPrologue",
|
|
@@ -16872,7 +17274,7 @@ var CivetPrologueContent$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import
|
|
|
16872
17274
|
function CivetPrologueContent(ctx, state2) {
|
|
16873
17275
|
return (0, import_lib3.$EVENT)(ctx, state2, "CivetPrologueContent", CivetPrologueContent$0);
|
|
16874
17276
|
}
|
|
16875
|
-
var CivetOption$0 = (0, import_lib3.$TR)((0, import_lib3.$EXPECT)($
|
|
17277
|
+
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) {
|
|
16876
17278
|
const optionName = $2.replace(/-+([a-z]?)/g, (_2, l) => {
|
|
16877
17279
|
if (l)
|
|
16878
17280
|
return l.toUpperCase();
|
|
@@ -16889,11 +17291,11 @@ var CivetOption$0 = (0, import_lib3.$TR)((0, import_lib3.$EXPECT)($R93, "CivetOp
|
|
|
16889
17291
|
function CivetOption(ctx, state2) {
|
|
16890
17292
|
return (0, import_lib3.$EVENT)(ctx, state2, "CivetOption", CivetOption$0);
|
|
16891
17293
|
}
|
|
16892
|
-
var UnknownPrologue$0 = (0, import_lib3.$S)((0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($
|
|
17294
|
+
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);
|
|
16893
17295
|
function UnknownPrologue(ctx, state2) {
|
|
16894
17296
|
return (0, import_lib3.$EVENT)(ctx, state2, "UnknownPrologue", UnknownPrologue$0);
|
|
16895
17297
|
}
|
|
16896
|
-
var TripleSlashDirective$0 = (0, import_lib3.$S)((0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($
|
|
17298
|
+
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));
|
|
16897
17299
|
function TripleSlashDirective(ctx, state2) {
|
|
16898
17300
|
return (0, import_lib3.$EVENT)(ctx, state2, "TripleSlashDirective", TripleSlashDirective$0);
|
|
16899
17301
|
}
|
|
@@ -16909,13 +17311,13 @@ var PrologueString$$ = [PrologueString$0, PrologueString$1];
|
|
|
16909
17311
|
function PrologueString(ctx, state2) {
|
|
16910
17312
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "PrologueString", PrologueString$$);
|
|
16911
17313
|
}
|
|
16912
|
-
var EOS$0 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($
|
|
17314
|
+
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) {
|
|
16913
17315
|
return value[1];
|
|
16914
17316
|
});
|
|
16915
17317
|
function EOS(ctx, state2) {
|
|
16916
17318
|
return (0, import_lib3.$EVENT)(ctx, state2, "EOS", EOS$0);
|
|
16917
17319
|
}
|
|
16918
|
-
var EOL$0 = (0, import_lib3.$TR)((0, import_lib3.$EXPECT)($
|
|
17320
|
+
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) {
|
|
16919
17321
|
return { $loc, token: $0 };
|
|
16920
17322
|
});
|
|
16921
17323
|
function EOL(ctx, state2) {
|
|
@@ -16981,6 +17383,18 @@ var InsertCloseBracket$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'I
|
|
|
16981
17383
|
function InsertCloseBracket(ctx, state2) {
|
|
16982
17384
|
return (0, import_lib3.$EVENT)(ctx, state2, "InsertCloseBracket", InsertCloseBracket$0);
|
|
16983
17385
|
}
|
|
17386
|
+
var InsertOpenAngleBracket$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'InsertOpenAngleBracket ""'), function($skip, $loc, $0, $1) {
|
|
17387
|
+
return { $loc, token: "<" };
|
|
17388
|
+
});
|
|
17389
|
+
function InsertOpenAngleBracket(ctx, state2) {
|
|
17390
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "InsertOpenAngleBracket", InsertOpenAngleBracket$0);
|
|
17391
|
+
}
|
|
17392
|
+
var InsertCloseAngleBracket$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'InsertCloseAngleBracket ""'), function($skip, $loc, $0, $1) {
|
|
17393
|
+
return { $loc, token: ">" };
|
|
17394
|
+
});
|
|
17395
|
+
function InsertCloseAngleBracket(ctx, state2) {
|
|
17396
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "InsertCloseAngleBracket", InsertCloseAngleBracket$0);
|
|
17397
|
+
}
|
|
16984
17398
|
var InsertComma$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'InsertComma ""'), function($skip, $loc, $0, $1) {
|
|
16985
17399
|
return { $loc, token: ",", implicit: true };
|
|
16986
17400
|
});
|
|
@@ -17165,6 +17579,22 @@ var CoffeePrototypeEnabled$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0
|
|
|
17165
17579
|
function CoffeePrototypeEnabled(ctx, state2) {
|
|
17166
17580
|
return (0, import_lib3.$EVENT)(ctx, state2, "CoffeePrototypeEnabled", CoffeePrototypeEnabled$0);
|
|
17167
17581
|
}
|
|
17582
|
+
var JSXCodeNestedEnabled$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'JSXCodeNestedEnabled ""'), function($skip, $loc, $0, $1) {
|
|
17583
|
+
if (config.jsxCodeNested)
|
|
17584
|
+
return;
|
|
17585
|
+
return $skip;
|
|
17586
|
+
});
|
|
17587
|
+
function JSXCodeNestedEnabled(ctx, state2) {
|
|
17588
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "JSXCodeNestedEnabled", JSXCodeNestedEnabled$0);
|
|
17589
|
+
}
|
|
17590
|
+
var JSXCodeSameLineEnabled$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'JSXCodeSameLineEnabled ""'), function($skip, $loc, $0, $1) {
|
|
17591
|
+
if (config.jsxCodeSameLine)
|
|
17592
|
+
return;
|
|
17593
|
+
return $skip;
|
|
17594
|
+
});
|
|
17595
|
+
function JSXCodeSameLineEnabled(ctx, state2) {
|
|
17596
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "JSXCodeSameLineEnabled", JSXCodeSameLineEnabled$0);
|
|
17597
|
+
}
|
|
17168
17598
|
var ObjectIsEnabled$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'ObjectIsEnabled ""'), function($skip, $loc, $0, $1) {
|
|
17169
17599
|
if (config.objectIs)
|
|
17170
17600
|
return;
|
|
@@ -17208,6 +17638,7 @@ var Reset$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'Reset ""'), fu
|
|
|
17208
17638
|
coffeePrototype: false,
|
|
17209
17639
|
defaultElement: "div",
|
|
17210
17640
|
implicitReturns: true,
|
|
17641
|
+
jsxCode: false,
|
|
17211
17642
|
objectIs: false,
|
|
17212
17643
|
react: false,
|
|
17213
17644
|
solid: false,
|
|
@@ -17252,6 +17683,16 @@ var Reset$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'Reset ""'), fu
|
|
|
17252
17683
|
}
|
|
17253
17684
|
}
|
|
17254
17685
|
});
|
|
17686
|
+
Object.defineProperty(config, "jsxCode", {
|
|
17687
|
+
set(b) {
|
|
17688
|
+
for (const option of [
|
|
17689
|
+
"jsxCodeNested",
|
|
17690
|
+
"jsxCodeSameLine"
|
|
17691
|
+
]) {
|
|
17692
|
+
config[option] = b;
|
|
17693
|
+
}
|
|
17694
|
+
}
|
|
17695
|
+
});
|
|
17255
17696
|
Object.assign(config, initialConfig);
|
|
17256
17697
|
return {
|
|
17257
17698
|
type: "ParserMeta",
|
|
@@ -17286,7 +17727,7 @@ var Prologue$0 = (0, import_lib3.$Q)((0, import_lib3.$C)(TripleSlashDirective, (
|
|
|
17286
17727
|
function Prologue(ctx, state2) {
|
|
17287
17728
|
return (0, import_lib3.$EVENT)(ctx, state2, "Prologue", Prologue$0);
|
|
17288
17729
|
}
|
|
17289
|
-
var ProloguePrefix$0 = (0, import_lib3.$S)(Prologue, (0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($
|
|
17730
|
+
var ProloguePrefix$0 = (0, import_lib3.$S)(Prologue, (0, import_lib3.$R$0)((0, import_lib3.$EXPECT)($R99, "ProloguePrefix /[^]*/")));
|
|
17290
17731
|
function ProloguePrefix(ctx, state2) {
|
|
17291
17732
|
return (0, import_lib3.$EVENT)(ctx, state2, "ProloguePrefix", ProloguePrefix$0);
|
|
17292
17733
|
}
|
|
@@ -17376,6 +17817,20 @@ var Dedented$0 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$N)(Ind
|
|
|
17376
17817
|
function Dedented(ctx, state2) {
|
|
17377
17818
|
return (0, import_lib3.$EVENT)(ctx, state2, "Dedented", Dedented$0);
|
|
17378
17819
|
}
|
|
17820
|
+
var PushExtraIndent1$0 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L0, 'PushExtraIndent1 ""'), function($skip, $loc, $0, $1) {
|
|
17821
|
+
const indent = {
|
|
17822
|
+
token: "",
|
|
17823
|
+
$loc,
|
|
17824
|
+
level: state.currentIndent.level + 1
|
|
17825
|
+
};
|
|
17826
|
+
if (config.verbose)
|
|
17827
|
+
console.log("pushing bonus indent", indent);
|
|
17828
|
+
state.indentLevels.push(indent);
|
|
17829
|
+
return indent;
|
|
17830
|
+
});
|
|
17831
|
+
function PushExtraIndent1(ctx, state2) {
|
|
17832
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "PushExtraIndent1", PushExtraIndent1$0);
|
|
17833
|
+
}
|
|
17379
17834
|
var parser = function() {
|
|
17380
17835
|
const { fail, validate, reset } = (0, import_lib3.Validator)();
|
|
17381
17836
|
let ctx = { expectation: "", fail };
|
|
@@ -17835,6 +18290,7 @@ var uncacheable = /* @__PURE__ */ new Set([
|
|
|
17835
18290
|
"PopIndent",
|
|
17836
18291
|
"TrackIndented",
|
|
17837
18292
|
"BulletIndent",
|
|
18293
|
+
"PushExtraIndent1",
|
|
17838
18294
|
// JSX
|
|
17839
18295
|
"PushJSXOpeningElement",
|
|
17840
18296
|
"PushJSXOpeningFragment",
|