remove meta.DoToken
This commit is contained in:
parent
fc20b19df3
commit
378830df76
@ -11,7 +11,6 @@ const (
|
||||
NumStringToken
|
||||
InlineHTMLToken
|
||||
EchoToken
|
||||
DoToken
|
||||
WhileToken
|
||||
EndwhileToken
|
||||
ForInitSemicolonToken
|
||||
|
@ -4,9 +4,9 @@ package meta
|
||||
|
||||
import "strconv"
|
||||
|
||||
const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
|
||||
const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
|
||||
|
||||
var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 72, 79, 89, 102, 123, 144, 155, 170, 185, 192, 206, 215, 228, 238, 249, 257, 269, 279, 293, 304, 312, 322, 332, 342, 356, 368, 383, 399, 412, 426, 450, 476, 492, 505, 519, 534, 549, 564, 574, 587, 597, 609, 623, 634, 642, 650, 669, 682, 696, 710, 725, 738, 751, 764, 780, 793, 806, 818, 831, 843, 855, 869, 884, 892, 899, 906, 922, 941, 953, 968, 989, 1010, 1027, 1045, 1065, 1086, 1100, 1110, 1130, 1151, 1168, 1186, 1203, 1217, 1227, 1236, 1246, 1262, 1272, 1282, 1295, 1305, 1317, 1326, 1338, 1346}
|
||||
var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 72, 82, 95, 116, 137, 148, 163, 178, 185, 199, 208, 221, 231, 242, 250, 262, 272, 286, 297, 305, 315, 325, 335, 349, 361, 376, 392, 405, 419, 443, 469, 485, 498, 512, 527, 542, 557, 567, 580, 590, 602, 616, 627, 635, 643, 662, 675, 689, 703, 718, 731, 744, 757, 773, 786, 799, 811, 824, 836, 848, 862, 877, 885, 892, 899, 915, 934, 946, 961, 982, 1003, 1020, 1038, 1058, 1079, 1093, 1103, 1123, 1144, 1161, 1179, 1196, 1210, 1220, 1229, 1239, 1255, 1265, 1275, 1288, 1298, 1310, 1319, 1331, 1339}
|
||||
|
||||
func (i TokenName) String() string {
|
||||
if i < 0 || i >= TokenName(len(_TokenName_index)-1) {
|
||||
|
@ -3058,7 +3058,7 @@ yydefault:
|
||||
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[5].token))
|
||||
|
||||
// save comments
|
||||
yyDollar[1].token.Meta.SetTokenName(meta.DoToken).AppendTo(yyVAL.node.GetMeta())
|
||||
yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta())
|
||||
yyDollar[3].token.Meta.SetTokenName(meta.WhileToken).AppendTo(yyVAL.node.GetMeta())
|
||||
yyDollar[4].node.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(yyVAL.node.GetMeta())
|
||||
yyDollar[4].node.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo(yyVAL.node.GetMeta())
|
||||
|
@ -952,7 +952,7 @@ unticked_statement:
|
||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5))
|
||||
|
||||
// save comments
|
||||
$1.Meta.SetTokenName(meta.DoToken).AppendTo($$.GetMeta())
|
||||
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||
$3.Meta.SetTokenName(meta.WhileToken).AppendTo($$.GetMeta())
|
||||
$4.GetMeta().Cut(meta.TokenNameFilter(meta.OpenParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo($$.GetMeta())
|
||||
$4.GetMeta().Cut(meta.TokenNameFilter(meta.CloseParenthesisToken)).Cut(meta.NotFilter(meta.TypeFilter(meta.TokenType))).AppendTo($$.GetMeta())
|
||||
|
@ -3300,7 +3300,7 @@ yydefault:
|
||||
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[7].token))
|
||||
|
||||
// save comments
|
||||
yyDollar[1].token.Meta.SetTokenName(meta.DoToken).AppendTo(yyVAL.node.GetMeta())
|
||||
yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta())
|
||||
yyDollar[3].token.Meta.SetTokenName(meta.WhileToken).AppendTo(yyVAL.node.GetMeta())
|
||||
yyDollar[4].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta())
|
||||
yyDollar[6].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta())
|
||||
|
@ -990,7 +990,7 @@ statement:
|
||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7))
|
||||
|
||||
// save comments
|
||||
$1.Meta.SetTokenName(meta.DoToken).AppendTo($$.GetMeta())
|
||||
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||
$3.Meta.SetTokenName(meta.WhileToken).AppendTo($$.GetMeta())
|
||||
$4.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta())
|
||||
$6.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta())
|
||||
|
@ -2099,7 +2099,6 @@ func (p *Printer) printStmtDo(n node.Node) {
|
||||
nn := n.(*stmt.Do)
|
||||
p.printMeta(nn, meta.NodeStart)
|
||||
|
||||
p.printMeta(nn, meta.DoToken)
|
||||
io.WriteString(p.w, "do")
|
||||
|
||||
p.Print(nn.Stmt)
|
||||
|
@ -6326,7 +6326,7 @@ func TestPrinterPrintStmtDo_Expression(t *testing.T) {
|
||||
&meta.Data{
|
||||
Type: meta.WhiteSpaceType,
|
||||
Value: " ",
|
||||
TokenName: meta.DoToken,
|
||||
TokenName: meta.NodeStart,
|
||||
},
|
||||
&meta.Data{
|
||||
Type: meta.WhiteSpaceType,
|
||||
@ -6386,7 +6386,7 @@ func TestPrinterPrintStmtDo_StmtList(t *testing.T) {
|
||||
&meta.Data{
|
||||
Type: meta.WhiteSpaceType,
|
||||
Value: " ",
|
||||
TokenName: meta.DoToken,
|
||||
TokenName: meta.NodeStart,
|
||||
},
|
||||
&meta.Data{
|
||||
Type: meta.WhiteSpaceType,
|
||||
|
Loading…
Reference in New Issue
Block a user