@danielx/civet 0.5.63 → 0.5.64
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/dist/browser.js +52 -26
- package/dist/main.js +52 -26
- package/dist/main.mjs +52 -26
- package/package.json +1 -1
package/dist/browser.js
CHANGED
|
@@ -501,6 +501,7 @@ ${input.slice(result.pos)}
|
|
|
501
501
|
CallExpression,
|
|
502
502
|
CallExpressionRest,
|
|
503
503
|
OptionalShorthand,
|
|
504
|
+
OptionalDot,
|
|
504
505
|
NonNullAssertion,
|
|
505
506
|
MemberExpression,
|
|
506
507
|
MemberExpressionRest,
|
|
@@ -3314,7 +3315,7 @@ ${input.slice(result.pos)}
|
|
|
3314
3315
|
return result;
|
|
3315
3316
|
}
|
|
3316
3317
|
}
|
|
3317
|
-
var OptionalShorthand$0 = $TS($S(QuestionMark,
|
|
3318
|
+
var OptionalShorthand$0 = $TS($S(QuestionMark, OptionalDot), function($skip, $loc, $0, $1, $2) {
|
|
3318
3319
|
return {
|
|
3319
3320
|
type: "Optional",
|
|
3320
3321
|
children: $0
|
|
@@ -3342,6 +3343,30 @@ ${input.slice(result.pos)}
|
|
|
3342
3343
|
return result;
|
|
3343
3344
|
}
|
|
3344
3345
|
}
|
|
3346
|
+
var OptionalDot$0 = Dot;
|
|
3347
|
+
var OptionalDot$1 = InsertDot;
|
|
3348
|
+
function OptionalDot(state) {
|
|
3349
|
+
let eventData;
|
|
3350
|
+
if (state.events) {
|
|
3351
|
+
const result = state.events.enter?.("OptionalDot", state);
|
|
3352
|
+
if (result) {
|
|
3353
|
+
if (result.cache)
|
|
3354
|
+
return result.cache;
|
|
3355
|
+
eventData = result.data;
|
|
3356
|
+
}
|
|
3357
|
+
}
|
|
3358
|
+
if (state.tokenize) {
|
|
3359
|
+
const result = $TOKEN("OptionalDot", state, OptionalDot$0(state) || OptionalDot$1(state));
|
|
3360
|
+
if (state.events)
|
|
3361
|
+
state.events.exit?.("OptionalDot", state, result, eventData);
|
|
3362
|
+
return result;
|
|
3363
|
+
} else {
|
|
3364
|
+
const result = OptionalDot$0(state) || OptionalDot$1(state);
|
|
3365
|
+
if (state.events)
|
|
3366
|
+
state.events.exit?.("OptionalDot", state, result, eventData);
|
|
3367
|
+
return result;
|
|
3368
|
+
}
|
|
3369
|
+
}
|
|
3345
3370
|
var NonNullAssertion$0 = $T($EXPECT($L14, fail, 'NonNullAssertion "!"'), function(value) {
|
|
3346
3371
|
return { "type": "NonNullAssertion", "ts": true, "children": value };
|
|
3347
3372
|
});
|
|
@@ -3622,11 +3647,11 @@ ${input.slice(result.pos)}
|
|
|
3622
3647
|
return result;
|
|
3623
3648
|
}
|
|
3624
3649
|
}
|
|
3625
|
-
var PropertyGlob$0 = $TS($S(
|
|
3626
|
-
var
|
|
3650
|
+
var PropertyGlob$0 = $TS($S(OptionalDot, BracedObjectLiteral), function($skip, $loc, $0, $1, $2) {
|
|
3651
|
+
var object = $2;
|
|
3627
3652
|
return {
|
|
3628
3653
|
type: "PropertyGlob",
|
|
3629
|
-
|
|
3654
|
+
object,
|
|
3630
3655
|
children: $0
|
|
3631
3656
|
};
|
|
3632
3657
|
});
|
|
@@ -5168,7 +5193,7 @@ ${input.slice(result.pos)}
|
|
|
5168
5193
|
block
|
|
5169
5194
|
};
|
|
5170
5195
|
});
|
|
5171
|
-
var FunctionExpression$1 = $TS($S($E(AmpersandUnaryPrefix), Ampersand, $E(AmpersandBlockRHS)), function($skip, $loc, $0, $1, $2, $3) {
|
|
5196
|
+
var FunctionExpression$1 = $TS($S($E(AmpersandUnaryPrefix), $C(Ampersand, $S($N(NumericLiteral), $Y($S($E(QuestionMark), Dot)))), $E(AmpersandBlockRHS)), function($skip, $loc, $0, $1, $2, $3) {
|
|
5172
5197
|
var prefix = $1;
|
|
5173
5198
|
var rhs = $3;
|
|
5174
5199
|
if (!prefix && !rhs)
|
|
@@ -6652,6 +6677,7 @@ ${input.slice(result.pos)}
|
|
|
6652
6677
|
const children = [open, ...content, close];
|
|
6653
6678
|
return {
|
|
6654
6679
|
type: "ObjectExpression",
|
|
6680
|
+
content,
|
|
6655
6681
|
children,
|
|
6656
6682
|
names: children.flatMap((c) => {
|
|
6657
6683
|
return c.names || [];
|
|
@@ -6981,7 +7007,7 @@ ${input.slice(result.pos)}
|
|
|
6981
7007
|
const value = [{ ...at, token: "this." }, id];
|
|
6982
7008
|
return {
|
|
6983
7009
|
type: "Property",
|
|
6984
|
-
children: [
|
|
7010
|
+
children: [ws, id, ": ", ...value],
|
|
6985
7011
|
name: id,
|
|
6986
7012
|
names: id.names,
|
|
6987
7013
|
value
|
|
@@ -6992,7 +7018,7 @@ ${input.slice(result.pos)}
|
|
|
6992
7018
|
var prop = $2;
|
|
6993
7019
|
return {
|
|
6994
7020
|
...prop,
|
|
6995
|
-
children: [
|
|
7021
|
+
children: [ws, ...prop.children]
|
|
6996
7022
|
};
|
|
6997
7023
|
});
|
|
6998
7024
|
var PropertyDefinition$2 = $TS($S(__, $TEXT($EXPECT($R5, fail, "PropertyDefinition /[!+-]/")), PropertyName), function($skip, $loc, $0, $1, $2, $3) {
|
|
@@ -7002,7 +7028,7 @@ ${input.slice(result.pos)}
|
|
|
7002
7028
|
const value = toggle === "+" ? "true" : "false";
|
|
7003
7029
|
return {
|
|
7004
7030
|
type: "Property",
|
|
7005
|
-
children: [
|
|
7031
|
+
children: [ws, id, ": ", value],
|
|
7006
7032
|
name: id,
|
|
7007
7033
|
names: id.names,
|
|
7008
7034
|
value
|
|
@@ -7015,7 +7041,7 @@ ${input.slice(result.pos)}
|
|
|
7015
7041
|
return $skip;
|
|
7016
7042
|
return {
|
|
7017
7043
|
...def,
|
|
7018
|
-
children: [
|
|
7044
|
+
children: [ws, ...def.children]
|
|
7019
7045
|
};
|
|
7020
7046
|
});
|
|
7021
7047
|
var PropertyDefinition$4 = $TS($S(__, DotDotDot, ExtendedExpression), function($skip, $loc, $0, $1, $2, $3) {
|
|
@@ -7024,7 +7050,7 @@ ${input.slice(result.pos)}
|
|
|
7024
7050
|
var exp = $3;
|
|
7025
7051
|
return {
|
|
7026
7052
|
type: "SpreadProperty",
|
|
7027
|
-
children: [
|
|
7053
|
+
children: [ws, dots, exp],
|
|
7028
7054
|
names: exp.names,
|
|
7029
7055
|
value: [dots, exp]
|
|
7030
7056
|
};
|
|
@@ -7033,7 +7059,7 @@ ${input.slice(result.pos)}
|
|
|
7033
7059
|
var ws = $1;
|
|
7034
7060
|
var value = $2;
|
|
7035
7061
|
if (value.type === "Identifier") {
|
|
7036
|
-
return { ...value, children: [
|
|
7062
|
+
return { ...value, children: [ws, ...value.children] };
|
|
7037
7063
|
}
|
|
7038
7064
|
let exp = value, children, i;
|
|
7039
7065
|
do {
|
|
@@ -7278,9 +7304,9 @@ ${input.slice(result.pos)}
|
|
|
7278
7304
|
ts: true
|
|
7279
7305
|
};
|
|
7280
7306
|
});
|
|
7281
|
-
var MethodDefinition$1 = $TS($S(MethodSignature, BracedOrEmptyBlock), function($skip, $loc, $0, $1, $2) {
|
|
7307
|
+
var MethodDefinition$1 = $TS($S(MethodSignature, $N(PropertyAccess), BracedOrEmptyBlock), function($skip, $loc, $0, $1, $2, $3) {
|
|
7282
7308
|
var signature = $1;
|
|
7283
|
-
var block = $
|
|
7309
|
+
var block = $3;
|
|
7284
7310
|
return {
|
|
7285
7311
|
type: "MethodDefinition",
|
|
7286
7312
|
children: $0,
|
|
@@ -18570,19 +18596,20 @@ ${input.slice(result.pos)}
|
|
|
18570
18596
|
if (glob?.type === "PropertyGlob") {
|
|
18571
18597
|
const prefix = children.slice(0, i).concat(glob.children[0]);
|
|
18572
18598
|
const parts = [];
|
|
18573
|
-
for (const part of glob.
|
|
18574
|
-
if (part.
|
|
18575
|
-
throw new Error("Glob pattern cannot have
|
|
18599
|
+
for (const part of glob.object.content) {
|
|
18600
|
+
if (part.type === "SpreadProperty") {
|
|
18601
|
+
throw new Error("Glob pattern cannot have ...spread property");
|
|
18576
18602
|
}
|
|
18577
|
-
if (part.type === "
|
|
18578
|
-
throw new Error("Glob pattern cannot have
|
|
18603
|
+
if (part.type === "MethodDefinition") {
|
|
18604
|
+
throw new Error("Glob pattern cannot have method definition");
|
|
18579
18605
|
}
|
|
18580
|
-
if (part.
|
|
18581
|
-
throw new Error("Glob pattern
|
|
18606
|
+
if (part.value && !["CallExpression", "MemberExpression", "Identifier"].includes(part.value.type)) {
|
|
18607
|
+
throw new Error("Glob pattern must have call or member expression value");
|
|
18582
18608
|
}
|
|
18583
|
-
const name = part
|
|
18584
|
-
|
|
18585
|
-
const wValue =
|
|
18609
|
+
const { name } = part;
|
|
18610
|
+
let value = part.value ?? part.name;
|
|
18611
|
+
const wValue = module.getTrimmingSpace(part.value);
|
|
18612
|
+
value = prefix.concat(module.insertTrimmingSpace(value, ""));
|
|
18586
18613
|
if (wValue)
|
|
18587
18614
|
value.unshift(wValue);
|
|
18588
18615
|
parts.push({
|
|
@@ -18603,10 +18630,9 @@ ${input.slice(result.pos)}
|
|
|
18603
18630
|
const object = {
|
|
18604
18631
|
type: "ObjectExpression",
|
|
18605
18632
|
children: [
|
|
18606
|
-
glob.
|
|
18633
|
+
glob.object.children[0],
|
|
18607
18634
|
...parts,
|
|
18608
|
-
glob.
|
|
18609
|
-
glob.pattern.children.at(-1)
|
|
18635
|
+
glob.object.children.at(-1)
|
|
18610
18636
|
]
|
|
18611
18637
|
};
|
|
18612
18638
|
if (i === children.length - 1)
|
package/dist/main.js
CHANGED
|
@@ -500,6 +500,7 @@ ${input.slice(result.pos)}
|
|
|
500
500
|
CallExpression,
|
|
501
501
|
CallExpressionRest,
|
|
502
502
|
OptionalShorthand,
|
|
503
|
+
OptionalDot,
|
|
503
504
|
NonNullAssertion,
|
|
504
505
|
MemberExpression,
|
|
505
506
|
MemberExpressionRest,
|
|
@@ -3313,7 +3314,7 @@ ${input.slice(result.pos)}
|
|
|
3313
3314
|
return result;
|
|
3314
3315
|
}
|
|
3315
3316
|
}
|
|
3316
|
-
var OptionalShorthand$0 = $TS($S(QuestionMark,
|
|
3317
|
+
var OptionalShorthand$0 = $TS($S(QuestionMark, OptionalDot), function($skip, $loc, $0, $1, $2) {
|
|
3317
3318
|
return {
|
|
3318
3319
|
type: "Optional",
|
|
3319
3320
|
children: $0
|
|
@@ -3341,6 +3342,30 @@ ${input.slice(result.pos)}
|
|
|
3341
3342
|
return result;
|
|
3342
3343
|
}
|
|
3343
3344
|
}
|
|
3345
|
+
var OptionalDot$0 = Dot;
|
|
3346
|
+
var OptionalDot$1 = InsertDot;
|
|
3347
|
+
function OptionalDot(state) {
|
|
3348
|
+
let eventData;
|
|
3349
|
+
if (state.events) {
|
|
3350
|
+
const result = state.events.enter?.("OptionalDot", state);
|
|
3351
|
+
if (result) {
|
|
3352
|
+
if (result.cache)
|
|
3353
|
+
return result.cache;
|
|
3354
|
+
eventData = result.data;
|
|
3355
|
+
}
|
|
3356
|
+
}
|
|
3357
|
+
if (state.tokenize) {
|
|
3358
|
+
const result = $TOKEN("OptionalDot", state, OptionalDot$0(state) || OptionalDot$1(state));
|
|
3359
|
+
if (state.events)
|
|
3360
|
+
state.events.exit?.("OptionalDot", state, result, eventData);
|
|
3361
|
+
return result;
|
|
3362
|
+
} else {
|
|
3363
|
+
const result = OptionalDot$0(state) || OptionalDot$1(state);
|
|
3364
|
+
if (state.events)
|
|
3365
|
+
state.events.exit?.("OptionalDot", state, result, eventData);
|
|
3366
|
+
return result;
|
|
3367
|
+
}
|
|
3368
|
+
}
|
|
3344
3369
|
var NonNullAssertion$0 = $T($EXPECT($L14, fail, 'NonNullAssertion "!"'), function(value) {
|
|
3345
3370
|
return { "type": "NonNullAssertion", "ts": true, "children": value };
|
|
3346
3371
|
});
|
|
@@ -3621,11 +3646,11 @@ ${input.slice(result.pos)}
|
|
|
3621
3646
|
return result;
|
|
3622
3647
|
}
|
|
3623
3648
|
}
|
|
3624
|
-
var PropertyGlob$0 = $TS($S(
|
|
3625
|
-
var
|
|
3649
|
+
var PropertyGlob$0 = $TS($S(OptionalDot, BracedObjectLiteral), function($skip, $loc, $0, $1, $2) {
|
|
3650
|
+
var object = $2;
|
|
3626
3651
|
return {
|
|
3627
3652
|
type: "PropertyGlob",
|
|
3628
|
-
|
|
3653
|
+
object,
|
|
3629
3654
|
children: $0
|
|
3630
3655
|
};
|
|
3631
3656
|
});
|
|
@@ -5167,7 +5192,7 @@ ${input.slice(result.pos)}
|
|
|
5167
5192
|
block
|
|
5168
5193
|
};
|
|
5169
5194
|
});
|
|
5170
|
-
var FunctionExpression$1 = $TS($S($E(AmpersandUnaryPrefix), Ampersand, $E(AmpersandBlockRHS)), function($skip, $loc, $0, $1, $2, $3) {
|
|
5195
|
+
var FunctionExpression$1 = $TS($S($E(AmpersandUnaryPrefix), $C(Ampersand, $S($N(NumericLiteral), $Y($S($E(QuestionMark), Dot)))), $E(AmpersandBlockRHS)), function($skip, $loc, $0, $1, $2, $3) {
|
|
5171
5196
|
var prefix = $1;
|
|
5172
5197
|
var rhs = $3;
|
|
5173
5198
|
if (!prefix && !rhs)
|
|
@@ -6651,6 +6676,7 @@ ${input.slice(result.pos)}
|
|
|
6651
6676
|
const children = [open, ...content, close];
|
|
6652
6677
|
return {
|
|
6653
6678
|
type: "ObjectExpression",
|
|
6679
|
+
content,
|
|
6654
6680
|
children,
|
|
6655
6681
|
names: children.flatMap((c) => {
|
|
6656
6682
|
return c.names || [];
|
|
@@ -6980,7 +7006,7 @@ ${input.slice(result.pos)}
|
|
|
6980
7006
|
const value = [{ ...at, token: "this." }, id];
|
|
6981
7007
|
return {
|
|
6982
7008
|
type: "Property",
|
|
6983
|
-
children: [
|
|
7009
|
+
children: [ws, id, ": ", ...value],
|
|
6984
7010
|
name: id,
|
|
6985
7011
|
names: id.names,
|
|
6986
7012
|
value
|
|
@@ -6991,7 +7017,7 @@ ${input.slice(result.pos)}
|
|
|
6991
7017
|
var prop = $2;
|
|
6992
7018
|
return {
|
|
6993
7019
|
...prop,
|
|
6994
|
-
children: [
|
|
7020
|
+
children: [ws, ...prop.children]
|
|
6995
7021
|
};
|
|
6996
7022
|
});
|
|
6997
7023
|
var PropertyDefinition$2 = $TS($S(__, $TEXT($EXPECT($R5, fail, "PropertyDefinition /[!+-]/")), PropertyName), function($skip, $loc, $0, $1, $2, $3) {
|
|
@@ -7001,7 +7027,7 @@ ${input.slice(result.pos)}
|
|
|
7001
7027
|
const value = toggle === "+" ? "true" : "false";
|
|
7002
7028
|
return {
|
|
7003
7029
|
type: "Property",
|
|
7004
|
-
children: [
|
|
7030
|
+
children: [ws, id, ": ", value],
|
|
7005
7031
|
name: id,
|
|
7006
7032
|
names: id.names,
|
|
7007
7033
|
value
|
|
@@ -7014,7 +7040,7 @@ ${input.slice(result.pos)}
|
|
|
7014
7040
|
return $skip;
|
|
7015
7041
|
return {
|
|
7016
7042
|
...def,
|
|
7017
|
-
children: [
|
|
7043
|
+
children: [ws, ...def.children]
|
|
7018
7044
|
};
|
|
7019
7045
|
});
|
|
7020
7046
|
var PropertyDefinition$4 = $TS($S(__, DotDotDot, ExtendedExpression), function($skip, $loc, $0, $1, $2, $3) {
|
|
@@ -7023,7 +7049,7 @@ ${input.slice(result.pos)}
|
|
|
7023
7049
|
var exp = $3;
|
|
7024
7050
|
return {
|
|
7025
7051
|
type: "SpreadProperty",
|
|
7026
|
-
children: [
|
|
7052
|
+
children: [ws, dots, exp],
|
|
7027
7053
|
names: exp.names,
|
|
7028
7054
|
value: [dots, exp]
|
|
7029
7055
|
};
|
|
@@ -7032,7 +7058,7 @@ ${input.slice(result.pos)}
|
|
|
7032
7058
|
var ws = $1;
|
|
7033
7059
|
var value = $2;
|
|
7034
7060
|
if (value.type === "Identifier") {
|
|
7035
|
-
return { ...value, children: [
|
|
7061
|
+
return { ...value, children: [ws, ...value.children] };
|
|
7036
7062
|
}
|
|
7037
7063
|
let exp = value, children, i;
|
|
7038
7064
|
do {
|
|
@@ -7277,9 +7303,9 @@ ${input.slice(result.pos)}
|
|
|
7277
7303
|
ts: true
|
|
7278
7304
|
};
|
|
7279
7305
|
});
|
|
7280
|
-
var MethodDefinition$1 = $TS($S(MethodSignature, BracedOrEmptyBlock), function($skip, $loc, $0, $1, $2) {
|
|
7306
|
+
var MethodDefinition$1 = $TS($S(MethodSignature, $N(PropertyAccess), BracedOrEmptyBlock), function($skip, $loc, $0, $1, $2, $3) {
|
|
7281
7307
|
var signature = $1;
|
|
7282
|
-
var block = $
|
|
7308
|
+
var block = $3;
|
|
7283
7309
|
return {
|
|
7284
7310
|
type: "MethodDefinition",
|
|
7285
7311
|
children: $0,
|
|
@@ -18569,19 +18595,20 @@ ${input.slice(result.pos)}
|
|
|
18569
18595
|
if (glob?.type === "PropertyGlob") {
|
|
18570
18596
|
const prefix = children.slice(0, i).concat(glob.children[0]);
|
|
18571
18597
|
const parts = [];
|
|
18572
|
-
for (const part of glob.
|
|
18573
|
-
if (part.
|
|
18574
|
-
throw new Error("Glob pattern cannot have
|
|
18598
|
+
for (const part of glob.object.content) {
|
|
18599
|
+
if (part.type === "SpreadProperty") {
|
|
18600
|
+
throw new Error("Glob pattern cannot have ...spread property");
|
|
18575
18601
|
}
|
|
18576
|
-
if (part.type === "
|
|
18577
|
-
throw new Error("Glob pattern cannot have
|
|
18602
|
+
if (part.type === "MethodDefinition") {
|
|
18603
|
+
throw new Error("Glob pattern cannot have method definition");
|
|
18578
18604
|
}
|
|
18579
|
-
if (part.
|
|
18580
|
-
throw new Error("Glob pattern
|
|
18605
|
+
if (part.value && !["CallExpression", "MemberExpression", "Identifier"].includes(part.value.type)) {
|
|
18606
|
+
throw new Error("Glob pattern must have call or member expression value");
|
|
18581
18607
|
}
|
|
18582
|
-
const name = part
|
|
18583
|
-
|
|
18584
|
-
const wValue =
|
|
18608
|
+
const { name } = part;
|
|
18609
|
+
let value = part.value ?? part.name;
|
|
18610
|
+
const wValue = module2.getTrimmingSpace(part.value);
|
|
18611
|
+
value = prefix.concat(module2.insertTrimmingSpace(value, ""));
|
|
18585
18612
|
if (wValue)
|
|
18586
18613
|
value.unshift(wValue);
|
|
18587
18614
|
parts.push({
|
|
@@ -18602,10 +18629,9 @@ ${input.slice(result.pos)}
|
|
|
18602
18629
|
const object = {
|
|
18603
18630
|
type: "ObjectExpression",
|
|
18604
18631
|
children: [
|
|
18605
|
-
glob.
|
|
18632
|
+
glob.object.children[0],
|
|
18606
18633
|
...parts,
|
|
18607
|
-
glob.
|
|
18608
|
-
glob.pattern.children.at(-1)
|
|
18634
|
+
glob.object.children.at(-1)
|
|
18609
18635
|
]
|
|
18610
18636
|
};
|
|
18611
18637
|
if (i === children.length - 1)
|
package/dist/main.mjs
CHANGED
|
@@ -498,6 +498,7 @@ ${input.slice(result.pos)}
|
|
|
498
498
|
CallExpression,
|
|
499
499
|
CallExpressionRest,
|
|
500
500
|
OptionalShorthand,
|
|
501
|
+
OptionalDot,
|
|
501
502
|
NonNullAssertion,
|
|
502
503
|
MemberExpression,
|
|
503
504
|
MemberExpressionRest,
|
|
@@ -3311,7 +3312,7 @@ ${input.slice(result.pos)}
|
|
|
3311
3312
|
return result;
|
|
3312
3313
|
}
|
|
3313
3314
|
}
|
|
3314
|
-
var OptionalShorthand$0 = $TS($S(QuestionMark,
|
|
3315
|
+
var OptionalShorthand$0 = $TS($S(QuestionMark, OptionalDot), function($skip, $loc, $0, $1, $2) {
|
|
3315
3316
|
return {
|
|
3316
3317
|
type: "Optional",
|
|
3317
3318
|
children: $0
|
|
@@ -3339,6 +3340,30 @@ ${input.slice(result.pos)}
|
|
|
3339
3340
|
return result;
|
|
3340
3341
|
}
|
|
3341
3342
|
}
|
|
3343
|
+
var OptionalDot$0 = Dot;
|
|
3344
|
+
var OptionalDot$1 = InsertDot;
|
|
3345
|
+
function OptionalDot(state) {
|
|
3346
|
+
let eventData;
|
|
3347
|
+
if (state.events) {
|
|
3348
|
+
const result = state.events.enter?.("OptionalDot", state);
|
|
3349
|
+
if (result) {
|
|
3350
|
+
if (result.cache)
|
|
3351
|
+
return result.cache;
|
|
3352
|
+
eventData = result.data;
|
|
3353
|
+
}
|
|
3354
|
+
}
|
|
3355
|
+
if (state.tokenize) {
|
|
3356
|
+
const result = $TOKEN("OptionalDot", state, OptionalDot$0(state) || OptionalDot$1(state));
|
|
3357
|
+
if (state.events)
|
|
3358
|
+
state.events.exit?.("OptionalDot", state, result, eventData);
|
|
3359
|
+
return result;
|
|
3360
|
+
} else {
|
|
3361
|
+
const result = OptionalDot$0(state) || OptionalDot$1(state);
|
|
3362
|
+
if (state.events)
|
|
3363
|
+
state.events.exit?.("OptionalDot", state, result, eventData);
|
|
3364
|
+
return result;
|
|
3365
|
+
}
|
|
3366
|
+
}
|
|
3342
3367
|
var NonNullAssertion$0 = $T($EXPECT($L14, fail, 'NonNullAssertion "!"'), function(value) {
|
|
3343
3368
|
return { "type": "NonNullAssertion", "ts": true, "children": value };
|
|
3344
3369
|
});
|
|
@@ -3619,11 +3644,11 @@ ${input.slice(result.pos)}
|
|
|
3619
3644
|
return result;
|
|
3620
3645
|
}
|
|
3621
3646
|
}
|
|
3622
|
-
var PropertyGlob$0 = $TS($S(
|
|
3623
|
-
var
|
|
3647
|
+
var PropertyGlob$0 = $TS($S(OptionalDot, BracedObjectLiteral), function($skip, $loc, $0, $1, $2) {
|
|
3648
|
+
var object = $2;
|
|
3624
3649
|
return {
|
|
3625
3650
|
type: "PropertyGlob",
|
|
3626
|
-
|
|
3651
|
+
object,
|
|
3627
3652
|
children: $0
|
|
3628
3653
|
};
|
|
3629
3654
|
});
|
|
@@ -5165,7 +5190,7 @@ ${input.slice(result.pos)}
|
|
|
5165
5190
|
block
|
|
5166
5191
|
};
|
|
5167
5192
|
});
|
|
5168
|
-
var FunctionExpression$1 = $TS($S($E(AmpersandUnaryPrefix), Ampersand, $E(AmpersandBlockRHS)), function($skip, $loc, $0, $1, $2, $3) {
|
|
5193
|
+
var FunctionExpression$1 = $TS($S($E(AmpersandUnaryPrefix), $C(Ampersand, $S($N(NumericLiteral), $Y($S($E(QuestionMark), Dot)))), $E(AmpersandBlockRHS)), function($skip, $loc, $0, $1, $2, $3) {
|
|
5169
5194
|
var prefix = $1;
|
|
5170
5195
|
var rhs = $3;
|
|
5171
5196
|
if (!prefix && !rhs)
|
|
@@ -6649,6 +6674,7 @@ ${input.slice(result.pos)}
|
|
|
6649
6674
|
const children = [open, ...content, close];
|
|
6650
6675
|
return {
|
|
6651
6676
|
type: "ObjectExpression",
|
|
6677
|
+
content,
|
|
6652
6678
|
children,
|
|
6653
6679
|
names: children.flatMap((c) => {
|
|
6654
6680
|
return c.names || [];
|
|
@@ -6978,7 +7004,7 @@ ${input.slice(result.pos)}
|
|
|
6978
7004
|
const value = [{ ...at, token: "this." }, id];
|
|
6979
7005
|
return {
|
|
6980
7006
|
type: "Property",
|
|
6981
|
-
children: [
|
|
7007
|
+
children: [ws, id, ": ", ...value],
|
|
6982
7008
|
name: id,
|
|
6983
7009
|
names: id.names,
|
|
6984
7010
|
value
|
|
@@ -6989,7 +7015,7 @@ ${input.slice(result.pos)}
|
|
|
6989
7015
|
var prop = $2;
|
|
6990
7016
|
return {
|
|
6991
7017
|
...prop,
|
|
6992
|
-
children: [
|
|
7018
|
+
children: [ws, ...prop.children]
|
|
6993
7019
|
};
|
|
6994
7020
|
});
|
|
6995
7021
|
var PropertyDefinition$2 = $TS($S(__, $TEXT($EXPECT($R5, fail, "PropertyDefinition /[!+-]/")), PropertyName), function($skip, $loc, $0, $1, $2, $3) {
|
|
@@ -6999,7 +7025,7 @@ ${input.slice(result.pos)}
|
|
|
6999
7025
|
const value = toggle === "+" ? "true" : "false";
|
|
7000
7026
|
return {
|
|
7001
7027
|
type: "Property",
|
|
7002
|
-
children: [
|
|
7028
|
+
children: [ws, id, ": ", value],
|
|
7003
7029
|
name: id,
|
|
7004
7030
|
names: id.names,
|
|
7005
7031
|
value
|
|
@@ -7012,7 +7038,7 @@ ${input.slice(result.pos)}
|
|
|
7012
7038
|
return $skip;
|
|
7013
7039
|
return {
|
|
7014
7040
|
...def,
|
|
7015
|
-
children: [
|
|
7041
|
+
children: [ws, ...def.children]
|
|
7016
7042
|
};
|
|
7017
7043
|
});
|
|
7018
7044
|
var PropertyDefinition$4 = $TS($S(__, DotDotDot, ExtendedExpression), function($skip, $loc, $0, $1, $2, $3) {
|
|
@@ -7021,7 +7047,7 @@ ${input.slice(result.pos)}
|
|
|
7021
7047
|
var exp = $3;
|
|
7022
7048
|
return {
|
|
7023
7049
|
type: "SpreadProperty",
|
|
7024
|
-
children: [
|
|
7050
|
+
children: [ws, dots, exp],
|
|
7025
7051
|
names: exp.names,
|
|
7026
7052
|
value: [dots, exp]
|
|
7027
7053
|
};
|
|
@@ -7030,7 +7056,7 @@ ${input.slice(result.pos)}
|
|
|
7030
7056
|
var ws = $1;
|
|
7031
7057
|
var value = $2;
|
|
7032
7058
|
if (value.type === "Identifier") {
|
|
7033
|
-
return { ...value, children: [
|
|
7059
|
+
return { ...value, children: [ws, ...value.children] };
|
|
7034
7060
|
}
|
|
7035
7061
|
let exp = value, children, i;
|
|
7036
7062
|
do {
|
|
@@ -7275,9 +7301,9 @@ ${input.slice(result.pos)}
|
|
|
7275
7301
|
ts: true
|
|
7276
7302
|
};
|
|
7277
7303
|
});
|
|
7278
|
-
var MethodDefinition$1 = $TS($S(MethodSignature, BracedOrEmptyBlock), function($skip, $loc, $0, $1, $2) {
|
|
7304
|
+
var MethodDefinition$1 = $TS($S(MethodSignature, $N(PropertyAccess), BracedOrEmptyBlock), function($skip, $loc, $0, $1, $2, $3) {
|
|
7279
7305
|
var signature = $1;
|
|
7280
|
-
var block = $
|
|
7306
|
+
var block = $3;
|
|
7281
7307
|
return {
|
|
7282
7308
|
type: "MethodDefinition",
|
|
7283
7309
|
children: $0,
|
|
@@ -18567,19 +18593,20 @@ ${input.slice(result.pos)}
|
|
|
18567
18593
|
if (glob?.type === "PropertyGlob") {
|
|
18568
18594
|
const prefix = children.slice(0, i).concat(glob.children[0]);
|
|
18569
18595
|
const parts = [];
|
|
18570
|
-
for (const part of glob.
|
|
18571
|
-
if (part.
|
|
18572
|
-
throw new Error("Glob pattern cannot have
|
|
18596
|
+
for (const part of glob.object.content) {
|
|
18597
|
+
if (part.type === "SpreadProperty") {
|
|
18598
|
+
throw new Error("Glob pattern cannot have ...spread property");
|
|
18573
18599
|
}
|
|
18574
|
-
if (part.type === "
|
|
18575
|
-
throw new Error("Glob pattern cannot have
|
|
18600
|
+
if (part.type === "MethodDefinition") {
|
|
18601
|
+
throw new Error("Glob pattern cannot have method definition");
|
|
18576
18602
|
}
|
|
18577
|
-
if (part.
|
|
18578
|
-
throw new Error("Glob pattern
|
|
18603
|
+
if (part.value && !["CallExpression", "MemberExpression", "Identifier"].includes(part.value.type)) {
|
|
18604
|
+
throw new Error("Glob pattern must have call or member expression value");
|
|
18579
18605
|
}
|
|
18580
|
-
const name = part
|
|
18581
|
-
|
|
18582
|
-
const wValue =
|
|
18606
|
+
const { name } = part;
|
|
18607
|
+
let value = part.value ?? part.name;
|
|
18608
|
+
const wValue = module.getTrimmingSpace(part.value);
|
|
18609
|
+
value = prefix.concat(module.insertTrimmingSpace(value, ""));
|
|
18583
18610
|
if (wValue)
|
|
18584
18611
|
value.unshift(wValue);
|
|
18585
18612
|
parts.push({
|
|
@@ -18600,10 +18627,9 @@ ${input.slice(result.pos)}
|
|
|
18600
18627
|
const object = {
|
|
18601
18628
|
type: "ObjectExpression",
|
|
18602
18629
|
children: [
|
|
18603
|
-
glob.
|
|
18630
|
+
glob.object.children[0],
|
|
18604
18631
|
...parts,
|
|
18605
|
-
glob.
|
|
18606
|
-
glob.pattern.children.at(-1)
|
|
18632
|
+
glob.object.children.at(-1)
|
|
18607
18633
|
]
|
|
18608
18634
|
};
|
|
18609
18635
|
if (i === children.length - 1)
|