@danielx/civet 0.7.23 → 0.7.24
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 +74 -11
- package/dist/main.js +74 -11
- package/dist/main.mjs +74 -11
- package/dist/unplugin/unplugin.js +1 -9
- package/dist/unplugin/unplugin.mjs +1 -9
- package/package.json +3 -3
package/dist/browser.js
CHANGED
|
@@ -5232,6 +5232,9 @@ ${js}`
|
|
|
5232
5232
|
children: ["(", ...call.children, ")"]
|
|
5233
5233
|
} : { ...call, type: "ParenthesizedExpression" }
|
|
5234
5234
|
);
|
|
5235
|
+
if (children.length === 1) {
|
|
5236
|
+
return children[0];
|
|
5237
|
+
}
|
|
5235
5238
|
}
|
|
5236
5239
|
}
|
|
5237
5240
|
for (let i = 0; i < children.length; i++) {
|
|
@@ -6172,7 +6175,17 @@ ${js}`
|
|
|
6172
6175
|
break;
|
|
6173
6176
|
}
|
|
6174
6177
|
case "PipelineExpression": {
|
|
6175
|
-
|
|
6178
|
+
const i = findChildIndex(parent, ancestor);
|
|
6179
|
+
let ref13;
|
|
6180
|
+
if (i === 1) {
|
|
6181
|
+
ref13 = ancestor === parent.children[i];
|
|
6182
|
+
} else if (i === 2) {
|
|
6183
|
+
ref13 = ancestor === parent.children[i][findChildIndex(parent.children[i], ancestor)][3];
|
|
6184
|
+
} else {
|
|
6185
|
+
ref13 = void 0;
|
|
6186
|
+
}
|
|
6187
|
+
;
|
|
6188
|
+
outer = ref13;
|
|
6176
6189
|
break;
|
|
6177
6190
|
}
|
|
6178
6191
|
case "AssignmentExpression":
|
|
@@ -6187,9 +6200,9 @@ ${js}`
|
|
|
6187
6200
|
fnExp = makeLeftHandSideExpression(fnExp);
|
|
6188
6201
|
}
|
|
6189
6202
|
replaceNode(ancestor, fnExp, parent);
|
|
6190
|
-
let
|
|
6191
|
-
if (
|
|
6192
|
-
const ws =
|
|
6203
|
+
let ref14;
|
|
6204
|
+
if (ref14 = getTrimmingSpace(body)) {
|
|
6205
|
+
const ws = ref14;
|
|
6193
6206
|
inplaceInsertTrimmingSpace(body, "");
|
|
6194
6207
|
inplacePrepend(ws, fnExp);
|
|
6195
6208
|
}
|
|
@@ -6234,8 +6247,8 @@ ${js}`
|
|
|
6234
6247
|
}
|
|
6235
6248
|
];
|
|
6236
6249
|
}
|
|
6237
|
-
let
|
|
6238
|
-
if (Array.isArray(rest.delim) && (
|
|
6250
|
+
let ref15;
|
|
6251
|
+
if (Array.isArray(rest.delim) && (ref15 = rest.delim)[ref15.length - 1]?.token === ",") {
|
|
6239
6252
|
rest.delim = rest.delim.slice(0, -1);
|
|
6240
6253
|
rest.children = [...rest.children.slice(0, -1), rest.delim];
|
|
6241
6254
|
}
|
|
@@ -6700,6 +6713,7 @@ ${js}`
|
|
|
6700
6713
|
FinallyClause,
|
|
6701
6714
|
CatchParameter,
|
|
6702
6715
|
Condition,
|
|
6716
|
+
BoundedCondition,
|
|
6703
6717
|
DeclarationCondition,
|
|
6704
6718
|
ExpressionWithIndentedApplicationForbidden,
|
|
6705
6719
|
SingleLineExpressionWithIndentedApplicationForbidden,
|
|
@@ -11352,7 +11366,8 @@ ${js}`
|
|
|
11352
11366
|
var PropertyName$1 = ComputedPropertyName;
|
|
11353
11367
|
var PropertyName$2 = StringLiteral;
|
|
11354
11368
|
var PropertyName$3 = IdentifierName;
|
|
11355
|
-
var PropertyName
|
|
11369
|
+
var PropertyName$4 = LengthShorthand;
|
|
11370
|
+
var PropertyName$$ = [PropertyName$0, PropertyName$1, PropertyName$2, PropertyName$3, PropertyName$4];
|
|
11356
11371
|
function PropertyName(ctx, state2) {
|
|
11357
11372
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "PropertyName", PropertyName$$);
|
|
11358
11373
|
}
|
|
@@ -12303,7 +12318,26 @@ ${js}`
|
|
|
12303
12318
|
function LabelledItem(ctx, state2) {
|
|
12304
12319
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "LabelledItem", LabelledItem$$);
|
|
12305
12320
|
}
|
|
12306
|
-
var IfStatement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(
|
|
12321
|
+
var IfStatement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$C)(If, Unless), (0, import_lib3.$E)(_), BoundedCondition, Then, BlockOrEmpty, (0, import_lib3.$E)(ElseClause)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
12322
|
+
var kind = $1;
|
|
12323
|
+
var ws = $2;
|
|
12324
|
+
var condition = $3;
|
|
12325
|
+
var block = $5;
|
|
12326
|
+
var e = $6;
|
|
12327
|
+
if (kind.negated) {
|
|
12328
|
+
kind = { ...kind, token: "if" };
|
|
12329
|
+
condition = negateCondition(condition);
|
|
12330
|
+
}
|
|
12331
|
+
return {
|
|
12332
|
+
type: "IfStatement",
|
|
12333
|
+
children: [kind, ws, condition, block, e],
|
|
12334
|
+
condition,
|
|
12335
|
+
negated: kind.negated,
|
|
12336
|
+
then: block,
|
|
12337
|
+
else: e
|
|
12338
|
+
};
|
|
12339
|
+
});
|
|
12340
|
+
var IfStatement$1 = (0, import_lib3.$TS)((0, import_lib3.$S)(IfClause, BlockOrEmpty, (0, import_lib3.$E)(ElseClause)), function($skip, $loc, $0, $1, $2, $3) {
|
|
12307
12341
|
var clause = $1;
|
|
12308
12342
|
var block = $2;
|
|
12309
12343
|
var e = $3;
|
|
@@ -12316,8 +12350,9 @@ ${js}`
|
|
|
12316
12350
|
else: e
|
|
12317
12351
|
};
|
|
12318
12352
|
});
|
|
12353
|
+
var IfStatement$$ = [IfStatement$0, IfStatement$1];
|
|
12319
12354
|
function IfStatement(ctx, state2) {
|
|
12320
|
-
return (0, import_lib3.$
|
|
12355
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "IfStatement", IfStatement$$);
|
|
12321
12356
|
}
|
|
12322
12357
|
var ElseClause$0 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$C)(Nested, (0, import_lib3.$E)(_)), Else, BlockOrEmpty), function(value) {
|
|
12323
12358
|
var block = value[2];
|
|
@@ -13021,7 +13056,19 @@ ${js}`
|
|
|
13021
13056
|
expression
|
|
13022
13057
|
};
|
|
13023
13058
|
});
|
|
13024
|
-
var Condition$3 = (0, import_lib3.$TS)((0, import_lib3.$S)(InsertOpenParen,
|
|
13059
|
+
var Condition$3 = (0, import_lib3.$TS)((0, import_lib3.$S)(PushIndent, InsertOpenParen, (0, import_lib3.$E)((0, import_lib3.$S)(Nested, ExtendedExpression)), InsertCloseParen, PopIndent), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
13060
|
+
var open = $2;
|
|
13061
|
+
var expression = $3;
|
|
13062
|
+
var close = $4;
|
|
13063
|
+
if (!expression)
|
|
13064
|
+
return $skip;
|
|
13065
|
+
return {
|
|
13066
|
+
type: "ParenthesizedExpression",
|
|
13067
|
+
children: [open, expression, close],
|
|
13068
|
+
expression
|
|
13069
|
+
};
|
|
13070
|
+
});
|
|
13071
|
+
var Condition$4 = (0, import_lib3.$TS)((0, import_lib3.$S)(InsertOpenParen, ExpressionWithObjectApplicationForbidden, InsertCloseParen), function($skip, $loc, $0, $1, $2, $3) {
|
|
13025
13072
|
var open = $1;
|
|
13026
13073
|
var expression = $2;
|
|
13027
13074
|
var close = $3;
|
|
@@ -13034,10 +13081,26 @@ ${js}`
|
|
|
13034
13081
|
expression
|
|
13035
13082
|
};
|
|
13036
13083
|
});
|
|
13037
|
-
var Condition$$ = [Condition$0, Condition$1, Condition$2, Condition$3];
|
|
13084
|
+
var Condition$$ = [Condition$0, Condition$1, Condition$2, Condition$3, Condition$4];
|
|
13038
13085
|
function Condition(ctx, state2) {
|
|
13039
13086
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "Condition", Condition$$);
|
|
13040
13087
|
}
|
|
13088
|
+
var BoundedCondition$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(InsertOpenParen, ExtendedExpression, InsertCloseParen), function($skip, $loc, $0, $1, $2, $3) {
|
|
13089
|
+
var open = $1;
|
|
13090
|
+
var expression = $2;
|
|
13091
|
+
var close = $3;
|
|
13092
|
+
if (expression.type === "ParenthesizedExpression")
|
|
13093
|
+
return expression;
|
|
13094
|
+
expression = trimFirstSpace(expression);
|
|
13095
|
+
return {
|
|
13096
|
+
type: "ParenthesizedExpression",
|
|
13097
|
+
children: [open, expression, close],
|
|
13098
|
+
expression
|
|
13099
|
+
};
|
|
13100
|
+
});
|
|
13101
|
+
function BoundedCondition(ctx, state2) {
|
|
13102
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "BoundedCondition", BoundedCondition$0);
|
|
13103
|
+
}
|
|
13041
13104
|
var DeclarationCondition$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(ForbidBracedApplication, ForbidIndentedApplication, ForbidNewlineBinaryOp, (0, import_lib3.$E)(LexicalDeclaration), RestoreNewlineBinaryOp, RestoreBracedApplication, RestoreIndentedApplication), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
|
|
13042
13105
|
var declaration = $4;
|
|
13043
13106
|
if (!declaration)
|
package/dist/main.js
CHANGED
|
@@ -5210,6 +5210,9 @@ function processCallMemberExpression(node) {
|
|
|
5210
5210
|
children: ["(", ...call.children, ")"]
|
|
5211
5211
|
} : { ...call, type: "ParenthesizedExpression" }
|
|
5212
5212
|
);
|
|
5213
|
+
if (children.length === 1) {
|
|
5214
|
+
return children[0];
|
|
5215
|
+
}
|
|
5213
5216
|
}
|
|
5214
5217
|
}
|
|
5215
5218
|
for (let i = 0; i < children.length; i++) {
|
|
@@ -6150,7 +6153,17 @@ function processPlaceholders(statements) {
|
|
|
6150
6153
|
break;
|
|
6151
6154
|
}
|
|
6152
6155
|
case "PipelineExpression": {
|
|
6153
|
-
|
|
6156
|
+
const i = findChildIndex(parent, ancestor);
|
|
6157
|
+
let ref13;
|
|
6158
|
+
if (i === 1) {
|
|
6159
|
+
ref13 = ancestor === parent.children[i];
|
|
6160
|
+
} else if (i === 2) {
|
|
6161
|
+
ref13 = ancestor === parent.children[i][findChildIndex(parent.children[i], ancestor)][3];
|
|
6162
|
+
} else {
|
|
6163
|
+
ref13 = void 0;
|
|
6164
|
+
}
|
|
6165
|
+
;
|
|
6166
|
+
outer = ref13;
|
|
6154
6167
|
break;
|
|
6155
6168
|
}
|
|
6156
6169
|
case "AssignmentExpression":
|
|
@@ -6165,9 +6178,9 @@ function processPlaceholders(statements) {
|
|
|
6165
6178
|
fnExp = makeLeftHandSideExpression(fnExp);
|
|
6166
6179
|
}
|
|
6167
6180
|
replaceNode(ancestor, fnExp, parent);
|
|
6168
|
-
let
|
|
6169
|
-
if (
|
|
6170
|
-
const ws =
|
|
6181
|
+
let ref14;
|
|
6182
|
+
if (ref14 = getTrimmingSpace(body)) {
|
|
6183
|
+
const ws = ref14;
|
|
6171
6184
|
inplaceInsertTrimmingSpace(body, "");
|
|
6172
6185
|
inplacePrepend(ws, fnExp);
|
|
6173
6186
|
}
|
|
@@ -6212,8 +6225,8 @@ function reorderBindingRestProperty(props) {
|
|
|
6212
6225
|
}
|
|
6213
6226
|
];
|
|
6214
6227
|
}
|
|
6215
|
-
let
|
|
6216
|
-
if (Array.isArray(rest.delim) && (
|
|
6228
|
+
let ref15;
|
|
6229
|
+
if (Array.isArray(rest.delim) && (ref15 = rest.delim)[ref15.length - 1]?.token === ",") {
|
|
6217
6230
|
rest.delim = rest.delim.slice(0, -1);
|
|
6218
6231
|
rest.children = [...rest.children.slice(0, -1), rest.delim];
|
|
6219
6232
|
}
|
|
@@ -6678,6 +6691,7 @@ var grammar = {
|
|
|
6678
6691
|
FinallyClause,
|
|
6679
6692
|
CatchParameter,
|
|
6680
6693
|
Condition,
|
|
6694
|
+
BoundedCondition,
|
|
6681
6695
|
DeclarationCondition,
|
|
6682
6696
|
ExpressionWithIndentedApplicationForbidden,
|
|
6683
6697
|
SingleLineExpressionWithIndentedApplicationForbidden,
|
|
@@ -11330,7 +11344,8 @@ var PropertyName$0 = NumericLiteral;
|
|
|
11330
11344
|
var PropertyName$1 = ComputedPropertyName;
|
|
11331
11345
|
var PropertyName$2 = StringLiteral;
|
|
11332
11346
|
var PropertyName$3 = IdentifierName;
|
|
11333
|
-
var PropertyName
|
|
11347
|
+
var PropertyName$4 = LengthShorthand;
|
|
11348
|
+
var PropertyName$$ = [PropertyName$0, PropertyName$1, PropertyName$2, PropertyName$3, PropertyName$4];
|
|
11334
11349
|
function PropertyName(ctx, state2) {
|
|
11335
11350
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "PropertyName", PropertyName$$);
|
|
11336
11351
|
}
|
|
@@ -12281,7 +12296,26 @@ var LabelledItem$$ = [LabelledItem$0, LabelledItem$1];
|
|
|
12281
12296
|
function LabelledItem(ctx, state2) {
|
|
12282
12297
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "LabelledItem", LabelledItem$$);
|
|
12283
12298
|
}
|
|
12284
|
-
var IfStatement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(
|
|
12299
|
+
var IfStatement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$C)(If, Unless), (0, import_lib3.$E)(_), BoundedCondition, Then, BlockOrEmpty, (0, import_lib3.$E)(ElseClause)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
12300
|
+
var kind = $1;
|
|
12301
|
+
var ws = $2;
|
|
12302
|
+
var condition = $3;
|
|
12303
|
+
var block = $5;
|
|
12304
|
+
var e = $6;
|
|
12305
|
+
if (kind.negated) {
|
|
12306
|
+
kind = { ...kind, token: "if" };
|
|
12307
|
+
condition = negateCondition(condition);
|
|
12308
|
+
}
|
|
12309
|
+
return {
|
|
12310
|
+
type: "IfStatement",
|
|
12311
|
+
children: [kind, ws, condition, block, e],
|
|
12312
|
+
condition,
|
|
12313
|
+
negated: kind.negated,
|
|
12314
|
+
then: block,
|
|
12315
|
+
else: e
|
|
12316
|
+
};
|
|
12317
|
+
});
|
|
12318
|
+
var IfStatement$1 = (0, import_lib3.$TS)((0, import_lib3.$S)(IfClause, BlockOrEmpty, (0, import_lib3.$E)(ElseClause)), function($skip, $loc, $0, $1, $2, $3) {
|
|
12285
12319
|
var clause = $1;
|
|
12286
12320
|
var block = $2;
|
|
12287
12321
|
var e = $3;
|
|
@@ -12294,8 +12328,9 @@ var IfStatement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(IfClause, BlockOrEm
|
|
|
12294
12328
|
else: e
|
|
12295
12329
|
};
|
|
12296
12330
|
});
|
|
12331
|
+
var IfStatement$$ = [IfStatement$0, IfStatement$1];
|
|
12297
12332
|
function IfStatement(ctx, state2) {
|
|
12298
|
-
return (0, import_lib3.$
|
|
12333
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "IfStatement", IfStatement$$);
|
|
12299
12334
|
}
|
|
12300
12335
|
var ElseClause$0 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$C)(Nested, (0, import_lib3.$E)(_)), Else, BlockOrEmpty), function(value) {
|
|
12301
12336
|
var block = value[2];
|
|
@@ -12999,7 +13034,19 @@ var Condition$2 = (0, import_lib3.$TS)((0, import_lib3.$S)(InsertOpenParen, Decl
|
|
|
12999
13034
|
expression
|
|
13000
13035
|
};
|
|
13001
13036
|
});
|
|
13002
|
-
var Condition$3 = (0, import_lib3.$TS)((0, import_lib3.$S)(InsertOpenParen,
|
|
13037
|
+
var Condition$3 = (0, import_lib3.$TS)((0, import_lib3.$S)(PushIndent, InsertOpenParen, (0, import_lib3.$E)((0, import_lib3.$S)(Nested, ExtendedExpression)), InsertCloseParen, PopIndent), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
13038
|
+
var open = $2;
|
|
13039
|
+
var expression = $3;
|
|
13040
|
+
var close = $4;
|
|
13041
|
+
if (!expression)
|
|
13042
|
+
return $skip;
|
|
13043
|
+
return {
|
|
13044
|
+
type: "ParenthesizedExpression",
|
|
13045
|
+
children: [open, expression, close],
|
|
13046
|
+
expression
|
|
13047
|
+
};
|
|
13048
|
+
});
|
|
13049
|
+
var Condition$4 = (0, import_lib3.$TS)((0, import_lib3.$S)(InsertOpenParen, ExpressionWithObjectApplicationForbidden, InsertCloseParen), function($skip, $loc, $0, $1, $2, $3) {
|
|
13003
13050
|
var open = $1;
|
|
13004
13051
|
var expression = $2;
|
|
13005
13052
|
var close = $3;
|
|
@@ -13012,10 +13059,26 @@ var Condition$3 = (0, import_lib3.$TS)((0, import_lib3.$S)(InsertOpenParen, Expr
|
|
|
13012
13059
|
expression
|
|
13013
13060
|
};
|
|
13014
13061
|
});
|
|
13015
|
-
var Condition$$ = [Condition$0, Condition$1, Condition$2, Condition$3];
|
|
13062
|
+
var Condition$$ = [Condition$0, Condition$1, Condition$2, Condition$3, Condition$4];
|
|
13016
13063
|
function Condition(ctx, state2) {
|
|
13017
13064
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "Condition", Condition$$);
|
|
13018
13065
|
}
|
|
13066
|
+
var BoundedCondition$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(InsertOpenParen, ExtendedExpression, InsertCloseParen), function($skip, $loc, $0, $1, $2, $3) {
|
|
13067
|
+
var open = $1;
|
|
13068
|
+
var expression = $2;
|
|
13069
|
+
var close = $3;
|
|
13070
|
+
if (expression.type === "ParenthesizedExpression")
|
|
13071
|
+
return expression;
|
|
13072
|
+
expression = trimFirstSpace(expression);
|
|
13073
|
+
return {
|
|
13074
|
+
type: "ParenthesizedExpression",
|
|
13075
|
+
children: [open, expression, close],
|
|
13076
|
+
expression
|
|
13077
|
+
};
|
|
13078
|
+
});
|
|
13079
|
+
function BoundedCondition(ctx, state2) {
|
|
13080
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "BoundedCondition", BoundedCondition$0);
|
|
13081
|
+
}
|
|
13019
13082
|
var DeclarationCondition$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(ForbidBracedApplication, ForbidIndentedApplication, ForbidNewlineBinaryOp, (0, import_lib3.$E)(LexicalDeclaration), RestoreNewlineBinaryOp, RestoreBracedApplication, RestoreIndentedApplication), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
|
|
13020
13083
|
var declaration = $4;
|
|
13021
13084
|
if (!declaration)
|
package/dist/main.mjs
CHANGED
|
@@ -5190,6 +5190,9 @@ function processCallMemberExpression(node) {
|
|
|
5190
5190
|
children: ["(", ...call.children, ")"]
|
|
5191
5191
|
} : { ...call, type: "ParenthesizedExpression" }
|
|
5192
5192
|
);
|
|
5193
|
+
if (children.length === 1) {
|
|
5194
|
+
return children[0];
|
|
5195
|
+
}
|
|
5193
5196
|
}
|
|
5194
5197
|
}
|
|
5195
5198
|
for (let i = 0; i < children.length; i++) {
|
|
@@ -6130,7 +6133,17 @@ function processPlaceholders(statements) {
|
|
|
6130
6133
|
break;
|
|
6131
6134
|
}
|
|
6132
6135
|
case "PipelineExpression": {
|
|
6133
|
-
|
|
6136
|
+
const i = findChildIndex(parent, ancestor);
|
|
6137
|
+
let ref13;
|
|
6138
|
+
if (i === 1) {
|
|
6139
|
+
ref13 = ancestor === parent.children[i];
|
|
6140
|
+
} else if (i === 2) {
|
|
6141
|
+
ref13 = ancestor === parent.children[i][findChildIndex(parent.children[i], ancestor)][3];
|
|
6142
|
+
} else {
|
|
6143
|
+
ref13 = void 0;
|
|
6144
|
+
}
|
|
6145
|
+
;
|
|
6146
|
+
outer = ref13;
|
|
6134
6147
|
break;
|
|
6135
6148
|
}
|
|
6136
6149
|
case "AssignmentExpression":
|
|
@@ -6145,9 +6158,9 @@ function processPlaceholders(statements) {
|
|
|
6145
6158
|
fnExp = makeLeftHandSideExpression(fnExp);
|
|
6146
6159
|
}
|
|
6147
6160
|
replaceNode(ancestor, fnExp, parent);
|
|
6148
|
-
let
|
|
6149
|
-
if (
|
|
6150
|
-
const ws =
|
|
6161
|
+
let ref14;
|
|
6162
|
+
if (ref14 = getTrimmingSpace(body)) {
|
|
6163
|
+
const ws = ref14;
|
|
6151
6164
|
inplaceInsertTrimmingSpace(body, "");
|
|
6152
6165
|
inplacePrepend(ws, fnExp);
|
|
6153
6166
|
}
|
|
@@ -6192,8 +6205,8 @@ function reorderBindingRestProperty(props) {
|
|
|
6192
6205
|
}
|
|
6193
6206
|
];
|
|
6194
6207
|
}
|
|
6195
|
-
let
|
|
6196
|
-
if (Array.isArray(rest.delim) && (
|
|
6208
|
+
let ref15;
|
|
6209
|
+
if (Array.isArray(rest.delim) && (ref15 = rest.delim)[ref15.length - 1]?.token === ",") {
|
|
6197
6210
|
rest.delim = rest.delim.slice(0, -1);
|
|
6198
6211
|
rest.children = [...rest.children.slice(0, -1), rest.delim];
|
|
6199
6212
|
}
|
|
@@ -6658,6 +6671,7 @@ var grammar = {
|
|
|
6658
6671
|
FinallyClause,
|
|
6659
6672
|
CatchParameter,
|
|
6660
6673
|
Condition,
|
|
6674
|
+
BoundedCondition,
|
|
6661
6675
|
DeclarationCondition,
|
|
6662
6676
|
ExpressionWithIndentedApplicationForbidden,
|
|
6663
6677
|
SingleLineExpressionWithIndentedApplicationForbidden,
|
|
@@ -11310,7 +11324,8 @@ var PropertyName$0 = NumericLiteral;
|
|
|
11310
11324
|
var PropertyName$1 = ComputedPropertyName;
|
|
11311
11325
|
var PropertyName$2 = StringLiteral;
|
|
11312
11326
|
var PropertyName$3 = IdentifierName;
|
|
11313
|
-
var PropertyName
|
|
11327
|
+
var PropertyName$4 = LengthShorthand;
|
|
11328
|
+
var PropertyName$$ = [PropertyName$0, PropertyName$1, PropertyName$2, PropertyName$3, PropertyName$4];
|
|
11314
11329
|
function PropertyName(ctx, state2) {
|
|
11315
11330
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "PropertyName", PropertyName$$);
|
|
11316
11331
|
}
|
|
@@ -12261,7 +12276,26 @@ var LabelledItem$$ = [LabelledItem$0, LabelledItem$1];
|
|
|
12261
12276
|
function LabelledItem(ctx, state2) {
|
|
12262
12277
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "LabelledItem", LabelledItem$$);
|
|
12263
12278
|
}
|
|
12264
|
-
var IfStatement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(
|
|
12279
|
+
var IfStatement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$C)(If, Unless), (0, import_lib3.$E)(_), BoundedCondition, Then, BlockOrEmpty, (0, import_lib3.$E)(ElseClause)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
12280
|
+
var kind = $1;
|
|
12281
|
+
var ws = $2;
|
|
12282
|
+
var condition = $3;
|
|
12283
|
+
var block = $5;
|
|
12284
|
+
var e = $6;
|
|
12285
|
+
if (kind.negated) {
|
|
12286
|
+
kind = { ...kind, token: "if" };
|
|
12287
|
+
condition = negateCondition(condition);
|
|
12288
|
+
}
|
|
12289
|
+
return {
|
|
12290
|
+
type: "IfStatement",
|
|
12291
|
+
children: [kind, ws, condition, block, e],
|
|
12292
|
+
condition,
|
|
12293
|
+
negated: kind.negated,
|
|
12294
|
+
then: block,
|
|
12295
|
+
else: e
|
|
12296
|
+
};
|
|
12297
|
+
});
|
|
12298
|
+
var IfStatement$1 = (0, import_lib3.$TS)((0, import_lib3.$S)(IfClause, BlockOrEmpty, (0, import_lib3.$E)(ElseClause)), function($skip, $loc, $0, $1, $2, $3) {
|
|
12265
12299
|
var clause = $1;
|
|
12266
12300
|
var block = $2;
|
|
12267
12301
|
var e = $3;
|
|
@@ -12274,8 +12308,9 @@ var IfStatement$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(IfClause, BlockOrEm
|
|
|
12274
12308
|
else: e
|
|
12275
12309
|
};
|
|
12276
12310
|
});
|
|
12311
|
+
var IfStatement$$ = [IfStatement$0, IfStatement$1];
|
|
12277
12312
|
function IfStatement(ctx, state2) {
|
|
12278
|
-
return (0, import_lib3.$
|
|
12313
|
+
return (0, import_lib3.$EVENT_C)(ctx, state2, "IfStatement", IfStatement$$);
|
|
12279
12314
|
}
|
|
12280
12315
|
var ElseClause$0 = (0, import_lib3.$T)((0, import_lib3.$S)((0, import_lib3.$C)(Nested, (0, import_lib3.$E)(_)), Else, BlockOrEmpty), function(value) {
|
|
12281
12316
|
var block = value[2];
|
|
@@ -12979,7 +13014,19 @@ var Condition$2 = (0, import_lib3.$TS)((0, import_lib3.$S)(InsertOpenParen, Decl
|
|
|
12979
13014
|
expression
|
|
12980
13015
|
};
|
|
12981
13016
|
});
|
|
12982
|
-
var Condition$3 = (0, import_lib3.$TS)((0, import_lib3.$S)(InsertOpenParen,
|
|
13017
|
+
var Condition$3 = (0, import_lib3.$TS)((0, import_lib3.$S)(PushIndent, InsertOpenParen, (0, import_lib3.$E)((0, import_lib3.$S)(Nested, ExtendedExpression)), InsertCloseParen, PopIndent), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
13018
|
+
var open = $2;
|
|
13019
|
+
var expression = $3;
|
|
13020
|
+
var close = $4;
|
|
13021
|
+
if (!expression)
|
|
13022
|
+
return $skip;
|
|
13023
|
+
return {
|
|
13024
|
+
type: "ParenthesizedExpression",
|
|
13025
|
+
children: [open, expression, close],
|
|
13026
|
+
expression
|
|
13027
|
+
};
|
|
13028
|
+
});
|
|
13029
|
+
var Condition$4 = (0, import_lib3.$TS)((0, import_lib3.$S)(InsertOpenParen, ExpressionWithObjectApplicationForbidden, InsertCloseParen), function($skip, $loc, $0, $1, $2, $3) {
|
|
12983
13030
|
var open = $1;
|
|
12984
13031
|
var expression = $2;
|
|
12985
13032
|
var close = $3;
|
|
@@ -12992,10 +13039,26 @@ var Condition$3 = (0, import_lib3.$TS)((0, import_lib3.$S)(InsertOpenParen, Expr
|
|
|
12992
13039
|
expression
|
|
12993
13040
|
};
|
|
12994
13041
|
});
|
|
12995
|
-
var Condition$$ = [Condition$0, Condition$1, Condition$2, Condition$3];
|
|
13042
|
+
var Condition$$ = [Condition$0, Condition$1, Condition$2, Condition$3, Condition$4];
|
|
12996
13043
|
function Condition(ctx, state2) {
|
|
12997
13044
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "Condition", Condition$$);
|
|
12998
13045
|
}
|
|
13046
|
+
var BoundedCondition$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(InsertOpenParen, ExtendedExpression, InsertCloseParen), function($skip, $loc, $0, $1, $2, $3) {
|
|
13047
|
+
var open = $1;
|
|
13048
|
+
var expression = $2;
|
|
13049
|
+
var close = $3;
|
|
13050
|
+
if (expression.type === "ParenthesizedExpression")
|
|
13051
|
+
return expression;
|
|
13052
|
+
expression = trimFirstSpace(expression);
|
|
13053
|
+
return {
|
|
13054
|
+
type: "ParenthesizedExpression",
|
|
13055
|
+
children: [open, expression, close],
|
|
13056
|
+
expression
|
|
13057
|
+
};
|
|
13058
|
+
});
|
|
13059
|
+
function BoundedCondition(ctx, state2) {
|
|
13060
|
+
return (0, import_lib3.$EVENT)(ctx, state2, "BoundedCondition", BoundedCondition$0);
|
|
13061
|
+
}
|
|
12999
13062
|
var DeclarationCondition$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(ForbidBracedApplication, ForbidIndentedApplication, ForbidNewlineBinaryOp, (0, import_lib3.$E)(LexicalDeclaration), RestoreNewlineBinaryOp, RestoreBracedApplication, RestoreIndentedApplication), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
|
|
13000
13063
|
var declaration = $4;
|
|
13001
13064
|
if (!declaration)
|
|
@@ -47,7 +47,6 @@ var import_os = __toESM(require("os"));
|
|
|
47
47
|
var DEFAULT_EXTENSIONS = [".mjs", ".js", ".mts", ".ts", ".jsx", ".tsx", ".json"];
|
|
48
48
|
|
|
49
49
|
// unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\unplugin.civet.jsx
|
|
50
|
-
var hasProp = {}.constructor.hasOwn;
|
|
51
50
|
var DiagnosticCategory = {};
|
|
52
51
|
DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning";
|
|
53
52
|
DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error";
|
|
@@ -469,16 +468,9 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
469
468
|
import_path.default.basename(id.replace(/\.[jt]sx$/, "")),
|
|
470
469
|
import_path.default.basename(id)
|
|
471
470
|
));
|
|
472
|
-
const blank = /* @__PURE__ */ Object.create(null);
|
|
473
|
-
for (const key in jsonSourceMap) {
|
|
474
|
-
if (!hasProp(jsonSourceMap, key))
|
|
475
|
-
continue;
|
|
476
|
-
const value = jsonSourceMap[key];
|
|
477
|
-
blank[key] = value;
|
|
478
|
-
}
|
|
479
471
|
let transformed = {
|
|
480
472
|
code: compiled.code,
|
|
481
|
-
map:
|
|
473
|
+
map: jsonSourceMap
|
|
482
474
|
};
|
|
483
475
|
if (options.transformOutput) {
|
|
484
476
|
transformed = await options.transformOutput(transformed.code, id);
|
|
@@ -15,7 +15,6 @@ import os from "os";
|
|
|
15
15
|
var DEFAULT_EXTENSIONS = [".mjs", ".js", ".mts", ".ts", ".jsx", ".tsx", ".json"];
|
|
16
16
|
|
|
17
17
|
// unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\unplugin.civet.jsx
|
|
18
|
-
var hasProp = {}.constructor.hasOwn;
|
|
19
18
|
var DiagnosticCategory = {};
|
|
20
19
|
DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning";
|
|
21
20
|
DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error";
|
|
@@ -437,16 +436,9 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
437
436
|
path.basename(id.replace(/\.[jt]sx$/, "")),
|
|
438
437
|
path.basename(id)
|
|
439
438
|
));
|
|
440
|
-
const blank = /* @__PURE__ */ Object.create(null);
|
|
441
|
-
for (const key in jsonSourceMap) {
|
|
442
|
-
if (!hasProp(jsonSourceMap, key))
|
|
443
|
-
continue;
|
|
444
|
-
const value = jsonSourceMap[key];
|
|
445
|
-
blank[key] = value;
|
|
446
|
-
}
|
|
447
439
|
let transformed = {
|
|
448
440
|
code: compiled.code,
|
|
449
|
-
map:
|
|
441
|
+
map: jsonSourceMap
|
|
450
442
|
};
|
|
451
443
|
if (options.transformOutput) {
|
|
452
444
|
transformed = await options.transformOutput(transformed.code, id);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@danielx/civet",
|
|
3
3
|
"type": "commonjs",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.24",
|
|
5
5
|
"description": "CoffeeScript style syntax for TypeScript",
|
|
6
6
|
"main": "dist/main.js",
|
|
7
7
|
"module": "dist/main.mjs",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"docs:dev": "yarn build && vitepress dev civet.dev",
|
|
78
78
|
"docs:build": "yarn build && vitepress build civet.dev",
|
|
79
79
|
"docs:preview": "yarn build && vitepress preview civet.dev",
|
|
80
|
-
"prepublishOnly": "yarn build && yarn test && yarn changelog",
|
|
80
|
+
"prepublishOnly": "yarn build && yarn test && yarn changelog --release",
|
|
81
81
|
"test": "bash ./build/test.sh",
|
|
82
82
|
"test:self": "yarn build && mocha --config .mocharc-self.json",
|
|
83
83
|
"changelog": "civet build/changelog.civet"
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"dependencies": {
|
|
88
88
|
"@cspotcode/source-map-support": "^0.8.1",
|
|
89
89
|
"@typescript/vfs": "^1.6.0",
|
|
90
|
-
"unplugin": "^1.
|
|
90
|
+
"unplugin": "^1.12.2"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
93
|
"@danielx/civet": "0.7.16",
|