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