remove meta.UnsetToken
This commit is contained in:
parent
8d976d3152
commit
a06dc22934
@ -22,7 +22,6 @@ const (
|
||||
ConstToken
|
||||
InsteadofToken
|
||||
VarToken
|
||||
UnsetToken
|
||||
ClassToken
|
||||
ExtendsToken
|
||||
ImplementsToken
|
||||
|
@ -4,9 +4,9 @@ package meta
|
||||
|
||||
import "strconv"
|
||||
|
||||
const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenInsteadofTokenVarTokenUnsetTokenClassTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
|
||||
const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenInsteadofTokenVarTokenClassTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
|
||||
|
||||
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}
|
||||
var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 58, 71, 92, 113, 124, 139, 154, 161, 175, 188, 198, 212, 220, 230, 242, 257, 273, 286, 300, 324, 350, 366, 379, 393, 408, 423, 438, 448, 461, 471, 483, 497, 508, 516, 524, 543, 556, 570, 584, 599, 612, 625, 638, 654, 667, 680, 692, 705, 717, 729, 743, 758, 766, 773, 780, 796, 815, 827, 842, 863, 884, 902, 922, 943, 957, 967, 987, 1008, 1025, 1043, 1060, 1074, 1084, 1093, 1103, 1119, 1129, 1139, 1152, 1162, 1174, 1183, 1195, 1203}
|
||||
|
||||
func (i TokenName) String() string {
|
||||
if i < 0 || i >= TokenName(len(_TokenName_index)-1) {
|
||||
|
@ -3336,7 +3336,7 @@ yydefault:
|
||||
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token))
|
||||
|
||||
// save comments
|
||||
yyDollar[1].token.Meta.SetTokenName(meta.UnsetToken).AppendTo(yyVAL.node.GetMeta())
|
||||
yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta())
|
||||
yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta())
|
||||
yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta())
|
||||
yyDollar[5].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta())
|
||||
|
@ -1198,7 +1198,7 @@ unticked_statement:
|
||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5))
|
||||
|
||||
// save comments
|
||||
$1.Meta.SetTokenName(meta.UnsetToken).AppendTo($$.GetMeta())
|
||||
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||
$2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta())
|
||||
$4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta())
|
||||
$5.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta())
|
||||
|
@ -3499,7 +3499,7 @@ yydefault:
|
||||
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[6].token))
|
||||
|
||||
// save comments
|
||||
yyDollar[1].token.Meta.SetTokenName(meta.UnsetToken).AppendTo(yyVAL.node.GetMeta())
|
||||
yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta())
|
||||
yyDollar[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta())
|
||||
if yyDollar[4].token != nil {
|
||||
yyDollar[4].token.Meta.SetTokenName(meta.CommaToken).AppendTo(yyVAL.node.GetMeta())
|
||||
|
@ -1167,7 +1167,7 @@ statement:
|
||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6))
|
||||
|
||||
// save comments
|
||||
$1.Meta.SetTokenName(meta.UnsetToken).AppendTo($$.GetMeta())
|
||||
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||
$2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta())
|
||||
if $4 != nil {
|
||||
$4.Meta.SetTokenName(meta.CommaToken).AppendTo($$.GetMeta())
|
||||
|
@ -2639,7 +2639,6 @@ func (p *Printer) printStmtUnset(n node.Node) {
|
||||
nn := n.(*stmt.Unset)
|
||||
p.printMeta(nn, meta.NodeStart)
|
||||
|
||||
p.printMeta(nn, meta.UnsetToken)
|
||||
io.WriteString(p.w, "unset")
|
||||
p.printMeta(nn, meta.OpenParenthesisToken)
|
||||
io.WriteString(p.w, "(")
|
||||
|
@ -8465,7 +8465,7 @@ func TestPrinterPrintStmtUnset(t *testing.T) {
|
||||
&meta.Data{
|
||||
Type: meta.WhiteSpaceType,
|
||||
Value: " ",
|
||||
TokenName: meta.UnsetToken,
|
||||
TokenName: meta.NodeStart,
|
||||
},
|
||||
&meta.Data{
|
||||
Type: meta.WhiteSpaceType,
|
||||
|
Loading…
Reference in New Issue
Block a user