remove meta.NewAnchor
This commit is contained in:
parent
67dfb0773c
commit
fb8ec01280
@ -60,7 +60,6 @@ const (
|
||||
LogicalXorToken
|
||||
LogicalAndToken
|
||||
InstanceofToken
|
||||
NewAnchor
|
||||
ElseifToken
|
||||
ElseToken
|
||||
EndifToken
|
||||
|
@ -4,9 +4,9 @@ package meta
|
||||
|
||||
import "strconv"
|
||||
|
||||
const _TokenName_name = "NodeStartNodeEndIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorElseifTokenElseTokenEndifTokenPrintTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
|
||||
const _TokenName_name = "NodeStartNodeEndIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
|
||||
|
||||
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, 621, 637, 651, 666, 681, 696, 705, 716, 725, 735, 745, 755, 768, 778, 790, 804, 815, 823, 831, 845, 864, 877, 891, 905, 920, 933, 946, 959, 975, 988, 1001, 1013, 1026, 1038, 1050, 1064, 1079, 1087, 1094, 1101, 1117, 1136, 1148, 1163, 1184, 1205, 1222, 1240, 1254, 1274, 1295, 1309, 1319, 1339, 1360, 1377, 1395, 1412, 1426, 1436, 1445, 1455, 1471, 1481, 1491, 1504, 1514, 1526, 1535, 1547, 1555}
|
||||
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, 621, 637, 651, 666, 681, 696, 707, 716, 726, 736, 746, 759, 769, 781, 795, 806, 814, 822, 836, 855, 868, 882, 896, 911, 924, 937, 950, 966, 979, 992, 1004, 1017, 1029, 1041, 1055, 1070, 1078, 1085, 1092, 1108, 1127, 1139, 1154, 1175, 1196, 1213, 1231, 1245, 1265, 1286, 1300, 1310, 1330, 1351, 1368, 1386, 1403, 1417, 1427, 1436, 1446, 1462, 1472, 1482, 1495, 1505, 1517, 1526, 1538, 1546}
|
||||
|
||||
func (i TokenName) String() string {
|
||||
if i < 0 || i >= TokenName(len(_TokenName_index)-1) {
|
||||
|
@ -5557,7 +5557,7 @@ yydefault:
|
||||
}
|
||||
|
||||
// save comments
|
||||
yyDollar[1].token.Meta.SetTokenName(meta.NewAnchor).AppendTo(yyVAL.node.GetMeta())
|
||||
yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta())
|
||||
|
||||
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
||||
}
|
||||
@ -5633,7 +5633,7 @@ yydefault:
|
||||
// save comments
|
||||
yyDollar[2].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta())
|
||||
yyDollar[3].token.Meta.SetTokenName(meta.AmpersandToken).AppendTo(yyVAL.node.GetMeta())
|
||||
yyDollar[4].token.Meta.SetTokenName(meta.NewAnchor).AppendTo(_new.GetMeta())
|
||||
yyDollar[4].token.Meta.SetTokenName(meta.NodeStart).AppendTo(_new.GetMeta())
|
||||
|
||||
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
||||
}
|
||||
|
@ -3329,7 +3329,7 @@ new_expr:
|
||||
}
|
||||
|
||||
// save comments
|
||||
$1.Meta.SetTokenName(meta.NewAnchor).AppendTo($$.GetMeta())
|
||||
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||
|
||||
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
||||
}
|
||||
@ -3400,7 +3400,7 @@ expr_without_variable:
|
||||
// save comments
|
||||
$2.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta())
|
||||
$3.Meta.SetTokenName(meta.AmpersandToken).AppendTo($$.GetMeta())
|
||||
$4.Meta.SetTokenName(meta.NewAnchor).AppendTo(_new.GetMeta())
|
||||
$4.Meta.SetTokenName(meta.NodeStart).AppendTo(_new.GetMeta())
|
||||
|
||||
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
||||
}
|
||||
|
@ -5486,7 +5486,7 @@ yydefault:
|
||||
}
|
||||
|
||||
// save comments
|
||||
yyDollar[1].token.Meta.SetTokenName(meta.NewAnchor).AppendTo(yyVAL.node.GetMeta())
|
||||
yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta())
|
||||
|
||||
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
||||
}
|
||||
@ -5500,7 +5500,7 @@ yydefault:
|
||||
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node))
|
||||
|
||||
// save comments
|
||||
yyDollar[1].token.Meta.SetTokenName(meta.NewAnchor).AppendTo(yyVAL.node.GetMeta())
|
||||
yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta())
|
||||
|
||||
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
||||
}
|
||||
|
@ -3064,7 +3064,7 @@ new_expr:
|
||||
}
|
||||
|
||||
// save comments
|
||||
$1.Meta.SetTokenName(meta.NewAnchor).AppendTo($$.GetMeta())
|
||||
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||
|
||||
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
||||
}
|
||||
@ -3076,7 +3076,7 @@ new_expr:
|
||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2))
|
||||
|
||||
// save comments
|
||||
$1.Meta.SetTokenName(meta.NewAnchor).AppendTo($$.GetMeta())
|
||||
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||
|
||||
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
||||
}
|
||||
|
@ -1432,7 +1432,6 @@ func (p *Printer) printExprNew(n node.Node) {
|
||||
nn := n.(*expr.New)
|
||||
p.printMeta(nn, meta.NodeStart)
|
||||
|
||||
p.printMeta(nn, meta.NewAnchor)
|
||||
io.WriteString(p.w, "new")
|
||||
p.Print(nn.Class)
|
||||
|
||||
|
@ -3823,7 +3823,7 @@ func TestPrinterPrintNew(t *testing.T) {
|
||||
&meta.Data{
|
||||
Type: meta.WhiteSpaceType,
|
||||
Value: " ",
|
||||
TokenName: meta.NewAnchor,
|
||||
TokenName: meta.NodeStart,
|
||||
},
|
||||
},
|
||||
Class: &name.Name{
|
||||
|
Loading…
Reference in New Issue
Block a user