remove meta.StartHeredocToken
This commit is contained in:
parent
11882949a7
commit
5144644d92
@ -58,7 +58,6 @@ const (
|
|||||||
ListToken
|
ListToken
|
||||||
ArrayToken
|
ArrayToken
|
||||||
CallableToken
|
CallableToken
|
||||||
StartHeredocToken
|
|
||||||
CurlyOpenToken
|
CurlyOpenToken
|
||||||
PaamayimNekudotayimToken
|
PaamayimNekudotayimToken
|
||||||
UseLeadingNsSeparatorToken
|
UseLeadingNsSeparatorToken
|
||||||
|
@ -4,9 +4,9 @@ package meta
|
|||||||
|
|
||||||
import "strconv"
|
import "strconv"
|
||||||
|
|
||||||
const _TokenName_name = "NodeStartNodeEndMagicConstantTokenIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenArrayTokenCallableTokenStartHeredocTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenIntCastTokenDoubleCastTokenStringCastTokenArrayCastTokenObjectCastTokenBoolCastTokenUnsetCastTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
|
const _TokenName_name = "NodeStartNodeEndMagicConstantTokenIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenArrayTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenIntCastTokenDoubleCastTokenStringCastTokenArrayCastTokenObjectCastTokenBoolCastTokenUnsetCastTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
|
||||||
|
|
||||||
var _TokenName_index = [...]uint16{0, 9, 16, 34, 46, 62, 71, 78, 96, 110, 125, 134, 141, 151, 164, 185, 206, 214, 225, 237, 252, 264, 279, 286, 297, 311, 320, 332, 342, 355, 364, 377, 387, 398, 406, 416, 428, 438, 446, 460, 471, 479, 489, 499, 509, 519, 529, 543, 555, 570, 586, 595, 605, 618, 635, 649, 673, 699, 715, 728, 737, 749, 765, 779, 794, 809, 824, 833, 843, 854, 863, 873, 883, 893, 904, 917, 927, 939, 953, 964, 972, 980, 994, 1013, 1025, 1040, 1055, 1069, 1084, 1097, 1111, 1124, 1138, 1152, 1167, 1180, 1193, 1206, 1222, 1235, 1248, 1260, 1273, 1285, 1297, 1311, 1326, 1334, 1341, 1348, 1364, 1383, 1395, 1410, 1431, 1452, 1469, 1487, 1501, 1521, 1542, 1556, 1566, 1586, 1607, 1624, 1642, 1659, 1673, 1683, 1692, 1712, 1722, 1729, 1739, 1755, 1765, 1775, 1788, 1798, 1810, 1819, 1831, 1839}
|
var _TokenName_index = [...]uint16{0, 9, 16, 34, 46, 62, 71, 78, 96, 110, 125, 134, 141, 151, 164, 185, 206, 214, 225, 237, 252, 264, 279, 286, 297, 311, 320, 332, 342, 355, 364, 377, 387, 398, 406, 416, 428, 438, 446, 460, 471, 479, 489, 499, 509, 519, 529, 543, 555, 570, 586, 595, 605, 618, 632, 656, 682, 698, 711, 720, 732, 748, 762, 777, 792, 807, 816, 826, 837, 846, 856, 866, 876, 887, 900, 910, 922, 936, 947, 955, 963, 977, 996, 1008, 1023, 1038, 1052, 1067, 1080, 1094, 1107, 1121, 1135, 1150, 1163, 1176, 1189, 1205, 1218, 1231, 1243, 1256, 1268, 1280, 1294, 1309, 1317, 1324, 1331, 1347, 1366, 1378, 1393, 1414, 1435, 1452, 1470, 1484, 1504, 1525, 1539, 1549, 1569, 1590, 1607, 1625, 1642, 1656, 1666, 1675, 1695, 1705, 1712, 1722, 1738, 1748, 1758, 1771, 1781, 1793, 1802, 1814, 1822}
|
||||||
|
|
||||||
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) {
|
||||||
|
@ -7444,7 +7444,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.StartHeredocToken).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)
|
||||||
}
|
}
|
||||||
@ -7458,7 +7458,7 @@ yydefault:
|
|||||||
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token))
|
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
yyDollar[1].token.Meta.SetTokenName(meta.StartHeredocToken).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)
|
||||||
}
|
}
|
||||||
@ -8193,7 +8193,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.StartHeredocToken).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)
|
||||||
}
|
}
|
||||||
|
@ -5008,7 +5008,7 @@ common_scalar:
|
|||||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3))
|
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
$1.Meta.SetTokenName(meta.StartHeredocToken).AppendTo($$.GetMeta())
|
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||||
|
|
||||||
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
||||||
}
|
}
|
||||||
@ -5020,7 +5020,7 @@ common_scalar:
|
|||||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2))
|
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
$1.Meta.SetTokenName(meta.StartHeredocToken).AppendTo($$.GetMeta())
|
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||||
|
|
||||||
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
||||||
}
|
}
|
||||||
@ -5663,7 +5663,7 @@ scalar:
|
|||||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3))
|
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
$1.Meta.SetTokenName(meta.StartHeredocToken).AppendTo($$.GetMeta())
|
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||||
|
|
||||||
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
||||||
}
|
}
|
||||||
|
@ -7053,7 +7053,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.StartHeredocToken).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)
|
||||||
}
|
}
|
||||||
@ -7067,7 +7067,7 @@ yydefault:
|
|||||||
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token))
|
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[2].token))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
yyDollar[1].token.Meta.SetTokenName(meta.StartHeredocToken).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)
|
||||||
}
|
}
|
||||||
@ -7095,7 +7095,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.StartHeredocToken).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)
|
||||||
}
|
}
|
||||||
|
@ -4443,7 +4443,7 @@ scalar:
|
|||||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3))
|
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
$1.Meta.SetTokenName(meta.StartHeredocToken).AppendTo($$.GetMeta())
|
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||||
|
|
||||||
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
||||||
}
|
}
|
||||||
@ -4455,7 +4455,7 @@ scalar:
|
|||||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2))
|
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
$1.Meta.SetTokenName(meta.StartHeredocToken).AppendTo($$.GetMeta())
|
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||||
|
|
||||||
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
||||||
}
|
}
|
||||||
@ -4479,7 +4479,7 @@ scalar:
|
|||||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3))
|
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
$1.Meta.SetTokenName(meta.StartHeredocToken).AppendTo($$.GetMeta())
|
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||||
|
|
||||||
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
||||||
}
|
}
|
||||||
|
@ -591,8 +591,6 @@ func (p *Printer) printScalarHeredoc(n node.Node) {
|
|||||||
nn := n.(*scalar.Heredoc)
|
nn := n.(*scalar.Heredoc)
|
||||||
p.printMeta(nn, meta.NodeStart)
|
p.printMeta(nn, meta.NodeStart)
|
||||||
|
|
||||||
p.printMeta(nn, meta.StartHeredocToken)
|
|
||||||
|
|
||||||
io.WriteString(p.w, "<<<")
|
io.WriteString(p.w, "<<<")
|
||||||
io.WriteString(p.w, nn.Label)
|
io.WriteString(p.w, nn.Label)
|
||||||
io.WriteString(p.w, "\n")
|
io.WriteString(p.w, "\n")
|
||||||
|
@ -653,7 +653,7 @@ func TestPrinterPrintScalarHeredoc(t *testing.T) {
|
|||||||
&meta.Data{
|
&meta.Data{
|
||||||
Type: meta.WhiteSpaceType,
|
Type: meta.WhiteSpaceType,
|
||||||
Value: " ",
|
Value: " ",
|
||||||
TokenName: meta.StartHeredocToken,
|
TokenName: meta.NodeStart,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Label: "LBL",
|
Label: "LBL",
|
||||||
@ -692,7 +692,7 @@ func TestPrinterPrintScalarNowdoc(t *testing.T) {
|
|||||||
&meta.Data{
|
&meta.Data{
|
||||||
Type: meta.WhiteSpaceType,
|
Type: meta.WhiteSpaceType,
|
||||||
Value: " ",
|
Value: " ",
|
||||||
TokenName: meta.StartHeredocToken,
|
TokenName: meta.NodeStart,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Label: "'LBL'",
|
Label: "'LBL'",
|
||||||
|
Loading…
Reference in New Issue
Block a user