remove meta.EchoToken
This commit is contained in:
parent
378830df76
commit
819a6d7f46
@ -10,7 +10,6 @@ const (
|
||||
StringVarnameToken
|
||||
NumStringToken
|
||||
InlineHTMLToken
|
||||
EchoToken
|
||||
WhileToken
|
||||
EndwhileToken
|
||||
ForInitSemicolonToken
|
||||
|
@ -4,9 +4,9 @@ package meta
|
||||
|
||||
import "strconv"
|
||||
|
||||
const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
|
||||
const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
|
||||
|
||||
var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 72, 82, 95, 116, 137, 148, 163, 178, 185, 199, 208, 221, 231, 242, 250, 262, 272, 286, 297, 305, 315, 325, 335, 349, 361, 376, 392, 405, 419, 443, 469, 485, 498, 512, 527, 542, 557, 567, 580, 590, 602, 616, 627, 635, 643, 662, 675, 689, 703, 718, 731, 744, 757, 773, 786, 799, 811, 824, 836, 848, 862, 877, 885, 892, 899, 915, 934, 946, 961, 982, 1003, 1020, 1038, 1058, 1079, 1093, 1103, 1123, 1144, 1161, 1179, 1196, 1210, 1220, 1229, 1239, 1255, 1265, 1275, 1288, 1298, 1310, 1319, 1331, 1339}
|
||||
var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 73, 86, 107, 128, 139, 154, 169, 176, 190, 199, 212, 222, 233, 241, 253, 263, 277, 288, 296, 306, 316, 326, 340, 352, 367, 383, 396, 410, 434, 460, 476, 489, 503, 518, 533, 548, 558, 571, 581, 593, 607, 618, 626, 634, 653, 666, 680, 694, 709, 722, 735, 748, 764, 777, 790, 802, 815, 827, 839, 853, 868, 876, 883, 890, 906, 925, 937, 952, 973, 994, 1011, 1029, 1049, 1070, 1084, 1094, 1114, 1135, 1152, 1170, 1187, 1201, 1211, 1220, 1230, 1246, 1256, 1266, 1279, 1289, 1301, 1310, 1322, 1330}
|
||||
|
||||
func (i TokenName) String() string {
|
||||
if i < 0 || i >= TokenName(len(_TokenName_index)-1) {
|
||||
|
@ -3290,8 +3290,8 @@ yydefault:
|
||||
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token))
|
||||
|
||||
// save comments
|
||||
yyDollar[1].token.Meta.SetTokenName(meta.EchoToken).AppendTo(yyVAL.node.GetMeta())
|
||||
yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.EchoToken)
|
||||
yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta())
|
||||
yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart)
|
||||
yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta())
|
||||
yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken)
|
||||
|
||||
|
@ -1158,8 +1158,8 @@ unticked_statement:
|
||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3))
|
||||
|
||||
// save comments
|
||||
$1.Meta.SetTokenName(meta.EchoToken).AppendTo($$.GetMeta())
|
||||
yylex.(*Parser).appendMetaToken($$, $1, meta.EchoToken)
|
||||
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||
yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart)
|
||||
$3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta())
|
||||
yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken)
|
||||
|
||||
|
@ -3453,8 +3453,8 @@ yydefault:
|
||||
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token))
|
||||
|
||||
// save comments
|
||||
yyDollar[1].token.Meta.SetTokenName(meta.EchoToken).AppendTo(yyVAL.node.GetMeta())
|
||||
yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.EchoToken)
|
||||
yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta())
|
||||
yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[1].token, meta.NodeStart)
|
||||
yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta())
|
||||
yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken)
|
||||
|
||||
|
@ -1127,8 +1127,8 @@ statement:
|
||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3))
|
||||
|
||||
// save comments
|
||||
$1.Meta.SetTokenName(meta.EchoToken).AppendTo($$.GetMeta())
|
||||
yylex.(*Parser).appendMetaToken($$, $1, meta.EchoToken)
|
||||
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||
yylex.(*Parser).appendMetaToken($$, $1, meta.NodeStart)
|
||||
$3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta())
|
||||
yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken)
|
||||
|
||||
|
@ -2119,7 +2119,6 @@ func (p *Printer) printStmtEcho(n node.Node) {
|
||||
nn := n.(*stmt.Echo)
|
||||
p.printMeta(nn, meta.NodeStart)
|
||||
|
||||
p.printMeta(nn, meta.EchoToken)
|
||||
p.joinPrint(",", nn.Exprs)
|
||||
p.printMeta(nn, meta.SemiColonToken)
|
||||
|
||||
|
@ -6448,12 +6448,12 @@ func TestPrinterPrintStmtEcho(t *testing.T) {
|
||||
&meta.Data{
|
||||
Type: meta.TokenType,
|
||||
Value: "echo",
|
||||
TokenName: meta.EchoToken,
|
||||
TokenName: meta.NodeStart,
|
||||
},
|
||||
&meta.Data{
|
||||
Type: meta.WhiteSpaceType,
|
||||
Value: " ",
|
||||
TokenName: meta.EchoToken,
|
||||
TokenName: meta.NodeStart,
|
||||
},
|
||||
&meta.Data{
|
||||
Type: meta.WhiteSpaceType,
|
||||
|
Loading…
Reference in New Issue
Block a user