remove meta.DefaultToken
This commit is contained in:
parent
bc4e070d57
commit
fc20b19df3
@ -21,7 +21,6 @@ const (
|
||||
EnddeclareToken
|
||||
AsToken
|
||||
EndswitchToken
|
||||
DefaultToken
|
||||
GotoToken
|
||||
FunctionToken
|
||||
ConstToken
|
||||
|
@ -4,9 +4,9 @@ package meta
|
||||
|
||||
import "strconv"
|
||||
|
||||
const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenDefaultTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
|
||||
const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
|
||||
|
||||
var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 72, 79, 89, 102, 123, 144, 155, 170, 185, 192, 206, 218, 227, 240, 250, 261, 269, 281, 291, 305, 316, 324, 334, 344, 354, 368, 380, 395, 411, 424, 438, 462, 488, 504, 517, 531, 546, 561, 576, 586, 599, 609, 621, 635, 646, 654, 662, 681, 694, 708, 722, 737, 750, 763, 776, 792, 805, 818, 830, 843, 855, 867, 881, 896, 904, 911, 918, 934, 953, 965, 980, 1001, 1022, 1039, 1057, 1077, 1098, 1112, 1122, 1142, 1163, 1180, 1198, 1215, 1229, 1239, 1248, 1258, 1274, 1284, 1294, 1307, 1317, 1329, 1338, 1350, 1358}
|
||||
var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 63, 72, 79, 89, 102, 123, 144, 155, 170, 185, 192, 206, 215, 228, 238, 249, 257, 269, 279, 293, 304, 312, 322, 332, 342, 356, 368, 383, 399, 412, 426, 450, 476, 492, 505, 519, 534, 549, 564, 574, 587, 597, 609, 623, 634, 642, 650, 669, 682, 696, 710, 725, 738, 751, 764, 780, 793, 806, 818, 831, 843, 855, 869, 884, 892, 899, 906, 922, 941, 953, 968, 989, 1010, 1027, 1045, 1065, 1086, 1100, 1110, 1130, 1151, 1168, 1186, 1203, 1217, 1227, 1236, 1246, 1262, 1272, 1282, 1295, 1305, 1317, 1326, 1338, 1346}
|
||||
|
||||
func (i TokenName) String() string {
|
||||
if i < 0 || i >= TokenName(len(_TokenName_index)-1) {
|
||||
|
@ -4218,7 +4218,7 @@ yydefault:
|
||||
_default.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list))
|
||||
|
||||
// save comments
|
||||
yyDollar[2].token.Meta.SetTokenName(meta.DefaultToken).AppendTo(_default.GetMeta())
|
||||
yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(_default.GetMeta())
|
||||
yyDollar[3].token.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_default.GetMeta())
|
||||
yylex.(*Parser).appendMetaToken(_default, yyDollar[3].token, meta.CaseSeparatorToken)
|
||||
|
||||
|
@ -2044,7 +2044,7 @@ case_list:
|
||||
_default.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4))
|
||||
|
||||
// save comments
|
||||
$2.Meta.SetTokenName(meta.DefaultToken).AppendTo(_default.GetMeta())
|
||||
$2.Meta.SetTokenName(meta.NodeStart).AppendTo(_default.GetMeta())
|
||||
$3.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_default.GetMeta())
|
||||
yylex.(*Parser).appendMetaToken(_default, $3, meta.CaseSeparatorToken)
|
||||
|
||||
|
@ -4262,7 +4262,7 @@ yydefault:
|
||||
_default.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition(yyDollar[2].token, yyDollar[4].list))
|
||||
|
||||
// save comments
|
||||
yyDollar[2].token.Meta.SetTokenName(meta.DefaultToken).AppendTo(_default.GetMeta())
|
||||
yyDollar[2].token.Meta.SetTokenName(meta.NodeStart).AppendTo(_default.GetMeta())
|
||||
yyDollar[3].token.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_default.GetMeta())
|
||||
yylex.(*Parser).appendMetaToken(_default, yyDollar[3].token, meta.CaseSeparatorToken)
|
||||
|
||||
|
@ -1889,7 +1889,7 @@ case_list:
|
||||
_default.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4))
|
||||
|
||||
// save comments
|
||||
$2.Meta.SetTokenName(meta.DefaultToken).AppendTo(_default.GetMeta())
|
||||
$2.Meta.SetTokenName(meta.NodeStart).AppendTo(_default.GetMeta())
|
||||
$3.Meta.SetTokenName(meta.CaseSeparatorToken).AppendTo(_default.GetMeta())
|
||||
yylex.(*Parser).appendMetaToken(_default, $3, meta.CaseSeparatorToken)
|
||||
|
||||
|
@ -2082,7 +2082,6 @@ func (p *Printer) printStmtDefault(n node.Node) {
|
||||
nn := n.(*stmt.Default)
|
||||
p.printMeta(nn, meta.NodeStart)
|
||||
|
||||
p.printMeta(nn, meta.DefaultToken)
|
||||
io.WriteString(p.w, "default")
|
||||
r := p.printMeta(nn, meta.CaseSeparatorToken)
|
||||
if !r {
|
||||
|
@ -6269,7 +6269,7 @@ func TestPrinterPrintStmtDefalut(t *testing.T) {
|
||||
&meta.Data{
|
||||
Type: meta.WhiteSpaceType,
|
||||
Value: " ",
|
||||
TokenName: meta.DefaultToken,
|
||||
TokenName: meta.NodeStart,
|
||||
},
|
||||
},
|
||||
Stmts: []node.Node{
|
||||
@ -6303,7 +6303,7 @@ func TestPrinterPrintStmtDefalutEmpty(t *testing.T) {
|
||||
&meta.Data{
|
||||
Type: meta.WhiteSpaceType,
|
||||
Value: " ",
|
||||
TokenName: meta.DefaultToken,
|
||||
TokenName: meta.NodeStart,
|
||||
},
|
||||
},
|
||||
Stmts: []node.Node{},
|
||||
|
Loading…
Reference in New Issue
Block a user