remove meta.DeclareToken
This commit is contained in:
parent
ba387f909a
commit
bc4e070d57
@ -18,7 +18,6 @@ const (
|
||||
ForCondSemicolonToken
|
||||
EndforToken
|
||||
EndforeachToken
|
||||
DeclareToken
|
||||
EnddeclareToken
|
||||
AsToken
|
||||
EndswitchToken
|
||||
|
@ -4,9 +4,9 @@ package meta
|
||||
|
||||
import "strconv"
|
||||
|
||||
const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenEndswitchTokenDefaultTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
|
||||
const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenDefaultTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
|
||||
|
||||
var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 72, 79, 89, 102, 123, 144, 155, 170, 182, 197, 204, 218, 230, 239, 252, 262, 273, 281, 293, 303, 317, 328, 336, 346, 356, 366, 380, 392, 407, 423, 436, 450, 474, 500, 516, 529, 543, 558, 573, 588, 598, 611, 621, 633, 647, 658, 666, 674, 693, 706, 720, 734, 749, 762, 775, 788, 804, 817, 830, 842, 855, 867, 879, 893, 908, 916, 923, 930, 946, 965, 977, 992, 1013, 1034, 1051, 1069, 1089, 1110, 1124, 1134, 1154, 1175, 1192, 1210, 1227, 1241, 1251, 1260, 1270, 1286, 1296, 1306, 1319, 1329, 1341, 1350, 1362, 1370}
|
||||
var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 72, 79, 89, 102, 123, 144, 155, 170, 185, 192, 206, 218, 227, 240, 250, 261, 269, 281, 291, 305, 316, 324, 334, 344, 354, 368, 380, 395, 411, 424, 438, 462, 488, 504, 517, 531, 546, 561, 576, 586, 599, 609, 621, 635, 646, 654, 662, 681, 694, 708, 722, 737, 750, 763, 776, 792, 805, 818, 830, 843, 855, 867, 881, 896, 904, 911, 918, 934, 953, 965, 980, 1001, 1022, 1039, 1057, 1077, 1098, 1112, 1122, 1142, 1163, 1180, 1198, 1215, 1229, 1239, 1248, 1258, 1274, 1284, 1294, 1307, 1317, 1329, 1338, 1350, 1358}
|
||||
|
||||
func (i TokenName) String() string {
|
||||
if i < 0 || i >= TokenName(len(_TokenName_index)-1) {
|
||||
|
@ -3439,7 +3439,7 @@ yydefault:
|
||||
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node))
|
||||
|
||||
// save comments
|
||||
yyDollar[1].token.Meta.SetTokenName(meta.DeclareToken).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())
|
||||
|
||||
|
@ -1295,7 +1295,7 @@ unticked_statement:
|
||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5))
|
||||
|
||||
// save comments
|
||||
$1.Meta.SetTokenName(meta.DeclareToken).AppendTo($$.GetMeta())
|
||||
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||
$2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta())
|
||||
$4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta())
|
||||
|
||||
|
@ -3577,7 +3577,7 @@ yydefault:
|
||||
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node))
|
||||
|
||||
// save comments
|
||||
yyDollar[1].token.Meta.SetTokenName(meta.DeclareToken).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())
|
||||
|
||||
|
@ -1239,7 +1239,7 @@ statement:
|
||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5))
|
||||
|
||||
// save comments
|
||||
$1.Meta.SetTokenName(meta.DeclareToken).AppendTo($$.GetMeta())
|
||||
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||
$2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta())
|
||||
$4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta())
|
||||
|
||||
|
@ -2053,7 +2053,6 @@ func (p *Printer) printStmtDeclare(n node.Node) {
|
||||
nn := n.(*stmt.Declare)
|
||||
p.printMeta(nn, meta.NodeStart)
|
||||
|
||||
p.printMeta(nn, meta.DeclareToken)
|
||||
io.WriteString(p.w, "declare")
|
||||
p.printMeta(nn, meta.OpenParenthesisToken)
|
||||
io.WriteString(p.w, "(")
|
||||
|
@ -6165,7 +6165,7 @@ func TestPrinterPrintStmtDeclareStmts(t *testing.T) {
|
||||
&meta.Data{
|
||||
Type: meta.WhiteSpaceType,
|
||||
Value: " ",
|
||||
TokenName: meta.DeclareToken,
|
||||
TokenName: meta.NodeStart,
|
||||
},
|
||||
&meta.Data{
|
||||
Type: meta.WhiteSpaceType,
|
||||
@ -6208,7 +6208,7 @@ func TestPrinterPrintStmtDeclareExpr(t *testing.T) {
|
||||
&meta.Data{
|
||||
Type: meta.WhiteSpaceType,
|
||||
Value: " ",
|
||||
TokenName: meta.DeclareToken,
|
||||
TokenName: meta.NodeStart,
|
||||
},
|
||||
&meta.Data{
|
||||
Type: meta.WhiteSpaceType,
|
||||
|
Loading…
Reference in New Issue
Block a user