diff --git a/internal/php5/parser.go b/internal/php5/parser.go index f7c244f..02bc113 100644 --- a/internal/php5/parser.go +++ b/internal/php5/parser.go @@ -2,7 +2,6 @@ package php5 import ( "bytes" - "fmt" "github.com/z7zmey/php-parser/internal/scanner" "github.com/z7zmey/php-parser/pkg/ast" @@ -63,10 +62,6 @@ func lastNode(nn []ast.Vertex) ast.Vertex { return nn[len(nn)-1] } -func isDollar(r rune) bool { - return r == '$' -} - func (p *Parser) MoveFreeFloating(src ast.Vertex, dst ast.Vertex) { if p.withTokens == false { return @@ -110,19 +105,6 @@ func (p *Parser) GetFreeFloatingToken(t *scanner.Token) []token.Token { } } -func (p *Parser) addDollarToken(v ast.Vertex) { - if p.withTokens == false { - return - } - - p.setFreeFloating(v, token.Dollar, []token.Token{ - { - ID: token.ID('$'), - Value: []byte("$"), - }, - }) -} - func (p *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast.Vertex) { if p.withTokens == false { return @@ -144,7 +126,6 @@ func (p *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast. } vlen := len(semiColon[0].Value) - fmt.Printf("vlen: %q\n", string(semiColon[0].Value)) tlen := 2 if bytes.HasSuffix(semiColon[0].Value, []byte("?>\n")) { diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index ec349e5..223eb2b 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -51,7 +51,7 @@ func TestIdentifier(t *testing.T) { EndPos: 7, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, }, @@ -165,7 +165,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 12, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -198,7 +198,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 19, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -242,7 +242,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 28, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, ArgumentList: &ast.ArgumentList{ @@ -284,7 +284,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 31, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -317,7 +317,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 38, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -361,7 +361,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 47, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Method: &ast.Identifier{ @@ -414,7 +414,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 55, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -447,7 +447,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 62, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -546,7 +546,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 78, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -579,7 +579,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 85, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -623,7 +623,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 94, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Call: &ast.Identifier{ @@ -676,7 +676,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 102, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -709,7 +709,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 109, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -797,7 +797,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 124, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -830,7 +830,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 131, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -940,7 +940,7 @@ func TestPhp5ParameterNode(t *testing.T) { EndPos: 27, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, DefaultValue: &ast.ExprConstFetch{ @@ -1029,7 +1029,7 @@ func TestPhp5ParameterNode(t *testing.T) { EndPos: 46, }, }, - Value: []byte("baz"), + Value: []byte("$baz"), }, }, }, @@ -1144,7 +1144,7 @@ func TestPhp5ParameterNode(t *testing.T) { EndPos: 92, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, DefaultValue: &ast.ExprConstFetch{ @@ -1233,7 +1233,7 @@ func TestPhp5ParameterNode(t *testing.T) { EndPos: 111, }, }, - Value: []byte("baz"), + Value: []byte("$baz"), }, }, }, @@ -1325,7 +1325,7 @@ func TestPhp5ParameterNode(t *testing.T) { EndPos: 136, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, DefaultValue: &ast.ExprConstFetch{ @@ -1414,7 +1414,7 @@ func TestPhp5ParameterNode(t *testing.T) { EndPos: 155, }, }, - Value: []byte("baz"), + Value: []byte("$baz"), }, }, }, @@ -1495,7 +1495,7 @@ func TestPhp5ParameterNode(t *testing.T) { EndPos: 187, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, DefaultValue: &ast.ExprConstFetch{ @@ -1584,7 +1584,7 @@ func TestPhp5ParameterNode(t *testing.T) { EndPos: 206, }, }, - Value: []byte("baz"), + Value: []byte("$baz"), }, }, }, @@ -1917,7 +1917,7 @@ func TestScalarEncapsed_SimpleVar(t *testing.T) { EndPos: 13, }, }, - Value: []byte("var"), + Value: []byte("$var"), }, }, }, @@ -1994,7 +1994,7 @@ func TestScalarEncapsed_SimpleVarOneChar(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -2071,7 +2071,7 @@ func TestScalarEncapsed_SimpleVarEndsEcapsed(t *testing.T) { EndPos: 13, }, }, - Value: []byte("var"), + Value: []byte("$var"), }, }, &ast.ScalarEncapsedStringPart{ @@ -2159,7 +2159,7 @@ func TestScalarEncapsed_StringVarCurveOpen(t *testing.T) { EndPos: 7, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, &ast.ExprVariable{ @@ -2180,7 +2180,7 @@ func TestScalarEncapsed_StringVarCurveOpen(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -2266,7 +2266,7 @@ func TestScalarEncapsed_SimpleVarPropertyFetch(t *testing.T) { EndPos: 13, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Property: &ast.Identifier{ @@ -2550,7 +2550,7 @@ func TestScalarEncapsed_CurlyOpenMethodCall(t *testing.T) { EndPos: 14, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Method: &ast.Identifier{ @@ -2653,7 +2653,7 @@ LBL; EndPos: 19, }, }, - Value: []byte("var"), + Value: []byte("$var"), }, }, &ast.ScalarEncapsedStringPart{ @@ -2745,7 +2745,7 @@ LBL; EndPos: 21, }, }, - Value: []byte("var"), + Value: []byte("$var"), }, }, &ast.ScalarEncapsedStringPart{ @@ -3560,7 +3560,7 @@ func TestStmtAltIf_AltIf(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -3629,7 +3629,7 @@ func TestStmtAltIf_AltElseIf(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -3671,7 +3671,7 @@ func TestStmtAltIf_AltElseIf(t *testing.T) { EndPos: 27, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Stmt: &ast.StmtStmtList{ @@ -3742,7 +3742,7 @@ func TestStmtAltIf_AltElse(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -3834,7 +3834,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -3876,7 +3876,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { EndPos: 27, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Stmt: &ast.StmtStmtList{ @@ -3918,7 +3918,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { EndPos: 42, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, Stmt: &ast.StmtStmtList{ @@ -5618,7 +5618,7 @@ func TestStmtEcho(t *testing.T) { EndPos: 10, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, &ast.ScalarLnumber{ @@ -5685,7 +5685,7 @@ func TestStmtEcho_Parenthesis(t *testing.T) { EndPos: 10, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -5794,7 +5794,7 @@ func TestStmtFor(t *testing.T) { EndPos: 9, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, Expr: &ast.ScalarLnumber{ @@ -5838,7 +5838,7 @@ func TestStmtFor(t *testing.T) { EndPos: 17, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, Right: &ast.ScalarLnumber{ @@ -5882,7 +5882,7 @@ func TestStmtFor(t *testing.T) { EndPos: 26, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, }, @@ -5913,7 +5913,7 @@ func TestStmtFor(t *testing.T) { EndPos: 32, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, }, @@ -5990,7 +5990,7 @@ func TestStmtFor_Alt(t *testing.T) { EndPos: 11, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, Right: &ast.ScalarLnumber{ @@ -6034,7 +6034,7 @@ func TestStmtFor_Alt(t *testing.T) { EndPos: 20, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, }, @@ -6101,7 +6101,7 @@ func TestStmtForeach(t *testing.T) { EndPos: 14, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Var: &ast.ExprVariable{ @@ -6122,7 +6122,7 @@ func TestStmtForeach(t *testing.T) { EndPos: 20, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, Stmt: &ast.StmtStmtList{ @@ -6198,7 +6198,7 @@ func TestStmtForeach_Expr(t *testing.T) { EndPos: 20, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, Stmt: &ast.StmtStmtList{ @@ -6263,7 +6263,7 @@ func TestStmtForeach_Alt(t *testing.T) { EndPos: 14, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Var: &ast.ExprVariable{ @@ -6284,7 +6284,7 @@ func TestStmtForeach_Alt(t *testing.T) { EndPos: 20, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, Stmt: &ast.StmtStmtList{ @@ -6349,7 +6349,7 @@ func TestStmtForeach_WithKey(t *testing.T) { EndPos: 14, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Key: &ast.ExprVariable{ @@ -6370,7 +6370,7 @@ func TestStmtForeach_WithKey(t *testing.T) { EndPos: 20, }, }, - Value: []byte("k"), + Value: []byte("$k"), }, }, Var: &ast.ExprVariable{ @@ -6391,7 +6391,7 @@ func TestStmtForeach_WithKey(t *testing.T) { EndPos: 26, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, Stmt: &ast.StmtStmtList{ @@ -6467,7 +6467,7 @@ func TestStmtForeach_ExprWithKey(t *testing.T) { EndPos: 20, }, }, - Value: []byte("k"), + Value: []byte("$k"), }, }, Var: &ast.ExprVariable{ @@ -6488,7 +6488,7 @@ func TestStmtForeach_ExprWithKey(t *testing.T) { EndPos: 26, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, Stmt: &ast.StmtStmtList{ @@ -6553,7 +6553,7 @@ func TestStmtForeach_WithRef(t *testing.T) { EndPos: 14, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Key: &ast.ExprVariable{ @@ -6574,7 +6574,7 @@ func TestStmtForeach_WithRef(t *testing.T) { EndPos: 20, }, }, - Value: []byte("k"), + Value: []byte("$k"), }, }, Var: &ast.ExprReference{ @@ -6604,7 +6604,7 @@ func TestStmtForeach_WithRef(t *testing.T) { EndPos: 27, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, }, @@ -6670,7 +6670,7 @@ func TestStmtForeach_WithList(t *testing.T) { EndPos: 14, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Key: &ast.ExprVariable{ @@ -6691,7 +6691,7 @@ func TestStmtForeach_WithList(t *testing.T) { EndPos: 20, }, }, - Value: []byte("k"), + Value: []byte("$k"), }, }, Var: &ast.ExprList{ @@ -6731,7 +6731,7 @@ func TestStmtForeach_WithList(t *testing.T) { EndPos: 31, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, }, @@ -6937,7 +6937,7 @@ func TestStmtFunction_ReturnVar(t *testing.T) { EndPos: 24, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -6981,7 +6981,7 @@ func TestStmtFunction_ReturnVar(t *testing.T) { EndPos: 37, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -7014,7 +7014,7 @@ func TestStmtFunction_ReturnVar(t *testing.T) { EndPos: 49, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -7139,7 +7139,7 @@ func TestStmtGlobal(t *testing.T) { EndPos: 12, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -7195,7 +7195,7 @@ func TestStmtGlobal_Vars(t *testing.T) { EndPos: 12, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, &ast.ExprVariable{ @@ -7216,7 +7216,7 @@ func TestStmtGlobal_Vars(t *testing.T) { EndPos: 16, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, &ast.ExprVariable{ @@ -7246,7 +7246,7 @@ func TestStmtGlobal_Vars(t *testing.T) { EndPos: 21, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, }, @@ -7453,7 +7453,7 @@ func TestStmtIf(t *testing.T) { EndPos: 9, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -7518,7 +7518,7 @@ func TestStmtIf_ElseIf(t *testing.T) { EndPos: 9, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -7560,7 +7560,7 @@ func TestStmtIf_ElseIf(t *testing.T) { EndPos: 24, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Stmt: &ast.StmtStmtList{ @@ -7627,7 +7627,7 @@ func TestStmtIf_Else(t *testing.T) { EndPos: 9, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -7713,7 +7713,7 @@ func TestStmtIf_ElseElseIf(t *testing.T) { EndPos: 9, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -7755,7 +7755,7 @@ func TestStmtIf_ElseElseIf(t *testing.T) { EndPos: 24, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Stmt: &ast.StmtStmtList{ @@ -7797,7 +7797,7 @@ func TestStmtIf_ElseElseIf(t *testing.T) { EndPos: 39, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, Stmt: &ast.StmtStmtList{ @@ -7885,7 +7885,7 @@ func TestStmtIf_ElseIfElseIfElse(t *testing.T) { EndPos: 9, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -7927,7 +7927,7 @@ func TestStmtIf_ElseIfElseIfElse(t *testing.T) { EndPos: 24, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Stmt: &ast.StmtStmtList{ @@ -7979,7 +7979,7 @@ func TestStmtIf_ElseIfElseIfElse(t *testing.T) { EndPos: 40, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, Stmt: &ast.StmtStmtList{ @@ -8530,7 +8530,7 @@ func TestStmtProperty(t *testing.T) { EndPos: 20, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -8643,7 +8643,7 @@ func TestStmtProperty_Properties(t *testing.T) { EndPos: 30, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -8674,7 +8674,7 @@ func TestStmtProperty_Properties(t *testing.T) { EndPos: 34, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Expr: &ast.ScalarLnumber{ @@ -8798,7 +8798,7 @@ func TestStmtProperty_Properties2(t *testing.T) { EndPos: 30, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ScalarLnumber{ @@ -8840,7 +8840,7 @@ func TestStmtProperty_Properties2(t *testing.T) { EndPos: 38, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -8908,7 +8908,7 @@ func TestStmtStaticVar(t *testing.T) { EndPos: 12, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -8974,7 +8974,7 @@ func TestStmtStaticVar_Vars(t *testing.T) { EndPos: 12, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -9005,7 +9005,7 @@ func TestStmtStaticVar_Vars(t *testing.T) { EndPos: 16, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Expr: &ast.ScalarLnumber{ @@ -9082,7 +9082,7 @@ func TestStmtStaticVar_Vars2(t *testing.T) { EndPos: 12, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ScalarLnumber{ @@ -9124,7 +9124,7 @@ func TestStmtStaticVar_Vars2(t *testing.T) { EndPos: 20, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -9656,7 +9656,7 @@ func TestStmtThrow(t *testing.T) { EndPos: 11, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, }, @@ -10759,7 +10759,7 @@ func TestStmtTry_TryCatch(t *testing.T) { EndPos: 32, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -10854,7 +10854,7 @@ func TestStmtTry_TryCatchCatch(t *testing.T) { EndPos: 32, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -10911,7 +10911,7 @@ func TestStmtTry_TryCatchCatch(t *testing.T) { EndPos: 63, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -11006,7 +11006,7 @@ func TestStmtTry_TryCatchFinally(t *testing.T) { EndPos: 32, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -11110,7 +11110,7 @@ func TestStmtTry_TryCatchCatchCatch(t *testing.T) { EndPos: 29, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -11167,7 +11167,7 @@ func TestStmtTry_TryCatchCatchCatch(t *testing.T) { EndPos: 61, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -11224,7 +11224,7 @@ func TestStmtTry_TryCatchCatchCatch(t *testing.T) { EndPos: 103, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -11282,7 +11282,7 @@ func TestStmtUnset(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -11338,7 +11338,7 @@ func TestStmtUnset_Vars(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, &ast.ExprVariable{ @@ -11359,7 +11359,7 @@ func TestStmtUnset_Vars(t *testing.T) { EndPos: 15, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -12565,7 +12565,7 @@ func TestExprArrayDimFetch(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Dim: &ast.ScalarLnumber{ @@ -12649,7 +12649,7 @@ func TestExprArrayDimFetch_Nested(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Dim: &ast.ScalarLnumber{ @@ -12897,7 +12897,7 @@ func TestExprArray_Items(t *testing.T) { EndPos: 18, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -12965,7 +12965,7 @@ func TestExprBitwiseNot(t *testing.T) { EndPos: 6, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -13029,7 +13029,7 @@ func TestExprBooleanNot(t *testing.T) { EndPos: 6, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -13235,7 +13235,7 @@ func TestExprClone_Brackets(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -13299,7 +13299,7 @@ func TestExprClone(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -13423,7 +13423,7 @@ func TestExprClosure_Use(t *testing.T) { EndPos: 14, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -13456,7 +13456,7 @@ func TestExprClosure_Use(t *testing.T) { EndPos: 18, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -13489,7 +13489,7 @@ func TestExprClosure_Use(t *testing.T) { EndPos: 27, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, &ast.ExprReference{ @@ -13519,7 +13519,7 @@ func TestExprClosure_Use(t *testing.T) { EndPos: 32, }, }, - Value: []byte("d"), + Value: []byte("$d"), }, }, }, @@ -13601,7 +13601,7 @@ func TestExprClosure_Use2(t *testing.T) { EndPos: 14, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -13634,7 +13634,7 @@ func TestExprClosure_Use2(t *testing.T) { EndPos: 18, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -13676,7 +13676,7 @@ func TestExprClosure_Use2(t *testing.T) { EndPos: 28, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, }, @@ -13698,7 +13698,7 @@ func TestExprClosure_Use2(t *testing.T) { EndPos: 32, }, }, - Value: []byte("d"), + Value: []byte("$d"), }, }, }, @@ -13963,7 +13963,7 @@ func TestExprEmpty(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14027,7 +14027,7 @@ func TestExprErrorSuppress(t *testing.T) { EndPos: 6, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14091,7 +14091,7 @@ func TestExprEval(t *testing.T) { EndPos: 10, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14244,7 +14244,7 @@ func TestExprExit_Expr(t *testing.T) { EndPos: 10, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14397,7 +14397,7 @@ func TestExprDie_Expr(t *testing.T) { EndPos: 9, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14714,7 +14714,7 @@ func TestExprFunctionCall_Var(t *testing.T) { EndPos: 7, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, ArgumentList: &ast.ArgumentList{ @@ -14765,7 +14765,7 @@ func TestExprFunctionCall_Var(t *testing.T) { EndPos: 16, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14886,7 +14886,7 @@ func TestExprFunctionCall_ExprArg(t *testing.T) { EndPos: 12, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Right: &ast.ScalarLnumber{ @@ -14965,7 +14965,7 @@ func TestExprPostDec(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15029,7 +15029,7 @@ func TestExprPostInc(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15093,7 +15093,7 @@ func TestExprPreDec(t *testing.T) { EndPos: 7, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15157,7 +15157,7 @@ func TestExprPreInc(t *testing.T) { EndPos: 7, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15221,7 +15221,7 @@ func TestExprInclude(t *testing.T) { EndPos: 13, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15285,7 +15285,7 @@ func TestExprInclude_Once(t *testing.T) { EndPos: 18, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15349,7 +15349,7 @@ func TestExprRequire(t *testing.T) { EndPos: 13, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15413,7 +15413,7 @@ func TestExprRequire_Once(t *testing.T) { EndPos: 18, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15477,7 +15477,7 @@ func TestExprInstanceOf(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Class: &ast.NameName{ @@ -15564,7 +15564,7 @@ func TestExprInstanceOf_Relative(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Class: &ast.NameRelative{ @@ -15651,7 +15651,7 @@ func TestExprInstanceOf_FullyQualified(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Class: &ast.NameFullyQualified{ @@ -15739,7 +15739,7 @@ func TestExprIsset(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15805,7 +15805,7 @@ func TestExprIsset_Variables(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, &ast.ExprVariable{ @@ -15826,7 +15826,7 @@ func TestExprIsset_Variables(t *testing.T) { EndPos: 15, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15902,7 +15902,7 @@ func TestExprList_Empty(t *testing.T) { EndPos: 14, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15985,7 +15985,7 @@ func TestExprList(t *testing.T) { EndPos: 10, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -16009,7 +16009,7 @@ func TestExprList(t *testing.T) { EndPos: 16, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16101,7 +16101,7 @@ func TestExprList_ArrayIndex(t *testing.T) { EndPos: 10, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -16126,7 +16126,7 @@ func TestExprList_ArrayIndex(t *testing.T) { EndPos: 18, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16228,7 +16228,7 @@ func TestExprList_List(t *testing.T) { EndPos: 15, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -16255,7 +16255,7 @@ func TestExprList_List(t *testing.T) { EndPos: 22, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16339,7 +16339,7 @@ func TestExprList_EmptyItem(t *testing.T) { EndPos: 12, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -16363,7 +16363,7 @@ func TestExprList_EmptyItem(t *testing.T) { EndPos: 18, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16448,7 +16448,7 @@ func TestExprList_EmptyItems(t *testing.T) { EndPos: 14, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -16473,7 +16473,7 @@ func TestExprList_EmptyItems(t *testing.T) { EndPos: 22, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16537,7 +16537,7 @@ func TestExprMethodCall(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Method: &ast.Identifier{ @@ -16840,7 +16840,7 @@ func TestExprPrint(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -16904,7 +16904,7 @@ func TestExprPropertyFetch(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Property: &ast.Identifier{ @@ -16971,7 +16971,7 @@ func TestExprReference_ForeachWithRef(t *testing.T) { EndPos: 14, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Key: &ast.ExprVariable{ @@ -16992,7 +16992,7 @@ func TestExprReference_ForeachWithRef(t *testing.T) { EndPos: 20, }, }, - Value: []byte("k"), + Value: []byte("$k"), }, }, Var: &ast.ExprReference{ @@ -17022,7 +17022,7 @@ func TestExprReference_ForeachWithRef(t *testing.T) { EndPos: 27, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, }, @@ -17109,7 +17109,7 @@ func TestExprShellExec(t *testing.T) { EndPos: 10, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -17335,7 +17335,7 @@ func TestExprShortArray_Items(t *testing.T) { EndPos: 13, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17687,7 +17687,7 @@ func TestExprStaticCall_Var(t *testing.T) { EndPos: 12, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, ArgumentList: &ast.ArgumentList{ @@ -17761,7 +17761,7 @@ func TestExprStaticCall_VarVar(t *testing.T) { EndPos: 7, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Call: &ast.ExprVariable{ @@ -17782,7 +17782,7 @@ func TestExprStaticCall_VarVar(t *testing.T) { EndPos: 13, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, ArgumentList: &ast.ArgumentList{ @@ -17879,7 +17879,7 @@ func TestExprStaticPropertyFetch(t *testing.T) { EndPos: 12, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -17966,7 +17966,7 @@ func TestExprStaticPropertyFetch_Relative(t *testing.T) { EndPos: 22, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -18053,7 +18053,7 @@ func TestExprStaticPropertyFetch_FullyQualified(t *testing.T) { EndPos: 13, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -18117,7 +18117,7 @@ func TestExprTernary(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, IfTrue: &ast.ExprVariable{ @@ -18138,7 +18138,7 @@ func TestExprTernary(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, IfFalse: &ast.ExprVariable{ @@ -18159,7 +18159,7 @@ func TestExprTernary(t *testing.T) { EndPos: 15, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, }, @@ -18223,7 +18223,7 @@ func TestExprTernary_Simple(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, IfFalse: &ast.ExprVariable{ @@ -18244,7 +18244,7 @@ func TestExprTernary_Simple(t *testing.T) { EndPos: 12, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, }, @@ -18308,7 +18308,7 @@ func TestExprTernary_NestedTrue(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, IfTrue: &ast.ExprTernary{ @@ -18338,7 +18338,7 @@ func TestExprTernary_NestedTrue(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, IfTrue: &ast.ExprVariable{ @@ -18359,7 +18359,7 @@ func TestExprTernary_NestedTrue(t *testing.T) { EndPos: 15, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, IfFalse: &ast.ExprVariable{ @@ -18380,7 +18380,7 @@ func TestExprTernary_NestedTrue(t *testing.T) { EndPos: 20, }, }, - Value: []byte("d"), + Value: []byte("$d"), }, }, }, @@ -18402,7 +18402,7 @@ func TestExprTernary_NestedTrue(t *testing.T) { EndPos: 25, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, }, @@ -18475,7 +18475,7 @@ func TestExprTernary_NestedCond(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, IfTrue: &ast.ExprVariable{ @@ -18496,7 +18496,7 @@ func TestExprTernary_NestedCond(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, IfFalse: &ast.ExprVariable{ @@ -18517,7 +18517,7 @@ func TestExprTernary_NestedCond(t *testing.T) { EndPos: 15, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, }, @@ -18539,7 +18539,7 @@ func TestExprTernary_NestedCond(t *testing.T) { EndPos: 20, }, }, - Value: []byte("d"), + Value: []byte("$d"), }, }, IfFalse: &ast.ExprVariable{ @@ -18560,7 +18560,7 @@ func TestExprTernary_NestedCond(t *testing.T) { EndPos: 25, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, }, @@ -18624,7 +18624,7 @@ func TestExprUnaryMinus(t *testing.T) { EndPos: 6, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -18688,7 +18688,7 @@ func TestExprUnaryPlus(t *testing.T) { EndPos: 6, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -18743,7 +18743,7 @@ func TestExprVariable(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -18806,7 +18806,7 @@ func TestExprVariable_Variable(t *testing.T) { EndPos: 6, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -18913,7 +18913,7 @@ func TestExprYield_Val(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -18977,7 +18977,7 @@ func TestExprYield_KeyVal(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Value: &ast.ExprVariable{ @@ -18998,7 +18998,7 @@ func TestExprYield_KeyVal(t *testing.T) { EndPos: 17, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -19116,7 +19116,7 @@ func TestExprYield_KeyExpr(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Value: &ast.ScalarLnumber{ @@ -19193,7 +19193,7 @@ func TestExprAssign_Assign(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -19214,7 +19214,7 @@ func TestExprAssign_Assign(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -19278,7 +19278,7 @@ func TestExprAssign_Reference(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -19299,7 +19299,7 @@ func TestExprAssign_Reference(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -19363,7 +19363,7 @@ func TestExprAssign_ReferenceNew(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprNew{ @@ -19460,7 +19460,7 @@ func TestExprAssign_ReferenceArgs(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprNew{ @@ -19534,7 +19534,7 @@ func TestExprAssign_ReferenceArgs(t *testing.T) { EndPos: 19, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -19602,7 +19602,7 @@ func TestExprAssign_BitwiseAnd(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -19623,7 +19623,7 @@ func TestExprAssign_BitwiseAnd(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -19687,7 +19687,7 @@ func TestExprAssign_BitwiseOr(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -19708,7 +19708,7 @@ func TestExprAssign_BitwiseOr(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -19772,7 +19772,7 @@ func TestExprAssign_BitwiseXor(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -19793,7 +19793,7 @@ func TestExprAssign_BitwiseXor(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -19857,7 +19857,7 @@ func TestExprAssign_Concat(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -19878,7 +19878,7 @@ func TestExprAssign_Concat(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -19942,7 +19942,7 @@ func TestExprAssign_Div(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -19963,7 +19963,7 @@ func TestExprAssign_Div(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -20027,7 +20027,7 @@ func TestExprAssign_Minus(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -20048,7 +20048,7 @@ func TestExprAssign_Minus(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -20112,7 +20112,7 @@ func TestExprAssign_Mod(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -20133,7 +20133,7 @@ func TestExprAssign_Mod(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -20197,7 +20197,7 @@ func TestExprAssign_Mul(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -20218,7 +20218,7 @@ func TestExprAssign_Mul(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -20282,7 +20282,7 @@ func TestExprAssign_Plus(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -20303,7 +20303,7 @@ func TestExprAssign_Plus(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -20367,7 +20367,7 @@ func TestExprAssign_Pow(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -20388,7 +20388,7 @@ func TestExprAssign_Pow(t *testing.T) { EndPos: 12, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -20452,7 +20452,7 @@ func TestExprAssign_ShiftLeft(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -20473,7 +20473,7 @@ func TestExprAssign_ShiftLeft(t *testing.T) { EndPos: 12, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -20537,7 +20537,7 @@ func TestExprAssign_ShiftRight(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -20558,7 +20558,7 @@ func TestExprAssign_ShiftRight(t *testing.T) { EndPos: 12, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -20624,7 +20624,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -20645,7 +20645,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -20709,7 +20709,7 @@ func TestExprBinary_BitwiseOr(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -20730,7 +20730,7 @@ func TestExprBinary_BitwiseOr(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -20794,7 +20794,7 @@ func TestExprBinary_BitwiseXor(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -20815,7 +20815,7 @@ func TestExprBinary_BitwiseXor(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -20879,7 +20879,7 @@ func TestExprBinary_BooleanAnd(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -20900,7 +20900,7 @@ func TestExprBinary_BooleanAnd(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -20964,7 +20964,7 @@ func TestExprBinary_BooleanOr(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -20985,7 +20985,7 @@ func TestExprBinary_BooleanOr(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -21049,7 +21049,7 @@ func TestExprBinary_Concat(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -21070,7 +21070,7 @@ func TestExprBinary_Concat(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -21134,7 +21134,7 @@ func TestExprBinary_Div(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -21155,7 +21155,7 @@ func TestExprBinary_Div(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -21219,7 +21219,7 @@ func TestExprBinary_Equal(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -21240,7 +21240,7 @@ func TestExprBinary_Equal(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -21304,7 +21304,7 @@ func TestExprBinary_GreaterOrEqual(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -21325,7 +21325,7 @@ func TestExprBinary_GreaterOrEqual(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -21389,7 +21389,7 @@ func TestExprBinary_Greater(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -21410,7 +21410,7 @@ func TestExprBinary_Greater(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -21474,7 +21474,7 @@ func TestExprBinary_Identical(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -21495,7 +21495,7 @@ func TestExprBinary_Identical(t *testing.T) { EndPos: 12, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -21559,7 +21559,7 @@ func TestExprBinary_LogicalAnd(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -21580,7 +21580,7 @@ func TestExprBinary_LogicalAnd(t *testing.T) { EndPos: 12, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -21644,7 +21644,7 @@ func TestExprBinary_LogicalOr(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -21665,7 +21665,7 @@ func TestExprBinary_LogicalOr(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -21729,7 +21729,7 @@ func TestExprBinary_LogicalXor(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -21750,7 +21750,7 @@ func TestExprBinary_LogicalXor(t *testing.T) { EndPos: 12, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -21814,7 +21814,7 @@ func TestExprBinary_Minus(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -21835,7 +21835,7 @@ func TestExprBinary_Minus(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -21899,7 +21899,7 @@ func TestExprBinary_Mod(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -21920,7 +21920,7 @@ func TestExprBinary_Mod(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -21984,7 +21984,7 @@ func TestExprBinary_Mul(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -22005,7 +22005,7 @@ func TestExprBinary_Mul(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -22069,7 +22069,7 @@ func TestExprBinary_NotEqual(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -22090,7 +22090,7 @@ func TestExprBinary_NotEqual(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -22154,7 +22154,7 @@ func TestExprBinary_NotIdentical(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -22175,7 +22175,7 @@ func TestExprBinary_NotIdentical(t *testing.T) { EndPos: 12, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -22239,7 +22239,7 @@ func TestExprBinary_Plus(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -22260,7 +22260,7 @@ func TestExprBinary_Plus(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -22324,7 +22324,7 @@ func TestExprBinary_Pow(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -22345,7 +22345,7 @@ func TestExprBinary_Pow(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -22409,7 +22409,7 @@ func TestExprBinary_ShiftLeft(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -22430,7 +22430,7 @@ func TestExprBinary_ShiftLeft(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -22494,7 +22494,7 @@ func TestExprBinary_ShiftRight(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -22515,7 +22515,7 @@ func TestExprBinary_ShiftRight(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -22579,7 +22579,7 @@ func TestExprBinary_SmallerOrEqual(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -22600,7 +22600,7 @@ func TestExprBinary_SmallerOrEqual(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -22664,7 +22664,7 @@ func TestExprBinary_Smaller(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -22685,7 +22685,7 @@ func TestExprBinary_Smaller(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -22751,7 +22751,7 @@ func TestExprCast_Array(t *testing.T) { EndPos: 12, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -22815,7 +22815,7 @@ func TestExprCast_Bool(t *testing.T) { EndPos: 14, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -22879,7 +22879,7 @@ func TestExprCast_BoolShort(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -22943,7 +22943,7 @@ func TestExprCast_Double(t *testing.T) { EndPos: 13, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -23007,7 +23007,7 @@ func TestExprCast_CastFloat(t *testing.T) { EndPos: 12, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -23071,7 +23071,7 @@ func TestExprCast_Int(t *testing.T) { EndPos: 14, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -23135,7 +23135,7 @@ func TestExprCast_IntShort(t *testing.T) { EndPos: 10, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -23199,7 +23199,7 @@ func TestExprCast_Object(t *testing.T) { EndPos: 13, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -23263,7 +23263,7 @@ func TestExprCast_String(t *testing.T) { EndPos: 13, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -23327,7 +23327,7 @@ func TestExprCast_BinaryString(t *testing.T) { EndPos: 13, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -23391,7 +23391,7 @@ func TestExprCast_Unset(t *testing.T) { EndPos: 12, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 22e8d54..01c6d9d 100644 Binary files a/internal/php5/php5.go and b/internal/php5/php5.go differ diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 7b05f37..07a2c3b 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -1418,7 +1418,7 @@ catch_statement: } | T_CATCH '(' fully_qualified_class_name T_VARIABLE ')' '{' inner_statement_list '}' additional_catches { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($4.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $4.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} catchNode := &ast.StmtCatch{ast.Node{}, []ast.Vertex{$3}, variable, $7} $$ = append([]ast.Vertex{catchNode}, $9...) @@ -1432,7 +1432,6 @@ catch_statement: yylex.(*Parser).setFreeFloating(catchNode, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating(catchNode, token.Catch, $2.Hidden) yylex.(*Parser).setFreeFloating(variable, token.Start, $4.Hidden) - yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating(catchNode, token.Var, $5.Hidden) yylex.(*Parser).setFreeFloating(catchNode, token.Cond, $6.Hidden) yylex.(*Parser).setFreeFloating(catchNode, token.Stmts, $8.Hidden) @@ -1497,7 +1496,7 @@ non_empty_additional_catches: additional_catch: T_CATCH '(' fully_qualified_class_name T_VARIABLE ')' '{' inner_statement_list '}' { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($4.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $4.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} $$ = &ast.StmtCatch{ast.Node{}, []ast.Vertex{$3}, variable, $7} @@ -1510,7 +1509,6 @@ additional_catch: yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating($$, token.Catch, $2.Hidden) yylex.(*Parser).setFreeFloating(variable, token.Start, $4.Hidden) - yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating($$, token.Var, $5.Hidden) yylex.(*Parser).setFreeFloating($$, token.Cond, $6.Hidden) yylex.(*Parser).setFreeFloating($$, token.Stmts, $8.Hidden) @@ -2284,7 +2282,7 @@ non_empty_parameter_list: parameter: optional_class_type is_reference is_variadic T_VARIABLE { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($4.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $4.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} $$ = &ast.Parameter{ast.Node{}, $2 != nil, $3 != nil, $1, variable, nil} @@ -2312,7 +2310,6 @@ parameter: yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Hidden) } yylex.(*Parser).setFreeFloating($$, token.Variadic, $4.Hidden) - yylex.(*Parser).addDollarToken(variable) // normalize if $3 == nil { @@ -2329,7 +2326,7 @@ parameter: } | optional_class_type is_reference is_variadic T_VARIABLE '=' static_scalar { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($4.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $4.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} $$ = &ast.Parameter{ast.Node{}, $2 != nil, $3 != nil, $1, variable, $6} @@ -2358,7 +2355,6 @@ parameter: } yylex.(*Parser).setFreeFloating($$, token.Variadic, $4.Hidden) yylex.(*Parser).setFreeFloating($$, token.Var, $5.Hidden) - yylex.(*Parser).addDollarToken(variable) // normalize if $3 == nil { @@ -2552,7 +2548,7 @@ global_var_list: global_var: T_VARIABLE { - name := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + name := &ast.Identifier{ast.Node{}, $1.Value} $$ = &ast.ExprVariable{ast.Node{}, name} // save position @@ -2561,7 +2557,6 @@ global_var: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2574,7 +2569,6 @@ global_var: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2587,7 +2581,6 @@ global_var: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).setFreeFloating($3, token.Start, append($2.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($2), $3.GetNode().Tokens[token.Start]...)...)) yylex.(*Parser).setFreeFloating($3, token.End, append($3.GetNode().Tokens[token.End], append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)...)) @@ -2599,7 +2592,7 @@ global_var: static_var_list: static_var_list ',' T_VARIABLE { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($3.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $3.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} staticVar := &ast.StmtStaticVar{ast.Node{}, variable, nil} $$ = append($1, staticVar) @@ -2611,14 +2604,13 @@ static_var_list: // save comments yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) - yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating(staticVar, token.Start, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_var_list ',' T_VARIABLE '=' static_scalar { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($3.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $3.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} staticVar := &ast.StmtStaticVar{ast.Node{}, variable, $5} $$ = append($1, staticVar) @@ -2630,7 +2622,6 @@ static_var_list: // save comments yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) - yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating(staticVar, token.Start, $3.Hidden) yylex.(*Parser).setFreeFloating(staticVar, token.Var, $4.Hidden) @@ -2638,7 +2629,7 @@ static_var_list: } | T_VARIABLE { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $1.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} staticVar := &ast.StmtStaticVar{ast.Node{}, variable, nil} $$ = []ast.Vertex{staticVar} @@ -2649,14 +2640,13 @@ static_var_list: staticVar.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating(staticVar, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_VARIABLE '=' static_scalar { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $1.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} staticVar := &ast.StmtStaticVar{ast.Node{}, variable, $3} $$ = []ast.Vertex{staticVar} @@ -2667,7 +2657,6 @@ static_var_list: staticVar.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating(staticVar, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating(staticVar, token.Var, $2.Hidden) @@ -3154,7 +3143,7 @@ member_modifier: class_variable_declaration: class_variable_declaration ',' T_VARIABLE { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($3.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $3.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} property := &ast.StmtProperty{ast.Node{}, variable, nil} $$ = append($1, property) @@ -3165,7 +3154,6 @@ class_variable_declaration: property.GetNode().Position = position.NewTokenPosition($3) // save comments - yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).setFreeFloating(property, token.Start, $3.Hidden) @@ -3173,7 +3161,7 @@ class_variable_declaration: } | class_variable_declaration ',' T_VARIABLE '=' static_scalar { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($3.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $3.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} property := &ast.StmtProperty{ast.Node{}, variable, $5} $$ = append($1, property) @@ -3185,7 +3173,6 @@ class_variable_declaration: // save comments yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) - yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating(property, token.Start, $3.Hidden) yylex.(*Parser).setFreeFloating(property, token.Var, $4.Hidden) @@ -3193,7 +3180,7 @@ class_variable_declaration: } | T_VARIABLE { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $1.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} property := &ast.StmtProperty{ast.Node{}, variable, nil} $$ = []ast.Vertex{property} @@ -3204,14 +3191,13 @@ class_variable_declaration: property.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating(property, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_VARIABLE '=' static_scalar { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $1.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} property := &ast.StmtProperty{ast.Node{}, variable, $3} $$ = []ast.Vertex{property} @@ -3222,7 +3208,6 @@ class_variable_declaration: property.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating(property, token.Start, $2.Hidden) yylex.(*Parser).setFreeFloating(property, token.Var, $2.Hidden) @@ -4592,7 +4577,7 @@ lexical_vars: lexical_var_list: lexical_var_list ',' T_VARIABLE { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($3.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $3.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} $$ = append($1, variable) @@ -4603,13 +4588,12 @@ lexical_var_list: // save comments yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).setFreeFloating(variable, token.Start, $3.Hidden) - yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | lexical_var_list ',' '&' T_VARIABLE { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($4.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $4.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} reference := &ast.ExprReference{ast.Node{}, variable} $$ = append($1, reference) @@ -4623,13 +4607,12 @@ lexical_var_list: yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).setFreeFloating(reference, token.Start, $3.Hidden) yylex.(*Parser).setFreeFloating(variable, token.Start, $4.Hidden) - yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_VARIABLE { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $1.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} $$ = []ast.Vertex{variable} @@ -4639,13 +4622,12 @@ lexical_var_list: // save comments yylex.(*Parser).setFreeFloating(variable, token.Start, $1.Hidden) - yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '&' T_VARIABLE { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($2.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $2.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} reference := &ast.ExprReference{ast.Node{}, variable} $$ = []ast.Vertex{reference} @@ -4658,7 +4640,6 @@ lexical_var_list: // save comments yylex.(*Parser).setFreeFloating(reference, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating(variable, token.Start, $2.Hidden) - yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6390,7 +6371,7 @@ reference_variable: compound_variable: T_VARIABLE { - name := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + name := &ast.Identifier{ast.Node{}, $1.Value} $$ = &ast.ExprVariable{ast.Node{}, name} // save position @@ -6399,7 +6380,6 @@ compound_variable: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6412,7 +6392,6 @@ compound_variable: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).setFreeFloating($3, token.Start, append($2.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($2), $3.GetNode().Tokens[token.Start]...)...)) yylex.(*Parser).setFreeFloating($3, token.End, append($3.GetNode().Tokens[token.End], append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)...)) @@ -6535,7 +6514,6 @@ simple_indirect_reference: // save comments yylex.(*Parser).setFreeFloating(n, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating(n, token.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6553,9 +6531,8 @@ simple_indirect_reference: // save comments yylex.(*Parser).setFreeFloating(n, token.Start, $2.Hidden) - yylex.(*Parser).setFreeFloating(n, token.Dollar, yylex.(*Parser).GetFreeFloatingToken($2)) - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -6817,7 +6794,7 @@ encaps_list: encaps_var: T_VARIABLE { - name := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + name := &ast.Identifier{ast.Node{}, $1.Value} $$ = &ast.ExprVariable{ast.Node{}, name} // save position @@ -6826,13 +6803,12 @@ encaps_var: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_VARIABLE '[' encaps_var_offset ']' { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $1.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} $$ = &ast.ExprArrayDimFetch{ast.Node{}, variable, $3} @@ -6842,7 +6818,6 @@ encaps_var: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) @@ -6850,7 +6825,7 @@ encaps_var: } | T_VARIABLE T_OBJECT_OPERATOR T_STRING { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $1.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} fetch := &ast.Identifier{ast.Node{}, $3.Value} $$ = &ast.ExprPropertyFetch{ast.Node{}, variable, fetch} @@ -6862,7 +6837,6 @@ encaps_var: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).setFreeFloating(fetch, token.Start, $3.Hidden) @@ -6963,7 +6937,7 @@ encaps_var_offset: } | T_VARIABLE { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $1.Value} $$ = &ast.ExprVariable{ast.Node{}, identifier} // save position @@ -6972,7 +6946,6 @@ encaps_var_offset: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/internal/php5/php5_test.go b/internal/php5/php5_test.go index 5bef94b..6f4d199 100644 --- a/internal/php5/php5_test.go +++ b/internal/php5/php5_test.go @@ -486,7 +486,7 @@ func TestPhp5(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -519,7 +519,7 @@ func TestPhp5(t *testing.T) { EndPos: 18, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -563,7 +563,7 @@ func TestPhp5(t *testing.T) { EndPos: 27, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, ArgumentList: &ast.ArgumentList{ @@ -605,7 +605,7 @@ func TestPhp5(t *testing.T) { EndPos: 30, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -638,7 +638,7 @@ func TestPhp5(t *testing.T) { EndPos: 37, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -682,7 +682,7 @@ func TestPhp5(t *testing.T) { EndPos: 46, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Method: &ast.Identifier{ @@ -735,7 +735,7 @@ func TestPhp5(t *testing.T) { EndPos: 54, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -768,7 +768,7 @@ func TestPhp5(t *testing.T) { EndPos: 61, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -867,7 +867,7 @@ func TestPhp5(t *testing.T) { EndPos: 77, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -900,7 +900,7 @@ func TestPhp5(t *testing.T) { EndPos: 84, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -944,7 +944,7 @@ func TestPhp5(t *testing.T) { EndPos: 93, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Call: &ast.Identifier{ @@ -997,7 +997,7 @@ func TestPhp5(t *testing.T) { EndPos: 101, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -1030,7 +1030,7 @@ func TestPhp5(t *testing.T) { EndPos: 108, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -1118,7 +1118,7 @@ func TestPhp5(t *testing.T) { EndPos: 123, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -1151,7 +1151,7 @@ func TestPhp5(t *testing.T) { EndPos: 130, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -1233,7 +1233,7 @@ func TestPhp5(t *testing.T) { EndPos: 157, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, DefaultValue: &ast.ExprConstFetch{ @@ -1322,7 +1322,7 @@ func TestPhp5(t *testing.T) { EndPos: 176, }, }, - Value: []byte("baz"), + Value: []byte("$baz"), }, }, }, @@ -1437,7 +1437,7 @@ func TestPhp5(t *testing.T) { EndPos: 222, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, DefaultValue: &ast.ExprConstFetch{ @@ -1526,7 +1526,7 @@ func TestPhp5(t *testing.T) { EndPos: 241, }, }, - Value: []byte("baz"), + Value: []byte("$baz"), }, }, }, @@ -1618,7 +1618,7 @@ func TestPhp5(t *testing.T) { EndPos: 266, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, DefaultValue: &ast.ExprConstFetch{ @@ -1707,7 +1707,7 @@ func TestPhp5(t *testing.T) { EndPos: 285, }, }, - Value: []byte("baz"), + Value: []byte("$baz"), }, }, }, @@ -1788,7 +1788,7 @@ func TestPhp5(t *testing.T) { EndPos: 317, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, DefaultValue: &ast.ExprConstFetch{ @@ -1877,7 +1877,7 @@ func TestPhp5(t *testing.T) { EndPos: 336, }, }, - Value: []byte("baz"), + Value: []byte("$baz"), }, }, }, @@ -2248,7 +2248,7 @@ func TestPhp5(t *testing.T) { EndPos: 703, }, }, - Value: []byte("var"), + Value: []byte("$var"), }, }, }, @@ -2311,7 +2311,7 @@ func TestPhp5(t *testing.T) { EndPos: 718, }, }, - Value: []byte("var"), + Value: []byte("$var"), }, }, Dim: &ast.ScalarLnumber{ @@ -2386,7 +2386,7 @@ func TestPhp5(t *testing.T) { EndPos: 736, }, }, - Value: []byte("var"), + Value: []byte("$var"), }, }, Dim: &ast.ScalarString{ @@ -2461,7 +2461,7 @@ func TestPhp5(t *testing.T) { EndPos: 793, }, }, - Value: []byte("var"), + Value: []byte("$var"), }, }, Dim: &ast.ScalarString{ @@ -2536,7 +2536,7 @@ func TestPhp5(t *testing.T) { EndPos: 813, }, }, - Value: []byte("var"), + Value: []byte("$var"), }, }, Dim: &ast.ExprVariable{ @@ -2557,7 +2557,7 @@ func TestPhp5(t *testing.T) { EndPos: 818, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -2601,7 +2601,7 @@ func TestPhp5(t *testing.T) { EndPos: 829, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, &ast.ScalarEncapsedStringPart{ @@ -2633,7 +2633,7 @@ func TestPhp5(t *testing.T) { EndPos: 834, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -2696,7 +2696,7 @@ func TestPhp5(t *testing.T) { EndPos: 849, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Property: &ast.Identifier{ @@ -2911,7 +2911,7 @@ func TestPhp5(t *testing.T) { EndPos: 909, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Method: &ast.Identifier{ @@ -2966,7 +2966,7 @@ func TestPhp5(t *testing.T) { EndPos: 929, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -3008,7 +3008,7 @@ func TestPhp5(t *testing.T) { EndPos: 950, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -3050,7 +3050,7 @@ func TestPhp5(t *testing.T) { EndPos: 966, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Stmt: &ast.StmtStmtList{ @@ -3094,7 +3094,7 @@ func TestPhp5(t *testing.T) { EndPos: 986, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -3157,7 +3157,7 @@ func TestPhp5(t *testing.T) { EndPos: 1015, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -3199,7 +3199,7 @@ func TestPhp5(t *testing.T) { EndPos: 1031, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Stmt: &ast.StmtStmtList{ @@ -3241,7 +3241,7 @@ func TestPhp5(t *testing.T) { EndPos: 1046, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, Stmt: &ast.StmtStmtList{ @@ -4600,7 +4600,7 @@ func TestPhp5(t *testing.T) { EndPos: 1740, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, &ast.ScalarLnumber{ @@ -4644,7 +4644,7 @@ func TestPhp5(t *testing.T) { EndPos: 1754, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -4686,7 +4686,7 @@ func TestPhp5(t *testing.T) { EndPos: 1765, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, Expr: &ast.ScalarLnumber{ @@ -4730,7 +4730,7 @@ func TestPhp5(t *testing.T) { EndPos: 1773, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, Right: &ast.ScalarLnumber{ @@ -4774,7 +4774,7 @@ func TestPhp5(t *testing.T) { EndPos: 1782, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, }, @@ -4805,7 +4805,7 @@ func TestPhp5(t *testing.T) { EndPos: 1788, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, }, @@ -4859,7 +4859,7 @@ func TestPhp5(t *testing.T) { EndPos: 1805, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, Right: &ast.ScalarLnumber{ @@ -4903,7 +4903,7 @@ func TestPhp5(t *testing.T) { EndPos: 1814, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, }, @@ -4947,7 +4947,7 @@ func TestPhp5(t *testing.T) { EndPos: 1841, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Var: &ast.ExprVariable{ @@ -4968,7 +4968,7 @@ func TestPhp5(t *testing.T) { EndPos: 1847, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, Stmt: &ast.StmtStmtList{ @@ -5021,7 +5021,7 @@ func TestPhp5(t *testing.T) { EndPos: 1871, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, Stmt: &ast.StmtStmtList{ @@ -5063,7 +5063,7 @@ func TestPhp5(t *testing.T) { EndPos: 1889, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Var: &ast.ExprVariable{ @@ -5084,7 +5084,7 @@ func TestPhp5(t *testing.T) { EndPos: 1895, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, Stmt: &ast.StmtStmtList{ @@ -5126,7 +5126,7 @@ func TestPhp5(t *testing.T) { EndPos: 1924, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Key: &ast.ExprVariable{ @@ -5147,7 +5147,7 @@ func TestPhp5(t *testing.T) { EndPos: 1930, }, }, - Value: []byte("k"), + Value: []byte("$k"), }, }, Var: &ast.ExprVariable{ @@ -5168,7 +5168,7 @@ func TestPhp5(t *testing.T) { EndPos: 1936, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, Stmt: &ast.StmtStmtList{ @@ -5221,7 +5221,7 @@ func TestPhp5(t *testing.T) { EndPos: 1960, }, }, - Value: []byte("k"), + Value: []byte("$k"), }, }, Var: &ast.ExprVariable{ @@ -5242,7 +5242,7 @@ func TestPhp5(t *testing.T) { EndPos: 1966, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, Stmt: &ast.StmtStmtList{ @@ -5284,7 +5284,7 @@ func TestPhp5(t *testing.T) { EndPos: 1984, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Key: &ast.ExprVariable{ @@ -5305,7 +5305,7 @@ func TestPhp5(t *testing.T) { EndPos: 1990, }, }, - Value: []byte("k"), + Value: []byte("$k"), }, }, Var: &ast.ExprReference{ @@ -5335,7 +5335,7 @@ func TestPhp5(t *testing.T) { EndPos: 1997, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, }, @@ -5378,7 +5378,7 @@ func TestPhp5(t *testing.T) { EndPos: 2015, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Key: &ast.ExprVariable{ @@ -5399,7 +5399,7 @@ func TestPhp5(t *testing.T) { EndPos: 2021, }, }, - Value: []byte("k"), + Value: []byte("$k"), }, }, Var: &ast.ExprList{ @@ -5439,7 +5439,7 @@ func TestPhp5(t *testing.T) { EndPos: 2032, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, }, @@ -5574,7 +5574,7 @@ func TestPhp5(t *testing.T) { EndPos: 2127, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -5642,7 +5642,7 @@ func TestPhp5(t *testing.T) { EndPos: 2159, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -5686,7 +5686,7 @@ func TestPhp5(t *testing.T) { EndPos: 2172, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -5800,7 +5800,7 @@ func TestPhp5(t *testing.T) { EndPos: 2246, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, &ast.ExprVariable{ @@ -5821,7 +5821,7 @@ func TestPhp5(t *testing.T) { EndPos: 2250, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, &ast.ExprVariable{ @@ -5851,7 +5851,7 @@ func TestPhp5(t *testing.T) { EndPos: 2255, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, }, @@ -5979,7 +5979,7 @@ func TestPhp5(t *testing.T) { EndPos: 2291, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -6021,7 +6021,7 @@ func TestPhp5(t *testing.T) { EndPos: 2304, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -6063,7 +6063,7 @@ func TestPhp5(t *testing.T) { EndPos: 2319, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Stmt: &ast.StmtStmtList{ @@ -6107,7 +6107,7 @@ func TestPhp5(t *testing.T) { EndPos: 2332, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -6170,7 +6170,7 @@ func TestPhp5(t *testing.T) { EndPos: 2353, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -6212,7 +6212,7 @@ func TestPhp5(t *testing.T) { EndPos: 2368, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Stmt: &ast.StmtStmtList{ @@ -6254,7 +6254,7 @@ func TestPhp5(t *testing.T) { EndPos: 2383, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, Stmt: &ast.StmtStmtList{ @@ -6319,7 +6319,7 @@ func TestPhp5(t *testing.T) { EndPos: 2404, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -6361,7 +6361,7 @@ func TestPhp5(t *testing.T) { EndPos: 2419, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Stmt: &ast.StmtStmtList{ @@ -6413,7 +6413,7 @@ func TestPhp5(t *testing.T) { EndPos: 2435, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, Stmt: &ast.StmtStmtList{ @@ -6791,7 +6791,7 @@ func TestPhp5(t *testing.T) { EndPos: 2628, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -6881,7 +6881,7 @@ func TestPhp5(t *testing.T) { EndPos: 2660, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -6912,7 +6912,7 @@ func TestPhp5(t *testing.T) { EndPos: 2664, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Expr: &ast.ScalarLnumber{ @@ -7013,7 +7013,7 @@ func TestPhp5(t *testing.T) { EndPos: 2700, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ScalarLnumber{ @@ -7055,7 +7055,7 @@ func TestPhp5(t *testing.T) { EndPos: 2708, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -7100,7 +7100,7 @@ func TestPhp5(t *testing.T) { EndPos: 2722, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -7131,7 +7131,7 @@ func TestPhp5(t *testing.T) { EndPos: 2726, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Expr: &ast.ScalarLnumber{ @@ -7185,7 +7185,7 @@ func TestPhp5(t *testing.T) { EndPos: 2743, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ScalarLnumber{ @@ -7227,7 +7227,7 @@ func TestPhp5(t *testing.T) { EndPos: 2751, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -7623,7 +7623,7 @@ func TestPhp5(t *testing.T) { EndPos: 2995, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, }, @@ -8424,7 +8424,7 @@ func TestPhp5(t *testing.T) { EndPos: 3287, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -8494,7 +8494,7 @@ func TestPhp5(t *testing.T) { EndPos: 3320, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -8551,7 +8551,7 @@ func TestPhp5(t *testing.T) { EndPos: 3351, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -8621,7 +8621,7 @@ func TestPhp5(t *testing.T) { EndPos: 3384, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -8678,7 +8678,7 @@ func TestPhp5(t *testing.T) { EndPos: 3416, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -8735,7 +8735,7 @@ func TestPhp5(t *testing.T) { EndPos: 3458, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -8805,7 +8805,7 @@ func TestPhp5(t *testing.T) { EndPos: 3491, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -8851,7 +8851,7 @@ func TestPhp5(t *testing.T) { EndPos: 3518, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, &ast.ExprVariable{ @@ -8872,7 +8872,7 @@ func TestPhp5(t *testing.T) { EndPos: 3522, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -9626,7 +9626,7 @@ func TestPhp5(t *testing.T) { EndPos: 3738, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Dim: &ast.ScalarLnumber{ @@ -9687,7 +9687,7 @@ func TestPhp5(t *testing.T) { EndPos: 3747, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Dim: &ast.ScalarLnumber{ @@ -9866,7 +9866,7 @@ func TestPhp5(t *testing.T) { EndPos: 3795, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -9941,7 +9941,7 @@ func TestPhp5(t *testing.T) { EndPos: 3814, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -10004,7 +10004,7 @@ func TestPhp5(t *testing.T) { EndPos: 3828, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -10109,7 +10109,7 @@ func TestPhp5(t *testing.T) { EndPos: 3846, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -10153,7 +10153,7 @@ func TestPhp5(t *testing.T) { EndPos: 3854, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -10194,7 +10194,7 @@ func TestPhp5(t *testing.T) { EndPos: 3861, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -10289,7 +10289,7 @@ func TestPhp5(t *testing.T) { EndPos: 3886, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -10330,7 +10330,7 @@ func TestPhp5(t *testing.T) { EndPos: 3899, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -10408,7 +10408,7 @@ func TestPhp5(t *testing.T) { EndPos: 3930, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -10441,7 +10441,7 @@ func TestPhp5(t *testing.T) { EndPos: 3934, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -10474,7 +10474,7 @@ func TestPhp5(t *testing.T) { EndPos: 3943, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, &ast.ExprReference{ @@ -10504,7 +10504,7 @@ func TestPhp5(t *testing.T) { EndPos: 3948, }, }, - Value: []byte("d"), + Value: []byte("$d"), }, }, }, @@ -10563,7 +10563,7 @@ func TestPhp5(t *testing.T) { EndPos: 3967, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -10596,7 +10596,7 @@ func TestPhp5(t *testing.T) { EndPos: 3971, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -10638,7 +10638,7 @@ func TestPhp5(t *testing.T) { EndPos: 3981, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, }, @@ -10660,7 +10660,7 @@ func TestPhp5(t *testing.T) { EndPos: 3985, }, }, - Value: []byte("d"), + Value: []byte("$d"), }, }, }, @@ -10856,7 +10856,7 @@ func TestPhp5(t *testing.T) { EndPos: 4051, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -10950,7 +10950,7 @@ func TestPhp5(t *testing.T) { EndPos: 4073, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -10991,7 +10991,7 @@ func TestPhp5(t *testing.T) { EndPos: 4084, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -11054,7 +11054,7 @@ func TestPhp5(t *testing.T) { EndPos: 4104, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -11117,7 +11117,7 @@ func TestPhp5(t *testing.T) { EndPos: 4124, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -11255,7 +11255,7 @@ func TestPhp5(t *testing.T) { EndPos: 4155, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -11377,7 +11377,7 @@ func TestPhp5(t *testing.T) { EndPos: 4176, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, ArgumentList: &ast.ArgumentList{ @@ -11428,7 +11428,7 @@ func TestPhp5(t *testing.T) { EndPos: 4185, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -11473,7 +11473,7 @@ func TestPhp5(t *testing.T) { EndPos: 4193, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -11514,7 +11514,7 @@ func TestPhp5(t *testing.T) { EndPos: 4201, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -11555,7 +11555,7 @@ func TestPhp5(t *testing.T) { EndPos: 4211, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -11596,7 +11596,7 @@ func TestPhp5(t *testing.T) { EndPos: 4219, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -11637,7 +11637,7 @@ func TestPhp5(t *testing.T) { EndPos: 4234, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -11678,7 +11678,7 @@ func TestPhp5(t *testing.T) { EndPos: 4253, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -11719,7 +11719,7 @@ func TestPhp5(t *testing.T) { EndPos: 4267, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -11760,7 +11760,7 @@ func TestPhp5(t *testing.T) { EndPos: 4286, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -11801,7 +11801,7 @@ func TestPhp5(t *testing.T) { EndPos: 4293, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Class: &ast.NameName{ @@ -11865,7 +11865,7 @@ func TestPhp5(t *testing.T) { EndPos: 4314, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Class: &ast.NameRelative{ @@ -11929,7 +11929,7 @@ func TestPhp5(t *testing.T) { EndPos: 4345, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Class: &ast.NameFullyQualified{ @@ -11994,7 +11994,7 @@ func TestPhp5(t *testing.T) { EndPos: 4374, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, &ast.ExprVariable{ @@ -12015,7 +12015,7 @@ func TestPhp5(t *testing.T) { EndPos: 4378, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -12123,7 +12123,7 @@ func TestPhp5(t *testing.T) { EndPos: 4408, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -12183,7 +12183,7 @@ func TestPhp5(t *testing.T) { EndPos: 4419, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -12214,7 +12214,7 @@ func TestPhp5(t *testing.T) { EndPos: 4423, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -12238,7 +12238,7 @@ func TestPhp5(t *testing.T) { EndPos: 4429, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -12307,7 +12307,7 @@ func TestPhp5(t *testing.T) { EndPos: 4440, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -12332,7 +12332,7 @@ func TestPhp5(t *testing.T) { EndPos: 4448, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -12411,7 +12411,7 @@ func TestPhp5(t *testing.T) { EndPos: 4464, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -12438,7 +12438,7 @@ func TestPhp5(t *testing.T) { EndPos: 4471, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -12479,7 +12479,7 @@ func TestPhp5(t *testing.T) { EndPos: 4478, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Method: &ast.Identifier{ @@ -12690,7 +12690,7 @@ func TestPhp5(t *testing.T) { EndPos: 4545, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -12731,7 +12731,7 @@ func TestPhp5(t *testing.T) { EndPos: 4552, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Property: &ast.Identifier{ @@ -12792,7 +12792,7 @@ func TestPhp5(t *testing.T) { EndPos: 4563, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Property: &ast.Identifier{ @@ -12892,7 +12892,7 @@ func TestPhp5(t *testing.T) { EndPos: 4577, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Property: &ast.Identifier{ @@ -13020,7 +13020,7 @@ func TestPhp5(t *testing.T) { EndPos: 4609, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Method: &ast.Identifier{ @@ -13118,7 +13118,7 @@ func TestPhp5(t *testing.T) { EndPos: 4633, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -13329,7 +13329,7 @@ func TestPhp5(t *testing.T) { EndPos: 4676, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -13589,7 +13589,7 @@ func TestPhp5(t *testing.T) { EndPos: 4745, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, ArgumentList: &ast.ArgumentList{ @@ -13640,7 +13640,7 @@ func TestPhp5(t *testing.T) { EndPos: 4755, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Call: &ast.ExprVariable{ @@ -13661,7 +13661,7 @@ func TestPhp5(t *testing.T) { EndPos: 4761, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, ArgumentList: &ast.ArgumentList{ @@ -13735,7 +13735,7 @@ func TestPhp5(t *testing.T) { EndPos: 4776, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -13799,7 +13799,7 @@ func TestPhp5(t *testing.T) { EndPos: 4799, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -13863,7 +13863,7 @@ func TestPhp5(t *testing.T) { EndPos: 4813, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -13904,7 +13904,7 @@ func TestPhp5(t *testing.T) { EndPos: 4819, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, IfTrue: &ast.ExprVariable{ @@ -13925,7 +13925,7 @@ func TestPhp5(t *testing.T) { EndPos: 4824, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, IfFalse: &ast.ExprVariable{ @@ -13946,7 +13946,7 @@ func TestPhp5(t *testing.T) { EndPos: 4829, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, }, @@ -13987,7 +13987,7 @@ func TestPhp5(t *testing.T) { EndPos: 4835, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, IfFalse: &ast.ExprVariable{ @@ -14008,7 +14008,7 @@ func TestPhp5(t *testing.T) { EndPos: 4842, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, }, @@ -14049,7 +14049,7 @@ func TestPhp5(t *testing.T) { EndPos: 4848, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, IfTrue: &ast.ExprTernary{ @@ -14079,7 +14079,7 @@ func TestPhp5(t *testing.T) { EndPos: 4853, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, IfTrue: &ast.ExprVariable{ @@ -14100,7 +14100,7 @@ func TestPhp5(t *testing.T) { EndPos: 4858, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, IfFalse: &ast.ExprVariable{ @@ -14121,7 +14121,7 @@ func TestPhp5(t *testing.T) { EndPos: 4863, }, }, - Value: []byte("d"), + Value: []byte("$d"), }, }, }, @@ -14143,7 +14143,7 @@ func TestPhp5(t *testing.T) { EndPos: 4868, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, }, @@ -14193,7 +14193,7 @@ func TestPhp5(t *testing.T) { EndPos: 4874, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, IfTrue: &ast.ExprVariable{ @@ -14214,7 +14214,7 @@ func TestPhp5(t *testing.T) { EndPos: 4879, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, IfFalse: &ast.ExprVariable{ @@ -14235,7 +14235,7 @@ func TestPhp5(t *testing.T) { EndPos: 4884, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, }, @@ -14257,7 +14257,7 @@ func TestPhp5(t *testing.T) { EndPos: 4889, }, }, - Value: []byte("d"), + Value: []byte("$d"), }, }, IfFalse: &ast.ExprVariable{ @@ -14278,7 +14278,7 @@ func TestPhp5(t *testing.T) { EndPos: 4894, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, }, @@ -14319,7 +14319,7 @@ func TestPhp5(t *testing.T) { EndPos: 4901, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14360,7 +14360,7 @@ func TestPhp5(t *testing.T) { EndPos: 4908, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14401,7 +14401,7 @@ func TestPhp5(t *testing.T) { EndPos: 4915, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14451,7 +14451,7 @@ func TestPhp5(t *testing.T) { EndPos: 4923, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14513,7 +14513,7 @@ func TestPhp5(t *testing.T) { EndPos: 4944, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14554,7 +14554,7 @@ func TestPhp5(t *testing.T) { EndPos: 4956, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Value: &ast.ExprVariable{ @@ -14575,7 +14575,7 @@ func TestPhp5(t *testing.T) { EndPos: 4962, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -14680,7 +14680,7 @@ func TestPhp5(t *testing.T) { EndPos: 4994, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Value: &ast.ExprClassConstFetch{ @@ -14765,7 +14765,7 @@ func TestPhp5(t *testing.T) { EndPos: 5024, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14806,7 +14806,7 @@ func TestPhp5(t *testing.T) { EndPos: 5039, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14847,7 +14847,7 @@ func TestPhp5(t *testing.T) { EndPos: 5051, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14888,7 +14888,7 @@ func TestPhp5(t *testing.T) { EndPos: 5065, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14929,7 +14929,7 @@ func TestPhp5(t *testing.T) { EndPos: 5078, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14970,7 +14970,7 @@ func TestPhp5(t *testing.T) { EndPos: 5093, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15011,7 +15011,7 @@ func TestPhp5(t *testing.T) { EndPos: 5104, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15052,7 +15052,7 @@ func TestPhp5(t *testing.T) { EndPos: 5118, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15093,7 +15093,7 @@ func TestPhp5(t *testing.T) { EndPos: 5132, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15134,7 +15134,7 @@ func TestPhp5(t *testing.T) { EndPos: 5145, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15175,7 +15175,7 @@ func TestPhp5(t *testing.T) { EndPos: 5152, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -15196,7 +15196,7 @@ func TestPhp5(t *testing.T) { EndPos: 5157, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15237,7 +15237,7 @@ func TestPhp5(t *testing.T) { EndPos: 5163, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -15258,7 +15258,7 @@ func TestPhp5(t *testing.T) { EndPos: 5168, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15299,7 +15299,7 @@ func TestPhp5(t *testing.T) { EndPos: 5174, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -15320,7 +15320,7 @@ func TestPhp5(t *testing.T) { EndPos: 5179, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15361,7 +15361,7 @@ func TestPhp5(t *testing.T) { EndPos: 5185, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -15382,7 +15382,7 @@ func TestPhp5(t *testing.T) { EndPos: 5191, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15423,7 +15423,7 @@ func TestPhp5(t *testing.T) { EndPos: 5197, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -15444,7 +15444,7 @@ func TestPhp5(t *testing.T) { EndPos: 5203, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15485,7 +15485,7 @@ func TestPhp5(t *testing.T) { EndPos: 5209, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -15506,7 +15506,7 @@ func TestPhp5(t *testing.T) { EndPos: 5214, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15547,7 +15547,7 @@ func TestPhp5(t *testing.T) { EndPos: 5220, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -15568,7 +15568,7 @@ func TestPhp5(t *testing.T) { EndPos: 5225, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15609,7 +15609,7 @@ func TestPhp5(t *testing.T) { EndPos: 5231, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -15630,7 +15630,7 @@ func TestPhp5(t *testing.T) { EndPos: 5237, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15671,7 +15671,7 @@ func TestPhp5(t *testing.T) { EndPos: 5243, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -15692,7 +15692,7 @@ func TestPhp5(t *testing.T) { EndPos: 5249, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15733,7 +15733,7 @@ func TestPhp5(t *testing.T) { EndPos: 5255, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -15754,7 +15754,7 @@ func TestPhp5(t *testing.T) { EndPos: 5260, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15795,7 +15795,7 @@ func TestPhp5(t *testing.T) { EndPos: 5266, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -15816,7 +15816,7 @@ func TestPhp5(t *testing.T) { EndPos: 5273, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15857,7 +15857,7 @@ func TestPhp5(t *testing.T) { EndPos: 5279, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -15878,7 +15878,7 @@ func TestPhp5(t *testing.T) { EndPos: 5286, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15919,7 +15919,7 @@ func TestPhp5(t *testing.T) { EndPos: 5292, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -15940,7 +15940,7 @@ func TestPhp5(t *testing.T) { EndPos: 5298, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15981,7 +15981,7 @@ func TestPhp5(t *testing.T) { EndPos: 5304, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16002,7 +16002,7 @@ func TestPhp5(t *testing.T) { EndPos: 5311, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16043,7 +16043,7 @@ func TestPhp5(t *testing.T) { EndPos: 5317, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16064,7 +16064,7 @@ func TestPhp5(t *testing.T) { EndPos: 5322, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16105,7 +16105,7 @@ func TestPhp5(t *testing.T) { EndPos: 5328, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16126,7 +16126,7 @@ func TestPhp5(t *testing.T) { EndPos: 5333, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16167,7 +16167,7 @@ func TestPhp5(t *testing.T) { EndPos: 5339, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16188,7 +16188,7 @@ func TestPhp5(t *testing.T) { EndPos: 5344, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16229,7 +16229,7 @@ func TestPhp5(t *testing.T) { EndPos: 5350, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16250,7 +16250,7 @@ func TestPhp5(t *testing.T) { EndPos: 5356, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16291,7 +16291,7 @@ func TestPhp5(t *testing.T) { EndPos: 5362, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16312,7 +16312,7 @@ func TestPhp5(t *testing.T) { EndPos: 5369, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16353,7 +16353,7 @@ func TestPhp5(t *testing.T) { EndPos: 5375, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16374,7 +16374,7 @@ func TestPhp5(t *testing.T) { EndPos: 5380, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16415,7 +16415,7 @@ func TestPhp5(t *testing.T) { EndPos: 5386, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16436,7 +16436,7 @@ func TestPhp5(t *testing.T) { EndPos: 5392, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16477,7 +16477,7 @@ func TestPhp5(t *testing.T) { EndPos: 5398, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16498,7 +16498,7 @@ func TestPhp5(t *testing.T) { EndPos: 5404, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16539,7 +16539,7 @@ func TestPhp5(t *testing.T) { EndPos: 5410, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16560,7 +16560,7 @@ func TestPhp5(t *testing.T) { EndPos: 5416, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16601,7 +16601,7 @@ func TestPhp5(t *testing.T) { EndPos: 5422, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16622,7 +16622,7 @@ func TestPhp5(t *testing.T) { EndPos: 5428, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16663,7 +16663,7 @@ func TestPhp5(t *testing.T) { EndPos: 5434, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16684,7 +16684,7 @@ func TestPhp5(t *testing.T) { EndPos: 5439, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16725,7 +16725,7 @@ func TestPhp5(t *testing.T) { EndPos: 5446, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -16746,7 +16746,7 @@ func TestPhp5(t *testing.T) { EndPos: 5452, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16787,7 +16787,7 @@ func TestPhp5(t *testing.T) { EndPos: 5458, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprNew{ @@ -16861,7 +16861,7 @@ func TestPhp5(t *testing.T) { EndPos: 5475, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprNew{ @@ -16935,7 +16935,7 @@ func TestPhp5(t *testing.T) { EndPos: 5489, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16980,7 +16980,7 @@ func TestPhp5(t *testing.T) { EndPos: 5496, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17001,7 +17001,7 @@ func TestPhp5(t *testing.T) { EndPos: 5501, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17042,7 +17042,7 @@ func TestPhp5(t *testing.T) { EndPos: 5507, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17063,7 +17063,7 @@ func TestPhp5(t *testing.T) { EndPos: 5513, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17104,7 +17104,7 @@ func TestPhp5(t *testing.T) { EndPos: 5519, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17125,7 +17125,7 @@ func TestPhp5(t *testing.T) { EndPos: 5525, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17166,7 +17166,7 @@ func TestPhp5(t *testing.T) { EndPos: 5531, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17187,7 +17187,7 @@ func TestPhp5(t *testing.T) { EndPos: 5537, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17228,7 +17228,7 @@ func TestPhp5(t *testing.T) { EndPos: 5543, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17249,7 +17249,7 @@ func TestPhp5(t *testing.T) { EndPos: 5549, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17290,7 +17290,7 @@ func TestPhp5(t *testing.T) { EndPos: 5555, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17311,7 +17311,7 @@ func TestPhp5(t *testing.T) { EndPos: 5561, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17352,7 +17352,7 @@ func TestPhp5(t *testing.T) { EndPos: 5567, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17373,7 +17373,7 @@ func TestPhp5(t *testing.T) { EndPos: 5573, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17414,7 +17414,7 @@ func TestPhp5(t *testing.T) { EndPos: 5579, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17435,7 +17435,7 @@ func TestPhp5(t *testing.T) { EndPos: 5585, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17476,7 +17476,7 @@ func TestPhp5(t *testing.T) { EndPos: 5591, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17497,7 +17497,7 @@ func TestPhp5(t *testing.T) { EndPos: 5597, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17538,7 +17538,7 @@ func TestPhp5(t *testing.T) { EndPos: 5603, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17559,7 +17559,7 @@ func TestPhp5(t *testing.T) { EndPos: 5609, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17600,7 +17600,7 @@ func TestPhp5(t *testing.T) { EndPos: 5615, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17621,7 +17621,7 @@ func TestPhp5(t *testing.T) { EndPos: 5622, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17662,7 +17662,7 @@ func TestPhp5(t *testing.T) { EndPos: 5628, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17683,7 +17683,7 @@ func TestPhp5(t *testing.T) { EndPos: 5635, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17724,7 +17724,7 @@ func TestPhp5(t *testing.T) { EndPos: 5641, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17745,7 +17745,7 @@ func TestPhp5(t *testing.T) { EndPos: 5648, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -18399,7 +18399,7 @@ func TestPhp5(t *testing.T) { EndPos: 5813, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, }, @@ -18449,7 +18449,7 @@ func TestPhp5(t *testing.T) { EndPos: 5825, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Property: &ast.ExprVariable{ @@ -18470,7 +18470,7 @@ func TestPhp5(t *testing.T) { EndPos: 5831, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -18530,7 +18530,7 @@ func TestPhp5(t *testing.T) { EndPos: 5841, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Property: &ast.Identifier{ @@ -18640,7 +18640,7 @@ func TestPhp5(t *testing.T) { EndPos: 5857, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Property: &ast.Identifier{ @@ -18682,7 +18682,7 @@ func TestPhp5(t *testing.T) { EndPos: 5863, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, IfFalse: &ast.ExprConstFetch{ @@ -18738,7 +18738,7 @@ func TestPhp5(t *testing.T) { EndPos: 5876, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, }, @@ -18805,7 +18805,7 @@ func TestPhp5(t *testing.T) { EndPos: 5892, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprArrayDimFetch{ @@ -18902,7 +18902,7 @@ func TestPhp5(t *testing.T) { EndPos: 5915, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprBooleanNot{ @@ -18966,7 +18966,7 @@ func TestPhp5(t *testing.T) { EndPos: 5933, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprBitwiseNot{ @@ -19030,7 +19030,7 @@ func TestPhp5(t *testing.T) { EndPos: 5951, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprUnaryPlus{ @@ -19094,7 +19094,7 @@ func TestPhp5(t *testing.T) { EndPos: 5969, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprUnaryMinus{ @@ -19158,7 +19158,7 @@ func TestPhp5(t *testing.T) { EndPos: 5987, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ScalarLnumber{ @@ -19212,7 +19212,7 @@ func TestPhp5(t *testing.T) { EndPos: 6006, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprTernary{ @@ -19287,7 +19287,7 @@ func TestPhp5(t *testing.T) { EndPos: 6028, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprTernary{ @@ -19373,7 +19373,7 @@ func TestPhp5(t *testing.T) { EndPos: 6053, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprBinaryBitwiseAnd{ @@ -19448,7 +19448,7 @@ func TestPhp5(t *testing.T) { EndPos: 6074, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprBinaryBitwiseOr{ @@ -19523,7 +19523,7 @@ func TestPhp5(t *testing.T) { EndPos: 6095, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprBinaryBitwiseXor{ @@ -19598,7 +19598,7 @@ func TestPhp5(t *testing.T) { EndPos: 6116, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprBinaryBooleanAnd{ @@ -19673,7 +19673,7 @@ func TestPhp5(t *testing.T) { EndPos: 6138, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprBinaryBooleanOr{ @@ -19748,7 +19748,7 @@ func TestPhp5(t *testing.T) { EndPos: 6160, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprBinaryConcat{ @@ -19823,7 +19823,7 @@ func TestPhp5(t *testing.T) { EndPos: 6181, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprBinaryDiv{ @@ -19898,7 +19898,7 @@ func TestPhp5(t *testing.T) { EndPos: 6202, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprBinaryEqual{ @@ -19973,7 +19973,7 @@ func TestPhp5(t *testing.T) { EndPos: 6224, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprBinaryGreaterOrEqual{ @@ -20048,7 +20048,7 @@ func TestPhp5(t *testing.T) { EndPos: 6246, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprBinaryGreater{ @@ -20123,7 +20123,7 @@ func TestPhp5(t *testing.T) { EndPos: 6267, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprBinaryIdentical{ @@ -20198,7 +20198,7 @@ func TestPhp5(t *testing.T) { EndPos: 6290, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprBinaryLogicalAnd{ @@ -20273,7 +20273,7 @@ func TestPhp5(t *testing.T) { EndPos: 6313, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprBinaryLogicalOr{ @@ -20348,7 +20348,7 @@ func TestPhp5(t *testing.T) { EndPos: 6335, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprBinaryLogicalXor{ @@ -20423,7 +20423,7 @@ func TestPhp5(t *testing.T) { EndPos: 6358, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprBinaryMinus{ @@ -20498,7 +20498,7 @@ func TestPhp5(t *testing.T) { EndPos: 6379, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprBinaryMod{ @@ -20573,7 +20573,7 @@ func TestPhp5(t *testing.T) { EndPos: 6400, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprBinaryMul{ @@ -20648,7 +20648,7 @@ func TestPhp5(t *testing.T) { EndPos: 6421, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprBinaryNotEqual{ @@ -20723,7 +20723,7 @@ func TestPhp5(t *testing.T) { EndPos: 6443, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprBinaryNotIdentical{ @@ -20798,7 +20798,7 @@ func TestPhp5(t *testing.T) { EndPos: 6466, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprBinaryPlus{ @@ -20873,7 +20873,7 @@ func TestPhp5(t *testing.T) { EndPos: 6487, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprBinaryPow{ @@ -20948,7 +20948,7 @@ func TestPhp5(t *testing.T) { EndPos: 6509, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprBinaryShiftLeft{ @@ -21023,7 +21023,7 @@ func TestPhp5(t *testing.T) { EndPos: 6531, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprBinaryShiftRight{ @@ -21098,7 +21098,7 @@ func TestPhp5(t *testing.T) { EndPos: 6553, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprBinarySmallerOrEqual{ @@ -21173,7 +21173,7 @@ func TestPhp5(t *testing.T) { EndPos: 6575, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprBinarySmaller{ @@ -21248,7 +21248,7 @@ func TestPhp5(t *testing.T) { EndPos: 6596, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprClassConstFetch{ @@ -21335,7 +21335,7 @@ func TestPhp5(t *testing.T) { EndPos: 6620, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprClassConstFetch{ @@ -21422,7 +21422,7 @@ func TestPhp5(t *testing.T) { EndPos: 6646, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ScalarMagicConstant{ @@ -21476,7 +21476,7 @@ func TestPhp5(t *testing.T) { EndPos: 6671, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprConstFetch{ @@ -21552,7 +21552,7 @@ func TestPhp5(t *testing.T) { EndPos: 6690, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprConstFetch{ @@ -21628,7 +21628,7 @@ func TestPhp5(t *testing.T) { EndPos: 6719, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprConstFetch{ @@ -21704,7 +21704,7 @@ func TestPhp5(t *testing.T) { EndPos: 6739, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprArray{ @@ -21757,7 +21757,7 @@ func TestPhp5(t *testing.T) { EndPos: 6762, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprArray{ @@ -21865,7 +21865,7 @@ func TestPhp5(t *testing.T) { EndPos: 6794, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprArrayDimFetch{ @@ -22067,7 +22067,7 @@ func TestPhp5(t *testing.T) { EndPos: 6844, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -22109,7 +22109,7 @@ func TestPhp5(t *testing.T) { EndPos: 6853, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, ArgumentList: &ast.ArgumentList{ @@ -22178,7 +22178,7 @@ func TestPhp5(t *testing.T) { EndPos: 6863, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, ArgumentList: &ast.ArgumentList{ @@ -22253,7 +22253,7 @@ func TestPhp5(t *testing.T) { EndPos: 6877, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Dim: &ast.ExprVariable{ @@ -22274,7 +22274,7 @@ func TestPhp5(t *testing.T) { EndPos: 6880, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -22315,7 +22315,7 @@ func TestPhp5(t *testing.T) { EndPos: 6889, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -22356,7 +22356,7 @@ func TestPhp5(t *testing.T) { EndPos: 6898, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Call: &ast.ExprVariable{ @@ -22377,7 +22377,7 @@ func TestPhp5(t *testing.T) { EndPos: 6905, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, ArgumentList: &ast.ArgumentList{ @@ -22428,7 +22428,7 @@ func TestPhp5(t *testing.T) { EndPos: 6916, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, ConstantName: &ast.Identifier{ @@ -22768,7 +22768,7 @@ CAD; EndPos: 85, }, }, - Value: []byte("world"), + Value: []byte("$world"), }, }, &ast.ScalarEncapsedStringPart{ diff --git a/internal/php7/parser.go b/internal/php7/parser.go index c219232..7426278 100644 --- a/internal/php7/parser.go +++ b/internal/php7/parser.go @@ -62,10 +62,6 @@ func lastNode(nn []ast.Vertex) ast.Vertex { return nn[len(nn)-1] } -func isDollar(r rune) bool { - return r == '$' -} - func (p *Parser) MoveFreeFloating(src ast.Vertex, dst ast.Vertex) { if p.withTokens == false { return @@ -109,19 +105,6 @@ func (p *Parser) GetFreeFloatingToken(t *scanner.Token) []token.Token { } } -func (p *Parser) addDollarToken(v ast.Vertex) { - if p.withTokens == false { - return - } - - p.setFreeFloating(v, token.Dollar, []token.Token{ - { - ID: token.ID('$'), - Value: []byte("$"), - }, - }) -} - func (p *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast.Vertex) { if p.withTokens == false { return diff --git a/internal/php7/parser_test.go b/internal/php7/parser_test.go index a7d2ced..05cdefc 100644 --- a/internal/php7/parser_test.go +++ b/internal/php7/parser_test.go @@ -51,7 +51,7 @@ func TestIdentifier(t *testing.T) { EndPos: 7, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, }, @@ -167,7 +167,7 @@ func TestPhp7ArgumentNode(t *testing.T) { EndPos: 12, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -200,7 +200,7 @@ func TestPhp7ArgumentNode(t *testing.T) { EndPos: 19, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -244,7 +244,7 @@ func TestPhp7ArgumentNode(t *testing.T) { EndPos: 28, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, ArgumentList: &ast.ArgumentList{ @@ -286,7 +286,7 @@ func TestPhp7ArgumentNode(t *testing.T) { EndPos: 31, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -319,7 +319,7 @@ func TestPhp7ArgumentNode(t *testing.T) { EndPos: 38, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -363,7 +363,7 @@ func TestPhp7ArgumentNode(t *testing.T) { EndPos: 47, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Method: &ast.Identifier{ @@ -416,7 +416,7 @@ func TestPhp7ArgumentNode(t *testing.T) { EndPos: 55, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -449,7 +449,7 @@ func TestPhp7ArgumentNode(t *testing.T) { EndPos: 62, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -548,7 +548,7 @@ func TestPhp7ArgumentNode(t *testing.T) { EndPos: 78, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -581,7 +581,7 @@ func TestPhp7ArgumentNode(t *testing.T) { EndPos: 85, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -625,7 +625,7 @@ func TestPhp7ArgumentNode(t *testing.T) { EndPos: 94, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Call: &ast.Identifier{ @@ -678,7 +678,7 @@ func TestPhp7ArgumentNode(t *testing.T) { EndPos: 102, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -711,7 +711,7 @@ func TestPhp7ArgumentNode(t *testing.T) { EndPos: 109, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -799,7 +799,7 @@ func TestPhp7ArgumentNode(t *testing.T) { EndPos: 124, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -832,7 +832,7 @@ func TestPhp7ArgumentNode(t *testing.T) { EndPos: 131, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -906,7 +906,7 @@ func TestPhp7ArgumentNode(t *testing.T) { EndPos: 174, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -939,7 +939,7 @@ func TestPhp7ArgumentNode(t *testing.T) { EndPos: 181, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -1061,7 +1061,7 @@ func TestPhp7ParameterNode(t *testing.T) { EndPos: 28, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, DefaultValue: &ast.ExprConstFetch{ @@ -1150,7 +1150,7 @@ func TestPhp7ParameterNode(t *testing.T) { EndPos: 47, }, }, - Value: []byte("baz"), + Value: []byte("$baz"), }, }, }, @@ -1275,7 +1275,7 @@ func TestPhp7ParameterNode(t *testing.T) { EndPos: 94, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, DefaultValue: &ast.ExprConstFetch{ @@ -1364,7 +1364,7 @@ func TestPhp7ParameterNode(t *testing.T) { EndPos: 113, }, }, - Value: []byte("baz"), + Value: []byte("$baz"), }, }, }, @@ -1466,7 +1466,7 @@ func TestPhp7ParameterNode(t *testing.T) { EndPos: 139, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, DefaultValue: &ast.ExprConstFetch{ @@ -1555,7 +1555,7 @@ func TestPhp7ParameterNode(t *testing.T) { EndPos: 158, }, }, - Value: []byte("baz"), + Value: []byte("$baz"), }, }, }, @@ -1646,7 +1646,7 @@ func TestPhp7ParameterNode(t *testing.T) { EndPos: 191, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, DefaultValue: &ast.ExprConstFetch{ @@ -1735,7 +1735,7 @@ func TestPhp7ParameterNode(t *testing.T) { EndPos: 210, }, }, - Value: []byte("baz"), + Value: []byte("$baz"), }, }, }, @@ -2068,7 +2068,7 @@ func TestScalarEncapsed_SimpleVar(t *testing.T) { EndPos: 13, }, }, - Value: []byte("var"), + Value: []byte("$var"), }, }, }, @@ -2145,7 +2145,7 @@ func TestScalarEncapsed_SimpleVarOneChar(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -2222,7 +2222,7 @@ func TestScalarEncapsed_SimpleVarEndsEcapsed(t *testing.T) { EndPos: 13, }, }, - Value: []byte("var"), + Value: []byte("$var"), }, }, &ast.ScalarEncapsedStringPart{ @@ -2310,7 +2310,7 @@ func TestScalarEncapsed_StringVarCurveOpen(t *testing.T) { EndPos: 7, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, &ast.ExprVariable{ @@ -2331,7 +2331,7 @@ func TestScalarEncapsed_StringVarCurveOpen(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -2417,7 +2417,7 @@ func TestScalarEncapsed_SimpleVarPropertyFetch(t *testing.T) { EndPos: 13, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Property: &ast.Identifier{ @@ -2701,7 +2701,7 @@ func TestScalarEncapsed_CurlyOpenMethodCall(t *testing.T) { EndPos: 14, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Method: &ast.Identifier{ @@ -2804,7 +2804,7 @@ LBL; EndPos: 19, }, }, - Value: []byte("var"), + Value: []byte("$var"), }, }, &ast.ScalarEncapsedStringPart{ @@ -2896,7 +2896,7 @@ LBL; EndPos: 21, }, }, - Value: []byte("var"), + Value: []byte("$var"), }, }, &ast.ScalarEncapsedStringPart{ @@ -3711,7 +3711,7 @@ func TestStmtAltIf_AltIf(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -3780,7 +3780,7 @@ func TestStmtAltIf_AltElseIf(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -3822,7 +3822,7 @@ func TestStmtAltIf_AltElseIf(t *testing.T) { EndPos: 27, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Stmt: &ast.StmtStmtList{ @@ -3893,7 +3893,7 @@ func TestStmtAltIf_AltElse(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -3985,7 +3985,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -4027,7 +4027,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { EndPos: 27, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Stmt: &ast.StmtStmtList{ @@ -4069,7 +4069,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { EndPos: 42, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, Stmt: &ast.StmtStmtList{ @@ -6209,7 +6209,7 @@ func TestStmtEcho(t *testing.T) { EndPos: 10, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, &ast.ScalarLnumber{ @@ -6276,7 +6276,7 @@ func TestStmtEcho_Parenthesis(t *testing.T) { EndPos: 10, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -6385,7 +6385,7 @@ func TestStmtFor(t *testing.T) { EndPos: 9, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, Expr: &ast.ScalarLnumber{ @@ -6429,7 +6429,7 @@ func TestStmtFor(t *testing.T) { EndPos: 17, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, Right: &ast.ScalarLnumber{ @@ -6473,7 +6473,7 @@ func TestStmtFor(t *testing.T) { EndPos: 26, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, }, @@ -6504,7 +6504,7 @@ func TestStmtFor(t *testing.T) { EndPos: 32, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, }, @@ -6581,7 +6581,7 @@ func TestStmtFor_Alt(t *testing.T) { EndPos: 11, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, Right: &ast.ScalarLnumber{ @@ -6625,7 +6625,7 @@ func TestStmtFor_Alt(t *testing.T) { EndPos: 20, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, }, @@ -6692,7 +6692,7 @@ func TestStmtForeach(t *testing.T) { EndPos: 14, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Var: &ast.ExprVariable{ @@ -6713,7 +6713,7 @@ func TestStmtForeach(t *testing.T) { EndPos: 20, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, Stmt: &ast.StmtStmtList{ @@ -6789,7 +6789,7 @@ func TestStmtForeach_Expr(t *testing.T) { EndPos: 20, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, Stmt: &ast.StmtStmtList{ @@ -6854,7 +6854,7 @@ func TestStmtForeach_Alt(t *testing.T) { EndPos: 14, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Var: &ast.ExprVariable{ @@ -6875,7 +6875,7 @@ func TestStmtForeach_Alt(t *testing.T) { EndPos: 20, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, Stmt: &ast.StmtStmtList{ @@ -6940,7 +6940,7 @@ func TestStmtForeach_WithKey(t *testing.T) { EndPos: 14, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Key: &ast.ExprVariable{ @@ -6961,7 +6961,7 @@ func TestStmtForeach_WithKey(t *testing.T) { EndPos: 20, }, }, - Value: []byte("k"), + Value: []byte("$k"), }, }, Var: &ast.ExprVariable{ @@ -6982,7 +6982,7 @@ func TestStmtForeach_WithKey(t *testing.T) { EndPos: 26, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, Stmt: &ast.StmtStmtList{ @@ -7058,7 +7058,7 @@ func TestStmtForeach_ExprWithKey(t *testing.T) { EndPos: 20, }, }, - Value: []byte("k"), + Value: []byte("$k"), }, }, Var: &ast.ExprVariable{ @@ -7079,7 +7079,7 @@ func TestStmtForeach_ExprWithKey(t *testing.T) { EndPos: 26, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, Stmt: &ast.StmtStmtList{ @@ -7144,7 +7144,7 @@ func TestStmtForeach_WithRef(t *testing.T) { EndPos: 14, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Key: &ast.ExprVariable{ @@ -7165,7 +7165,7 @@ func TestStmtForeach_WithRef(t *testing.T) { EndPos: 20, }, }, - Value: []byte("k"), + Value: []byte("$k"), }, }, Var: &ast.ExprReference{ @@ -7195,7 +7195,7 @@ func TestStmtForeach_WithRef(t *testing.T) { EndPos: 27, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, }, @@ -7261,7 +7261,7 @@ func TestStmtForeach_WithList(t *testing.T) { EndPos: 14, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Key: &ast.ExprVariable{ @@ -7282,7 +7282,7 @@ func TestStmtForeach_WithList(t *testing.T) { EndPos: 20, }, }, - Value: []byte("k"), + Value: []byte("$k"), }, }, Var: &ast.ExprList{ @@ -7322,7 +7322,7 @@ func TestStmtForeach_WithList(t *testing.T) { EndPos: 31, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, }, @@ -7528,7 +7528,7 @@ func TestStmtFunction_ReturnVar(t *testing.T) { EndPos: 24, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -7572,7 +7572,7 @@ func TestStmtFunction_ReturnVar(t *testing.T) { EndPos: 37, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -7605,7 +7605,7 @@ func TestStmtFunction_ReturnVar(t *testing.T) { EndPos: 49, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -7799,7 +7799,7 @@ func TestStmtGlobal(t *testing.T) { EndPos: 12, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -7855,7 +7855,7 @@ func TestStmtGlobal_Vars(t *testing.T) { EndPos: 12, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, &ast.ExprVariable{ @@ -7876,7 +7876,7 @@ func TestStmtGlobal_Vars(t *testing.T) { EndPos: 16, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, &ast.ExprVariable{ @@ -7906,7 +7906,7 @@ func TestStmtGlobal_Vars(t *testing.T) { EndPos: 21, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, }, @@ -8113,7 +8113,7 @@ func TestStmtIf(t *testing.T) { EndPos: 9, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -8178,7 +8178,7 @@ func TestStmtIf_ElseIf(t *testing.T) { EndPos: 9, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -8220,7 +8220,7 @@ func TestStmtIf_ElseIf(t *testing.T) { EndPos: 24, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Stmt: &ast.StmtStmtList{ @@ -8287,7 +8287,7 @@ func TestStmtIf_Else(t *testing.T) { EndPos: 9, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -8373,7 +8373,7 @@ func TestStmtIf_ElseElseIf(t *testing.T) { EndPos: 9, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -8415,7 +8415,7 @@ func TestStmtIf_ElseElseIf(t *testing.T) { EndPos: 24, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Stmt: &ast.StmtStmtList{ @@ -8457,7 +8457,7 @@ func TestStmtIf_ElseElseIf(t *testing.T) { EndPos: 39, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, Stmt: &ast.StmtStmtList{ @@ -8545,7 +8545,7 @@ func TestStmtIf_ElseIfElseIfElse(t *testing.T) { EndPos: 9, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -8587,7 +8587,7 @@ func TestStmtIf_ElseIfElseIfElse(t *testing.T) { EndPos: 24, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Stmt: &ast.StmtStmtList{ @@ -8639,7 +8639,7 @@ func TestStmtIf_ElseIfElseIfElse(t *testing.T) { EndPos: 40, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, Stmt: &ast.StmtStmtList{ @@ -9190,7 +9190,7 @@ func TestStmtProperty(t *testing.T) { EndPos: 20, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -9303,7 +9303,7 @@ func TestStmtProperty_Properties(t *testing.T) { EndPos: 30, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -9334,7 +9334,7 @@ func TestStmtProperty_Properties(t *testing.T) { EndPos: 34, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Expr: &ast.ScalarLnumber{ @@ -9458,7 +9458,7 @@ func TestStmtProperty_Properties2(t *testing.T) { EndPos: 30, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ScalarLnumber{ @@ -9500,7 +9500,7 @@ func TestStmtProperty_Properties2(t *testing.T) { EndPos: 38, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -9625,7 +9625,7 @@ func TestStmtProperty_PropertyType(t *testing.T) { EndPos: 24, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -9693,7 +9693,7 @@ func TestStmtStaticVar(t *testing.T) { EndPos: 12, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -9759,7 +9759,7 @@ func TestStmtStaticVar_Vars(t *testing.T) { EndPos: 12, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -9790,7 +9790,7 @@ func TestStmtStaticVar_Vars(t *testing.T) { EndPos: 16, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Expr: &ast.ScalarLnumber{ @@ -9867,7 +9867,7 @@ func TestStmtStaticVar_Vars2(t *testing.T) { EndPos: 12, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ScalarLnumber{ @@ -9909,7 +9909,7 @@ func TestStmtStaticVar_Vars2(t *testing.T) { EndPos: 20, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -10441,7 +10441,7 @@ func TestStmtThrow(t *testing.T) { EndPos: 11, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, }, @@ -11544,7 +11544,7 @@ func TestStmtTry_TryCatch(t *testing.T) { EndPos: 32, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -11662,7 +11662,7 @@ func TestStmtTry_Php7TryCatch(t *testing.T) { EndPos: 49, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -11757,7 +11757,7 @@ func TestStmtTry_TryCatchCatch(t *testing.T) { EndPos: 32, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -11814,7 +11814,7 @@ func TestStmtTry_TryCatchCatch(t *testing.T) { EndPos: 63, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -11909,7 +11909,7 @@ func TestStmtTry_TryCatchFinally(t *testing.T) { EndPos: 32, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -12013,7 +12013,7 @@ func TestStmtTry_TryCatchCatchCatch(t *testing.T) { EndPos: 29, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -12070,7 +12070,7 @@ func TestStmtTry_TryCatchCatchCatch(t *testing.T) { EndPos: 61, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -12127,7 +12127,7 @@ func TestStmtTry_TryCatchCatchCatch(t *testing.T) { EndPos: 103, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -12185,7 +12185,7 @@ func TestStmtUnset(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -12241,7 +12241,7 @@ func TestStmtUnset_Vars(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, &ast.ExprVariable{ @@ -12262,7 +12262,7 @@ func TestStmtUnset_Vars(t *testing.T) { EndPos: 15, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -12318,7 +12318,7 @@ func TestStmtUnset_TrailingComma(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, &ast.ExprVariable{ @@ -12339,7 +12339,7 @@ func TestStmtUnset_TrailingComma(t *testing.T) { EndPos: 15, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -14220,7 +14220,7 @@ func TestExprArrayDimFetch(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Dim: &ast.ScalarLnumber{ @@ -14304,7 +14304,7 @@ func TestExprArrayDimFetch_Nested(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Dim: &ast.ScalarLnumber{ @@ -14552,7 +14552,7 @@ func TestExprArray_Items(t *testing.T) { EndPos: 18, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -14631,7 +14631,7 @@ func TestExprArray_ItemUnpack(t *testing.T) { EndPos: 14, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -14699,7 +14699,7 @@ func TestExprArrowFunction(t *testing.T) { EndPos: 13, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14788,7 +14788,7 @@ func TestExprArrowFunction_ReturnType(t *testing.T) { EndPos: 22, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14852,7 +14852,7 @@ func TestExprBitwiseNot(t *testing.T) { EndPos: 6, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14916,7 +14916,7 @@ func TestExprBooleanNot(t *testing.T) { EndPos: 6, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15122,7 +15122,7 @@ func TestExprClone_Brackets(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15186,7 +15186,7 @@ func TestExprClone(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15310,7 +15310,7 @@ func TestExprClosure_Use(t *testing.T) { EndPos: 14, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15343,7 +15343,7 @@ func TestExprClosure_Use(t *testing.T) { EndPos: 18, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15376,7 +15376,7 @@ func TestExprClosure_Use(t *testing.T) { EndPos: 27, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, &ast.ExprReference{ @@ -15406,7 +15406,7 @@ func TestExprClosure_Use(t *testing.T) { EndPos: 32, }, }, - Value: []byte("d"), + Value: []byte("$d"), }, }, }, @@ -15488,7 +15488,7 @@ func TestExprClosure_Use2(t *testing.T) { EndPos: 14, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15521,7 +15521,7 @@ func TestExprClosure_Use2(t *testing.T) { EndPos: 18, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15563,7 +15563,7 @@ func TestExprClosure_Use2(t *testing.T) { EndPos: 28, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, }, @@ -15585,7 +15585,7 @@ func TestExprClosure_Use2(t *testing.T) { EndPos: 32, }, }, - Value: []byte("d"), + Value: []byte("$d"), }, }, }, @@ -15919,7 +15919,7 @@ func TestExprEmpty(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15983,7 +15983,7 @@ func TestExprErrorSuppress(t *testing.T) { EndPos: 6, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -16047,7 +16047,7 @@ func TestExprEval(t *testing.T) { EndPos: 10, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -16200,7 +16200,7 @@ func TestExprExit_Expr(t *testing.T) { EndPos: 10, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -16353,7 +16353,7 @@ func TestExprDie_Expr(t *testing.T) { EndPos: 9, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -16670,7 +16670,7 @@ func TestExprFunctionCall_Var(t *testing.T) { EndPos: 7, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, ArgumentList: &ast.ArgumentList{ @@ -16721,7 +16721,7 @@ func TestExprFunctionCall_Var(t *testing.T) { EndPos: 16, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -16842,7 +16842,7 @@ func TestExprFunctionCall_ExprArg(t *testing.T) { EndPos: 12, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Right: &ast.ScalarLnumber{ @@ -16921,7 +16921,7 @@ func TestExprPostDec(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -16985,7 +16985,7 @@ func TestExprPostInc(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -17049,7 +17049,7 @@ func TestExprPreDec(t *testing.T) { EndPos: 7, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -17113,7 +17113,7 @@ func TestExprPreInc(t *testing.T) { EndPos: 7, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -17177,7 +17177,7 @@ func TestExprInclude(t *testing.T) { EndPos: 13, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -17241,7 +17241,7 @@ func TestExprInclude_Once(t *testing.T) { EndPos: 18, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -17305,7 +17305,7 @@ func TestExprRequire(t *testing.T) { EndPos: 13, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -17369,7 +17369,7 @@ func TestExprRequire_Once(t *testing.T) { EndPos: 18, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -17433,7 +17433,7 @@ func TestExprInstanceOf(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Class: &ast.NameName{ @@ -17520,7 +17520,7 @@ func TestExprInstanceOf_Relative(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Class: &ast.NameRelative{ @@ -17607,7 +17607,7 @@ func TestExprInstanceOf_FullyQualified(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Class: &ast.NameFullyQualified{ @@ -17695,7 +17695,7 @@ func TestExprIsset(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -17761,7 +17761,7 @@ func TestExprIsset_Variables(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, &ast.ExprVariable{ @@ -17782,7 +17782,7 @@ func TestExprIsset_Variables(t *testing.T) { EndPos: 15, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17858,7 +17858,7 @@ func TestExprList_Empty(t *testing.T) { EndPos: 14, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17941,7 +17941,7 @@ func TestExprList(t *testing.T) { EndPos: 10, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -17965,7 +17965,7 @@ func TestExprList(t *testing.T) { EndPos: 16, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -18057,7 +18057,7 @@ func TestExprList_ArrayIndex(t *testing.T) { EndPos: 10, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -18082,7 +18082,7 @@ func TestExprList_ArrayIndex(t *testing.T) { EndPos: 18, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -18184,7 +18184,7 @@ func TestExprList_List(t *testing.T) { EndPos: 15, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -18211,7 +18211,7 @@ func TestExprList_List(t *testing.T) { EndPos: 22, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -18295,7 +18295,7 @@ func TestExprList_EmptyItem(t *testing.T) { EndPos: 12, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -18319,7 +18319,7 @@ func TestExprList_EmptyItem(t *testing.T) { EndPos: 18, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -18404,7 +18404,7 @@ func TestExprList_EmptyItems(t *testing.T) { EndPos: 14, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -18429,7 +18429,7 @@ func TestExprList_EmptyItems(t *testing.T) { EndPos: 22, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -18493,7 +18493,7 @@ func TestExprMethodCall(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Method: &ast.Identifier{ @@ -18826,7 +18826,7 @@ func TestExprNew_Anonymous(t *testing.T) { EndPos: 16, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -18859,7 +18859,7 @@ func TestExprNew_Anonymous(t *testing.T) { EndPos: 23, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -18928,7 +18928,7 @@ func TestExprPrint(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -18992,7 +18992,7 @@ func TestExprPropertyFetch(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Property: &ast.Identifier{ @@ -19059,7 +19059,7 @@ func TestExprReference_ForeachWithRef(t *testing.T) { EndPos: 14, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Key: &ast.ExprVariable{ @@ -19080,7 +19080,7 @@ func TestExprReference_ForeachWithRef(t *testing.T) { EndPos: 20, }, }, - Value: []byte("k"), + Value: []byte("$k"), }, }, Var: &ast.ExprReference{ @@ -19110,7 +19110,7 @@ func TestExprReference_ForeachWithRef(t *testing.T) { EndPos: 27, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, }, @@ -19197,7 +19197,7 @@ func TestExprShellExec(t *testing.T) { EndPos: 10, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -19423,7 +19423,7 @@ func TestExprShortArray_Items(t *testing.T) { EndPos: 13, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -19510,7 +19510,7 @@ func TestExprShortList(t *testing.T) { EndPos: 6, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -19534,7 +19534,7 @@ func TestExprShortList(t *testing.T) { EndPos: 12, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -19626,7 +19626,7 @@ func TestExprShortList_ArrayIndex(t *testing.T) { EndPos: 6, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -19651,7 +19651,7 @@ func TestExprShortList_ArrayIndex(t *testing.T) { EndPos: 14, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -19753,7 +19753,7 @@ func TestExprShortList_List(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -19780,7 +19780,7 @@ func TestExprShortList_List(t *testing.T) { EndPos: 18, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -20128,7 +20128,7 @@ func TestExprStaticCall_Var(t *testing.T) { EndPos: 12, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, ArgumentList: &ast.ArgumentList{ @@ -20202,7 +20202,7 @@ func TestExprStaticCall_VarVar(t *testing.T) { EndPos: 7, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Call: &ast.ExprVariable{ @@ -20223,7 +20223,7 @@ func TestExprStaticCall_VarVar(t *testing.T) { EndPos: 13, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, ArgumentList: &ast.ArgumentList{ @@ -20320,7 +20320,7 @@ func TestExprStaticPropertyFetch(t *testing.T) { EndPos: 12, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -20407,7 +20407,7 @@ func TestExprStaticPropertyFetch_Relative(t *testing.T) { EndPos: 22, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -20494,7 +20494,7 @@ func TestExprStaticPropertyFetch_FullyQualified(t *testing.T) { EndPos: 13, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -20558,7 +20558,7 @@ func TestExprTernary(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, IfTrue: &ast.ExprVariable{ @@ -20579,7 +20579,7 @@ func TestExprTernary(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, IfFalse: &ast.ExprVariable{ @@ -20600,7 +20600,7 @@ func TestExprTernary(t *testing.T) { EndPos: 15, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, }, @@ -20664,7 +20664,7 @@ func TestExprTernary_Simple(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, IfFalse: &ast.ExprVariable{ @@ -20685,7 +20685,7 @@ func TestExprTernary_Simple(t *testing.T) { EndPos: 12, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, }, @@ -20749,7 +20749,7 @@ func TestExprTernary_NestedTrue(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, IfTrue: &ast.ExprTernary{ @@ -20779,7 +20779,7 @@ func TestExprTernary_NestedTrue(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, IfTrue: &ast.ExprVariable{ @@ -20800,7 +20800,7 @@ func TestExprTernary_NestedTrue(t *testing.T) { EndPos: 15, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, IfFalse: &ast.ExprVariable{ @@ -20821,7 +20821,7 @@ func TestExprTernary_NestedTrue(t *testing.T) { EndPos: 20, }, }, - Value: []byte("d"), + Value: []byte("$d"), }, }, }, @@ -20843,7 +20843,7 @@ func TestExprTernary_NestedTrue(t *testing.T) { EndPos: 25, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, }, @@ -20916,7 +20916,7 @@ func TestExprTernary_NestedCond(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, IfTrue: &ast.ExprVariable{ @@ -20937,7 +20937,7 @@ func TestExprTernary_NestedCond(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, IfFalse: &ast.ExprVariable{ @@ -20958,7 +20958,7 @@ func TestExprTernary_NestedCond(t *testing.T) { EndPos: 15, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, }, @@ -20980,7 +20980,7 @@ func TestExprTernary_NestedCond(t *testing.T) { EndPos: 20, }, }, - Value: []byte("d"), + Value: []byte("$d"), }, }, IfFalse: &ast.ExprVariable{ @@ -21001,7 +21001,7 @@ func TestExprTernary_NestedCond(t *testing.T) { EndPos: 25, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, }, @@ -21065,7 +21065,7 @@ func TestExprUnaryMinus(t *testing.T) { EndPos: 6, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -21129,7 +21129,7 @@ func TestExprUnaryPlus(t *testing.T) { EndPos: 6, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -21184,7 +21184,7 @@ func TestExprVariable(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -21247,7 +21247,7 @@ func TestExprVariable_Variable(t *testing.T) { EndPos: 6, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -21354,7 +21354,7 @@ func TestExprYield_Val(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -21418,7 +21418,7 @@ func TestExprYield_KeyVal(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Value: &ast.ExprVariable{ @@ -21439,7 +21439,7 @@ func TestExprYield_KeyVal(t *testing.T) { EndPos: 17, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -21557,7 +21557,7 @@ func TestExprYield_KeyExpr(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Value: &ast.ScalarLnumber{ @@ -21632,7 +21632,7 @@ func TestExprYieldFrom(t *testing.T) { EndPos: 16, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -21698,7 +21698,7 @@ func TestExprAssign_Assign(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -21719,7 +21719,7 @@ func TestExprAssign_Assign(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -21783,7 +21783,7 @@ func TestExprAssign_Reference(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -21804,7 +21804,7 @@ func TestExprAssign_Reference(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -21868,7 +21868,7 @@ func TestExprAssign_ReferenceNew(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprNew{ @@ -21965,7 +21965,7 @@ func TestExprAssign_ReferenceArgs(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprNew{ @@ -22039,7 +22039,7 @@ func TestExprAssign_ReferenceArgs(t *testing.T) { EndPos: 19, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -22107,7 +22107,7 @@ func TestExprAssign_BitwiseAnd(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -22128,7 +22128,7 @@ func TestExprAssign_BitwiseAnd(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -22192,7 +22192,7 @@ func TestExprAssign_BitwiseOr(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -22213,7 +22213,7 @@ func TestExprAssign_BitwiseOr(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -22277,7 +22277,7 @@ func TestExprAssign_BitwiseXor(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -22298,7 +22298,7 @@ func TestExprAssign_BitwiseXor(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -22362,7 +22362,7 @@ func TestExprAssign_Concat(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -22383,7 +22383,7 @@ func TestExprAssign_Concat(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -22447,7 +22447,7 @@ func TestExprAssign_Div(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -22468,7 +22468,7 @@ func TestExprAssign_Div(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -22532,7 +22532,7 @@ func TestExprAssign_Minus(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -22553,7 +22553,7 @@ func TestExprAssign_Minus(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -22617,7 +22617,7 @@ func TestExprAssign_Mod(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -22638,7 +22638,7 @@ func TestExprAssign_Mod(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -22702,7 +22702,7 @@ func TestExprAssign_Mul(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -22723,7 +22723,7 @@ func TestExprAssign_Mul(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -22787,7 +22787,7 @@ func TestExprAssign_Plus(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -22808,7 +22808,7 @@ func TestExprAssign_Plus(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -22872,7 +22872,7 @@ func TestExprAssign_Pow(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -22893,7 +22893,7 @@ func TestExprAssign_Pow(t *testing.T) { EndPos: 12, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -22957,7 +22957,7 @@ func TestExprAssign_ShiftLeft(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -22978,7 +22978,7 @@ func TestExprAssign_ShiftLeft(t *testing.T) { EndPos: 12, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -23042,7 +23042,7 @@ func TestExprAssign_ShiftRight(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -23063,7 +23063,7 @@ func TestExprAssign_ShiftRight(t *testing.T) { EndPos: 12, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -23127,7 +23127,7 @@ func TestExprAssign_Coalesce(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -23148,7 +23148,7 @@ func TestExprAssign_Coalesce(t *testing.T) { EndPos: 12, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -23214,7 +23214,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -23235,7 +23235,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -23299,7 +23299,7 @@ func TestExprBinary_BitwiseOr(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -23320,7 +23320,7 @@ func TestExprBinary_BitwiseOr(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -23384,7 +23384,7 @@ func TestExprBinary_BitwiseXor(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -23405,7 +23405,7 @@ func TestExprBinary_BitwiseXor(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -23469,7 +23469,7 @@ func TestExprBinary_BooleanAnd(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -23490,7 +23490,7 @@ func TestExprBinary_BooleanAnd(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -23554,7 +23554,7 @@ func TestExprBinary_BooleanOr(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -23575,7 +23575,7 @@ func TestExprBinary_BooleanOr(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -23639,7 +23639,7 @@ func TestExprBinary_Coalesce(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -23660,7 +23660,7 @@ func TestExprBinary_Coalesce(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -23724,7 +23724,7 @@ func TestExprBinary_Concat(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -23745,7 +23745,7 @@ func TestExprBinary_Concat(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -23809,7 +23809,7 @@ func TestExprBinary_Div(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -23830,7 +23830,7 @@ func TestExprBinary_Div(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -23894,7 +23894,7 @@ func TestExprBinary_Equal(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -23915,7 +23915,7 @@ func TestExprBinary_Equal(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -23979,7 +23979,7 @@ func TestExprBinary_GreaterOrEqual(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -24000,7 +24000,7 @@ func TestExprBinary_GreaterOrEqual(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -24064,7 +24064,7 @@ func TestExprBinary_Greater(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -24085,7 +24085,7 @@ func TestExprBinary_Greater(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -24149,7 +24149,7 @@ func TestExprBinary_Identical(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -24170,7 +24170,7 @@ func TestExprBinary_Identical(t *testing.T) { EndPos: 12, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -24234,7 +24234,7 @@ func TestExprBinary_LogicalAnd(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -24255,7 +24255,7 @@ func TestExprBinary_LogicalAnd(t *testing.T) { EndPos: 12, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -24319,7 +24319,7 @@ func TestExprBinary_LogicalOr(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -24340,7 +24340,7 @@ func TestExprBinary_LogicalOr(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -24404,7 +24404,7 @@ func TestExprBinary_LogicalXor(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -24425,7 +24425,7 @@ func TestExprBinary_LogicalXor(t *testing.T) { EndPos: 12, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -24489,7 +24489,7 @@ func TestExprBinary_Minus(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -24510,7 +24510,7 @@ func TestExprBinary_Minus(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -24574,7 +24574,7 @@ func TestExprBinary_Mod(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -24595,7 +24595,7 @@ func TestExprBinary_Mod(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -24659,7 +24659,7 @@ func TestExprBinary_Mul(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -24680,7 +24680,7 @@ func TestExprBinary_Mul(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -24744,7 +24744,7 @@ func TestExprBinary_NotEqual(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -24765,7 +24765,7 @@ func TestExprBinary_NotEqual(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -24829,7 +24829,7 @@ func TestExprBinary_NotIdentical(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -24850,7 +24850,7 @@ func TestExprBinary_NotIdentical(t *testing.T) { EndPos: 12, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -24914,7 +24914,7 @@ func TestExprBinary_Plus(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -24935,7 +24935,7 @@ func TestExprBinary_Plus(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -24999,7 +24999,7 @@ func TestExprBinary_Pow(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -25020,7 +25020,7 @@ func TestExprBinary_Pow(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -25084,7 +25084,7 @@ func TestExprBinary_ShiftLeft(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -25105,7 +25105,7 @@ func TestExprBinary_ShiftLeft(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -25169,7 +25169,7 @@ func TestExprBinary_ShiftRight(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -25190,7 +25190,7 @@ func TestExprBinary_ShiftRight(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -25254,7 +25254,7 @@ func TestExprBinary_SmallerOrEqual(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -25275,7 +25275,7 @@ func TestExprBinary_SmallerOrEqual(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -25339,7 +25339,7 @@ func TestExprBinary_Smaller(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -25360,7 +25360,7 @@ func TestExprBinary_Smaller(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -25424,7 +25424,7 @@ func TestExprBinary_Spaceship(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -25445,7 +25445,7 @@ func TestExprBinary_Spaceship(t *testing.T) { EndPos: 12, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -25511,7 +25511,7 @@ func TestExprCast_Array(t *testing.T) { EndPos: 12, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -25575,7 +25575,7 @@ func TestExprCast_Bool(t *testing.T) { EndPos: 14, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -25639,7 +25639,7 @@ func TestExprCast_BoolShort(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -25703,7 +25703,7 @@ func TestExprCast_Double(t *testing.T) { EndPos: 13, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -25767,7 +25767,7 @@ func TestExprCast_CastFloat(t *testing.T) { EndPos: 12, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -25831,7 +25831,7 @@ func TestExprCast_Int(t *testing.T) { EndPos: 14, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -25895,7 +25895,7 @@ func TestExprCast_IntShort(t *testing.T) { EndPos: 10, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -25959,7 +25959,7 @@ func TestExprCast_Object(t *testing.T) { EndPos: 13, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -26023,7 +26023,7 @@ func TestExprCast_String(t *testing.T) { EndPos: 13, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -26087,7 +26087,7 @@ func TestExprCast_BinaryString(t *testing.T) { EndPos: 13, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -26151,7 +26151,7 @@ func TestExprCast_Unset(t *testing.T) { EndPos: 12, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, diff --git a/internal/php7/php7.go b/internal/php7/php7.go index cccb6d9..90532bc 100644 Binary files a/internal/php7/php7.go and b/internal/php7/php7.go differ diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 16e3936..29a4a8b 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -1352,7 +1352,7 @@ catch_list: } | catch_list T_CATCH '(' catch_name_list T_VARIABLE ')' '{' inner_statement_list '}' { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($5.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $5.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} catch := &ast.StmtCatch{ast.Node{}, $4, variable, $8} $$ = append($1, catch) @@ -1366,7 +1366,6 @@ catch_list: yylex.(*Parser).setFreeFloating(catch, token.Start, $2.Hidden) yylex.(*Parser).setFreeFloating(catch, token.Catch, $3.Hidden) yylex.(*Parser).setFreeFloating(variable, token.Start, $5.Hidden) - yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating(catch, token.Var, $6.Hidden) yylex.(*Parser).setFreeFloating(catch, token.Cond, $7.Hidden) yylex.(*Parser).setFreeFloating(catch, token.Stmts, $9.Hidden) @@ -2142,7 +2141,7 @@ non_empty_parameter_list: parameter: optional_type is_reference is_variadic T_VARIABLE { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($4.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $4.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} $$ = &ast.Parameter{ast.Node{}, $2 != nil, $3 != nil, $1, variable, nil} @@ -2171,7 +2170,6 @@ parameter: } yylex.(*Parser).setFreeFloating($$, token.Variadic, $4.Hidden) - yylex.(*Parser).addDollarToken(variable) // normalize if $3 == nil { @@ -2188,7 +2186,7 @@ parameter: } | optional_type is_reference is_variadic T_VARIABLE '=' expr { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($4.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $4.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} $$ = &ast.Parameter{ast.Node{}, $2 != nil, $3 != nil, $1, variable, $6} @@ -2218,7 +2216,6 @@ parameter: yylex.(*Parser).setFreeFloating($$, token.Variadic, $4.Hidden) yylex.(*Parser).setFreeFloating($$, token.Var, $5.Hidden) - yylex.(*Parser).addDollarToken(variable) // normalize if $3 == nil { @@ -2448,7 +2445,7 @@ static_var_list: static_var: T_VARIABLE { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $1.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} $$ = &ast.StmtStaticVar{ast.Node{}, variable, nil} @@ -2459,13 +2456,12 @@ static_var: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_VARIABLE '=' expr { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $1.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} $$ = &ast.StmtStaticVar{ast.Node{}, variable, $3} @@ -2476,7 +2472,6 @@ static_var: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2975,7 +2970,7 @@ property_list: property: T_VARIABLE backup_doc_comment { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $1.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} $$ = &ast.StmtProperty{ast.Node{}, variable, nil} @@ -2986,13 +2981,12 @@ property: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_VARIABLE '=' expr backup_doc_comment { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $1.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} $$ = &ast.StmtProperty{ast.Node{}, variable, $3} @@ -3003,7 +2997,6 @@ property: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4289,7 +4282,7 @@ lexical_var_list: lexical_var: T_VARIABLE { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $1.Value} $$ = &ast.ExprVariable{ast.Node{}, identifier} // save position @@ -4298,13 +4291,12 @@ lexical_var: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '&' T_VARIABLE { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($2.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $2.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} $$ = &ast.ExprReference{ast.Node{}, variable} @@ -4316,7 +4308,6 @@ lexical_var: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating(variable, token.Start, $2.Hidden) - yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4937,7 +4928,7 @@ variable: simple_variable: T_VARIABLE { - name := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + name := &ast.Identifier{ast.Node{}, $1.Value} $$ = &ast.ExprVariable{ast.Node{}, name} // save position @@ -4946,7 +4937,6 @@ simple_variable: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4959,7 +4949,6 @@ simple_variable: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).setFreeFloating($3, token.Start, append($2.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($2), $3.GetNode().Tokens[token.Start]...)...)) yylex.(*Parser).setFreeFloating($3, token.End, append($3.GetNode().Tokens[token.End], append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)...)) @@ -4974,7 +4963,6 @@ simple_variable: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5347,7 +5335,7 @@ encaps_list: encaps_var: T_VARIABLE { - name := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + name := &ast.Identifier{ast.Node{}, $1.Value} $$ = &ast.ExprVariable{ast.Node{}, name} // save position @@ -5356,13 +5344,12 @@ encaps_var: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_VARIABLE '[' encaps_var_offset ']' { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $1.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} $$ = &ast.ExprArrayDimFetch{ast.Node{}, variable, $3} @@ -5372,7 +5359,6 @@ encaps_var: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) @@ -5380,7 +5366,7 @@ encaps_var: } | T_VARIABLE T_OBJECT_OPERATOR T_STRING { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $1.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} fetch := &ast.Identifier{ast.Node{}, $3.Value} $$ = &ast.ExprPropertyFetch{ast.Node{}, variable, fetch} @@ -5392,7 +5378,6 @@ encaps_var: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).setFreeFloating(fetch, token.Start, $3.Hidden) @@ -5519,7 +5504,7 @@ encaps_var_offset: } | T_VARIABLE { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $1.Value} $$ = &ast.ExprVariable{ast.Node{}, identifier} // save position @@ -5528,7 +5513,6 @@ encaps_var_offset: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/internal/php7/php7_test.go b/internal/php7/php7_test.go index 1fd25a0..169e62c 100644 --- a/internal/php7/php7_test.go +++ b/internal/php7/php7_test.go @@ -455,7 +455,7 @@ func TestPhp7(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -488,7 +488,7 @@ func TestPhp7(t *testing.T) { EndPos: 18, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -532,7 +532,7 @@ func TestPhp7(t *testing.T) { EndPos: 27, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, ArgumentList: &ast.ArgumentList{ @@ -574,7 +574,7 @@ func TestPhp7(t *testing.T) { EndPos: 30, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -607,7 +607,7 @@ func TestPhp7(t *testing.T) { EndPos: 37, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -651,7 +651,7 @@ func TestPhp7(t *testing.T) { EndPos: 46, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Method: &ast.Identifier{ @@ -704,7 +704,7 @@ func TestPhp7(t *testing.T) { EndPos: 54, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -737,7 +737,7 @@ func TestPhp7(t *testing.T) { EndPos: 61, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -836,7 +836,7 @@ func TestPhp7(t *testing.T) { EndPos: 77, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -869,7 +869,7 @@ func TestPhp7(t *testing.T) { EndPos: 84, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -913,7 +913,7 @@ func TestPhp7(t *testing.T) { EndPos: 93, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Call: &ast.Identifier{ @@ -966,7 +966,7 @@ func TestPhp7(t *testing.T) { EndPos: 101, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -999,7 +999,7 @@ func TestPhp7(t *testing.T) { EndPos: 108, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -1087,7 +1087,7 @@ func TestPhp7(t *testing.T) { EndPos: 123, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -1120,7 +1120,7 @@ func TestPhp7(t *testing.T) { EndPos: 130, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -1194,7 +1194,7 @@ func TestPhp7(t *testing.T) { EndPos: 173, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -1227,7 +1227,7 @@ func TestPhp7(t *testing.T) { EndPos: 180, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -1304,7 +1304,7 @@ func TestPhp7(t *testing.T) { EndPos: 212, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, }, @@ -1354,7 +1354,7 @@ func TestPhp7(t *testing.T) { EndPos: 224, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Dim: &ast.ScalarLnumber{ @@ -1416,7 +1416,7 @@ func TestPhp7(t *testing.T) { EndPos: 239, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Dim: &ast.ExprVariable{ @@ -1437,7 +1437,7 @@ func TestPhp7(t *testing.T) { EndPos: 244, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -1488,7 +1488,7 @@ func TestPhp7(t *testing.T) { EndPos: 257, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Property: &ast.Identifier{ @@ -1550,7 +1550,7 @@ func TestPhp7(t *testing.T) { EndPos: 274, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Property: &ast.ExprVariable{ @@ -1571,7 +1571,7 @@ func TestPhp7(t *testing.T) { EndPos: 280, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -1633,7 +1633,7 @@ func TestPhp7(t *testing.T) { EndPos: 300, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -1723,7 +1723,7 @@ func TestPhp7(t *testing.T) { EndPos: 327, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, DefaultValue: &ast.ExprConstFetch{ @@ -1812,7 +1812,7 @@ func TestPhp7(t *testing.T) { EndPos: 346, }, }, - Value: []byte("baz"), + Value: []byte("$baz"), }, }, }, @@ -1937,7 +1937,7 @@ func TestPhp7(t *testing.T) { EndPos: 393, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, DefaultValue: &ast.ExprConstFetch{ @@ -2026,7 +2026,7 @@ func TestPhp7(t *testing.T) { EndPos: 412, }, }, - Value: []byte("baz"), + Value: []byte("$baz"), }, }, }, @@ -2128,7 +2128,7 @@ func TestPhp7(t *testing.T) { EndPos: 438, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, DefaultValue: &ast.ExprConstFetch{ @@ -2217,7 +2217,7 @@ func TestPhp7(t *testing.T) { EndPos: 457, }, }, - Value: []byte("baz"), + Value: []byte("$baz"), }, }, }, @@ -2308,7 +2308,7 @@ func TestPhp7(t *testing.T) { EndPos: 490, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, DefaultValue: &ast.ExprConstFetch{ @@ -2397,7 +2397,7 @@ func TestPhp7(t *testing.T) { EndPos: 509, }, }, - Value: []byte("baz"), + Value: []byte("$baz"), }, }, }, @@ -2768,7 +2768,7 @@ func TestPhp7(t *testing.T) { EndPos: 876, }, }, - Value: []byte("var"), + Value: []byte("$var"), }, }, }, @@ -2831,7 +2831,7 @@ func TestPhp7(t *testing.T) { EndPos: 891, }, }, - Value: []byte("var"), + Value: []byte("$var"), }, }, Dim: &ast.ScalarLnumber{ @@ -2906,7 +2906,7 @@ func TestPhp7(t *testing.T) { EndPos: 909, }, }, - Value: []byte("var"), + Value: []byte("$var"), }, }, Dim: &ast.ExprUnaryMinus{ @@ -2991,7 +2991,7 @@ func TestPhp7(t *testing.T) { EndPos: 928, }, }, - Value: []byte("var"), + Value: []byte("$var"), }, }, Dim: &ast.ScalarString{ @@ -3066,7 +3066,7 @@ func TestPhp7(t *testing.T) { EndPos: 985, }, }, - Value: []byte("var"), + Value: []byte("$var"), }, }, Dim: &ast.ScalarString{ @@ -3141,7 +3141,7 @@ func TestPhp7(t *testing.T) { EndPos: 1043, }, }, - Value: []byte("var"), + Value: []byte("$var"), }, }, Dim: &ast.ScalarString{ @@ -3216,7 +3216,7 @@ func TestPhp7(t *testing.T) { EndPos: 1063, }, }, - Value: []byte("var"), + Value: []byte("$var"), }, }, Dim: &ast.ExprVariable{ @@ -3237,7 +3237,7 @@ func TestPhp7(t *testing.T) { EndPos: 1068, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -3281,7 +3281,7 @@ func TestPhp7(t *testing.T) { EndPos: 1079, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, &ast.ScalarEncapsedStringPart{ @@ -3313,7 +3313,7 @@ func TestPhp7(t *testing.T) { EndPos: 1084, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -3376,7 +3376,7 @@ func TestPhp7(t *testing.T) { EndPos: 1099, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Property: &ast.Identifier{ @@ -3591,7 +3591,7 @@ func TestPhp7(t *testing.T) { EndPos: 1160, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, }, @@ -3655,7 +3655,7 @@ func TestPhp7(t *testing.T) { EndPos: 1177, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Method: &ast.Identifier{ @@ -3710,7 +3710,7 @@ func TestPhp7(t *testing.T) { EndPos: 1197, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -3752,7 +3752,7 @@ func TestPhp7(t *testing.T) { EndPos: 1218, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -3794,7 +3794,7 @@ func TestPhp7(t *testing.T) { EndPos: 1234, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Stmt: &ast.StmtStmtList{ @@ -3838,7 +3838,7 @@ func TestPhp7(t *testing.T) { EndPos: 1254, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -3901,7 +3901,7 @@ func TestPhp7(t *testing.T) { EndPos: 1283, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -3943,7 +3943,7 @@ func TestPhp7(t *testing.T) { EndPos: 1299, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Stmt: &ast.StmtStmtList{ @@ -3985,7 +3985,7 @@ func TestPhp7(t *testing.T) { EndPos: 1314, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, Stmt: &ast.StmtStmtList{ @@ -5476,7 +5476,7 @@ func TestPhp7(t *testing.T) { EndPos: 2036, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, &ast.ScalarLnumber{ @@ -5520,7 +5520,7 @@ func TestPhp7(t *testing.T) { EndPos: 2050, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -5562,7 +5562,7 @@ func TestPhp7(t *testing.T) { EndPos: 2061, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, Expr: &ast.ScalarLnumber{ @@ -5606,7 +5606,7 @@ func TestPhp7(t *testing.T) { EndPos: 2069, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, Right: &ast.ScalarLnumber{ @@ -5650,7 +5650,7 @@ func TestPhp7(t *testing.T) { EndPos: 2078, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, }, @@ -5681,7 +5681,7 @@ func TestPhp7(t *testing.T) { EndPos: 2084, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, }, @@ -5735,7 +5735,7 @@ func TestPhp7(t *testing.T) { EndPos: 2101, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, Right: &ast.ScalarLnumber{ @@ -5779,7 +5779,7 @@ func TestPhp7(t *testing.T) { EndPos: 2110, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, }, @@ -5810,7 +5810,7 @@ func TestPhp7(t *testing.T) { EndPos: 2116, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, }, @@ -5854,7 +5854,7 @@ func TestPhp7(t *testing.T) { EndPos: 2143, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Var: &ast.ExprVariable{ @@ -5875,7 +5875,7 @@ func TestPhp7(t *testing.T) { EndPos: 2149, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, Stmt: &ast.StmtStmtList{ @@ -5917,7 +5917,7 @@ func TestPhp7(t *testing.T) { EndPos: 2167, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Var: &ast.ExprVariable{ @@ -5938,7 +5938,7 @@ func TestPhp7(t *testing.T) { EndPos: 2173, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, Stmt: &ast.StmtStmtList{ @@ -5980,7 +5980,7 @@ func TestPhp7(t *testing.T) { EndPos: 2202, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Key: &ast.ExprVariable{ @@ -6001,7 +6001,7 @@ func TestPhp7(t *testing.T) { EndPos: 2208, }, }, - Value: []byte("k"), + Value: []byte("$k"), }, }, Var: &ast.ExprVariable{ @@ -6022,7 +6022,7 @@ func TestPhp7(t *testing.T) { EndPos: 2214, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, Stmt: &ast.StmtStmtList{ @@ -6064,7 +6064,7 @@ func TestPhp7(t *testing.T) { EndPos: 2232, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Key: &ast.ExprVariable{ @@ -6085,7 +6085,7 @@ func TestPhp7(t *testing.T) { EndPos: 2238, }, }, - Value: []byte("k"), + Value: []byte("$k"), }, }, Var: &ast.ExprReference{ @@ -6115,7 +6115,7 @@ func TestPhp7(t *testing.T) { EndPos: 2245, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, }, @@ -6158,7 +6158,7 @@ func TestPhp7(t *testing.T) { EndPos: 2263, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Key: &ast.ExprVariable{ @@ -6179,7 +6179,7 @@ func TestPhp7(t *testing.T) { EndPos: 2269, }, }, - Value: []byte("k"), + Value: []byte("$k"), }, }, Var: &ast.ExprList{ @@ -6219,7 +6219,7 @@ func TestPhp7(t *testing.T) { EndPos: 2280, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, }, @@ -6264,7 +6264,7 @@ func TestPhp7(t *testing.T) { EndPos: 2299, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Key: &ast.ExprVariable{ @@ -6285,7 +6285,7 @@ func TestPhp7(t *testing.T) { EndPos: 2305, }, }, - Value: []byte("k"), + Value: []byte("$k"), }, }, Var: &ast.ExprShortList{ @@ -6325,7 +6325,7 @@ func TestPhp7(t *testing.T) { EndPos: 2312, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, }, @@ -6519,7 +6519,7 @@ func TestPhp7(t *testing.T) { EndPos: 2433, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, &ast.ExprVariable{ @@ -6540,7 +6540,7 @@ func TestPhp7(t *testing.T) { EndPos: 2437, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -6614,7 +6614,7 @@ func TestPhp7(t *testing.T) { EndPos: 2463, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -6656,7 +6656,7 @@ func TestPhp7(t *testing.T) { EndPos: 2476, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -6698,7 +6698,7 @@ func TestPhp7(t *testing.T) { EndPos: 2491, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Stmt: &ast.StmtStmtList{ @@ -6742,7 +6742,7 @@ func TestPhp7(t *testing.T) { EndPos: 2504, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -6805,7 +6805,7 @@ func TestPhp7(t *testing.T) { EndPos: 2525, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -6847,7 +6847,7 @@ func TestPhp7(t *testing.T) { EndPos: 2540, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Stmt: &ast.StmtStmtList{ @@ -6889,7 +6889,7 @@ func TestPhp7(t *testing.T) { EndPos: 2555, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, Stmt: &ast.StmtStmtList{ @@ -6954,7 +6954,7 @@ func TestPhp7(t *testing.T) { EndPos: 2576, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -6996,7 +6996,7 @@ func TestPhp7(t *testing.T) { EndPos: 2591, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Stmt: &ast.StmtStmtList{ @@ -7048,7 +7048,7 @@ func TestPhp7(t *testing.T) { EndPos: 2607, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, Stmt: &ast.StmtStmtList{ @@ -7415,7 +7415,7 @@ func TestPhp7(t *testing.T) { EndPos: 2796, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -7505,7 +7505,7 @@ func TestPhp7(t *testing.T) { EndPos: 2828, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -7536,7 +7536,7 @@ func TestPhp7(t *testing.T) { EndPos: 2832, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Expr: &ast.ScalarLnumber{ @@ -7592,7 +7592,7 @@ func TestPhp7(t *testing.T) { EndPos: 2850, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -7623,7 +7623,7 @@ func TestPhp7(t *testing.T) { EndPos: 2854, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Expr: &ast.ScalarLnumber{ @@ -8030,7 +8030,7 @@ func TestPhp7(t *testing.T) { EndPos: 3103, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, }, @@ -8966,7 +8966,7 @@ func TestPhp7(t *testing.T) { EndPos: 3445, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -9059,7 +9059,7 @@ func TestPhp7(t *testing.T) { EndPos: 3495, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -9129,7 +9129,7 @@ func TestPhp7(t *testing.T) { EndPos: 3528, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -9186,7 +9186,7 @@ func TestPhp7(t *testing.T) { EndPos: 3559, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -9256,7 +9256,7 @@ func TestPhp7(t *testing.T) { EndPos: 3592, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -9302,7 +9302,7 @@ func TestPhp7(t *testing.T) { EndPos: 3619, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, &ast.ExprVariable{ @@ -9323,7 +9323,7 @@ func TestPhp7(t *testing.T) { EndPos: 3623, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -10637,7 +10637,7 @@ func TestPhp7(t *testing.T) { EndPos: 3991, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Dim: &ast.ScalarLnumber{ @@ -10698,7 +10698,7 @@ func TestPhp7(t *testing.T) { EndPos: 4000, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Dim: &ast.ScalarLnumber{ @@ -10877,7 +10877,7 @@ func TestPhp7(t *testing.T) { EndPos: 4048, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -10922,7 +10922,7 @@ func TestPhp7(t *testing.T) { EndPos: 4057, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -10963,7 +10963,7 @@ func TestPhp7(t *testing.T) { EndPos: 4064, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -11058,7 +11058,7 @@ func TestPhp7(t *testing.T) { EndPos: 4085, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, ConstantName: &ast.Identifier{ @@ -11110,7 +11110,7 @@ func TestPhp7(t *testing.T) { EndPos: 4102, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -11151,7 +11151,7 @@ func TestPhp7(t *testing.T) { EndPos: 4115, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -11229,7 +11229,7 @@ func TestPhp7(t *testing.T) { EndPos: 4146, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -11262,7 +11262,7 @@ func TestPhp7(t *testing.T) { EndPos: 4150, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -11295,7 +11295,7 @@ func TestPhp7(t *testing.T) { EndPos: 4159, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, &ast.ExprReference{ @@ -11325,7 +11325,7 @@ func TestPhp7(t *testing.T) { EndPos: 4164, }, }, - Value: []byte("d"), + Value: []byte("$d"), }, }, }, @@ -11545,7 +11545,7 @@ func TestPhp7(t *testing.T) { EndPos: 4236, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -11586,7 +11586,7 @@ func TestPhp7(t *testing.T) { EndPos: 4244, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -11627,7 +11627,7 @@ func TestPhp7(t *testing.T) { EndPos: 4255, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -11690,7 +11690,7 @@ func TestPhp7(t *testing.T) { EndPos: 4275, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -11753,7 +11753,7 @@ func TestPhp7(t *testing.T) { EndPos: 4293, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -11953,7 +11953,7 @@ func TestPhp7(t *testing.T) { EndPos: 4340, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, ArgumentList: &ast.ArgumentList{ @@ -12004,7 +12004,7 @@ func TestPhp7(t *testing.T) { EndPos: 4349, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -12045,7 +12045,7 @@ func TestPhp7(t *testing.T) { EndPos: 4357, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -12086,7 +12086,7 @@ func TestPhp7(t *testing.T) { EndPos: 4367, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -12127,7 +12127,7 @@ func TestPhp7(t *testing.T) { EndPos: 4375, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -12168,7 +12168,7 @@ func TestPhp7(t *testing.T) { EndPos: 4390, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -12209,7 +12209,7 @@ func TestPhp7(t *testing.T) { EndPos: 4409, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -12250,7 +12250,7 @@ func TestPhp7(t *testing.T) { EndPos: 4423, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -12291,7 +12291,7 @@ func TestPhp7(t *testing.T) { EndPos: 4442, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -12332,7 +12332,7 @@ func TestPhp7(t *testing.T) { EndPos: 4449, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Class: &ast.NameName{ @@ -12396,7 +12396,7 @@ func TestPhp7(t *testing.T) { EndPos: 4470, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Class: &ast.NameRelative{ @@ -12460,7 +12460,7 @@ func TestPhp7(t *testing.T) { EndPos: 4501, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Class: &ast.NameFullyQualified{ @@ -12525,7 +12525,7 @@ func TestPhp7(t *testing.T) { EndPos: 4530, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, &ast.ExprVariable{ @@ -12546,7 +12546,7 @@ func TestPhp7(t *testing.T) { EndPos: 4534, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -12607,7 +12607,7 @@ func TestPhp7(t *testing.T) { EndPos: 4546, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -12631,7 +12631,7 @@ func TestPhp7(t *testing.T) { EndPos: 4552, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -12700,7 +12700,7 @@ func TestPhp7(t *testing.T) { EndPos: 4563, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -12725,7 +12725,7 @@ func TestPhp7(t *testing.T) { EndPos: 4571, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -12804,7 +12804,7 @@ func TestPhp7(t *testing.T) { EndPos: 4587, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -12831,7 +12831,7 @@ func TestPhp7(t *testing.T) { EndPos: 4594, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -12872,7 +12872,7 @@ func TestPhp7(t *testing.T) { EndPos: 4601, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Method: &ast.Identifier{ @@ -13123,7 +13123,7 @@ func TestPhp7(t *testing.T) { EndPos: 4675, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -13156,7 +13156,7 @@ func TestPhp7(t *testing.T) { EndPos: 4682, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -13202,7 +13202,7 @@ func TestPhp7(t *testing.T) { EndPos: 4698, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -13243,7 +13243,7 @@ func TestPhp7(t *testing.T) { EndPos: 4705, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Property: &ast.Identifier{ @@ -13307,7 +13307,7 @@ func TestPhp7(t *testing.T) { EndPos: 4721, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -13518,7 +13518,7 @@ func TestPhp7(t *testing.T) { EndPos: 4764, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -13582,7 +13582,7 @@ func TestPhp7(t *testing.T) { EndPos: 4774, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -13606,7 +13606,7 @@ func TestPhp7(t *testing.T) { EndPos: 4780, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -13675,7 +13675,7 @@ func TestPhp7(t *testing.T) { EndPos: 4787, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -13700,7 +13700,7 @@ func TestPhp7(t *testing.T) { EndPos: 4795, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -13779,7 +13779,7 @@ func TestPhp7(t *testing.T) { EndPos: 4807, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -13806,7 +13806,7 @@ func TestPhp7(t *testing.T) { EndPos: 4814, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -14062,7 +14062,7 @@ func TestPhp7(t *testing.T) { EndPos: 4880, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -14103,7 +14103,7 @@ func TestPhp7(t *testing.T) { EndPos: 4888, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Property: &ast.ExprVariable{ @@ -14124,7 +14124,7 @@ func TestPhp7(t *testing.T) { EndPos: 4894, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -14188,7 +14188,7 @@ func TestPhp7(t *testing.T) { EndPos: 4917, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -14252,7 +14252,7 @@ func TestPhp7(t *testing.T) { EndPos: 4931, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -14293,7 +14293,7 @@ func TestPhp7(t *testing.T) { EndPos: 4937, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, IfTrue: &ast.ExprVariable{ @@ -14314,7 +14314,7 @@ func TestPhp7(t *testing.T) { EndPos: 4942, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, IfFalse: &ast.ExprVariable{ @@ -14335,7 +14335,7 @@ func TestPhp7(t *testing.T) { EndPos: 4947, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, }, @@ -14376,7 +14376,7 @@ func TestPhp7(t *testing.T) { EndPos: 4953, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, IfFalse: &ast.ExprVariable{ @@ -14397,7 +14397,7 @@ func TestPhp7(t *testing.T) { EndPos: 4960, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, }, @@ -14438,7 +14438,7 @@ func TestPhp7(t *testing.T) { EndPos: 4966, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, IfTrue: &ast.ExprTernary{ @@ -14468,7 +14468,7 @@ func TestPhp7(t *testing.T) { EndPos: 4971, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, IfTrue: &ast.ExprVariable{ @@ -14489,7 +14489,7 @@ func TestPhp7(t *testing.T) { EndPos: 4976, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, IfFalse: &ast.ExprVariable{ @@ -14510,7 +14510,7 @@ func TestPhp7(t *testing.T) { EndPos: 4981, }, }, - Value: []byte("d"), + Value: []byte("$d"), }, }, }, @@ -14532,7 +14532,7 @@ func TestPhp7(t *testing.T) { EndPos: 4986, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, }, @@ -14582,7 +14582,7 @@ func TestPhp7(t *testing.T) { EndPos: 4992, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, IfTrue: &ast.ExprVariable{ @@ -14603,7 +14603,7 @@ func TestPhp7(t *testing.T) { EndPos: 4997, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, IfFalse: &ast.ExprVariable{ @@ -14624,7 +14624,7 @@ func TestPhp7(t *testing.T) { EndPos: 5002, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, }, @@ -14646,7 +14646,7 @@ func TestPhp7(t *testing.T) { EndPos: 5007, }, }, - Value: []byte("d"), + Value: []byte("$d"), }, }, IfFalse: &ast.ExprVariable{ @@ -14667,7 +14667,7 @@ func TestPhp7(t *testing.T) { EndPos: 5012, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, }, @@ -14708,7 +14708,7 @@ func TestPhp7(t *testing.T) { EndPos: 5019, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14749,7 +14749,7 @@ func TestPhp7(t *testing.T) { EndPos: 5026, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14790,7 +14790,7 @@ func TestPhp7(t *testing.T) { EndPos: 5033, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14851,7 +14851,7 @@ func TestPhp7(t *testing.T) { EndPos: 5054, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14892,7 +14892,7 @@ func TestPhp7(t *testing.T) { EndPos: 5066, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Value: &ast.ExprVariable{ @@ -14913,7 +14913,7 @@ func TestPhp7(t *testing.T) { EndPos: 5072, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -14954,7 +14954,7 @@ func TestPhp7(t *testing.T) { EndPos: 5089, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14995,7 +14995,7 @@ func TestPhp7(t *testing.T) { EndPos: 5105, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15036,7 +15036,7 @@ func TestPhp7(t *testing.T) { EndPos: 5120, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15077,7 +15077,7 @@ func TestPhp7(t *testing.T) { EndPos: 5132, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15118,7 +15118,7 @@ func TestPhp7(t *testing.T) { EndPos: 5146, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15159,7 +15159,7 @@ func TestPhp7(t *testing.T) { EndPos: 5159, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15200,7 +15200,7 @@ func TestPhp7(t *testing.T) { EndPos: 5174, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15241,7 +15241,7 @@ func TestPhp7(t *testing.T) { EndPos: 5185, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15282,7 +15282,7 @@ func TestPhp7(t *testing.T) { EndPos: 5199, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15323,7 +15323,7 @@ func TestPhp7(t *testing.T) { EndPos: 5213, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15364,7 +15364,7 @@ func TestPhp7(t *testing.T) { EndPos: 5226, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15405,7 +15405,7 @@ func TestPhp7(t *testing.T) { EndPos: 5233, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -15426,7 +15426,7 @@ func TestPhp7(t *testing.T) { EndPos: 5238, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15467,7 +15467,7 @@ func TestPhp7(t *testing.T) { EndPos: 5244, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -15488,7 +15488,7 @@ func TestPhp7(t *testing.T) { EndPos: 5249, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15529,7 +15529,7 @@ func TestPhp7(t *testing.T) { EndPos: 5255, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -15550,7 +15550,7 @@ func TestPhp7(t *testing.T) { EndPos: 5260, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15591,7 +15591,7 @@ func TestPhp7(t *testing.T) { EndPos: 5266, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -15612,7 +15612,7 @@ func TestPhp7(t *testing.T) { EndPos: 5272, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15653,7 +15653,7 @@ func TestPhp7(t *testing.T) { EndPos: 5278, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -15674,7 +15674,7 @@ func TestPhp7(t *testing.T) { EndPos: 5284, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15715,7 +15715,7 @@ func TestPhp7(t *testing.T) { EndPos: 5290, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -15736,7 +15736,7 @@ func TestPhp7(t *testing.T) { EndPos: 5296, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15777,7 +15777,7 @@ func TestPhp7(t *testing.T) { EndPos: 5302, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -15798,7 +15798,7 @@ func TestPhp7(t *testing.T) { EndPos: 5307, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15839,7 +15839,7 @@ func TestPhp7(t *testing.T) { EndPos: 5313, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -15860,7 +15860,7 @@ func TestPhp7(t *testing.T) { EndPos: 5318, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15901,7 +15901,7 @@ func TestPhp7(t *testing.T) { EndPos: 5324, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -15922,7 +15922,7 @@ func TestPhp7(t *testing.T) { EndPos: 5330, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15963,7 +15963,7 @@ func TestPhp7(t *testing.T) { EndPos: 5336, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -15984,7 +15984,7 @@ func TestPhp7(t *testing.T) { EndPos: 5342, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16025,7 +16025,7 @@ func TestPhp7(t *testing.T) { EndPos: 5348, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16046,7 +16046,7 @@ func TestPhp7(t *testing.T) { EndPos: 5353, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16087,7 +16087,7 @@ func TestPhp7(t *testing.T) { EndPos: 5359, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16108,7 +16108,7 @@ func TestPhp7(t *testing.T) { EndPos: 5366, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16149,7 +16149,7 @@ func TestPhp7(t *testing.T) { EndPos: 5372, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16170,7 +16170,7 @@ func TestPhp7(t *testing.T) { EndPos: 5379, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16211,7 +16211,7 @@ func TestPhp7(t *testing.T) { EndPos: 5385, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16232,7 +16232,7 @@ func TestPhp7(t *testing.T) { EndPos: 5391, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16273,7 +16273,7 @@ func TestPhp7(t *testing.T) { EndPos: 5397, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16294,7 +16294,7 @@ func TestPhp7(t *testing.T) { EndPos: 5404, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16335,7 +16335,7 @@ func TestPhp7(t *testing.T) { EndPos: 5410, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16356,7 +16356,7 @@ func TestPhp7(t *testing.T) { EndPos: 5415, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16397,7 +16397,7 @@ func TestPhp7(t *testing.T) { EndPos: 5421, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16418,7 +16418,7 @@ func TestPhp7(t *testing.T) { EndPos: 5426, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16459,7 +16459,7 @@ func TestPhp7(t *testing.T) { EndPos: 5432, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16480,7 +16480,7 @@ func TestPhp7(t *testing.T) { EndPos: 5437, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16521,7 +16521,7 @@ func TestPhp7(t *testing.T) { EndPos: 5443, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16542,7 +16542,7 @@ func TestPhp7(t *testing.T) { EndPos: 5449, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16583,7 +16583,7 @@ func TestPhp7(t *testing.T) { EndPos: 5455, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16604,7 +16604,7 @@ func TestPhp7(t *testing.T) { EndPos: 5462, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16645,7 +16645,7 @@ func TestPhp7(t *testing.T) { EndPos: 5468, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16666,7 +16666,7 @@ func TestPhp7(t *testing.T) { EndPos: 5473, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16707,7 +16707,7 @@ func TestPhp7(t *testing.T) { EndPos: 5479, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16728,7 +16728,7 @@ func TestPhp7(t *testing.T) { EndPos: 5485, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16769,7 +16769,7 @@ func TestPhp7(t *testing.T) { EndPos: 5491, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16790,7 +16790,7 @@ func TestPhp7(t *testing.T) { EndPos: 5497, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16831,7 +16831,7 @@ func TestPhp7(t *testing.T) { EndPos: 5503, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16852,7 +16852,7 @@ func TestPhp7(t *testing.T) { EndPos: 5509, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16893,7 +16893,7 @@ func TestPhp7(t *testing.T) { EndPos: 5515, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16914,7 +16914,7 @@ func TestPhp7(t *testing.T) { EndPos: 5521, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16955,7 +16955,7 @@ func TestPhp7(t *testing.T) { EndPos: 5527, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16976,7 +16976,7 @@ func TestPhp7(t *testing.T) { EndPos: 5532, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17017,7 +17017,7 @@ func TestPhp7(t *testing.T) { EndPos: 5538, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -17038,7 +17038,7 @@ func TestPhp7(t *testing.T) { EndPos: 5545, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17079,7 +17079,7 @@ func TestPhp7(t *testing.T) { EndPos: 5552, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17100,7 +17100,7 @@ func TestPhp7(t *testing.T) { EndPos: 5558, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17141,7 +17141,7 @@ func TestPhp7(t *testing.T) { EndPos: 5564, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17162,7 +17162,7 @@ func TestPhp7(t *testing.T) { EndPos: 5569, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17203,7 +17203,7 @@ func TestPhp7(t *testing.T) { EndPos: 5575, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17224,7 +17224,7 @@ func TestPhp7(t *testing.T) { EndPos: 5581, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17265,7 +17265,7 @@ func TestPhp7(t *testing.T) { EndPos: 5587, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17286,7 +17286,7 @@ func TestPhp7(t *testing.T) { EndPos: 5593, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17327,7 +17327,7 @@ func TestPhp7(t *testing.T) { EndPos: 5599, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17348,7 +17348,7 @@ func TestPhp7(t *testing.T) { EndPos: 5605, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17389,7 +17389,7 @@ func TestPhp7(t *testing.T) { EndPos: 5611, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17410,7 +17410,7 @@ func TestPhp7(t *testing.T) { EndPos: 5617, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17451,7 +17451,7 @@ func TestPhp7(t *testing.T) { EndPos: 5623, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17472,7 +17472,7 @@ func TestPhp7(t *testing.T) { EndPos: 5629, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17513,7 +17513,7 @@ func TestPhp7(t *testing.T) { EndPos: 5635, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17534,7 +17534,7 @@ func TestPhp7(t *testing.T) { EndPos: 5641, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17575,7 +17575,7 @@ func TestPhp7(t *testing.T) { EndPos: 5647, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17596,7 +17596,7 @@ func TestPhp7(t *testing.T) { EndPos: 5653, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17637,7 +17637,7 @@ func TestPhp7(t *testing.T) { EndPos: 5659, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17658,7 +17658,7 @@ func TestPhp7(t *testing.T) { EndPos: 5665, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17699,7 +17699,7 @@ func TestPhp7(t *testing.T) { EndPos: 5671, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17720,7 +17720,7 @@ func TestPhp7(t *testing.T) { EndPos: 5677, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17761,7 +17761,7 @@ func TestPhp7(t *testing.T) { EndPos: 5683, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17782,7 +17782,7 @@ func TestPhp7(t *testing.T) { EndPos: 5690, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17823,7 +17823,7 @@ func TestPhp7(t *testing.T) { EndPos: 5696, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17844,7 +17844,7 @@ func TestPhp7(t *testing.T) { EndPos: 5703, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17885,7 +17885,7 @@ func TestPhp7(t *testing.T) { EndPos: 5709, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17906,7 +17906,7 @@ func TestPhp7(t *testing.T) { EndPos: 5716, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -18095,7 +18095,7 @@ func TestPhp7(t *testing.T) { EndPos: 5794, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -18128,7 +18128,7 @@ func TestPhp7(t *testing.T) { EndPos: 5801, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -18276,7 +18276,7 @@ func TestPhp7(t *testing.T) { EndPos: 5927, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, DefaultValue: &ast.ScalarLnumber{ @@ -18320,7 +18320,7 @@ func TestPhp7(t *testing.T) { EndPos: 5938, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, DefaultValue: &ast.ScalarLnumber{ @@ -18364,7 +18364,7 @@ func TestPhp7(t *testing.T) { EndPos: 5946, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, DefaultValue: &ast.ScalarLnumber{ @@ -18444,7 +18444,7 @@ func TestPhp7(t *testing.T) { EndPos: 5978, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -18488,7 +18488,7 @@ func TestPhp7(t *testing.T) { EndPos: 5991, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -18857,7 +18857,7 @@ func TestPhp7(t *testing.T) { EndPos: 6142, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, }, @@ -19090,7 +19090,7 @@ func TestPhp7(t *testing.T) { EndPos: 6183, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, }, @@ -19228,7 +19228,7 @@ func TestPhp7(t *testing.T) { EndPos: 6212, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, ArgumentList: &ast.ArgumentList{ @@ -19311,7 +19311,7 @@ func TestPhp7(t *testing.T) { EndPos: 6228, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, Dim: &ast.ScalarLnumber{ @@ -19374,7 +19374,7 @@ func TestPhp7(t *testing.T) { EndPos: 6245, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Property: &ast.ExprVariable{ @@ -19395,7 +19395,7 @@ func TestPhp7(t *testing.T) { EndPos: 6251, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -19436,7 +19436,7 @@ func TestPhp7(t *testing.T) { EndPos: 6259, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Property: &ast.ExprArrayDimFetch{ @@ -19466,7 +19466,7 @@ func TestPhp7(t *testing.T) { EndPos: 6266, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, Dim: &ast.ScalarLnumber{ @@ -19549,7 +19549,7 @@ func TestPhp7(t *testing.T) { EndPos: 6282, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -19611,7 +19611,7 @@ func TestPhp7(t *testing.T) { EndPos: 6294, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -19945,7 +19945,7 @@ CAD; EndPos: 85, }, }, - Value: []byte("world"), + Value: []byte("$world"), }, }, &ast.ScalarEncapsedStringPart{ diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index 421db21..09399dd 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -1,10 +1,11 @@ package printer import ( - "github.com/z7zmey/php-parser/pkg/ast" - "github.com/z7zmey/php-parser/pkg/token" "io" "strings" + + "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/token" ) type printerState int @@ -1860,7 +1861,7 @@ func (p *Printer) printExprVariable(n ast.Vertex) { p.printFreeFloating(nn, token.Start) p.printFreeFloating(nn, token.Dollar) - if nn.GetNode().Tokens.IsEmpty() { + if _, ok := nn.VarName.(*ast.Identifier); !ok { io.WriteString(p.w, "$") } diff --git a/pkg/printer/printer_parsed_php5_test.go b/pkg/printer/printer_parsed_php5_test.go index e632f11..2257614 100644 --- a/pkg/printer/printer_parsed_php5_test.go +++ b/pkg/printer/printer_parsed_php5_test.go @@ -1084,7 +1084,7 @@ func TestParseAndPrintPhp5Shebang(t *testing.T) { test