diff --git a/meta/tokenName.go b/meta/tokenName.go index a426cf2..ab801f3 100644 --- a/meta/tokenName.go +++ b/meta/tokenName.go @@ -59,7 +59,6 @@ const ( UseLeadingNsSeparatorToken NsSeparatorToken EllipsisToken - EvalToken RequireToken RequireOnceToken LogicalOrToken diff --git a/meta/tokenName_string.go b/meta/tokenName_string.go index 1724ff9..67db002 100644 --- a/meta/tokenName_string.go +++ b/meta/tokenName_string.go @@ -4,9 +4,9 @@ package meta import "strconv" -const _TokenName_name = "NodeStartNodeEndIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorElseifTokenElseTokenEndifTokenPrintTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" +const _TokenName_name = "NodeStartNodeEndIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorElseifTokenElseTokenEndifTokenPrintTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" -var _TokenName_index = [...]uint16{0, 9, 16, 28, 44, 53, 60, 78, 92, 107, 116, 123, 133, 146, 167, 188, 196, 207, 219, 234, 246, 261, 268, 279, 293, 302, 314, 324, 337, 346, 359, 369, 380, 388, 398, 410, 420, 434, 445, 453, 463, 473, 483, 493, 507, 519, 534, 550, 559, 572, 586, 610, 636, 652, 665, 674, 686, 702, 716, 731, 746, 761, 770, 781, 790, 800, 810, 820, 833, 843, 855, 869, 880, 888, 896, 910, 929, 942, 956, 970, 985, 998, 1011, 1024, 1040, 1053, 1066, 1078, 1091, 1103, 1115, 1129, 1144, 1152, 1159, 1166, 1182, 1201, 1213, 1228, 1249, 1270, 1287, 1305, 1319, 1339, 1360, 1374, 1384, 1404, 1425, 1442, 1460, 1477, 1491, 1501, 1510, 1520, 1536, 1546, 1556, 1569, 1579, 1591, 1600, 1612, 1620} +var _TokenName_index = [...]uint16{0, 9, 16, 28, 44, 53, 60, 78, 92, 107, 116, 123, 133, 146, 167, 188, 196, 207, 219, 234, 246, 261, 268, 279, 293, 302, 314, 324, 337, 346, 359, 369, 380, 388, 398, 410, 420, 434, 445, 453, 463, 473, 483, 493, 507, 519, 534, 550, 559, 572, 586, 610, 636, 652, 665, 677, 693, 707, 722, 737, 752, 761, 772, 781, 791, 801, 811, 824, 834, 846, 860, 871, 879, 887, 901, 920, 933, 947, 961, 976, 989, 1002, 1015, 1031, 1044, 1057, 1069, 1082, 1094, 1106, 1120, 1135, 1143, 1150, 1157, 1173, 1192, 1204, 1219, 1240, 1261, 1278, 1296, 1310, 1330, 1351, 1365, 1375, 1395, 1416, 1433, 1451, 1468, 1482, 1492, 1501, 1511, 1527, 1537, 1547, 1560, 1570, 1582, 1591, 1603, 1611} func (i TokenName) String() string { if i < 0 || i >= TokenName(len(_TokenName_index)-1) { diff --git a/php5/php5.go b/php5/php5.go index 520de19..6fd6414 100644 --- a/php5/php5.go +++ b/php5/php5.go @@ -9455,7 +9455,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.EvalToken).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()) diff --git a/php5/php5.y b/php5/php5.y index 57ee1e9..80d5fe0 100644 --- a/php5/php5.y +++ b/php5/php5.y @@ -6856,7 +6856,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.EvalToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) diff --git a/php7/php7.go b/php7/php7.go index d8e1ca7..bb919e2 100644 --- a/php7/php7.go +++ b/php7/php7.go @@ -8101,7 +8101,7 @@ yydefault: yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token)) // save comments - yyDollar[1].token.Meta.SetTokenName(meta.EvalToken).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()) diff --git a/php7/php7.y b/php7/php7.y index c3c8b27..5899c26 100644 --- a/php7/php7.y +++ b/php7/php7.y @@ -5402,7 +5402,7 @@ internal_functions_in_yacc: $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) // save comments - $1.Meta.SetTokenName(meta.EvalToken).AppendTo($$.GetMeta()) + $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta()) $2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta()) $4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta()) diff --git a/printer/printer.go b/printer/printer.go index a183625..9971a36 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -1311,8 +1311,6 @@ func (p *Printer) printExprErrorSuppress(n node.Node) { func (p *Printer) printExprEval(n node.Node) { nn := n.(*expr.Eval) p.printMeta(nn, meta.NodeStart) - - p.printMeta(nn, meta.EvalToken) io.WriteString(p.w, "eval") p.printMeta(nn, meta.OpenParenthesisToken) io.WriteString(p.w, "(") diff --git a/printer/printer_test.go b/printer/printer_test.go index 99820f6..498754c 100644 --- a/printer/printer_test.go +++ b/printer/printer_test.go @@ -3335,7 +3335,7 @@ func TestPrinterPrintEval(t *testing.T) { &meta.Data{ Type: meta.WhiteSpaceType, Value: " ", - TokenName: meta.EvalToken, + TokenName: meta.NodeStart, }, &meta.Data{ Type: meta.WhiteSpaceType,