remove meta.CaseToken
This commit is contained in:
parent
72136ee853
commit
2c1c25de58
@ -22,7 +22,6 @@ const (
|
|||||||
EnddeclareToken
|
EnddeclareToken
|
||||||
AsToken
|
AsToken
|
||||||
EndswitchToken
|
EndswitchToken
|
||||||
CaseToken
|
|
||||||
DefaultToken
|
DefaultToken
|
||||||
ContinueToken
|
ContinueToken
|
||||||
GotoToken
|
GotoToken
|
||||||
|
@ -4,9 +4,9 @@ package meta
|
|||||||
|
|
||||||
import "strconv"
|
import "strconv"
|
||||||
|
|
||||||
const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenEndswitchTokenCaseTokenDefaultTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
|
const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenEndswitchTokenDefaultTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
|
||||||
|
|
||||||
var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 72, 79, 89, 102, 123, 144, 155, 170, 182, 197, 204, 218, 227, 239, 252, 261, 274, 284, 295, 303, 313, 325, 335, 349, 360, 368, 378, 388, 398, 412, 424, 439, 455, 468, 482, 506, 532, 548, 561, 575, 590, 605, 620, 630, 643, 653, 665, 679, 690, 698, 706, 725, 738, 752, 766, 781, 794, 807, 820, 836, 849, 862, 874, 887, 899, 911, 925, 940, 948, 955, 962, 978, 997, 1009, 1024, 1045, 1066, 1083, 1101, 1121, 1142, 1156, 1166, 1186, 1207, 1224, 1242, 1259, 1273, 1283, 1292, 1302, 1318, 1328, 1338, 1351, 1361, 1373, 1382, 1394, 1402}
|
var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 72, 79, 89, 102, 123, 144, 155, 170, 182, 197, 204, 218, 230, 243, 252, 265, 275, 286, 294, 304, 316, 326, 340, 351, 359, 369, 379, 389, 403, 415, 430, 446, 459, 473, 497, 523, 539, 552, 566, 581, 596, 611, 621, 634, 644, 656, 670, 681, 689, 697, 716, 729, 743, 757, 772, 785, 798, 811, 827, 840, 853, 865, 878, 890, 902, 916, 931, 939, 946, 953, 969, 988, 1000, 1015, 1036, 1057, 1074, 1092, 1112, 1133, 1147, 1157, 1177, 1198, 1215, 1233, 1250, 1264, 1274, 1283, 1293, 1309, 1319, 1329, 1342, 1352, 1364, 1373, 1385, 1393}
|
||||||
|
|
||||||
func (i TokenName) String() string {
|
func (i TokenName) String() string {
|
||||||
if i < 0 || i >= TokenName(len(_TokenName_index)-1) {
|
if i < 0 || i >= TokenName(len(_TokenName_index)-1) {
|
||||||
|
@ -4201,7 +4201,7 @@ yydefault:
|
|||||||
_case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list))
|
_case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
yyDollar[2].token.Meta.SetTokenName(meta.CaseToken).AppendTo(_case.GetMeta())
|
yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(_case.GetMeta())
|
||||||
yyDollar[4].token.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_case.GetMeta())
|
yyDollar[4].token.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_case.GetMeta())
|
||||||
yylex.(*Parser).appendMetaToken(_case, yyDollar[4].token, meta.CaseSeparatorToken)
|
yylex.(*Parser).appendMetaToken(_case, yyDollar[4].token, meta.CaseSeparatorToken)
|
||||||
|
|
||||||
|
@ -2029,7 +2029,7 @@ case_list:
|
|||||||
_case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5))
|
_case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
$2.Meta.SetTokenName(meta.CaseToken).AppendTo(_case.GetMeta())
|
$2.Meta.SetTokenName(meta.NodeStart).AppendTo(_case.GetMeta())
|
||||||
$4.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_case.GetMeta())
|
$4.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_case.GetMeta())
|
||||||
yylex.(*Parser).appendMetaToken(_case, $4, meta.CaseSeparatorToken)
|
yylex.(*Parser).appendMetaToken(_case, $4, meta.CaseSeparatorToken)
|
||||||
|
|
||||||
|
@ -4245,7 +4245,7 @@ yydefault:
|
|||||||
_case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list))
|
_case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[5].list))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
yyDollar[2].token.Meta.SetTokenName(meta.CaseToken).AppendTo(_case.GetMeta())
|
yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(_case.GetMeta())
|
||||||
yyDollar[4].token.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_case.GetMeta())
|
yyDollar[4].token.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_case.GetMeta())
|
||||||
yylex.(*Parser).appendMetaToken(_case, yyDollar[4].token, meta.CaseSeparatorToken)
|
yylex.(*Parser).appendMetaToken(_case, yyDollar[4].token, meta.CaseSeparatorToken)
|
||||||
|
|
||||||
|
@ -1874,7 +1874,7 @@ case_list:
|
|||||||
_case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5))
|
_case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
$2.Meta.SetTokenName(meta.CaseToken).AppendTo(_case.GetMeta())
|
$2.Meta.SetTokenName(meta.NodeStart).AppendTo(_case.GetMeta())
|
||||||
$4.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_case.GetMeta())
|
$4.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_case.GetMeta())
|
||||||
yylex.(*Parser).appendMetaToken(_case, $4, meta.CaseSeparatorToken)
|
yylex.(*Parser).appendMetaToken(_case, $4, meta.CaseSeparatorToken)
|
||||||
|
|
||||||
|
@ -1879,7 +1879,6 @@ func (p *Printer) printStmtCase(n node.Node) {
|
|||||||
nn := n.(*stmt.Case)
|
nn := n.(*stmt.Case)
|
||||||
p.printMeta(nn, meta.NodeStart)
|
p.printMeta(nn, meta.NodeStart)
|
||||||
|
|
||||||
p.printMeta(nn, meta.CaseToken)
|
|
||||||
io.WriteString(p.w, "case")
|
io.WriteString(p.w, "case")
|
||||||
p.Print(nn.Cond)
|
p.Print(nn.Cond)
|
||||||
r := p.printMeta(nn, meta.CaseSeparatorToken)
|
r := p.printMeta(nn, meta.CaseSeparatorToken)
|
||||||
|
@ -5507,7 +5507,7 @@ func TestPrinterPrintStmtCase(t *testing.T) {
|
|||||||
&meta.Data{
|
&meta.Data{
|
||||||
Type: meta.WhiteSpaceType,
|
Type: meta.WhiteSpaceType,
|
||||||
Value: " ",
|
Value: " ",
|
||||||
TokenName: meta.CaseToken,
|
TokenName: meta.NodeStart,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Cond: &expr.Variable{
|
Cond: &expr.Variable{
|
||||||
@ -5551,7 +5551,7 @@ func TestPrinterPrintStmtCaseEmpty(t *testing.T) {
|
|||||||
&meta.Data{
|
&meta.Data{
|
||||||
Type: meta.WhiteSpaceType,
|
Type: meta.WhiteSpaceType,
|
||||||
Value: " ",
|
Value: " ",
|
||||||
TokenName: meta.CaseToken,
|
TokenName: meta.NodeStart,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Cond: &expr.Variable{
|
Cond: &expr.Variable{
|
||||||
|
Loading…
Reference in New Issue
Block a user