@danielx/civet 0.5.36 → 0.5.37
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 +109 -190
- package/dist/main.js +109 -190
- package/dist/main.mjs +109 -190
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -850,6 +850,8 @@ ${input.slice(result.pos)}
|
|
|
850
850
|
TypeDeclaration,
|
|
851
851
|
TypeDeclarationModifier,
|
|
852
852
|
TypeDeclarationRest,
|
|
853
|
+
InterfaceExtendsClause,
|
|
854
|
+
InterfaceExtendsTarget,
|
|
853
855
|
TypeKeyword,
|
|
854
856
|
Interface,
|
|
855
857
|
Namespace,
|
|
@@ -882,10 +884,6 @@ ${input.slice(result.pos)}
|
|
|
882
884
|
TypeBinaryOp,
|
|
883
885
|
FunctionType,
|
|
884
886
|
TypeArguments,
|
|
885
|
-
InlineTypeArguments,
|
|
886
|
-
InlineTypeArgument,
|
|
887
|
-
InlineTypeArgumentDelimiter,
|
|
888
|
-
CompactTypeArguments,
|
|
889
887
|
TypeArgument,
|
|
890
888
|
TypeArgumentDelimiter,
|
|
891
889
|
TypeParameters,
|
|
@@ -1106,7 +1104,7 @@ ${input.slice(result.pos)}
|
|
|
1106
1104
|
var $L164 = $L("infer");
|
|
1107
1105
|
var $L165 = $L("[]");
|
|
1108
1106
|
var $L166 = $L("civet");
|
|
1109
|
-
var $R0 = $R(new RegExp("(for|of|then|when)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
|
|
1107
|
+
var $R0 = $R(new RegExp("(as|for|of|satisfies|then|when)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
|
|
1110
1108
|
var $R1 = $R(new RegExp("[&]", "suy"));
|
|
1111
1109
|
var $R2 = $R(new RegExp("[!~+-]+", "suy"));
|
|
1112
1110
|
var $R3 = $R(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$])*", "suy"));
|
|
@@ -1143,7 +1141,7 @@ ${input.slice(result.pos)}
|
|
|
1143
1141
|
var $R34 = $R(new RegExp("(?:by)(?!\\p{ID_Continue})", "suy"));
|
|
1144
1142
|
var $R35 = $R(new RegExp("(?:of)(?!\\p{ID_Continue})", "suy"));
|
|
1145
1143
|
var $R36 = $R(new RegExp("(?:not)(?!\\p{ID_Continue})", "suy"));
|
|
1146
|
-
var $R37 = $R(new RegExp("(?:and|
|
|
1144
|
+
var $R37 = $R(new RegExp("(?:and|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|function|if|import|in|instanceof|interface|is|let|loop|new|null|or|private|protected|public|return|static|super|switch|this|throw|true|try|typeof|unless|until|var|void|while|with|yield)(?!\\p{ID_Continue})", "suy"));
|
|
1147
1145
|
var $R38 = $R(new RegExp("\\/\\/(?!\\/)[^\\r\\n]*", "suy"));
|
|
1148
1146
|
var $R39 = $R(new RegExp(".", "suy"));
|
|
1149
1147
|
var $R40 = $R(new RegExp("#(?!##(?!#))([^\\r\\n]*)", "suy"));
|
|
@@ -1353,7 +1351,7 @@ ${input.slice(result.pos)}
|
|
|
1353
1351
|
}
|
|
1354
1352
|
}
|
|
1355
1353
|
var Arguments$0 = ExplicitArguments;
|
|
1356
|
-
var Arguments$1 = $TS($S($E($S(
|
|
1354
|
+
var Arguments$1 = $TS($S($E($S(TypeArguments, $N($S(__, ImplementsToken)))), ApplicationStart, InsertOpenParen, $Q(_), ArgumentList, InsertCloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
1357
1355
|
var ta = $1;
|
|
1358
1356
|
var open = $3;
|
|
1359
1357
|
var ws = $4;
|
|
@@ -3049,7 +3047,7 @@ ${input.slice(result.pos)}
|
|
|
3049
3047
|
return result;
|
|
3050
3048
|
}
|
|
3051
3049
|
}
|
|
3052
|
-
var AdditionalReservedWords$0 = $R$0($EXPECT($R0, fail, "AdditionalReservedWords /(for|of|then|when)(?!\\p{ID_Continue}|[\\u200C\\u200D$])/"));
|
|
3050
|
+
var AdditionalReservedWords$0 = $R$0($EXPECT($R0, fail, "AdditionalReservedWords /(as|for|of|satisfies|then|when)(?!\\p{ID_Continue}|[\\u200C\\u200D$])/"));
|
|
3053
3051
|
var AdditionalReservedWords$1 = AtAt;
|
|
3054
3052
|
function AdditionalReservedWords(state) {
|
|
3055
3053
|
let eventData;
|
|
@@ -4576,16 +4574,8 @@ ${input.slice(result.pos)}
|
|
|
4576
4574
|
return result;
|
|
4577
4575
|
}
|
|
4578
4576
|
}
|
|
4579
|
-
var ThenClause$0 = $
|
|
4580
|
-
|
|
4581
|
-
var s = $3;
|
|
4582
|
-
const expressions = [[ws, s]];
|
|
4583
|
-
return {
|
|
4584
|
-
type: "BlockStatement",
|
|
4585
|
-
expressions,
|
|
4586
|
-
children: [expressions],
|
|
4587
|
-
bare: true
|
|
4588
|
-
};
|
|
4577
|
+
var ThenClause$0 = $T($S(Then, SingleLineStatements), function(value) {
|
|
4578
|
+
return value[1];
|
|
4589
4579
|
});
|
|
4590
4580
|
function ThenClause(state) {
|
|
4591
4581
|
let eventData;
|
|
@@ -4690,8 +4680,8 @@ ${input.slice(result.pos)}
|
|
|
4690
4680
|
var c = $5;
|
|
4691
4681
|
return {
|
|
4692
4682
|
type: "BlockStatement",
|
|
4693
|
-
expressions: s,
|
|
4694
|
-
children: [o, s, ws, c]
|
|
4683
|
+
expressions: s.expressions,
|
|
4684
|
+
children: [o, s.children, ws, c]
|
|
4695
4685
|
};
|
|
4696
4686
|
});
|
|
4697
4687
|
function BracedBlock(state) {
|
|
@@ -4716,13 +4706,18 @@ ${input.slice(result.pos)}
|
|
|
4716
4706
|
return result;
|
|
4717
4707
|
}
|
|
4718
4708
|
}
|
|
4719
|
-
var SingleLineStatements$0 = $TS($S($S($Q(
|
|
4720
|
-
var
|
|
4721
|
-
var
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
return
|
|
4709
|
+
var SingleLineStatements$0 = $TS($S($Q($S($Q(_), Statement, SemicolonDelimiter)), $E($S($Q(_), Statement, $E(SemicolonDelimiter)))), function($skip, $loc, $0, $1, $2) {
|
|
4710
|
+
var stmts = $1;
|
|
4711
|
+
var last = $2;
|
|
4712
|
+
const children = [...stmts];
|
|
4713
|
+
if (last)
|
|
4714
|
+
children.push(last);
|
|
4715
|
+
return {
|
|
4716
|
+
type: "BlockStatement",
|
|
4717
|
+
expressions: children,
|
|
4718
|
+
children,
|
|
4719
|
+
bare: true
|
|
4720
|
+
};
|
|
4726
4721
|
});
|
|
4727
4722
|
function SingleLineStatements(state) {
|
|
4728
4723
|
let eventData;
|
|
@@ -8015,48 +8010,34 @@ ${input.slice(result.pos)}
|
|
|
8015
8010
|
}
|
|
8016
8011
|
}
|
|
8017
8012
|
var CaseClause$0 = $T($S(Case, CaseExpressionList, $C(NestedBlockStatements, NoExpressions)), function(value) {
|
|
8018
|
-
|
|
8019
|
-
var expressions = value[2];
|
|
8020
|
-
return { "type": "CaseClause", "cases": cases, "expressions": expressions, "children": value };
|
|
8013
|
+
return { "type": "CaseClause", "children": value };
|
|
8021
8014
|
});
|
|
8022
|
-
var CaseClause$1 = $TS($S(When, CaseExpressionList, InsertOpenBrace, $
|
|
8015
|
+
var CaseClause$1 = $TS($S(When, CaseExpressionList, InsertOpenBrace, $C(ThenClause, NestedBlockStatements, NoExpressions), InsertBreak, InsertNewline, InsertIndent, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8) {
|
|
8023
8016
|
var cases = $2;
|
|
8024
|
-
var
|
|
8017
|
+
var block = $4;
|
|
8025
8018
|
var b = $5;
|
|
8026
|
-
let children = $0;
|
|
8027
|
-
if (!expressions) {
|
|
8028
|
-
expressions = [];
|
|
8029
|
-
children = children.map((c, i) => i === 3 ? expressions : c);
|
|
8030
|
-
}
|
|
8031
|
-
if (expressions.expressions) {
|
|
8032
|
-
expressions = expressions.expressions;
|
|
8033
|
-
}
|
|
8034
8019
|
return {
|
|
8035
8020
|
type: "WhenClause",
|
|
8036
8021
|
cases,
|
|
8037
|
-
|
|
8022
|
+
block,
|
|
8038
8023
|
break: b,
|
|
8039
|
-
children
|
|
8024
|
+
children: $0
|
|
8040
8025
|
};
|
|
8041
8026
|
});
|
|
8042
8027
|
var CaseClause$2 = $TS($S(Default, ImpliedColon, $C(NestedBlockStatements, NoExpressions)), function($skip, $loc, $0, $1, $2, $3) {
|
|
8043
|
-
var
|
|
8044
|
-
if (expressions.expressions)
|
|
8045
|
-
expressions = expressions.expressions;
|
|
8028
|
+
var block = $3;
|
|
8046
8029
|
return {
|
|
8047
8030
|
type: "DefaultClause",
|
|
8048
|
-
|
|
8031
|
+
block,
|
|
8049
8032
|
children: $0
|
|
8050
8033
|
};
|
|
8051
8034
|
});
|
|
8052
|
-
var CaseClause$3 = $TS($S(Else, ImpliedColon, InsertOpenBrace, $C(NestedBlockStatements,
|
|
8053
|
-
var
|
|
8035
|
+
var CaseClause$3 = $TS($S(Else, ImpliedColon, InsertOpenBrace, $C(NestedBlockStatements, SingleLineStatements), InsertNewline, InsertIndent, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
|
|
8036
|
+
var block = $4;
|
|
8054
8037
|
$1.token = "default";
|
|
8055
|
-
if (expressions.expressions)
|
|
8056
|
-
expressions = expressions.expressions;
|
|
8057
8038
|
return {
|
|
8058
8039
|
type: "DefaultClause",
|
|
8059
|
-
|
|
8040
|
+
block,
|
|
8060
8041
|
children: $0
|
|
8061
8042
|
};
|
|
8062
8043
|
});
|
|
@@ -10385,7 +10366,7 @@ ${input.slice(result.pos)}
|
|
|
10385
10366
|
var ReservedWord$3 = $S(CoffeeOfEnabled, $R$0($EXPECT($R35, fail, "ReservedWord /(?:of)(?!\\p{ID_Continue})/")));
|
|
10386
10367
|
var ReservedWord$4 = $S(CoffeeNotEnabled, $R$0($EXPECT($R36, fail, "ReservedWord /(?:not)(?!\\p{ID_Continue})/")));
|
|
10387
10368
|
var ReservedWord$5 = $S($EXPECT($L71, fail, 'ReservedWord "not"'), NonIdContinue, __, $EXPECT($L72, fail, 'ReservedWord "in"'), NonIdContinue);
|
|
10388
|
-
var ReservedWord$6 = $R$0($EXPECT($R37, fail, "ReservedWord /(?:and|
|
|
10369
|
+
var ReservedWord$6 = $R$0($EXPECT($R37, fail, "ReservedWord /(?:and|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|function|if|import|in|instanceof|interface|is|let|loop|new|null|or|private|protected|public|return|static|super|switch|this|throw|true|try|typeof|unless|until|var|void|while|with|yield)(?!\\p{ID_Continue})/"));
|
|
10389
10370
|
function ReservedWord(state) {
|
|
10390
10371
|
let eventData;
|
|
10391
10372
|
if (state.events) {
|
|
@@ -12938,7 +12919,7 @@ ${input.slice(result.pos)}
|
|
|
12938
12919
|
return result;
|
|
12939
12920
|
}
|
|
12940
12921
|
}
|
|
12941
|
-
var JSXSelfClosingElement$0 = $TS($S($EXPECT($L120, fail, 'JSXSelfClosingElement "<"'), $TEXT(JSXElementName), $E(
|
|
12922
|
+
var JSXSelfClosingElement$0 = $TS($S($EXPECT($L120, fail, 'JSXSelfClosingElement "<"'), $TEXT(JSXElementName), $E(TypeArguments), $E(JSXAttributes), $E(Whitespace), $EXPECT($L152, fail, 'JSXSelfClosingElement "/>"')), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
12942
12923
|
return { type: "JSXElement", children: $0 };
|
|
12943
12924
|
});
|
|
12944
12925
|
function JSXSelfClosingElement(state) {
|
|
@@ -12963,7 +12944,7 @@ ${input.slice(result.pos)}
|
|
|
12963
12944
|
return result;
|
|
12964
12945
|
}
|
|
12965
12946
|
}
|
|
12966
|
-
var JSXOpeningElement$0 = $S($EXPECT($L120, fail, 'JSXOpeningElement "<"'), $TEXT(JSXElementName), $E(
|
|
12947
|
+
var JSXOpeningElement$0 = $S($EXPECT($L120, fail, 'JSXOpeningElement "<"'), $TEXT(JSXElementName), $E(TypeArguments), $E(JSXAttributes), $E(Whitespace), $EXPECT($L25, fail, 'JSXOpeningElement ">"'));
|
|
12967
12948
|
function JSXOpeningElement(state) {
|
|
12968
12949
|
let eventData;
|
|
12969
12950
|
if (state.events) {
|
|
@@ -14043,7 +14024,7 @@ ${input.slice(result.pos)}
|
|
|
14043
14024
|
}
|
|
14044
14025
|
}
|
|
14045
14026
|
var TypeDeclarationRest$0 = $S(TypeKeyword, $Q(TrailingComment), IdentifierName, $E(TypeParameters), __, Equals, __, Type);
|
|
14046
|
-
var TypeDeclarationRest$1 = $S(Interface, $Q(TrailingComment), IdentifierName, $E(TypeParameters), InterfaceBlock);
|
|
14027
|
+
var TypeDeclarationRest$1 = $S(Interface, $Q(TrailingComment), IdentifierName, $E(TypeParameters), $E(InterfaceExtendsClause), InterfaceBlock);
|
|
14047
14028
|
var TypeDeclarationRest$2 = $S(Namespace, $Q(TrailingComment), IdentifierName, NamespaceBlock);
|
|
14048
14029
|
var TypeDeclarationRest$3 = FunctionSignature;
|
|
14049
14030
|
function TypeDeclarationRest(state) {
|
|
@@ -14068,6 +14049,52 @@ ${input.slice(result.pos)}
|
|
|
14068
14049
|
return result;
|
|
14069
14050
|
}
|
|
14070
14051
|
}
|
|
14052
|
+
var InterfaceExtendsClause$0 = $S(ExtendsToken, InterfaceExtendsTarget);
|
|
14053
|
+
function InterfaceExtendsClause(state) {
|
|
14054
|
+
let eventData;
|
|
14055
|
+
if (state.events) {
|
|
14056
|
+
const result = state.events.enter?.("InterfaceExtendsClause", state);
|
|
14057
|
+
if (result) {
|
|
14058
|
+
if (result.cache)
|
|
14059
|
+
return result.cache;
|
|
14060
|
+
eventData = result.data;
|
|
14061
|
+
}
|
|
14062
|
+
}
|
|
14063
|
+
if (state.tokenize) {
|
|
14064
|
+
const result = $TOKEN("InterfaceExtendsClause", state, InterfaceExtendsClause$0(state));
|
|
14065
|
+
if (state.events)
|
|
14066
|
+
state.events.exit?.("InterfaceExtendsClause", state, result, eventData);
|
|
14067
|
+
return result;
|
|
14068
|
+
} else {
|
|
14069
|
+
const result = InterfaceExtendsClause$0(state);
|
|
14070
|
+
if (state.events)
|
|
14071
|
+
state.events.exit?.("InterfaceExtendsClause", state, result, eventData);
|
|
14072
|
+
return result;
|
|
14073
|
+
}
|
|
14074
|
+
}
|
|
14075
|
+
var InterfaceExtendsTarget$0 = ImplementsTarget;
|
|
14076
|
+
function InterfaceExtendsTarget(state) {
|
|
14077
|
+
let eventData;
|
|
14078
|
+
if (state.events) {
|
|
14079
|
+
const result = state.events.enter?.("InterfaceExtendsTarget", state);
|
|
14080
|
+
if (result) {
|
|
14081
|
+
if (result.cache)
|
|
14082
|
+
return result.cache;
|
|
14083
|
+
eventData = result.data;
|
|
14084
|
+
}
|
|
14085
|
+
}
|
|
14086
|
+
if (state.tokenize) {
|
|
14087
|
+
const result = $TOKEN("InterfaceExtendsTarget", state, InterfaceExtendsTarget$0(state));
|
|
14088
|
+
if (state.events)
|
|
14089
|
+
state.events.exit?.("InterfaceExtendsTarget", state, result, eventData);
|
|
14090
|
+
return result;
|
|
14091
|
+
} else {
|
|
14092
|
+
const result = InterfaceExtendsTarget$0(state);
|
|
14093
|
+
if (state.events)
|
|
14094
|
+
state.events.exit?.("InterfaceExtendsTarget", state, result, eventData);
|
|
14095
|
+
return result;
|
|
14096
|
+
}
|
|
14097
|
+
}
|
|
14071
14098
|
var TypeKeyword$0 = $S($EXPECT($L159, fail, 'TypeKeyword "type"'), NonIdContinue);
|
|
14072
14099
|
function TypeKeyword(state) {
|
|
14073
14100
|
let eventData;
|
|
@@ -14853,7 +14880,7 @@ ${input.slice(result.pos)}
|
|
|
14853
14880
|
return result;
|
|
14854
14881
|
}
|
|
14855
14882
|
}
|
|
14856
|
-
var TypeArguments$0 = $TS($S(
|
|
14883
|
+
var TypeArguments$0 = $TS($S($EXPECT($L120, fail, 'TypeArguments "<"'), $P(TypeArgument), __, $EXPECT($L25, fail, 'TypeArguments ">"')), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
14857
14884
|
return { ts: true, children: $0 };
|
|
14858
14885
|
});
|
|
14859
14886
|
function TypeArguments(state) {
|
|
@@ -14878,103 +14905,6 @@ ${input.slice(result.pos)}
|
|
|
14878
14905
|
return result;
|
|
14879
14906
|
}
|
|
14880
14907
|
}
|
|
14881
|
-
var InlineTypeArguments$0 = $TS($S($Q(_), $EXPECT($L120, fail, 'InlineTypeArguments "<"'), $P(InlineTypeArgument), $Q(_), $EXPECT($L25, fail, 'InlineTypeArguments ">"')), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
14882
|
-
return { ts: true, children: $0 };
|
|
14883
|
-
});
|
|
14884
|
-
function InlineTypeArguments(state) {
|
|
14885
|
-
let eventData;
|
|
14886
|
-
if (state.events) {
|
|
14887
|
-
const result = state.events.enter?.("InlineTypeArguments", state);
|
|
14888
|
-
if (result) {
|
|
14889
|
-
if (result.cache)
|
|
14890
|
-
return result.cache;
|
|
14891
|
-
eventData = result.data;
|
|
14892
|
-
}
|
|
14893
|
-
}
|
|
14894
|
-
if (state.tokenize) {
|
|
14895
|
-
const result = $TOKEN("InlineTypeArguments", state, InlineTypeArguments$0(state));
|
|
14896
|
-
if (state.events)
|
|
14897
|
-
state.events.exit?.("InlineTypeArguments", state, result, eventData);
|
|
14898
|
-
return result;
|
|
14899
|
-
} else {
|
|
14900
|
-
const result = InlineTypeArguments$0(state);
|
|
14901
|
-
if (state.events)
|
|
14902
|
-
state.events.exit?.("InlineTypeArguments", state, result, eventData);
|
|
14903
|
-
return result;
|
|
14904
|
-
}
|
|
14905
|
-
}
|
|
14906
|
-
var InlineTypeArgument$0 = $S($Q(_), Type, InlineTypeArgumentDelimiter);
|
|
14907
|
-
function InlineTypeArgument(state) {
|
|
14908
|
-
let eventData;
|
|
14909
|
-
if (state.events) {
|
|
14910
|
-
const result = state.events.enter?.("InlineTypeArgument", state);
|
|
14911
|
-
if (result) {
|
|
14912
|
-
if (result.cache)
|
|
14913
|
-
return result.cache;
|
|
14914
|
-
eventData = result.data;
|
|
14915
|
-
}
|
|
14916
|
-
}
|
|
14917
|
-
if (state.tokenize) {
|
|
14918
|
-
const result = $TOKEN("InlineTypeArgument", state, InlineTypeArgument$0(state));
|
|
14919
|
-
if (state.events)
|
|
14920
|
-
state.events.exit?.("InlineTypeArgument", state, result, eventData);
|
|
14921
|
-
return result;
|
|
14922
|
-
} else {
|
|
14923
|
-
const result = InlineTypeArgument$0(state);
|
|
14924
|
-
if (state.events)
|
|
14925
|
-
state.events.exit?.("InlineTypeArgument", state, result, eventData);
|
|
14926
|
-
return result;
|
|
14927
|
-
}
|
|
14928
|
-
}
|
|
14929
|
-
var InlineTypeArgumentDelimiter$0 = $S($Q(_), Comma);
|
|
14930
|
-
var InlineTypeArgumentDelimiter$1 = $Y($S($Q(_), $EXPECT($L25, fail, 'InlineTypeArgumentDelimiter ">"')));
|
|
14931
|
-
function InlineTypeArgumentDelimiter(state) {
|
|
14932
|
-
let eventData;
|
|
14933
|
-
if (state.events) {
|
|
14934
|
-
const result = state.events.enter?.("InlineTypeArgumentDelimiter", state);
|
|
14935
|
-
if (result) {
|
|
14936
|
-
if (result.cache)
|
|
14937
|
-
return result.cache;
|
|
14938
|
-
eventData = result.data;
|
|
14939
|
-
}
|
|
14940
|
-
}
|
|
14941
|
-
if (state.tokenize) {
|
|
14942
|
-
const result = $TOKEN("InlineTypeArgumentDelimiter", state, InlineTypeArgumentDelimiter$0(state) || InlineTypeArgumentDelimiter$1(state));
|
|
14943
|
-
if (state.events)
|
|
14944
|
-
state.events.exit?.("InlineTypeArgumentDelimiter", state, result, eventData);
|
|
14945
|
-
return result;
|
|
14946
|
-
} else {
|
|
14947
|
-
const result = InlineTypeArgumentDelimiter$0(state) || InlineTypeArgumentDelimiter$1(state);
|
|
14948
|
-
if (state.events)
|
|
14949
|
-
state.events.exit?.("InlineTypeArgumentDelimiter", state, result, eventData);
|
|
14950
|
-
return result;
|
|
14951
|
-
}
|
|
14952
|
-
}
|
|
14953
|
-
var CompactTypeArguments$0 = $TS($S($EXPECT($L120, fail, 'CompactTypeArguments "<"'), $P(TypeArgument), __, $EXPECT($L25, fail, 'CompactTypeArguments ">"')), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
14954
|
-
return { ts: true, children: $0 };
|
|
14955
|
-
});
|
|
14956
|
-
function CompactTypeArguments(state) {
|
|
14957
|
-
let eventData;
|
|
14958
|
-
if (state.events) {
|
|
14959
|
-
const result = state.events.enter?.("CompactTypeArguments", state);
|
|
14960
|
-
if (result) {
|
|
14961
|
-
if (result.cache)
|
|
14962
|
-
return result.cache;
|
|
14963
|
-
eventData = result.data;
|
|
14964
|
-
}
|
|
14965
|
-
}
|
|
14966
|
-
if (state.tokenize) {
|
|
14967
|
-
const result = $TOKEN("CompactTypeArguments", state, CompactTypeArguments$0(state));
|
|
14968
|
-
if (state.events)
|
|
14969
|
-
state.events.exit?.("CompactTypeArguments", state, result, eventData);
|
|
14970
|
-
return result;
|
|
14971
|
-
} else {
|
|
14972
|
-
const result = CompactTypeArguments$0(state);
|
|
14973
|
-
if (state.events)
|
|
14974
|
-
state.events.exit?.("CompactTypeArguments", state, result, eventData);
|
|
14975
|
-
return result;
|
|
14976
|
-
}
|
|
14977
|
-
}
|
|
14978
14908
|
var TypeArgument$0 = $S(__, Type, TypeArgumentDelimiter);
|
|
14979
14909
|
function TypeArgument(state) {
|
|
14980
14910
|
let eventData;
|
|
@@ -16152,6 +16082,16 @@ ${input.slice(result.pos)}
|
|
|
16152
16082
|
};
|
|
16153
16083
|
module2.prelude.push(["", ["const ", moduloRef, typeSuffix, " = (a, b) => (a % b + b) % b", "\n"]]);
|
|
16154
16084
|
},
|
|
16085
|
+
returnSymbol(ref) {
|
|
16086
|
+
module2.prelude.push({
|
|
16087
|
+
children: [
|
|
16088
|
+
"const ",
|
|
16089
|
+
ref,
|
|
16090
|
+
` = Symbol("return")';
|
|
16091
|
+
`
|
|
16092
|
+
]
|
|
16093
|
+
});
|
|
16094
|
+
},
|
|
16155
16095
|
JSX(jsxRef) {
|
|
16156
16096
|
module2.prelude.push({
|
|
16157
16097
|
ts: true,
|
|
@@ -16448,35 +16388,19 @@ ${input.slice(result.pos)}
|
|
|
16448
16388
|
if (!node)
|
|
16449
16389
|
return;
|
|
16450
16390
|
switch (node.type) {
|
|
16451
|
-
case "AssignmentExpression":
|
|
16452
|
-
node.children.unshift(ref, ".push(");
|
|
16453
|
-
node.children.push(")");
|
|
16454
|
-
return;
|
|
16455
|
-
case "Identifier":
|
|
16456
|
-
node.children.unshift(ref, ".push(");
|
|
16457
|
-
node.children.push(")");
|
|
16458
|
-
return;
|
|
16459
16391
|
case "BlockStatement":
|
|
16460
16392
|
insertPush(node.expressions[node.expressions.length - 1], ref);
|
|
16461
16393
|
return;
|
|
16462
|
-
case "ObjectBindingPattern":
|
|
16463
|
-
case "ObjectExpression":
|
|
16464
|
-
module2.insertTrimmingSpace(node.children[0], "");
|
|
16465
|
-
node.children.unshift(ref, ".push(");
|
|
16466
|
-
node.children.push(")");
|
|
16467
|
-
return;
|
|
16468
16394
|
case "CaseBlock":
|
|
16469
16395
|
node.clauses.forEach((clause) => {
|
|
16470
16396
|
insertPush(clause, ref);
|
|
16471
16397
|
});
|
|
16472
16398
|
return;
|
|
16473
|
-
case "CaseClause":
|
|
16474
|
-
return;
|
|
16475
16399
|
case "WhenClause":
|
|
16476
|
-
insertPush(node.
|
|
16400
|
+
insertPush(node.block, ref);
|
|
16477
16401
|
return;
|
|
16478
16402
|
case "DefaultClause":
|
|
16479
|
-
insertPush(node.
|
|
16403
|
+
insertPush(node.block, ref);
|
|
16480
16404
|
return;
|
|
16481
16405
|
}
|
|
16482
16406
|
if (!Array.isArray(node))
|
|
@@ -16522,41 +16446,35 @@ ${input.slice(result.pos)}
|
|
|
16522
16446
|
node.splice(1, 0, ref, ".push(");
|
|
16523
16447
|
node.push(")");
|
|
16524
16448
|
}
|
|
16449
|
+
function wrapWithReturn(expression) {
|
|
16450
|
+
const children = expression ? ["return ", expression] : ["return"];
|
|
16451
|
+
return {
|
|
16452
|
+
type: "ReturnStatement",
|
|
16453
|
+
children
|
|
16454
|
+
};
|
|
16455
|
+
}
|
|
16525
16456
|
function insertReturn(node) {
|
|
16526
16457
|
if (!node)
|
|
16527
16458
|
return;
|
|
16528
16459
|
switch (node.type) {
|
|
16529
|
-
case "AssignmentExpression":
|
|
16530
|
-
node.children.unshift("return ");
|
|
16531
|
-
return;
|
|
16532
|
-
case "Identifier":
|
|
16533
|
-
node.children.unshift("return ");
|
|
16534
|
-
return;
|
|
16535
16460
|
case "BlockStatement":
|
|
16536
16461
|
insertReturn(node.expressions[node.expressions.length - 1]);
|
|
16537
16462
|
return;
|
|
16538
|
-
case "ObjectBindingPattern":
|
|
16539
|
-
case "ObjectExpression":
|
|
16540
|
-
module2.insertTrimmingSpace(node.children[0], "");
|
|
16541
|
-
node.children.unshift("return ");
|
|
16542
|
-
return;
|
|
16543
16463
|
case "CaseBlock":
|
|
16544
16464
|
node.clauses.forEach((clause) => {
|
|
16545
16465
|
insertReturn(clause);
|
|
16546
16466
|
});
|
|
16547
16467
|
return;
|
|
16548
|
-
case "CaseClause":
|
|
16549
|
-
return;
|
|
16550
16468
|
case "WhenClause":
|
|
16551
16469
|
node.children.splice(node.children.indexOf(node.break), 1);
|
|
16552
|
-
if (node.
|
|
16553
|
-
node.
|
|
16470
|
+
if (node.block.length === 0) {
|
|
16471
|
+
node.block.push(wrapWithReturn());
|
|
16554
16472
|
return;
|
|
16555
16473
|
}
|
|
16556
|
-
insertReturn(node.
|
|
16474
|
+
insertReturn(node.block);
|
|
16557
16475
|
return;
|
|
16558
16476
|
case "DefaultClause":
|
|
16559
|
-
insertReturn(node.
|
|
16477
|
+
insertReturn(node.block);
|
|
16560
16478
|
return;
|
|
16561
16479
|
}
|
|
16562
16480
|
if (!Array.isArray(node))
|
|
@@ -16588,7 +16506,7 @@ ${input.slice(result.pos)}
|
|
|
16588
16506
|
if (exp.children[3])
|
|
16589
16507
|
insertReturn(exp.children[3][2]);
|
|
16590
16508
|
else
|
|
16591
|
-
exp.children.push(["\n", indent,
|
|
16509
|
+
exp.children.push(["\n", indent, wrapWithReturn()]);
|
|
16592
16510
|
return;
|
|
16593
16511
|
case "SwitchStatement":
|
|
16594
16512
|
insertReturn(exp.children[2]);
|
|
@@ -16601,7 +16519,8 @@ ${input.slice(result.pos)}
|
|
|
16601
16519
|
}
|
|
16602
16520
|
if (node[node.length - 1]?.type === "SemicolonDelimiter")
|
|
16603
16521
|
return;
|
|
16604
|
-
|
|
16522
|
+
const returnStatement = wrapWithReturn(node[1]);
|
|
16523
|
+
node.splice(1, 1, returnStatement);
|
|
16605
16524
|
}
|
|
16606
16525
|
module2.makeLeftHandSideExpression = function(exp) {
|
|
16607
16526
|
switch (exp.type) {
|