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