remove meta.RequireToken and meta.RequireOnceToken
This commit is contained in:
parent
5c09a98413
commit
e036135fab
@ -54,8 +54,6 @@ const (
|
|||||||
UseLeadingNsSeparatorToken
|
UseLeadingNsSeparatorToken
|
||||||
NsSeparatorToken
|
NsSeparatorToken
|
||||||
EllipsisToken
|
EllipsisToken
|
||||||
RequireToken
|
|
||||||
RequireOnceToken
|
|
||||||
LogicalOrToken
|
LogicalOrToken
|
||||||
LogicalXorToken
|
LogicalXorToken
|
||||||
LogicalAndToken
|
LogicalAndToken
|
||||||
|
@ -4,9 +4,9 @@ package meta
|
|||||||
|
|
||||||
import "strconv"
|
import "strconv"
|
||||||
|
|
||||||
const _TokenName_name = "NodeStartNodeEndIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenElseifTokenElseTokenEndifTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
|
const _TokenName_name = "NodeStartNodeEndIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenElseifTokenElseTokenEndifTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
|
||||||
|
|
||||||
var _TokenName_index = [...]uint16{0, 9, 16, 23, 41, 55, 70, 79, 86, 96, 109, 130, 151, 159, 170, 182, 197, 209, 224, 231, 242, 256, 265, 277, 287, 300, 309, 322, 332, 343, 351, 361, 373, 383, 397, 408, 416, 426, 436, 446, 460, 472, 487, 503, 516, 530, 554, 580, 596, 609, 621, 637, 651, 666, 681, 696, 707, 716, 726, 736, 749, 759, 771, 785, 796, 804, 812, 826, 845, 858, 872, 886, 901, 914, 927, 940, 956, 969, 982, 994, 1007, 1019, 1031, 1045, 1060, 1068, 1075, 1082, 1098, 1117, 1129, 1144, 1165, 1186, 1203, 1221, 1235, 1255, 1276, 1290, 1300, 1320, 1341, 1358, 1376, 1393, 1407, 1417, 1426, 1436, 1452, 1462, 1472, 1485, 1495, 1507, 1516, 1528, 1536}
|
var _TokenName_index = [...]uint16{0, 9, 16, 23, 41, 55, 70, 79, 86, 96, 109, 130, 151, 159, 170, 182, 197, 209, 224, 231, 242, 256, 265, 277, 287, 300, 309, 322, 332, 343, 351, 361, 373, 383, 397, 408, 416, 426, 436, 446, 460, 472, 487, 503, 516, 530, 554, 580, 596, 609, 623, 638, 653, 668, 679, 688, 698, 708, 721, 731, 743, 757, 768, 776, 784, 798, 817, 830, 844, 858, 873, 886, 899, 912, 928, 941, 954, 966, 979, 991, 1003, 1017, 1032, 1040, 1047, 1054, 1070, 1089, 1101, 1116, 1137, 1158, 1175, 1193, 1207, 1227, 1248, 1262, 1272, 1292, 1313, 1330, 1348, 1365, 1379, 1389, 1398, 1408, 1424, 1434, 1444, 1457, 1467, 1479, 1488, 1500, 1508}
|
||||||
|
|
||||||
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) {
|
||||||
|
@ -9471,7 +9471,7 @@ yydefault:
|
|||||||
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node))
|
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
yyDollar[1].token.Meta.SetTokenName(meta.RequireToken).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)
|
||||||
}
|
}
|
||||||
@ -9485,7 +9485,7 @@ yydefault:
|
|||||||
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node))
|
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
yyDollar[1].token.Meta.SetTokenName(meta.RequireOnceToken).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)
|
||||||
}
|
}
|
||||||
|
@ -6870,7 +6870,7 @@ internal_functions_in_yacc:
|
|||||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2))
|
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
$1.Meta.SetTokenName(meta.RequireToken).AppendTo($$.GetMeta())
|
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||||
|
|
||||||
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
||||||
}
|
}
|
||||||
@ -6882,7 +6882,7 @@ internal_functions_in_yacc:
|
|||||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2))
|
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
$1.Meta.SetTokenName(meta.RequireOnceToken).AppendTo($$.GetMeta())
|
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||||
|
|
||||||
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
||||||
}
|
}
|
||||||
|
@ -8117,7 +8117,7 @@ yydefault:
|
|||||||
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node))
|
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
yyDollar[1].token.Meta.SetTokenName(meta.RequireToken).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)
|
||||||
}
|
}
|
||||||
@ -8131,7 +8131,7 @@ yydefault:
|
|||||||
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node))
|
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
yyDollar[1].token.Meta.SetTokenName(meta.RequireOnceToken).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)
|
||||||
}
|
}
|
||||||
|
@ -5416,7 +5416,7 @@ internal_functions_in_yacc:
|
|||||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2))
|
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
$1.Meta.SetTokenName(meta.RequireToken).AppendTo($$.GetMeta())
|
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||||
|
|
||||||
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
||||||
}
|
}
|
||||||
@ -5428,7 +5428,7 @@ internal_functions_in_yacc:
|
|||||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2))
|
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
$1.Meta.SetTokenName(meta.RequireOnceToken).AppendTo($$.GetMeta())
|
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||||
|
|
||||||
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
||||||
}
|
}
|
||||||
|
@ -1525,7 +1525,6 @@ func (p *Printer) printExprRequire(n node.Node) {
|
|||||||
nn := n.(*expr.Require)
|
nn := n.(*expr.Require)
|
||||||
p.printMeta(nn, meta.NodeStart)
|
p.printMeta(nn, meta.NodeStart)
|
||||||
|
|
||||||
p.printMeta(nn, meta.RequireToken)
|
|
||||||
io.WriteString(p.w, "require")
|
io.WriteString(p.w, "require")
|
||||||
p.Print(nn.Expr)
|
p.Print(nn.Expr)
|
||||||
|
|
||||||
@ -1536,7 +1535,6 @@ func (p *Printer) printExprRequireOnce(n node.Node) {
|
|||||||
nn := n.(*expr.RequireOnce)
|
nn := n.(*expr.RequireOnce)
|
||||||
p.printMeta(nn, meta.NodeStart)
|
p.printMeta(nn, meta.NodeStart)
|
||||||
|
|
||||||
p.printMeta(nn, meta.RequireOnceToken)
|
|
||||||
io.WriteString(p.w, "require_once")
|
io.WriteString(p.w, "require_once")
|
||||||
p.Print(nn.Expr)
|
p.Print(nn.Expr)
|
||||||
|
|
||||||
|
@ -4129,7 +4129,7 @@ func TestPrinterPrintRequire(t *testing.T) {
|
|||||||
&meta.Data{
|
&meta.Data{
|
||||||
Type: meta.WhiteSpaceType,
|
Type: meta.WhiteSpaceType,
|
||||||
Value: " ",
|
Value: " ",
|
||||||
TokenName: meta.RequireToken,
|
TokenName: meta.NodeStart,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Expr: &scalar.String{Value: "'path'"},
|
Expr: &scalar.String{Value: "'path'"},
|
||||||
@ -4152,7 +4152,7 @@ func TestPrinterPrintRequireOnce(t *testing.T) {
|
|||||||
&meta.Data{
|
&meta.Data{
|
||||||
Type: meta.WhiteSpaceType,
|
Type: meta.WhiteSpaceType,
|
||||||
Value: " ",
|
Value: " ",
|
||||||
TokenName: meta.RequireOnceToken,
|
TokenName: meta.NodeStart,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Expr: &scalar.String{Value: "'path'"},
|
Expr: &scalar.String{Value: "'path'"},
|
||||||
|
Loading…
Reference in New Issue
Block a user