remove meta.YieldFromToken
This commit is contained in:
parent
00b1f659df
commit
6d7c5d5d2b
@ -69,7 +69,6 @@ const (
|
||||
PublicToken
|
||||
IncToken
|
||||
DecToken
|
||||
YieldFromToken
|
||||
ObjectOperatorToken
|
||||
CoalesceToken
|
||||
SpaceshipToken
|
||||
|
@ -4,9 +4,9 @@ package meta
|
||||
|
||||
import "strconv"
|
||||
|
||||
const _TokenName_name = "NodeStartNodeEndIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenElseifTokenElseTokenEndifTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
|
||||
const _TokenName_name = "NodeStartNodeEndIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenElseifTokenElseTokenEndifTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
|
||||
|
||||
var _TokenName_index = [...]uint16{0, 9, 16, 23, 41, 55, 70, 79, 86, 96, 109, 130, 151, 159, 170, 182, 197, 209, 224, 231, 242, 256, 265, 277, 287, 300, 309, 322, 332, 343, 351, 361, 373, 383, 397, 408, 416, 426, 436, 446, 460, 472, 487, 503, 516, 530, 554, 580, 596, 609, 623, 638, 653, 668, 679, 688, 698, 708, 721, 731, 743, 757, 768, 776, 784, 798, 817, 830, 844, 858, 873, 886, 899, 912, 928, 941, 954, 966, 979, 991, 1003, 1017, 1032, 1040, 1047, 1054, 1070, 1089, 1101, 1116, 1137, 1158, 1175, 1193, 1213, 1234, 1248, 1258, 1278, 1299, 1316, 1334, 1351, 1365, 1375, 1384, 1394, 1410, 1420, 1430, 1443, 1453, 1465, 1474, 1486, 1494}
|
||||
var _TokenName_index = [...]uint16{0, 9, 16, 23, 41, 55, 70, 79, 86, 96, 109, 130, 151, 159, 170, 182, 197, 209, 224, 231, 242, 256, 265, 277, 287, 300, 309, 322, 332, 343, 351, 361, 373, 383, 397, 408, 416, 426, 436, 446, 460, 472, 487, 503, 516, 530, 554, 580, 596, 609, 623, 638, 653, 668, 679, 688, 698, 708, 721, 731, 743, 757, 768, 776, 784, 803, 816, 830, 844, 859, 872, 885, 898, 914, 927, 940, 952, 965, 977, 989, 1003, 1018, 1026, 1033, 1040, 1056, 1075, 1087, 1102, 1123, 1144, 1161, 1179, 1199, 1220, 1234, 1244, 1264, 1285, 1302, 1320, 1337, 1351, 1361, 1370, 1380, 1396, 1406, 1416, 1429, 1439, 1451, 1460, 1472, 1480}
|
||||
|
||||
func (i TokenName) String() string {
|
||||
if i < 0 || i >= TokenName(len(_TokenName_index)-1) {
|
||||
|
@ -6554,7 +6554,7 @@ yydefault:
|
||||
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node))
|
||||
|
||||
// save comments
|
||||
yyDollar[1].token.Meta.SetTokenName(meta.YieldFromToken).AppendTo(yyVAL.node.GetMeta())
|
||||
yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta())
|
||||
|
||||
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
||||
}
|
||||
|
@ -3985,7 +3985,7 @@ expr_without_variable:
|
||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2))
|
||||
|
||||
// save comments
|
||||
$1.Meta.SetTokenName(meta.YieldFromToken).AppendTo($$.GetMeta())
|
||||
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||
|
||||
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
||||
}
|
||||
|
@ -1660,7 +1660,6 @@ func (p *Printer) printExprYieldFrom(n node.Node) {
|
||||
nn := n.(*expr.YieldFrom)
|
||||
p.printMeta(nn, meta.NodeStart)
|
||||
|
||||
p.printMeta(nn, meta.YieldFromToken)
|
||||
io.WriteString(p.w, "yield from")
|
||||
p.Print(nn.Expr)
|
||||
|
||||
|
@ -4651,7 +4651,7 @@ func TestPrinterPrintYieldFrom(t *testing.T) {
|
||||
&meta.Data{
|
||||
Type: meta.WhiteSpaceType,
|
||||
Value: " ",
|
||||
TokenName: meta.YieldFromToken,
|
||||
TokenName: meta.NodeStart,
|
||||
},
|
||||
},
|
||||
Expr: &expr.Variable{
|
||||
|
Loading…
Reference in New Issue
Block a user