remove meta.ArrayToken
This commit is contained in:
parent
837e6a5add
commit
aa7a862573
@ -55,7 +55,6 @@ const (
|
|||||||
ImplementsToken
|
ImplementsToken
|
||||||
DoubleArrowToken
|
DoubleArrowToken
|
||||||
ListToken
|
ListToken
|
||||||
ArrayToken
|
|
||||||
CallableToken
|
CallableToken
|
||||||
CurlyOpenToken
|
CurlyOpenToken
|
||||||
PaamayimNekudotayimToken
|
PaamayimNekudotayimToken
|
||||||
|
@ -4,9 +4,9 @@ package meta
|
|||||||
|
|
||||||
import "strconv"
|
import "strconv"
|
||||||
|
|
||||||
const _TokenName_name = "NodeStartNodeEndIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenArrayTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
|
const _TokenName_name = "NodeStartNodeEndIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
|
||||||
|
|
||||||
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, 428, 442, 453, 461, 471, 481, 491, 501, 511, 525, 537, 552, 568, 577, 587, 600, 614, 638, 664, 680, 693, 702, 714, 730, 744, 759, 774, 789, 798, 808, 819, 828, 838, 848, 858, 869, 882, 892, 904, 918, 929, 937, 945, 959, 978, 991, 1005, 1019, 1034, 1047, 1060, 1073, 1089, 1102, 1115, 1127, 1140, 1152, 1164, 1178, 1193, 1201, 1208, 1215, 1231, 1250, 1262, 1277, 1298, 1319, 1336, 1354, 1368, 1388, 1409, 1423, 1433, 1453, 1474, 1491, 1509, 1526, 1540, 1550, 1559, 1579, 1589, 1596, 1606, 1622, 1632, 1642, 1655, 1665, 1677, 1686, 1698, 1706}
|
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, 428, 442, 453, 461, 471, 481, 491, 501, 511, 525, 537, 552, 568, 577, 590, 604, 628, 654, 670, 683, 692, 704, 720, 734, 749, 764, 779, 788, 798, 809, 818, 828, 838, 848, 859, 872, 882, 894, 908, 919, 927, 935, 949, 968, 981, 995, 1009, 1024, 1037, 1050, 1063, 1079, 1092, 1105, 1117, 1130, 1142, 1154, 1168, 1183, 1191, 1198, 1205, 1221, 1240, 1252, 1267, 1288, 1309, 1326, 1344, 1358, 1378, 1399, 1413, 1423, 1443, 1464, 1481, 1499, 1516, 1530, 1540, 1549, 1569, 1579, 1586, 1596, 1612, 1622, 1632, 1645, 1655, 1667, 1676, 1688, 1696}
|
||||||
|
|
||||||
func (i TokenName) String() string {
|
func (i TokenName) String() string {
|
||||||
if i < 0 || i >= TokenName(len(_TokenName_index)-1) {
|
if i < 0 || i >= TokenName(len(_TokenName_index)-1) {
|
||||||
|
@ -6780,7 +6780,7 @@ yydefault:
|
|||||||
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token))
|
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
yyDollar[1].token.Meta.SetTokenName(meta.ArrayToken).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[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta())
|
||||||
yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta())
|
yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta())
|
||||||
|
|
||||||
@ -7559,7 +7559,7 @@ yydefault:
|
|||||||
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token))
|
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
yyDollar[1].token.Meta.SetTokenName(meta.ArrayToken).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[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta())
|
||||||
yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta())
|
yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta())
|
||||||
|
|
||||||
|
@ -4398,7 +4398,7 @@ combined_scalar:
|
|||||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4))
|
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
$1.Meta.SetTokenName(meta.ArrayToken).AppendTo($$.GetMeta())
|
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||||
$2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta())
|
$2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta())
|
||||||
$4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta())
|
$4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta())
|
||||||
|
|
||||||
@ -5114,7 +5114,7 @@ static_scalar_value:
|
|||||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4))
|
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
$1.Meta.SetTokenName(meta.ArrayToken).AppendTo($$.GetMeta())
|
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||||
$2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta())
|
$2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta())
|
||||||
$4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta())
|
$4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta())
|
||||||
|
|
||||||
|
@ -6866,7 +6866,7 @@ yydefault:
|
|||||||
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token))
|
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
yyDollar[1].token.Meta.SetTokenName(meta.ArrayToken).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[2].token.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo(yyVAL.node.GetMeta())
|
||||||
yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta())
|
yyDollar[4].token.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo(yyVAL.node.GetMeta())
|
||||||
|
|
||||||
|
@ -4279,7 +4279,7 @@ dereferencable_scalar:
|
|||||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4))
|
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
$1.Meta.SetTokenName(meta.ArrayToken).AppendTo($$.GetMeta())
|
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||||
$2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta())
|
$2.Meta.SetTokenName(meta.OpenParenthesisToken).AppendTo($$.GetMeta())
|
||||||
$4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta())
|
$4.Meta.SetTokenName(meta.CloseParenthesisToken).AppendTo($$.GetMeta())
|
||||||
|
|
||||||
|
@ -1179,8 +1179,6 @@ func (p *Printer) printExprArrayItem(n node.Node) {
|
|||||||
func (p *Printer) printExprArray(n node.Node) {
|
func (p *Printer) printExprArray(n node.Node) {
|
||||||
nn := n.(*expr.Array)
|
nn := n.(*expr.Array)
|
||||||
p.printMeta(nn, meta.NodeStart)
|
p.printMeta(nn, meta.NodeStart)
|
||||||
|
|
||||||
p.printMeta(nn, meta.ArrayToken)
|
|
||||||
io.WriteString(p.w, "array")
|
io.WriteString(p.w, "array")
|
||||||
p.printMeta(nn, meta.OpenParenthesisToken)
|
p.printMeta(nn, meta.OpenParenthesisToken)
|
||||||
io.WriteString(p.w, "(")
|
io.WriteString(p.w, "(")
|
||||||
|
@ -2865,7 +2865,7 @@ func TestPrinterPrintExprArray(t *testing.T) {
|
|||||||
&meta.Data{
|
&meta.Data{
|
||||||
Type: meta.WhiteSpaceType,
|
Type: meta.WhiteSpaceType,
|
||||||
Value: " ",
|
Value: " ",
|
||||||
TokenName: meta.ArrayToken,
|
TokenName: meta.NodeStart,
|
||||||
},
|
},
|
||||||
&meta.Data{
|
&meta.Data{
|
||||||
Type: meta.WhiteSpaceType,
|
Type: meta.WhiteSpaceType,
|
||||||
|
Loading…
Reference in New Issue
Block a user