remove meta.BreakToken
This commit is contained in:
parent
e19956b303
commit
72136ee853
@ -24,7 +24,6 @@ const (
|
||||
EndswitchToken
|
||||
CaseToken
|
||||
DefaultToken
|
||||
BreakToken
|
||||
ContinueToken
|
||||
GotoToken
|
||||
FunctionToken
|
||||
|
@ -4,9 +4,9 @@ package meta
|
||||
|
||||
import "strconv"
|
||||
|
||||
const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
|
||||
const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenEndswitchTokenCaseTokenDefaultTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
|
||||
|
||||
var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 72, 79, 89, 102, 123, 144, 155, 170, 182, 197, 204, 218, 227, 239, 249, 262, 271, 284, 294, 305, 313, 323, 335, 345, 359, 370, 378, 388, 398, 408, 422, 434, 449, 465, 478, 492, 516, 542, 558, 571, 585, 600, 615, 630, 640, 653, 663, 675, 689, 700, 708, 716, 735, 748, 762, 776, 791, 804, 817, 830, 846, 859, 872, 884, 897, 909, 921, 935, 950, 958, 965, 972, 988, 1007, 1019, 1034, 1055, 1076, 1093, 1111, 1131, 1152, 1166, 1176, 1196, 1217, 1234, 1252, 1269, 1283, 1293, 1302, 1312, 1328, 1338, 1348, 1361, 1371, 1383, 1392, 1404, 1412}
|
||||
var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 72, 79, 89, 102, 123, 144, 155, 170, 182, 197, 204, 218, 227, 239, 252, 261, 274, 284, 295, 303, 313, 325, 335, 349, 360, 368, 378, 388, 398, 412, 424, 439, 455, 468, 482, 506, 532, 548, 561, 575, 590, 605, 620, 630, 643, 653, 665, 679, 690, 698, 706, 725, 738, 752, 766, 781, 794, 807, 820, 836, 849, 862, 874, 887, 899, 911, 925, 940, 948, 955, 962, 978, 997, 1009, 1024, 1045, 1066, 1083, 1101, 1121, 1142, 1156, 1166, 1186, 1207, 1224, 1242, 1259, 1273, 1283, 1292, 1302, 1318, 1328, 1338, 1351, 1361, 1373, 1382, 1394, 1402}
|
||||
|
||||
func (i TokenName) String() string {
|
||||
if i < 0 || i >= TokenName(len(_TokenName_index)-1) {
|
||||
|
@ -3131,7 +3131,7 @@ yydefault:
|
||||
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token))
|
||||
|
||||
// save comments
|
||||
yyDollar[1].token.Meta.SetTokenName(meta.BreakToken).AppendTo(yyVAL.node.GetMeta())
|
||||
yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta())
|
||||
yyDollar[2].token.Meta.SetTokenName(meta.SemiColonToken).AppendTo(yyVAL.node.GetMeta())
|
||||
yylex.(*Parser).appendMetaToken(yyVAL.node, yyDollar[2].token, meta.SemiColonToken)
|
||||
|
||||
@ -3147,7 +3147,7 @@ yydefault:
|
||||
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token))
|
||||
|
||||
// save comments
|
||||
yyDollar[1].token.Meta.SetTokenName(meta.BreakToken).AppendTo(yyVAL.node.GetMeta())
|
||||
yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).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)
|
||||
|
||||
|
@ -1019,7 +1019,7 @@ unticked_statement:
|
||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2))
|
||||
|
||||
// save comments
|
||||
$1.Meta.SetTokenName(meta.BreakToken).AppendTo($$.GetMeta())
|
||||
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||
$2.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta())
|
||||
yylex.(*Parser).appendMetaToken($$, $2, meta.SemiColonToken)
|
||||
|
||||
@ -1033,7 +1033,7 @@ unticked_statement:
|
||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3))
|
||||
|
||||
// save comments
|
||||
$1.Meta.SetTokenName(meta.BreakToken).AppendTo($$.GetMeta())
|
||||
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||
$3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta())
|
||||
yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken)
|
||||
|
||||
|
@ -3373,7 +3373,7 @@ yydefault:
|
||||
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token))
|
||||
|
||||
// save comments
|
||||
yyDollar[1].token.Meta.SetTokenName(meta.BreakToken).AppendTo(yyVAL.node.GetMeta())
|
||||
yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).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)
|
||||
|
||||
|
@ -1057,7 +1057,7 @@ statement:
|
||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3))
|
||||
|
||||
// save comments
|
||||
$1.Meta.SetTokenName(meta.BreakToken).AppendTo($$.GetMeta())
|
||||
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||
$3.Meta.SetTokenName(meta.SemiColonToken).AppendTo($$.GetMeta())
|
||||
yylex.(*Parser).appendMetaToken($$, $3, meta.SemiColonToken)
|
||||
|
||||
|
@ -1865,7 +1865,6 @@ func (p *Printer) printStmtBreak(n node.Node) {
|
||||
nn := n.(*stmt.Break)
|
||||
p.printMeta(nn, meta.NodeStart)
|
||||
|
||||
p.printMeta(nn, meta.BreakToken)
|
||||
io.WriteString(p.w, "break")
|
||||
if nn.Expr != nil {
|
||||
p.Print(nn.Expr)
|
||||
|
@ -5465,7 +5465,7 @@ func TestPrinterPrintStmtBreak(t *testing.T) {
|
||||
&meta.Data{
|
||||
Type: meta.WhiteSpaceType,
|
||||
Value: " ",
|
||||
TokenName: meta.BreakToken,
|
||||
TokenName: meta.NodeStart,
|
||||
},
|
||||
&meta.Data{
|
||||
Type: meta.WhiteSpaceType,
|
||||
|
Loading…
Reference in New Issue
Block a user