remove meta.AtToken

This commit is contained in:
z7zmey 2018-10-26 11:53:54 +03:00
parent 3b5fd08743
commit 24293377b6
8 changed files with 7 additions and 10 deletions

View File

@ -121,7 +121,6 @@ const (
AmpersandToken // '&'
MinusToken // '-'
PlusToken // '+'
AtToken // '@'
CommaToken // ','
VerticalBarToken // '|'
EqualToken // '='

View File

@ -4,9 +4,9 @@ package meta
import "strconv"
const _TokenName_name = "NodeStartNodeEndIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorElseifTokenElseTokenEndifTokenPrintTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
const _TokenName_name = "NodeStartNodeEndIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorElseifTokenElseTokenEndifTokenPrintTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
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, 503, 517, 529, 544, 560, 569, 582, 596, 620, 646, 662, 675, 684, 696, 712, 726, 741, 756, 771, 780, 791, 800, 810, 820, 830, 843, 853, 865, 879, 890, 898, 906, 920, 939, 952, 966, 980, 995, 1008, 1021, 1034, 1050, 1063, 1076, 1088, 1101, 1113, 1125, 1139, 1154, 1162, 1169, 1176, 1192, 1211, 1223, 1238, 1259, 1280, 1297, 1315, 1329, 1349, 1370, 1384, 1394, 1414, 1435, 1452, 1470, 1487, 1501, 1511, 1520, 1527, 1537, 1553, 1563, 1573, 1586, 1596, 1608, 1617, 1629, 1637}
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}
func (i TokenName) String() string {
if i < 0 || i >= TokenName(len(_TokenName_index)-1) {

View File

@ -6528,7 +6528,7 @@ yydefault:
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node))
// save comments
yyDollar[1].token.Meta.SetTokenName(meta.AtToken).AppendTo(yyVAL.node.GetMeta())
yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta())
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
}

View File

@ -4171,7 +4171,7 @@ expr_without_variable:
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2))
// save comments
$1.Meta.SetTokenName(meta.AtToken).AppendTo($$.GetMeta())
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
}

View File

@ -6461,7 +6461,7 @@ yydefault:
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node))
// save comments
yyDollar[1].token.Meta.SetTokenName(meta.AtToken).AppendTo(yyVAL.node.GetMeta())
yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta())
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
}

View File

@ -3906,7 +3906,7 @@ expr_without_variable:
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2))
// save comments
$1.Meta.SetTokenName(meta.AtToken).AppendTo($$.GetMeta())
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
}

View File

@ -1302,8 +1302,6 @@ func (p *Printer) printExprEmpty(n node.Node) {
func (p *Printer) printExprErrorSuppress(n node.Node) {
nn := n.(*expr.ErrorSuppress)
p.printMeta(nn, meta.NodeStart)
p.printMeta(nn, meta.AtToken)
io.WriteString(p.w, "@")
p.Print(nn.Expr)

View File

@ -3303,7 +3303,7 @@ func TestPrinterPrettyPrinterrorSuppress(t *testing.T) {
&meta.Data{
Type: meta.WhiteSpaceType,
Value: " ",
TokenName: meta.AtToken,
TokenName: meta.NodeStart,
},
},
Expr: &expr.Variable{