remove meta.TildeToken
This commit is contained in:
parent
aa7a862573
commit
6bb51493e0
@ -126,7 +126,6 @@ const (
|
|||||||
MinusToken // '-'
|
MinusToken // '-'
|
||||||
PlusToken // '+'
|
PlusToken // '+'
|
||||||
ExclamationMarkToken // '!'
|
ExclamationMarkToken // '!'
|
||||||
TildeToken // '~'
|
|
||||||
AtToken // '@'
|
AtToken // '@'
|
||||||
CommaToken // ','
|
CommaToken // ','
|
||||||
VerticalBarToken // '|'
|
VerticalBarToken // '|'
|
||||||
|
@ -4,9 +4,9 @@ package meta
|
|||||||
|
|
||||||
import "strconv"
|
import "strconv"
|
||||||
|
|
||||||
const _TokenName_name = "NodeStartNodeEndIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenTildeTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
|
const _TokenName_name = "NodeStartNodeEndIncludeTokenIncludeOnceTokenExitTokenIfTokenStringVarnameTokenNumStringTokenInlineHTMLTokenEchoTokenDoTokenWhileTokenEndwhileTokenForInitSemicolonTokenForCondSemicolonTokenForTokenEndforTokenForeachTokenEndforeachTokenDeclareTokenEnddeclareTokenAsTokenSwitchTokenEndswitchTokenCaseTokenDefaultTokenBreakTokenContinueTokenGotoTokenFunctionTokenConstTokenReturnTokenTryTokenCatchTokenFinallyTokenThrowTokenUseTokenInsteadofTokenGlobalTokenVarTokenUnsetTokenIssetTokenEmptyTokenClassTokenTraitTokenInterfaceTokenExtendsTokenImplementsTokenDoubleArrowTokenListTokenCallableTokenCurlyOpenTokenPaamayimNekudotayimTokenUseLeadingNsSeparatorTokenNsSeparatorTokenEllipsisTokenEvalTokenRequireTokenRequireOnceTokenLogicalOrTokenLogicalXorTokenLogicalAndTokenInstanceofTokenNewAnchorCloneTokenElseifTokenElseTokenEndifTokenPrintTokenYieldTokenStaticTokenAbstractTokenFinalTokenPrivateTokenProtectedTokenPublicTokenIncTokenDecTokenYieldFromTokenObjectOperatorTokenCoalesceTokenSpaceshipTokenPlusEqualTokenMinusEqualTokenMulEqualTokenPowEqualTokenDivEqualTokenConcatEqualTokenModEqualTokenAndEqualTokenOrEqualTokenXorEqualTokenSlEqualTokenSrEqualTokenBooleanOrTokenBooleanAndTokenPowTokenSlTokenSrTokenIsIdenticalTokenIsNotIdenticalTokenIsEqualTokenIsNotEqualTokenIsSmallerOrEqualTokenIsGreaterOrEqualTokenHaltCompilerTokenCaseSeparatorTokenBackquoteTokenOpenCurlyBracesTokenCloseCurlyBracesTokenSemiColonTokenColonTokenOpenParenthesisTokenCloseParenthesisTokenOpenSquareBracketCloseSquareBracketQuestionMarkTokenAmpersandTokenMinusTokenPlusTokenExclamationMarkTokenAtTokenCommaTokenVerticalBarTokenEqualTokenCaretTokenAsteriskTokenSlashTokenPercentTokenLessTokenGreaterTokenDotToken"
|
||||||
|
|
||||||
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, 428, 442, 453, 461, 471, 481, 491, 501, 511, 525, 537, 552, 568, 577, 590, 604, 628, 654, 670, 683, 692, 704, 720, 734, 749, 764, 779, 788, 798, 809, 818, 828, 838, 848, 859, 872, 882, 894, 908, 919, 927, 935, 949, 968, 981, 995, 1009, 1024, 1037, 1050, 1063, 1079, 1092, 1105, 1117, 1130, 1142, 1154, 1168, 1183, 1191, 1198, 1205, 1221, 1240, 1252, 1267, 1288, 1309, 1326, 1344, 1358, 1378, 1399, 1413, 1423, 1443, 1464, 1481, 1499, 1516, 1530, 1540, 1549, 1569, 1579, 1586, 1596, 1612, 1622, 1632, 1645, 1655, 1667, 1676, 1688, 1696}
|
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, 428, 442, 453, 461, 471, 481, 491, 501, 511, 525, 537, 552, 568, 577, 590, 604, 628, 654, 670, 683, 692, 704, 720, 734, 749, 764, 779, 788, 798, 809, 818, 828, 838, 848, 859, 872, 882, 894, 908, 919, 927, 935, 949, 968, 981, 995, 1009, 1024, 1037, 1050, 1063, 1079, 1092, 1105, 1117, 1130, 1142, 1154, 1168, 1183, 1191, 1198, 1205, 1221, 1240, 1252, 1267, 1288, 1309, 1326, 1344, 1358, 1378, 1399, 1413, 1423, 1443, 1464, 1481, 1499, 1516, 1530, 1540, 1549, 1569, 1576, 1586, 1602, 1612, 1622, 1635, 1645, 1657, 1666, 1678, 1686}
|
||||||
|
|
||||||
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) {
|
||||||
|
@ -6165,7 +6165,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.TildeToken).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)
|
||||||
}
|
}
|
||||||
@ -7735,7 +7735,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.TildeToken).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)
|
||||||
}
|
}
|
||||||
|
@ -3856,7 +3856,7 @@ expr_without_variable:
|
|||||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2))
|
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
$1.Meta.SetTokenName(meta.TildeToken).AppendTo($$.GetMeta())
|
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||||
|
|
||||||
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
||||||
}
|
}
|
||||||
@ -5267,7 +5267,7 @@ static_operation:
|
|||||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2))
|
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
$1.Meta.SetTokenName(meta.TildeToken).AppendTo($$.GetMeta())
|
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||||
|
|
||||||
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
||||||
}
|
}
|
||||||
|
@ -6098,7 +6098,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.TildeToken).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)
|
||||||
}
|
}
|
||||||
|
@ -3593,7 +3593,7 @@ expr_without_variable:
|
|||||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2))
|
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2))
|
||||||
|
|
||||||
// save comments
|
// save comments
|
||||||
$1.Meta.SetTokenName(meta.TildeToken).AppendTo($$.GetMeta())
|
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||||
|
|
||||||
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
||||||
}
|
}
|
||||||
|
@ -1192,10 +1192,8 @@ func (p *Printer) printExprArray(n node.Node) {
|
|||||||
func (p *Printer) printExprBitwiseNot(n node.Node) {
|
func (p *Printer) printExprBitwiseNot(n node.Node) {
|
||||||
nn := n.(*expr.BitwiseNot)
|
nn := n.(*expr.BitwiseNot)
|
||||||
p.printMeta(nn, meta.NodeStart)
|
p.printMeta(nn, meta.NodeStart)
|
||||||
p.printMeta(nn, meta.TildeToken)
|
|
||||||
io.WriteString(p.w, "~")
|
io.WriteString(p.w, "~")
|
||||||
p.Print(nn.Expr)
|
p.Print(nn.Expr)
|
||||||
|
|
||||||
p.printMeta(nn, meta.NodeEnd)
|
p.printMeta(nn, meta.NodeEnd)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2937,7 +2937,7 @@ func TestPrinterPrintExprBitwiseNot(t *testing.T) {
|
|||||||
&meta.Data{
|
&meta.Data{
|
||||||
Type: meta.WhiteSpaceType,
|
Type: meta.WhiteSpaceType,
|
||||||
Value: " ",
|
Value: " ",
|
||||||
TokenName: meta.TildeToken,
|
TokenName: meta.NodeStart,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Expr: &expr.Variable{
|
Expr: &expr.Variable{
|
||||||
|
Loading…
Reference in New Issue
Block a user