remove meta.GotoToken
This commit is contained in:
parent
9c6a756545
commit
4ec92f57ee
@ -19,7 +19,6 @@ const (
|
|||||||
EnddeclareToken
|
EnddeclareToken
|
||||||
AsToken
|
AsToken
|
||||||
EndswitchToken
|
EndswitchToken
|
||||||
GotoToken
|
|
||||||
FunctionToken
|
FunctionToken
|
||||||
ConstToken
|
ConstToken
|
||||||
ReturnToken
|
ReturnToken
|
||||||
|
@ -4,9 +4,9 @@ package meta
|
|||||||
|
|
||||||
import "strconv"
|
import "strconv"
|
||||||
|
|
||||||
const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenThrowTokenInsteadofTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
|
const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenReturnTokenTryTokenThrowTokenInsteadofTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
|
||||||
|
|
||||||
var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 73, 86, 107, 128, 139, 154, 169, 176, 190, 199, 212, 222, 233, 241, 251, 265, 273, 283, 293, 303, 317, 329, 344, 360, 373, 387, 411, 437, 453, 466, 480, 495, 510, 525, 535, 548, 558, 570, 584, 595, 603, 611, 630, 643, 657, 671, 686, 699, 712, 725, 741, 754, 767, 779, 792, 804, 816, 830, 845, 853, 860, 867, 883, 902, 914, 929, 950, 971, 988, 1006, 1026, 1047, 1061, 1071, 1091, 1112, 1129, 1147, 1164, 1178, 1188, 1197, 1207, 1223, 1233, 1243, 1256, 1266, 1278, 1287, 1299, 1307}
|
var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 73, 86, 107, 128, 139, 154, 169, 176, 190, 203, 213, 224, 232, 242, 256, 264, 274, 284, 294, 308, 320, 335, 351, 364, 378, 402, 428, 444, 457, 471, 486, 501, 516, 526, 539, 549, 561, 575, 586, 594, 602, 621, 634, 648, 662, 677, 690, 703, 716, 732, 745, 758, 770, 783, 795, 807, 821, 836, 844, 851, 858, 874, 893, 905, 920, 941, 962, 979, 997, 1017, 1038, 1052, 1062, 1082, 1103, 1120, 1138, 1155, 1169, 1179, 1188, 1198, 1214, 1224, 1234, 1247, 1257, 1269, 1278, 1290, 1298}
|
||||||
|
|
||||||
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) {
|
||||||
|
@ -3508,7 +3508,7 @@ yydefault:
|
|||||||
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token))
|
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
yyDollar[1].token.Meta.SetTokenName(meta.GotoToken).AppendTo(yyVAL.node.GetMeta())
|
yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta())
|
||||||
yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(label.GetMeta())
|
yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(label.GetMeta())
|
||||||
yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta())
|
yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta())
|
||||||
yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken)
|
yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken)
|
||||||
|
@ -1356,7 +1356,7 @@ unticked_statement:
|
|||||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3))
|
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
$1.Meta.SetTokenName(meta.GotoToken).AppendTo($$.GetMeta())
|
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||||
$2.Meta.SetTokenName(meta.NodeStart).AppendTo(label.GetMeta())
|
$2.Meta.SetTokenName(meta.NodeStart).AppendTo(label.GetMeta())
|
||||||
$3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta())
|
$3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta())
|
||||||
yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken)
|
yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken)
|
||||||
|
@ -3645,7 +3645,7 @@ yydefault:
|
|||||||
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token))
|
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
yyDollar[1].token.Meta.SetTokenName(meta.GotoToken).AppendTo(yyVAL.node.GetMeta())
|
yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta())
|
||||||
yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(label.GetMeta())
|
yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(label.GetMeta())
|
||||||
yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta())
|
yyDollar[3].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta())
|
||||||
yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken)
|
yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[3].token, meta.SemiColonToken)
|
||||||
|
@ -1299,7 +1299,7 @@ statement:
|
|||||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3))
|
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
$1.Meta.SetTokenName(meta.GotoToken).AppendTo($$.GetMeta())
|
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||||
$2.Meta.SetTokenName(meta.NodeStart).AppendTo(label.GetMeta())
|
$2.Meta.SetTokenName(meta.NodeStart).AppendTo(label.GetMeta())
|
||||||
$3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta())
|
$3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta())
|
||||||
yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken)
|
yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken)
|
||||||
|
@ -2274,7 +2274,6 @@ func (p *Printer) printStmtGoto(n node.Node) {
|
|||||||
nn := n.(*stmt.Goto)
|
nn := n.(*stmt.Goto)
|
||||||
p.printMeta(nn, meta.NodeStart)
|
p.printMeta(nn, meta.NodeStart)
|
||||||
|
|
||||||
p.printMeta(nn, meta.GotoToken)
|
|
||||||
io.WriteString(p.w, "goto")
|
io.WriteString(p.w, "goto")
|
||||||
p.Print(nn.Label)
|
p.Print(nn.Label)
|
||||||
p.printMeta(nn, meta.SemiColonToken)
|
p.printMeta(nn, meta.SemiColonToken)
|
||||||
|
@ -7083,7 +7083,7 @@ func TestPrinterPrintStmtGoto(t *testing.T) {
|
|||||||
&meta.Data{
|
&meta.Data{
|
||||||
Type: meta.WhiteSpaceType,
|
Type: meta.WhiteSpaceType,
|
||||||
Value: " ",
|
Value: " ",
|
||||||
TokenName: meta.GotoToken,
|
TokenName: meta.NodeStart,
|
||||||
},
|
},
|
||||||
&meta.Data{
|
&meta.Data{
|
||||||
Type: meta.WhiteSpaceType,
|
Type: meta.WhiteSpaceType,
|
||||||
|
Loading…
Reference in New Issue
Block a user