remove meta.InterfaceToken

This commit is contained in:
z7zmey 2018-10-29 14:20:29 +02:00
parent 67e222a88f
commit 5a715a4a11
8 changed files with 7 additions and 9 deletions

View File

@ -28,7 +28,6 @@ const (
UnsetToken
ClassToken
TraitToken
InterfaceToken
ExtendsToken
ImplementsToken
DoubleArrowToken

View File

@ -4,9 +4,9 @@ package meta
import "strconv"
const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenReturnTokenTryTokenThrowTokenInsteadofTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenReturnTokenTryTokenThrowTokenInsteadofTokenVarTokenUnsetTokenClassTokenTraitTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 58, 71, 92, 113, 124, 139, 154, 161, 175, 188, 198, 209, 217, 227, 241, 249, 259, 269, 279, 293, 305, 320, 336, 349, 363, 387, 413, 429, 442, 456, 471, 486, 501, 511, 524, 534, 546, 560, 571, 579, 587, 606, 619, 633, 647, 662, 675, 688, 701, 717, 730, 743, 755, 768, 780, 792, 806, 821, 829, 836, 843, 859, 878, 890, 905, 926, 947, 965, 985, 1006, 1020, 1030, 1050, 1071, 1088, 1106, 1123, 1137, 1147, 1156, 1166, 1182, 1192, 1202, 1215, 1225, 1237, 1246, 1258, 1266}
var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 58, 71, 92, 113, 124, 139, 154, 161, 175, 188, 198, 209, 217, 227, 241, 249, 259, 269, 279, 291, 306, 322, 335, 349, 373, 399, 415, 428, 442, 457, 472, 487, 497, 510, 520, 532, 546, 557, 565, 573, 592, 605, 619, 633, 648, 661, 674, 687, 703, 716, 729, 741, 754, 766, 778, 792, 807, 815, 822, 829, 845, 864, 876, 891, 912, 933, 951, 971, 992, 1006, 1016, 1036, 1057, 1074, 1092, 1109, 1123, 1133, 1142, 1152, 1168, 1178, 1188, 1201, 1211, 1223, 1232, 1244, 1252}
func (i TokenName) String() string {
if i < 0 || i >= TokenName(len(_TokenName_index)-1) {

View File

@ -3761,7 +3761,7 @@ yydefault:
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token))
// save comments
yyDollar[1].token.Meta.SetTokenName(meta.InterfaceToken).AppendTo(yyVAL.node.GetMeta())
yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta())
yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta())
yyDollar[4].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta())
yyDollar[6].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta())

View File

@ -1606,7 +1606,7 @@ unticked_class_declaration_statement:
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6))
// save comments
$1.Meta.SetTokenName(meta.InterfaceToken).AppendTo($$.GetMeta())
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
$2.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta())
$4.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta())
$6.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta())

View File

@ -3933,7 +3933,7 @@ yydefault:
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token))
// save comments
yyDollar[1].token.Meta.SetTokenName(meta.InterfaceToken).AppendTo(yyVAL.node.GetMeta())
yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta())
yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta())
yyDollar[5].token.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo(yyVAL.node.GetMeta())
yyDollar[7].token.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo(yyVAL.node.GetMeta())

View File

@ -1579,7 +1579,7 @@ interface_declaration_statement:
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7))
// save comments
$1.Meta.SetTokenName(meta.InterfaceToken).AppendTo($$.GetMeta())
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
$2.Meta.SetTokenName(meta.NodeStart).AppendTo(name.GetMeta())
$5.Meta.SetTokenName(meta.OpenCurlyBracesToken).AppendTo($$.GetMeta())
$7.Meta.SetTokenName(meta.CloseCurlyBracesToken).AppendTo($$.GetMeta())

View File

@ -2357,7 +2357,6 @@ func (p *Printer) printStmtInterface(n node.Node) {
nn := n.(*stmt.Interface)
p.printMeta(nn, meta.NodeStart)
p.printMeta(n, meta.InterfaceToken)
io.WriteString(p.w, "interface")
if nn.InterfaceName != nil {

View File

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