remove meta.DoubleQuoteToken
This commit is contained in:
parent
3aa4406a95
commit
11882949a7
@ -122,7 +122,6 @@ const (
|
|||||||
IsGreaterOrEqualToken
|
IsGreaterOrEqualToken
|
||||||
HaltCompilerToken
|
HaltCompilerToken
|
||||||
CaseSeparatorToken // ';' or ':'
|
CaseSeparatorToken // ';' or ':'
|
||||||
DoubleQuoteToken // '"'
|
|
||||||
BackquoteToken // '`'
|
BackquoteToken // '`'
|
||||||
OpenCurlyBracesToken // '{'
|
OpenCurlyBracesToken // '{'
|
||||||
CloseCurlyBracesToken // '}'
|
CloseCurlyBracesToken // '}'
|
||||||
|
@ -4,9 +4,9 @@ package meta
|
|||||||
|
|
||||||
import "strconv"
|
import "strconv"
|
||||||
|
|
||||||
const _TokenName_name = "NodeStartNodeEndMagicConstantTokenIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenArrayTokenCallableTokenStartHeredocTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenIntCastTokenDoubleCastTokenStringCastTokenArrayCastTokenObjectCastTokenBoolCastTokenUnsetCastTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenDoubleQuoteTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
|
const _TokenName_name = "NodeStartNodeEndMagicConstantTokenIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenArrayTokenCallableTokenStartHeredocTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenIntCastTokenDoubleCastTokenStringCastTokenArrayCastTokenObjectCastTokenBoolCastTokenUnsetCastTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
|
||||||
|
|
||||||
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, 1503, 1517, 1537, 1558, 1572, 1582, 1602, 1623, 1640, 1658, 1675, 1689, 1699, 1708, 1728, 1738, 1745, 1755, 1771, 1781, 1791, 1804, 1814, 1826, 1835, 1847, 1855}
|
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}
|
||||||
|
|
||||||
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) {
|
||||||
|
@ -8179,7 +8179,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.DoubleQuoteToken).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)
|
||||||
}
|
}
|
||||||
|
@ -5651,7 +5651,7 @@ scalar:
|
|||||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3))
|
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
$1.Meta.SetTokenName(meta.DoubleQuoteToken).AppendTo($$.GetMeta())
|
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||||
|
|
||||||
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
||||||
}
|
}
|
||||||
|
@ -7081,7 +7081,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.DoubleQuoteToken).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)
|
||||||
}
|
}
|
||||||
|
@ -4467,7 +4467,7 @@ scalar:
|
|||||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3))
|
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
$1.Meta.SetTokenName(meta.DoubleQuoteToken).AppendTo($$.GetMeta())
|
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||||
|
|
||||||
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
||||||
}
|
}
|
||||||
|
@ -578,13 +578,10 @@ func (p *Printer) printScalarEncapsed(n node.Node) {
|
|||||||
nn := n.(*scalar.Encapsed)
|
nn := n.(*scalar.Encapsed)
|
||||||
p.printMeta(nn, meta.NodeStart)
|
p.printMeta(nn, meta.NodeStart)
|
||||||
|
|
||||||
p.printMeta(nn, meta.DoubleQuoteToken)
|
|
||||||
io.WriteString(p.w, "\"")
|
io.WriteString(p.w, "\"")
|
||||||
|
|
||||||
for _, part := range nn.Parts {
|
for _, part := range nn.Parts {
|
||||||
p.Print(part)
|
p.Print(part)
|
||||||
}
|
}
|
||||||
|
|
||||||
io.WriteString(p.w, "\"")
|
io.WriteString(p.w, "\"")
|
||||||
|
|
||||||
p.printMeta(nn, meta.NodeEnd)
|
p.printMeta(nn, meta.NodeEnd)
|
||||||
|
@ -620,7 +620,7 @@ func TestPrinterPrintScalarEncapsed(t *testing.T) {
|
|||||||
&meta.Data{
|
&meta.Data{
|
||||||
Type: meta.WhiteSpaceType,
|
Type: meta.WhiteSpaceType,
|
||||||
Value: " ",
|
Value: " ",
|
||||||
TokenName: meta.DoubleQuoteToken,
|
TokenName: meta.NodeStart,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Parts: []node.Node{
|
Parts: []node.Node{
|
||||||
|
Loading…
Reference in New Issue
Block a user