remove meta.BackquoteToken

This commit is contained in:
z7zmey 2018-10-29 12:32:54 +02:00
parent e036135fab
commit 6dde9ef052
8 changed files with 354 additions and 360 deletions

View File

@ -98,7 +98,6 @@ const (
IsGreaterOrEqualToken IsGreaterOrEqualToken
HaltCompilerToken HaltCompilerToken
CaseSeparatorToken // ';' or ':' CaseSeparatorToken // ';' or ':'
BackquoteToken // '`'
OpenCurlyBracesToken // '{' OpenCurlyBracesToken // '{'
CloseCurlyBracesToken // '}' CloseCurlyBracesToken // '}'
SemiColonToken // ';' SemiColonToken // ';'

View File

@ -4,9 +4,9 @@ package meta
import "strconv" import "strconv"
const _TokenName_name = "NodeStartNodeEndIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenElseifTokenElseTokenEndifTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken" const _TokenName_name = "NodeStartNodeEndIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenElseifTokenElseTokenEndifTokenYieldTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
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} 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, 1213, 1234, 1248, 1258, 1278, 1299, 1316, 1334, 1351, 1365, 1375, 1384, 1394, 1410, 1420, 1430, 1443, 1453, 1465, 1474, 1486, 1494}
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) {

File diff suppressed because it is too large Load Diff

View File

@ -4201,8 +4201,7 @@ expr_without_variable:
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3))
// save comments // save comments
$1.Meta.SetTokenName(meta.BackquoteToken).AppendTo($$.GetMeta()) $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
$3.Meta.SetTokenName(meta.BackquoteToken).AppendTo($$.GetMeta())
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
} }

File diff suppressed because it is too large Load Diff

View File

@ -3924,8 +3924,7 @@ expr_without_variable:
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3))
// save comments // save comments
$1.Meta.SetTokenName(meta.BackquoteToken).AppendTo($$.GetMeta()) $1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
$3.Meta.SetTokenName(meta.BackquoteToken).AppendTo($$.GetMeta())
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
} }

View File

@ -1545,7 +1545,6 @@ func (p *Printer) printExprShellExec(n node.Node) {
nn := n.(*expr.ShellExec) nn := n.(*expr.ShellExec)
p.printMeta(nn, meta.NodeStart) p.printMeta(nn, meta.NodeStart)
p.printMeta(nn, meta.BackquoteToken)
io.WriteString(p.w, "`") io.WriteString(p.w, "`")
for _, part := range nn.Parts { for _, part := range nn.Parts {
p.Print(part) p.Print(part)

View File

@ -4175,7 +4175,7 @@ func TestPrinterPrintShellExec(t *testing.T) {
&meta.Data{ &meta.Data{
Type: meta.WhiteSpaceType, Type: meta.WhiteSpaceType,
Value: " ", Value: " ",
TokenName: meta.BackquoteToken, TokenName: meta.NodeStart,
}, },
}, },
Parts: []node.Node{ Parts: []node.Node{