@danielx/civet 0.5.77 → 0.5.78
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 +21 -11
- package/dist/main.js +21 -11
- package/dist/main.mjs +21 -11
- package/package.json +1 -1
package/dist/browser.js
CHANGED
|
@@ -1235,7 +1235,7 @@ ${input.slice(result.pos)}
|
|
|
1235
1235
|
var $L179 = $L("infer");
|
|
1236
1236
|
var $L180 = $L("[]");
|
|
1237
1237
|
var $L181 = $L("civet");
|
|
1238
|
-
var $R0 = $R(new RegExp("(as|
|
|
1238
|
+
var $R0 = $R(new RegExp("(as|of|satisfies|then|when|implements|xor|xnor)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
|
|
1239
1239
|
var $R1 = $R(new RegExp("[0-9]", "suy"));
|
|
1240
1240
|
var $R2 = $R(new RegExp("[)}]", "suy"));
|
|
1241
1241
|
var $R3 = $R(new RegExp("[&]", "suy"));
|
|
@@ -1548,6 +1548,9 @@ ${input.slice(result.pos)}
|
|
|
1548
1548
|
var ws = $4;
|
|
1549
1549
|
var args = $5;
|
|
1550
1550
|
var close = $6;
|
|
1551
|
+
if (args.length === 1 && args[0].type === "IterationExpression" && args[0].subtype !== "DoStatement" && !args[0].async && module.isEmptyBareBlock(args[0].block)) {
|
|
1552
|
+
return $skip;
|
|
1553
|
+
}
|
|
1551
1554
|
return [ta?.[0], open, module.insertTrimmingSpace(ws, ""), args, close];
|
|
1552
1555
|
});
|
|
1553
1556
|
function ImplicitArguments(state) {
|
|
@@ -1619,7 +1622,7 @@ ${input.slice(result.pos)}
|
|
|
1619
1622
|
return result;
|
|
1620
1623
|
}
|
|
1621
1624
|
}
|
|
1622
|
-
var ForbiddenImplicitCalls$0 = $R$0($EXPECT($R0, fail, "ForbiddenImplicitCalls /(as|
|
|
1625
|
+
var ForbiddenImplicitCalls$0 = $R$0($EXPECT($R0, fail, "ForbiddenImplicitCalls /(as|of|satisfies|then|when|implements|xor|xnor)(?!\\p{ID_Continue}|[\\u200C\\u200D$])/"));
|
|
1623
1626
|
var ForbiddenImplicitCalls$1 = $EXPECT($L0, fail, 'ForbiddenImplicitCalls "/ "');
|
|
1624
1627
|
var ForbiddenImplicitCalls$2 = AtAt;
|
|
1625
1628
|
var ForbiddenImplicitCalls$3 = $S(Identifier, $EXPECT($L1, fail, 'ForbiddenImplicitCalls "="'), Whitespace);
|
|
@@ -5836,10 +5839,10 @@ ${input.slice(result.pos)}
|
|
|
5836
5839
|
var Block$0 = ExplicitBlock;
|
|
5837
5840
|
var Block$1 = ImplicitNestedBlock;
|
|
5838
5841
|
var Block$2 = ThenClause;
|
|
5839
|
-
var Block$3 = $TS($S($Q(TrailingComment), Statement), function($skip, $loc, $0, $1, $2) {
|
|
5842
|
+
var Block$3 = $TS($S($Q(TrailingComment), $N(EOS), Statement), function($skip, $loc, $0, $1, $2, $3) {
|
|
5840
5843
|
var ws = $1;
|
|
5841
|
-
var s = $
|
|
5842
|
-
const expressions = [
|
|
5844
|
+
var s = $3;
|
|
5845
|
+
const expressions = [[ws, s]];
|
|
5843
5846
|
return {
|
|
5844
5847
|
type: "BlockStatement",
|
|
5845
5848
|
expressions,
|
|
@@ -17019,10 +17022,11 @@ ${input.slice(result.pos)}
|
|
|
17019
17022
|
}
|
|
17020
17023
|
}
|
|
17021
17024
|
var TypeLexicalDeclaration$0 = $S(__, LetOrConstOrVar, TypeDeclarationBinding, $Q($S(CommaDelimiter, __, TypeDeclarationBinding)));
|
|
17022
|
-
var TypeLexicalDeclaration$1 =
|
|
17023
|
-
var TypeLexicalDeclaration$2 =
|
|
17024
|
-
var TypeLexicalDeclaration$3 = $S(
|
|
17025
|
-
var TypeLexicalDeclaration$4 = $S(
|
|
17025
|
+
var TypeLexicalDeclaration$1 = $S(__, EnumDeclaration);
|
|
17026
|
+
var TypeLexicalDeclaration$2 = ClassSignature;
|
|
17027
|
+
var TypeLexicalDeclaration$3 = $S(Namespace, $Q(TrailingComment), IdentifierName, DeclareBlock);
|
|
17028
|
+
var TypeLexicalDeclaration$4 = $S(Module, _, StringLiteral, $E(DeclareBlock));
|
|
17029
|
+
var TypeLexicalDeclaration$5 = $S(Global, $E(DeclareBlock));
|
|
17026
17030
|
function TypeLexicalDeclaration(state) {
|
|
17027
17031
|
let eventData;
|
|
17028
17032
|
if (state.events) {
|
|
@@ -17034,12 +17038,12 @@ ${input.slice(result.pos)}
|
|
|
17034
17038
|
}
|
|
17035
17039
|
}
|
|
17036
17040
|
if (state.tokenize) {
|
|
17037
|
-
const result = $TOKEN("TypeLexicalDeclaration", state, TypeLexicalDeclaration$0(state) || TypeLexicalDeclaration$1(state) || TypeLexicalDeclaration$2(state) || TypeLexicalDeclaration$3(state) || TypeLexicalDeclaration$4(state));
|
|
17041
|
+
const result = $TOKEN("TypeLexicalDeclaration", state, TypeLexicalDeclaration$0(state) || TypeLexicalDeclaration$1(state) || TypeLexicalDeclaration$2(state) || TypeLexicalDeclaration$3(state) || TypeLexicalDeclaration$4(state) || TypeLexicalDeclaration$5(state));
|
|
17038
17042
|
if (state.events)
|
|
17039
17043
|
state.events.exit?.("TypeLexicalDeclaration", state, result, eventData);
|
|
17040
17044
|
return result;
|
|
17041
17045
|
} else {
|
|
17042
|
-
const result = TypeLexicalDeclaration$0(state) || TypeLexicalDeclaration$1(state) || TypeLexicalDeclaration$2(state) || TypeLexicalDeclaration$3(state) || TypeLexicalDeclaration$4(state);
|
|
17046
|
+
const result = TypeLexicalDeclaration$0(state) || TypeLexicalDeclaration$1(state) || TypeLexicalDeclaration$2(state) || TypeLexicalDeclaration$3(state) || TypeLexicalDeclaration$4(state) || TypeLexicalDeclaration$5(state);
|
|
17043
17047
|
if (state.events)
|
|
17044
17048
|
state.events.exit?.("TypeLexicalDeclaration", state, result, eventData);
|
|
17045
17049
|
return result;
|
|
@@ -20578,6 +20582,12 @@ ${input.slice(result.pos)}
|
|
|
20578
20582
|
s = s[0];
|
|
20579
20583
|
return s.token?.startsWith?.("`");
|
|
20580
20584
|
};
|
|
20585
|
+
module.isEmptyBareBlock = function(node) {
|
|
20586
|
+
if (node?.type !== "BlockStatement")
|
|
20587
|
+
return false;
|
|
20588
|
+
const { bare, expressions } = node;
|
|
20589
|
+
return bare && (expressions.length === 0 || expressions.length === 1 && expressions[0][1]?.type === "EmptyStatement");
|
|
20590
|
+
};
|
|
20581
20591
|
module.processBinaryOpExpression = function($02) {
|
|
20582
20592
|
const expandedOps = module.expandChainedComparisons($02);
|
|
20583
20593
|
let i = 2;
|
package/dist/main.js
CHANGED
|
@@ -1234,7 +1234,7 @@ ${input.slice(result.pos)}
|
|
|
1234
1234
|
var $L179 = $L("infer");
|
|
1235
1235
|
var $L180 = $L("[]");
|
|
1236
1236
|
var $L181 = $L("civet");
|
|
1237
|
-
var $R0 = $R(new RegExp("(as|
|
|
1237
|
+
var $R0 = $R(new RegExp("(as|of|satisfies|then|when|implements|xor|xnor)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
|
|
1238
1238
|
var $R1 = $R(new RegExp("[0-9]", "suy"));
|
|
1239
1239
|
var $R2 = $R(new RegExp("[)}]", "suy"));
|
|
1240
1240
|
var $R3 = $R(new RegExp("[&]", "suy"));
|
|
@@ -1547,6 +1547,9 @@ ${input.slice(result.pos)}
|
|
|
1547
1547
|
var ws = $4;
|
|
1548
1548
|
var args = $5;
|
|
1549
1549
|
var close = $6;
|
|
1550
|
+
if (args.length === 1 && args[0].type === "IterationExpression" && args[0].subtype !== "DoStatement" && !args[0].async && module2.isEmptyBareBlock(args[0].block)) {
|
|
1551
|
+
return $skip;
|
|
1552
|
+
}
|
|
1550
1553
|
return [ta?.[0], open, module2.insertTrimmingSpace(ws, ""), args, close];
|
|
1551
1554
|
});
|
|
1552
1555
|
function ImplicitArguments(state) {
|
|
@@ -1618,7 +1621,7 @@ ${input.slice(result.pos)}
|
|
|
1618
1621
|
return result;
|
|
1619
1622
|
}
|
|
1620
1623
|
}
|
|
1621
|
-
var ForbiddenImplicitCalls$0 = $R$0($EXPECT($R0, fail, "ForbiddenImplicitCalls /(as|
|
|
1624
|
+
var ForbiddenImplicitCalls$0 = $R$0($EXPECT($R0, fail, "ForbiddenImplicitCalls /(as|of|satisfies|then|when|implements|xor|xnor)(?!\\p{ID_Continue}|[\\u200C\\u200D$])/"));
|
|
1622
1625
|
var ForbiddenImplicitCalls$1 = $EXPECT($L0, fail, 'ForbiddenImplicitCalls "/ "');
|
|
1623
1626
|
var ForbiddenImplicitCalls$2 = AtAt;
|
|
1624
1627
|
var ForbiddenImplicitCalls$3 = $S(Identifier, $EXPECT($L1, fail, 'ForbiddenImplicitCalls "="'), Whitespace);
|
|
@@ -5835,10 +5838,10 @@ ${input.slice(result.pos)}
|
|
|
5835
5838
|
var Block$0 = ExplicitBlock;
|
|
5836
5839
|
var Block$1 = ImplicitNestedBlock;
|
|
5837
5840
|
var Block$2 = ThenClause;
|
|
5838
|
-
var Block$3 = $TS($S($Q(TrailingComment), Statement), function($skip, $loc, $0, $1, $2) {
|
|
5841
|
+
var Block$3 = $TS($S($Q(TrailingComment), $N(EOS), Statement), function($skip, $loc, $0, $1, $2, $3) {
|
|
5839
5842
|
var ws = $1;
|
|
5840
|
-
var s = $
|
|
5841
|
-
const expressions = [
|
|
5843
|
+
var s = $3;
|
|
5844
|
+
const expressions = [[ws, s]];
|
|
5842
5845
|
return {
|
|
5843
5846
|
type: "BlockStatement",
|
|
5844
5847
|
expressions,
|
|
@@ -17018,10 +17021,11 @@ ${input.slice(result.pos)}
|
|
|
17018
17021
|
}
|
|
17019
17022
|
}
|
|
17020
17023
|
var TypeLexicalDeclaration$0 = $S(__, LetOrConstOrVar, TypeDeclarationBinding, $Q($S(CommaDelimiter, __, TypeDeclarationBinding)));
|
|
17021
|
-
var TypeLexicalDeclaration$1 =
|
|
17022
|
-
var TypeLexicalDeclaration$2 =
|
|
17023
|
-
var TypeLexicalDeclaration$3 = $S(
|
|
17024
|
-
var TypeLexicalDeclaration$4 = $S(
|
|
17024
|
+
var TypeLexicalDeclaration$1 = $S(__, EnumDeclaration);
|
|
17025
|
+
var TypeLexicalDeclaration$2 = ClassSignature;
|
|
17026
|
+
var TypeLexicalDeclaration$3 = $S(Namespace, $Q(TrailingComment), IdentifierName, DeclareBlock);
|
|
17027
|
+
var TypeLexicalDeclaration$4 = $S(Module, _, StringLiteral, $E(DeclareBlock));
|
|
17028
|
+
var TypeLexicalDeclaration$5 = $S(Global, $E(DeclareBlock));
|
|
17025
17029
|
function TypeLexicalDeclaration(state) {
|
|
17026
17030
|
let eventData;
|
|
17027
17031
|
if (state.events) {
|
|
@@ -17033,12 +17037,12 @@ ${input.slice(result.pos)}
|
|
|
17033
17037
|
}
|
|
17034
17038
|
}
|
|
17035
17039
|
if (state.tokenize) {
|
|
17036
|
-
const result = $TOKEN("TypeLexicalDeclaration", state, TypeLexicalDeclaration$0(state) || TypeLexicalDeclaration$1(state) || TypeLexicalDeclaration$2(state) || TypeLexicalDeclaration$3(state) || TypeLexicalDeclaration$4(state));
|
|
17040
|
+
const result = $TOKEN("TypeLexicalDeclaration", state, TypeLexicalDeclaration$0(state) || TypeLexicalDeclaration$1(state) || TypeLexicalDeclaration$2(state) || TypeLexicalDeclaration$3(state) || TypeLexicalDeclaration$4(state) || TypeLexicalDeclaration$5(state));
|
|
17037
17041
|
if (state.events)
|
|
17038
17042
|
state.events.exit?.("TypeLexicalDeclaration", state, result, eventData);
|
|
17039
17043
|
return result;
|
|
17040
17044
|
} else {
|
|
17041
|
-
const result = TypeLexicalDeclaration$0(state) || TypeLexicalDeclaration$1(state) || TypeLexicalDeclaration$2(state) || TypeLexicalDeclaration$3(state) || TypeLexicalDeclaration$4(state);
|
|
17045
|
+
const result = TypeLexicalDeclaration$0(state) || TypeLexicalDeclaration$1(state) || TypeLexicalDeclaration$2(state) || TypeLexicalDeclaration$3(state) || TypeLexicalDeclaration$4(state) || TypeLexicalDeclaration$5(state);
|
|
17042
17046
|
if (state.events)
|
|
17043
17047
|
state.events.exit?.("TypeLexicalDeclaration", state, result, eventData);
|
|
17044
17048
|
return result;
|
|
@@ -20577,6 +20581,12 @@ ${input.slice(result.pos)}
|
|
|
20577
20581
|
s = s[0];
|
|
20578
20582
|
return s.token?.startsWith?.("`");
|
|
20579
20583
|
};
|
|
20584
|
+
module2.isEmptyBareBlock = function(node) {
|
|
20585
|
+
if (node?.type !== "BlockStatement")
|
|
20586
|
+
return false;
|
|
20587
|
+
const { bare, expressions } = node;
|
|
20588
|
+
return bare && (expressions.length === 0 || expressions.length === 1 && expressions[0][1]?.type === "EmptyStatement");
|
|
20589
|
+
};
|
|
20580
20590
|
module2.processBinaryOpExpression = function($02) {
|
|
20581
20591
|
const expandedOps = module2.expandChainedComparisons($02);
|
|
20582
20592
|
let i = 2;
|
package/dist/main.mjs
CHANGED
|
@@ -1232,7 +1232,7 @@ ${input.slice(result.pos)}
|
|
|
1232
1232
|
var $L179 = $L("infer");
|
|
1233
1233
|
var $L180 = $L("[]");
|
|
1234
1234
|
var $L181 = $L("civet");
|
|
1235
|
-
var $R0 = $R(new RegExp("(as|
|
|
1235
|
+
var $R0 = $R(new RegExp("(as|of|satisfies|then|when|implements|xor|xnor)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
|
|
1236
1236
|
var $R1 = $R(new RegExp("[0-9]", "suy"));
|
|
1237
1237
|
var $R2 = $R(new RegExp("[)}]", "suy"));
|
|
1238
1238
|
var $R3 = $R(new RegExp("[&]", "suy"));
|
|
@@ -1545,6 +1545,9 @@ ${input.slice(result.pos)}
|
|
|
1545
1545
|
var ws = $4;
|
|
1546
1546
|
var args = $5;
|
|
1547
1547
|
var close = $6;
|
|
1548
|
+
if (args.length === 1 && args[0].type === "IterationExpression" && args[0].subtype !== "DoStatement" && !args[0].async && module.isEmptyBareBlock(args[0].block)) {
|
|
1549
|
+
return $skip;
|
|
1550
|
+
}
|
|
1548
1551
|
return [ta?.[0], open, module.insertTrimmingSpace(ws, ""), args, close];
|
|
1549
1552
|
});
|
|
1550
1553
|
function ImplicitArguments(state) {
|
|
@@ -1616,7 +1619,7 @@ ${input.slice(result.pos)}
|
|
|
1616
1619
|
return result;
|
|
1617
1620
|
}
|
|
1618
1621
|
}
|
|
1619
|
-
var ForbiddenImplicitCalls$0 = $R$0($EXPECT($R0, fail, "ForbiddenImplicitCalls /(as|
|
|
1622
|
+
var ForbiddenImplicitCalls$0 = $R$0($EXPECT($R0, fail, "ForbiddenImplicitCalls /(as|of|satisfies|then|when|implements|xor|xnor)(?!\\p{ID_Continue}|[\\u200C\\u200D$])/"));
|
|
1620
1623
|
var ForbiddenImplicitCalls$1 = $EXPECT($L0, fail, 'ForbiddenImplicitCalls "/ "');
|
|
1621
1624
|
var ForbiddenImplicitCalls$2 = AtAt;
|
|
1622
1625
|
var ForbiddenImplicitCalls$3 = $S(Identifier, $EXPECT($L1, fail, 'ForbiddenImplicitCalls "="'), Whitespace);
|
|
@@ -5833,10 +5836,10 @@ ${input.slice(result.pos)}
|
|
|
5833
5836
|
var Block$0 = ExplicitBlock;
|
|
5834
5837
|
var Block$1 = ImplicitNestedBlock;
|
|
5835
5838
|
var Block$2 = ThenClause;
|
|
5836
|
-
var Block$3 = $TS($S($Q(TrailingComment), Statement), function($skip, $loc, $0, $1, $2) {
|
|
5839
|
+
var Block$3 = $TS($S($Q(TrailingComment), $N(EOS), Statement), function($skip, $loc, $0, $1, $2, $3) {
|
|
5837
5840
|
var ws = $1;
|
|
5838
|
-
var s = $
|
|
5839
|
-
const expressions = [
|
|
5841
|
+
var s = $3;
|
|
5842
|
+
const expressions = [[ws, s]];
|
|
5840
5843
|
return {
|
|
5841
5844
|
type: "BlockStatement",
|
|
5842
5845
|
expressions,
|
|
@@ -17016,10 +17019,11 @@ ${input.slice(result.pos)}
|
|
|
17016
17019
|
}
|
|
17017
17020
|
}
|
|
17018
17021
|
var TypeLexicalDeclaration$0 = $S(__, LetOrConstOrVar, TypeDeclarationBinding, $Q($S(CommaDelimiter, __, TypeDeclarationBinding)));
|
|
17019
|
-
var TypeLexicalDeclaration$1 =
|
|
17020
|
-
var TypeLexicalDeclaration$2 =
|
|
17021
|
-
var TypeLexicalDeclaration$3 = $S(
|
|
17022
|
-
var TypeLexicalDeclaration$4 = $S(
|
|
17022
|
+
var TypeLexicalDeclaration$1 = $S(__, EnumDeclaration);
|
|
17023
|
+
var TypeLexicalDeclaration$2 = ClassSignature;
|
|
17024
|
+
var TypeLexicalDeclaration$3 = $S(Namespace, $Q(TrailingComment), IdentifierName, DeclareBlock);
|
|
17025
|
+
var TypeLexicalDeclaration$4 = $S(Module, _, StringLiteral, $E(DeclareBlock));
|
|
17026
|
+
var TypeLexicalDeclaration$5 = $S(Global, $E(DeclareBlock));
|
|
17023
17027
|
function TypeLexicalDeclaration(state) {
|
|
17024
17028
|
let eventData;
|
|
17025
17029
|
if (state.events) {
|
|
@@ -17031,12 +17035,12 @@ ${input.slice(result.pos)}
|
|
|
17031
17035
|
}
|
|
17032
17036
|
}
|
|
17033
17037
|
if (state.tokenize) {
|
|
17034
|
-
const result = $TOKEN("TypeLexicalDeclaration", state, TypeLexicalDeclaration$0(state) || TypeLexicalDeclaration$1(state) || TypeLexicalDeclaration$2(state) || TypeLexicalDeclaration$3(state) || TypeLexicalDeclaration$4(state));
|
|
17038
|
+
const result = $TOKEN("TypeLexicalDeclaration", state, TypeLexicalDeclaration$0(state) || TypeLexicalDeclaration$1(state) || TypeLexicalDeclaration$2(state) || TypeLexicalDeclaration$3(state) || TypeLexicalDeclaration$4(state) || TypeLexicalDeclaration$5(state));
|
|
17035
17039
|
if (state.events)
|
|
17036
17040
|
state.events.exit?.("TypeLexicalDeclaration", state, result, eventData);
|
|
17037
17041
|
return result;
|
|
17038
17042
|
} else {
|
|
17039
|
-
const result = TypeLexicalDeclaration$0(state) || TypeLexicalDeclaration$1(state) || TypeLexicalDeclaration$2(state) || TypeLexicalDeclaration$3(state) || TypeLexicalDeclaration$4(state);
|
|
17043
|
+
const result = TypeLexicalDeclaration$0(state) || TypeLexicalDeclaration$1(state) || TypeLexicalDeclaration$2(state) || TypeLexicalDeclaration$3(state) || TypeLexicalDeclaration$4(state) || TypeLexicalDeclaration$5(state);
|
|
17040
17044
|
if (state.events)
|
|
17041
17045
|
state.events.exit?.("TypeLexicalDeclaration", state, result, eventData);
|
|
17042
17046
|
return result;
|
|
@@ -20575,6 +20579,12 @@ ${input.slice(result.pos)}
|
|
|
20575
20579
|
s = s[0];
|
|
20576
20580
|
return s.token?.startsWith?.("`");
|
|
20577
20581
|
};
|
|
20582
|
+
module.isEmptyBareBlock = function(node) {
|
|
20583
|
+
if (node?.type !== "BlockStatement")
|
|
20584
|
+
return false;
|
|
20585
|
+
const { bare, expressions } = node;
|
|
20586
|
+
return bare && (expressions.length === 0 || expressions.length === 1 && expressions[0][1]?.type === "EmptyStatement");
|
|
20587
|
+
};
|
|
20578
20588
|
module.processBinaryOpExpression = function($02) {
|
|
20579
20589
|
const expandedOps = module.expandChainedComparisons($02);
|
|
20580
20590
|
let i = 2;
|