remove meta.ThrowToken
This commit is contained in:
parent
14cfed2e03
commit
5382ec090c
@ -21,7 +21,6 @@ const (
|
|||||||
FunctionToken
|
FunctionToken
|
||||||
ConstToken
|
ConstToken
|
||||||
TryToken
|
TryToken
|
||||||
ThrowToken
|
|
||||||
InsteadofToken
|
InsteadofToken
|
||||||
VarToken
|
VarToken
|
||||||
UnsetToken
|
UnsetToken
|
||||||
|
@ -4,9 +4,9 @@ package meta
|
|||||||
|
|
||||||
import "strconv"
|
import "strconv"
|
||||||
|
|
||||||
const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenTryTokenThrowTokenInsteadofTokenVarTokenUnsetTokenClassTokenTraitTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
|
const _TokenName_name = "NodeStartNodeEndStringVarnameTokenNumStringTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenEndforTokenEndforeachTokenEnddeclareTokenAsTokenEndswitchTokenFunctionTokenConstTokenTryTokenInsteadofTokenVarTokenUnsetTokenClassTokenTraitTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenEndifTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
|
||||||
|
|
||||||
var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 58, 71, 92, 113, 124, 139, 154, 161, 175, 188, 198, 206, 216, 230, 238, 248, 258, 268, 280, 295, 311, 324, 338, 362, 388, 404, 417, 431, 446, 461, 476, 486, 499, 509, 521, 535, 546, 554, 562, 581, 594, 608, 622, 637, 650, 663, 676, 692, 705, 718, 730, 743, 755, 767, 781, 796, 804, 811, 818, 834, 853, 865, 880, 901, 922, 940, 960, 981, 995, 1005, 1025, 1046, 1063, 1081, 1098, 1112, 1122, 1131, 1141, 1157, 1167, 1177, 1190, 1200, 1212, 1221, 1233, 1241}
|
var _TokenName_index = [...]uint16{0, 9, 16, 34, 48, 58, 71, 92, 113, 124, 139, 154, 161, 175, 188, 198, 206, 220, 228, 238, 248, 258, 270, 285, 301, 314, 328, 352, 378, 394, 407, 421, 436, 451, 466, 476, 489, 499, 511, 525, 536, 544, 552, 571, 584, 598, 612, 627, 640, 653, 666, 682, 695, 708, 720, 733, 745, 757, 771, 786, 794, 801, 808, 824, 843, 855, 870, 891, 912, 930, 950, 971, 985, 995, 1015, 1036, 1053, 1071, 1088, 1102, 1112, 1121, 1131, 1147, 1157, 1167, 1180, 1190, 1202, 1211, 1223, 1231}
|
||||||
|
|
||||||
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) {
|
||||||
|
@ -3490,7 +3490,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.ThrowToken).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())
|
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)
|
||||||
|
|
||||||
|
@ -1340,7 +1340,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.ThrowToken).AppendTo($$.GetMeta())
|
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.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)
|
||||||
|
|
||||||
|
@ -3627,7 +3627,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.ThrowToken).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())
|
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)
|
||||||
|
|
||||||
|
@ -1283,7 +1283,7 @@ statement:
|
|||||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3))
|
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
$1.Meta.SetTokenName(meta.ThrowToken).AppendTo($$.GetMeta())
|
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.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)
|
||||||
|
|
||||||
|
@ -2517,7 +2517,6 @@ func (p *Printer) printStmtThrow(n node.Node) {
|
|||||||
nn := n.(*stmt.Throw)
|
nn := n.(*stmt.Throw)
|
||||||
p.printMeta(nn, meta.NodeStart)
|
p.printMeta(nn, meta.NodeStart)
|
||||||
|
|
||||||
p.printMeta(nn, meta.ThrowToken)
|
|
||||||
io.WriteString(p.w, "throw")
|
io.WriteString(p.w, "throw")
|
||||||
p.Print(nn.Expr)
|
p.Print(nn.Expr)
|
||||||
p.printMeta(nn, meta.SemiColonToken)
|
p.printMeta(nn, meta.SemiColonToken)
|
||||||
|
@ -8047,7 +8047,7 @@ func TestPrinterPrintStmtThrow(t *testing.T) {
|
|||||||
&meta.Data{
|
&meta.Data{
|
||||||
Type: meta.WhiteSpaceType,
|
Type: meta.WhiteSpaceType,
|
||||||
Value: " ",
|
Value: " ",
|
||||||
TokenName: meta.ThrowToken,
|
TokenName: meta.NodeStart,
|
||||||
},
|
},
|
||||||
&meta.Data{
|
&meta.Data{
|
||||||
Type: meta.WhiteSpaceType,
|
Type: meta.WhiteSpaceType,
|
||||||
|
Loading…
Reference in New Issue
Block a user