remove meta.ExitToken
This commit is contained in:
parent
89064d4530
commit
5159b0f473
@ -9,7 +9,6 @@ const (
|
|||||||
NodeEnd
|
NodeEnd
|
||||||
IncludeToken
|
IncludeToken
|
||||||
IncludeOnceToken
|
IncludeOnceToken
|
||||||
ExitToken
|
|
||||||
IfToken
|
IfToken
|
||||||
StringVarnameToken
|
StringVarnameToken
|
||||||
NumStringToken
|
NumStringToken
|
||||||
|
@ -4,9 +4,9 @@ package meta
|
|||||||
|
|
||||||
import "strconv"
|
import "strconv"
|
||||||
|
|
||||||
const _TokenName_name = "NodeStartNodeEndIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorElseifTokenElseTokenEndifTokenPrintTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
|
const _TokenName_name = "NodeStartNodeEndIncludeTokenIncludeOnceTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorElseifTokenElseTokenEndifTokenPrintTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
|
||||||
|
|
||||||
var _TokenName_index = [...]uint16{0, 9, 16, 28, 44, 53, 60, 78, 92, 107, 116, 123, 133, 146, 167, 188, 196, 207, 219, 234, 246, 261, 268, 279, 293, 302, 314, 324, 337, 346, 359, 369, 380, 388, 398, 410, 420, 434, 445, 453, 463, 473, 483, 493, 507, 519, 534, 550, 559, 572, 586, 610, 636, 652, 665, 677, 693, 707, 722, 737, 752, 761, 772, 781, 791, 801, 811, 824, 834, 846, 860, 871, 879, 887, 901, 920, 933, 947, 961, 976, 989, 1002, 1015, 1031, 1044, 1057, 1069, 1082, 1094, 1106, 1120, 1135, 1143, 1150, 1157, 1173, 1192, 1204, 1219, 1240, 1261, 1278, 1296, 1310, 1330, 1351, 1365, 1375, 1395, 1416, 1433, 1451, 1468, 1482, 1492, 1501, 1511, 1527, 1537, 1547, 1560, 1570, 1582, 1591, 1603, 1611}
|
var _TokenName_index = [...]uint16{0, 9, 16, 28, 44, 51, 69, 83, 98, 107, 114, 124, 137, 158, 179, 187, 198, 210, 225, 237, 252, 259, 270, 284, 293, 305, 315, 328, 337, 350, 360, 371, 379, 389, 401, 411, 425, 436, 444, 454, 464, 474, 484, 498, 510, 525, 541, 550, 563, 577, 601, 627, 643, 656, 668, 684, 698, 713, 728, 743, 752, 763, 772, 782, 792, 802, 815, 825, 837, 851, 862, 870, 878, 892, 911, 924, 938, 952, 967, 980, 993, 1006, 1022, 1035, 1048, 1060, 1073, 1085, 1097, 1111, 1126, 1134, 1141, 1148, 1164, 1183, 1195, 1210, 1231, 1252, 1269, 1287, 1301, 1321, 1342, 1356, 1366, 1386, 1407, 1424, 1442, 1459, 1473, 1483, 1492, 1502, 1518, 1528, 1538, 1551, 1561, 1573, 1582, 1594, 1602}
|
||||||
|
|
||||||
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) {
|
||||||
|
@ -6514,7 +6514,7 @@ yydefault:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
yyDollar[1].token.Meta.SetTokenName(meta.ExitToken).AppendTo(yyVAL.node.GetMeta())
|
yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta())
|
||||||
|
|
||||||
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
||||||
}
|
}
|
||||||
|
@ -4159,7 +4159,7 @@ expr_without_variable:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
$1.Meta.SetTokenName(meta.ExitToken).AppendTo($$.GetMeta())
|
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||||
|
|
||||||
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
||||||
}
|
}
|
||||||
|
@ -6447,7 +6447,7 @@ yydefault:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
yyDollar[1].token.Meta.SetTokenName(meta.ExitToken).AppendTo(yyVAL.node.GetMeta())
|
yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta())
|
||||||
|
|
||||||
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
||||||
}
|
}
|
||||||
|
@ -3894,7 +3894,7 @@ expr_without_variable:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
$1.Meta.SetTokenName(meta.ExitToken).AppendTo($$.GetMeta())
|
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||||
|
|
||||||
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
||||||
}
|
}
|
||||||
|
@ -1325,12 +1325,12 @@ func (p *Printer) printExprExit(n node.Node) {
|
|||||||
nn := n.(*expr.Exit)
|
nn := n.(*expr.Exit)
|
||||||
p.printMeta(nn, meta.NodeStart)
|
p.printMeta(nn, meta.NodeStart)
|
||||||
|
|
||||||
p.printMeta(nn, meta.ExitToken)
|
|
||||||
if nn.Die {
|
if nn.Die {
|
||||||
io.WriteString(p.w, "die")
|
io.WriteString(p.w, "die")
|
||||||
} else {
|
} else {
|
||||||
io.WriteString(p.w, "exit")
|
io.WriteString(p.w, "exit")
|
||||||
}
|
}
|
||||||
|
|
||||||
p.printMeta(nn, meta.OpenParenthesisToken)
|
p.printMeta(nn, meta.OpenParenthesisToken)
|
||||||
p.Print(nn.Expr)
|
p.Print(nn.Expr)
|
||||||
p.printMeta(nn, meta.CloseParenthesisToken)
|
p.printMeta(nn, meta.CloseParenthesisToken)
|
||||||
|
@ -3377,7 +3377,7 @@ func TestPrinterPrintExit(t *testing.T) {
|
|||||||
&meta.Data{
|
&meta.Data{
|
||||||
Type: meta.WhiteSpaceType,
|
Type: meta.WhiteSpaceType,
|
||||||
Value: " ",
|
Value: " ",
|
||||||
TokenName: meta.ExitToken,
|
TokenName: meta.NodeStart,
|
||||||
},
|
},
|
||||||
&meta.Data{
|
&meta.Data{
|
||||||
Type: meta.WhiteSpaceType,
|
Type: meta.WhiteSpaceType,
|
||||||
@ -3421,7 +3421,7 @@ func TestPrinterPrintDie(t *testing.T) {
|
|||||||
&meta.Data{
|
&meta.Data{
|
||||||
Type: meta.WhiteSpaceType,
|
Type: meta.WhiteSpaceType,
|
||||||
Value: " ",
|
Value: " ",
|
||||||
TokenName: meta.ExitToken,
|
TokenName: meta.NodeStart,
|
||||||
},
|
},
|
||||||
&meta.Data{
|
&meta.Data{
|
||||||
Type: meta.WhiteSpaceType,
|
Type: meta.WhiteSpaceType,
|
||||||
|
Loading…
Reference in New Issue
Block a user