remove meta.UnknownToken

This commit is contained in:
z7zmey 2018-10-25 12:37:31 +03:00
parent 2efb4dc4cf
commit d232d3ae6b
3 changed files with 3 additions and 8 deletions

View File

@ -5,8 +5,7 @@ type TokenName int
//go:generate stringer -type=TokenName -output ./tokenName_string.go
const (
UnknownToken TokenName = iota
NodeStart
NodeStart TokenName = iota
NodeEnd
MagicConstantToken
IncludeToken

View File

@ -4,9 +4,9 @@ package meta
import "strconv"
const _TokenName_name = "UnknownTokenNodeStartNodeEndMagicConstantTokenIncludeTokenIncludeOnceTokenExitTokenIfTokenLnumberTokenDnumberTokenStringTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEncapsedAndWhitespaceTokenConstantEncapsedStringTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenArrayTokenCallableTokenStartHeredocTokenCurlyOpenTokenPaamayimNekudotayimTokenNamespaceTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenIntCastTokenDoubleCastTokenStringCastTokenArrayCastTokenObjectCastTokenBoolCastTokenUnsetCastTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenDoubleQuoteTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
const _TokenName_name = "NodeStartNodeEndMagicConstantTokenIncludeTokenIncludeOnceTokenExitTokenIfTokenLnumberTokenDnumberTokenStringTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEncapsedAndWhitespaceTokenConstantEncapsedStringTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenArrayTokenCallableTokenStartHeredocTokenCurlyOpenTokenPaamayimNekudotayimTokenNamespaceTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenIntCastTokenDoubleCastTokenStringCastTokenArrayCastTokenObjectCastTokenBoolCastTokenUnsetCastTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenDoubleQuoteTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
var _TokenName_index = [...]uint16{0, 12, 21, 28, 46, 58, 74, 83, 90, 102, 114, 125, 143, 157, 172, 198, 225, 234, 241, 251, 264, 285, 306, 314, 325, 337, 352, 364, 379, 386, 397, 411, 420, 432, 442, 455, 464, 477, 487, 498, 506, 516, 528, 538, 546, 560, 571, 579, 589, 599, 609, 619, 629, 643, 655, 670, 686, 695, 705, 718, 735, 749, 773, 787, 813, 829, 842, 851, 863, 879, 893, 908, 923, 938, 947, 957, 968, 977, 987, 997, 1007, 1018, 1031, 1041, 1053, 1067, 1078, 1086, 1094, 1108, 1127, 1139, 1154, 1169, 1183, 1198, 1211, 1225, 1238, 1252, 1266, 1281, 1294, 1307, 1320, 1336, 1349, 1362, 1374, 1387, 1399, 1411, 1425, 1440, 1448, 1455, 1462, 1478, 1497, 1509, 1524, 1545, 1566, 1583, 1601, 1617, 1631, 1651, 1672, 1686, 1696, 1716, 1737, 1754, 1772, 1789, 1803, 1813, 1822, 1842, 1852, 1859, 1869, 1885, 1895, 1905, 1918, 1928, 1940, 1949, 1961, 1969}
var _TokenName_index = [...]uint16{0, 9, 16, 34, 46, 62, 71, 78, 90, 102, 113, 131, 145, 160, 186, 213, 222, 229, 239, 252, 273, 294, 302, 313, 325, 340, 352, 367, 374, 385, 399, 408, 420, 430, 443, 452, 465, 475, 486, 494, 504, 516, 526, 534, 548, 559, 567, 577, 587, 597, 607, 617, 631, 643, 658, 674, 683, 693, 706, 723, 737, 761, 775, 801, 817, 830, 839, 851, 867, 881, 896, 911, 926, 935, 945, 956, 965, 975, 985, 995, 1006, 1019, 1029, 1041, 1055, 1066, 1074, 1082, 1096, 1115, 1127, 1142, 1157, 1171, 1186, 1199, 1213, 1226, 1240, 1254, 1269, 1282, 1295, 1308, 1324, 1337, 1350, 1362, 1375, 1387, 1399, 1413, 1428, 1436, 1443, 1450, 1466, 1485, 1497, 1512, 1533, 1554, 1571, 1589, 1605, 1619, 1639, 1660, 1674, 1684, 1704, 1725, 1742, 1760, 1777, 1791, 1801, 1810, 1830, 1840, 1847, 1857, 1873, 1883, 1893, 1906, 1916, 1928, 1937, 1949, 1957}
func (i TokenName) String() string {
if i < 0 || i >= TokenName(len(_TokenName_index)-1) {

View File

@ -436,8 +436,6 @@ func (p *Printer) printNodeParameter(n node.Node) {
nn := n.(*node.Parameter)
p.printMeta(nn, meta.NodeStart)
p.printMeta(nn, meta.UnknownToken)
if nn.VariableType != nil {
p.Print(nn.VariableType)
}
@ -479,8 +477,6 @@ func (p *Printer) printNodeArgument(n node.Node) {
nn := n.(*node.Argument)
p.printMeta(nn, meta.NodeStart)
p.printMeta(nn, meta.UnknownToken)
if nn.IsReference {
p.printMeta(nn, meta.AmpersandToken)
io.WriteString(p.w, "&")