remove meta.TryToken

This commit is contained in:
z7zmey 2018-10-29 15:04:54 +02:00
parent f7a0038307
commit 8d976d3152
8 changed files with 7 additions and 9 deletions

View File

@ -20,7 +20,6 @@ const (
EndswitchToken
FunctionToken
ConstToken
TryToken
InsteadofToken
VarToken
UnsetToken

View File

@ -4,9 +4,9 @@ package meta
import "strconv"
const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenTryTokenInsteadofTokenVarTokenUnsetTokenClassTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenInsteadofTokenVarTokenUnsetTokenClassTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 58, 71, 92, 113, 124, 139, 154, 161, 175, 188, 198, 206, 220, 228, 238, 248, 260, 275, 291, 304, 318, 342, 368, 384, 397, 411, 426, 441, 456, 466, 479, 489, 501, 515, 526, 534, 542, 561, 574, 588, 602, 617, 630, 643, 656, 672, 685, 698, 710, 723, 735, 747, 761, 776, 784, 791, 798, 814, 833, 845, 860, 881, 902, 920, 940, 961, 975, 985, 1005, 1026, 1043, 1061, 1078, 1092, 1102, 1111, 1121, 1137, 1147, 1157, 1170, 1180, 1192, 1201, 1213, 1221}
var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 58, 71, 92, 113, 124, 139, 154, 161, 175, 188, 198, 212, 220, 230, 240, 252, 267, 283, 296, 310, 334, 360, 376, 389, 403, 418, 433, 448, 458, 471, 481, 493, 507, 518, 526, 534, 553, 566, 580, 594, 609, 622, 635, 648, 664, 677, 690, 702, 715, 727, 739, 753, 768, 776, 783, 790, 806, 825, 837, 852, 873, 894, 912, 932, 953, 967, 977, 997, 1018, 1035, 1053, 1070, 1084, 1094, 1103, 1113, 1129, 1139, 1149, 1162, 1172, 1184, 1193, 1205, 1213}
func (i TokenName) String() string {
if i < 0 || i >= TokenName(len(_TokenName_index)-1) {

View File

@ -3474,7 +3474,7 @@ yydefault:
}
// save comments
yyDollar[1].token.Meta.SetTokenName(meta.TryToken).AppendTo(yyVAL.node.GetMeta())
yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta())
yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta())
yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta())

View File

@ -1326,7 +1326,7 @@ unticked_statement:
}
// save comments
$1.Meta.SetTokenName(meta.TryToken).AppendTo($$.GetMeta())
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
$2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta())
$4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta())

View File

@ -3611,7 +3611,7 @@ yydefault:
}
// save comments
yyDollar[1].token.Meta.SetTokenName(meta.TryToken).AppendTo(yyVAL.node.GetMeta())
yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta())
yyDollar[2].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta())
yyDollar[4].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta())

View File

@ -1269,7 +1269,7 @@ statement:
}
// save comments
$1.Meta.SetTokenName(meta.TryToken).AppendTo($$.GetMeta())
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
$2.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta())
$4.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta())

View File

@ -2617,7 +2617,6 @@ func (p *Printer) printStmtTry(n node.Node) {
nn := n.(*stmt.Try)
p.printMeta(nn, meta.NodeStart)
p.printMeta(nn, meta.TryToken)
io.WriteString(p.w, "try")
p.printMeta(nn, meta.OpenCurlyBracesToken)
io.WriteString(p.w, "{")

View File

@ -8386,7 +8386,7 @@ func TestPrinterPrintStmtTry(t *testing.T) {
&meta.Data{
Type: meta.WhiteSpaceType,
Value: " ",
TokenName: meta.TryToken,
TokenName: meta.NodeStart,
},
&meta.Data{
Type: meta.WhiteSpaceType,