remove underscore from package names
This commit is contained in:
parent
014b0576d6
commit
4dda4fe7af
@ -1,4 +1,4 @@
|
||||
package assign_op
|
||||
package assign
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package assign_op
|
||||
package assign
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package assign_op
|
||||
package assign
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package assign_op
|
||||
package assign
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package assign_op
|
||||
package assign
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package assign_op
|
||||
package assign
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package assign_op
|
||||
package assign
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package assign_op
|
||||
package assign
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package assign_op
|
||||
package assign
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package assign_op
|
||||
package assign
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package assign_op
|
||||
package assign
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package assign_op
|
||||
package assign
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package assign_op
|
||||
package assign
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package assign_op
|
||||
package assign
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,11 +1,11 @@
|
||||
package assign_op_test
|
||||
package assign_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/z7zmey/php-parser/node/expr/assign_op"
|
||||
"github.com/z7zmey/php-parser/node/expr/assign"
|
||||
|
||||
"github.com/kylelemons/godebug/pretty"
|
||||
|
||||
@ -35,7 +35,7 @@ func TestAssignRef(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.AssignRef{
|
||||
Expr: &assign.AssignRef{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -56,7 +56,7 @@ func TestAssignRefNew(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.AssignRef{
|
||||
Expr: &assign.AssignRef{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.New{
|
||||
Class: &name.Name{
|
||||
@ -83,7 +83,7 @@ func TestAssignRefArgs(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.AssignRef{
|
||||
Expr: &assign.AssignRef{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.New{
|
||||
Class: &name.Name{
|
||||
@ -117,7 +117,7 @@ func TestAssign(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Assign{
|
||||
Expr: &assign.Assign{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -138,7 +138,7 @@ func TestBitwiseAnd(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.BitwiseAnd{
|
||||
Expr: &assign.BitwiseAnd{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -159,7 +159,7 @@ func TestBitwiseOr(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.BitwiseOr{
|
||||
Expr: &assign.BitwiseOr{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -180,7 +180,7 @@ func TestBitwiseXor(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.BitwiseXor{
|
||||
Expr: &assign.BitwiseXor{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -201,7 +201,7 @@ func TestConcat(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Concat{
|
||||
Expr: &assign.Concat{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -222,7 +222,7 @@ func TestDiv(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Div{
|
||||
Expr: &assign.Div{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -243,7 +243,7 @@ func TestMinus(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Minus{
|
||||
Expr: &assign.Minus{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -264,7 +264,7 @@ func TestMod(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Mod{
|
||||
Expr: &assign.Mod{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -285,7 +285,7 @@ func TestMul(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Mul{
|
||||
Expr: &assign.Mul{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -306,7 +306,7 @@ func TestPlus(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Plus{
|
||||
Expr: &assign.Plus{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -327,7 +327,7 @@ func TestPow(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Pow{
|
||||
Expr: &assign.Pow{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -348,7 +348,7 @@ func TestShiftLeft(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.ShiftLeft{
|
||||
Expr: &assign.ShiftLeft{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -369,7 +369,7 @@ func TestShiftRight(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.ShiftRight{
|
||||
Expr: &assign.ShiftRight{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
@ -1,10 +1,10 @@
|
||||
package assign_op_test
|
||||
package assign_test
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/z7zmey/php-parser/node/expr/assign_op"
|
||||
"github.com/z7zmey/php-parser/node/expr/assign"
|
||||
|
||||
"github.com/kylelemons/godebug/pretty"
|
||||
|
||||
@ -19,7 +19,7 @@ var nodesToTest = []struct {
|
||||
expectedAttributes map[string]interface{}
|
||||
}{
|
||||
{
|
||||
&assign_op.AssignRef{
|
||||
&assign.AssignRef{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -27,7 +27,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&assign_op.Assign{
|
||||
&assign.Assign{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -35,7 +35,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&assign_op.BitwiseAnd{
|
||||
&assign.BitwiseAnd{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -43,7 +43,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&assign_op.BitwiseOr{
|
||||
&assign.BitwiseOr{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -51,7 +51,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&assign_op.BitwiseXor{
|
||||
&assign.BitwiseXor{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -59,7 +59,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&assign_op.Concat{
|
||||
&assign.Concat{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -67,7 +67,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&assign_op.Div{
|
||||
&assign.Div{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -75,7 +75,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&assign_op.Minus{
|
||||
&assign.Minus{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -83,7 +83,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&assign_op.Mod{
|
||||
&assign.Mod{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -91,7 +91,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&assign_op.Mul{
|
||||
&assign.Mul{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -99,7 +99,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&assign_op.Plus{
|
||||
&assign.Plus{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -107,7 +107,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&assign_op.Pow{
|
||||
&assign.Pow{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -115,7 +115,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&assign_op.ShiftLeft{
|
||||
&assign.ShiftLeft{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -123,7 +123,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&assign_op.ShiftRight{
|
||||
&assign.ShiftRight{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
@ -1,4 +1,4 @@
|
||||
package binary_op
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package binary_op
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package binary_op
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package binary_op
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package binary_op
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package binary_op
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package binary_op
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package binary_op
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package binary_op
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package binary_op
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package binary_op
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package binary_op
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package binary_op
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package binary_op
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package binary_op
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package binary_op
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package binary_op
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package binary_op
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package binary_op
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package binary_op
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package binary_op
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package binary_op
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package binary_op
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package binary_op
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package binary_op
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package binary_op
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package binary_op
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/node"
|
@ -1,4 +1,4 @@
|
||||
package binary_op_test
|
||||
package binary_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/node/expr"
|
||||
"github.com/z7zmey/php-parser/node/expr/binary_op"
|
||||
"github.com/z7zmey/php-parser/node/expr/binary"
|
||||
"github.com/z7zmey/php-parser/node/stmt"
|
||||
"github.com/z7zmey/php-parser/php5"
|
||||
"github.com/z7zmey/php-parser/php7"
|
||||
@ -33,7 +33,7 @@ func TestBitwiseAnd(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.BitwiseAnd{
|
||||
Expr: &binary.BitwiseAnd{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -54,7 +54,7 @@ func TestBitwiseOr(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.BitwiseOr{
|
||||
Expr: &binary.BitwiseOr{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -75,7 +75,7 @@ func TestBitwiseXor(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.BitwiseXor{
|
||||
Expr: &binary.BitwiseXor{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -96,7 +96,7 @@ func TestBooleanAnd(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.BooleanAnd{
|
||||
Expr: &binary.BooleanAnd{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -117,7 +117,7 @@ func TestBooleanOr(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.BooleanOr{
|
||||
Expr: &binary.BooleanOr{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -138,7 +138,7 @@ func TestCoalesce(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Coalesce{
|
||||
Expr: &binary.Coalesce{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -156,7 +156,7 @@ func TestConcat(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Concat{
|
||||
Expr: &binary.Concat{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -177,7 +177,7 @@ func TestDiv(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Div{
|
||||
Expr: &binary.Div{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -198,7 +198,7 @@ func TestEqual(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Equal{
|
||||
Expr: &binary.Equal{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -219,7 +219,7 @@ func TestGreaterOrEqual(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.GreaterOrEqual{
|
||||
Expr: &binary.GreaterOrEqual{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -240,7 +240,7 @@ func TestGreater(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Greater{
|
||||
Expr: &binary.Greater{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -261,7 +261,7 @@ func TestIdentical(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Identical{
|
||||
Expr: &binary.Identical{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -282,7 +282,7 @@ func TestLogicalAnd(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.LogicalAnd{
|
||||
Expr: &binary.LogicalAnd{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -303,7 +303,7 @@ func TestLogicalOr(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.LogicalOr{
|
||||
Expr: &binary.LogicalOr{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -324,7 +324,7 @@ func TestLogicalXor(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.LogicalXor{
|
||||
Expr: &binary.LogicalXor{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -345,7 +345,7 @@ func TestMinus(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Minus{
|
||||
Expr: &binary.Minus{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -366,7 +366,7 @@ func TestMod(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Mod{
|
||||
Expr: &binary.Mod{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -387,7 +387,7 @@ func TestMul(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Mul{
|
||||
Expr: &binary.Mul{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -408,7 +408,7 @@ func TestNotEqual(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.NotEqual{
|
||||
Expr: &binary.NotEqual{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -429,7 +429,7 @@ func TestNotIdentical(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.NotIdentical{
|
||||
Expr: &binary.NotIdentical{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -450,7 +450,7 @@ func TestPlus(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Plus{
|
||||
Expr: &binary.Plus{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -471,7 +471,7 @@ func TestPow(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Pow{
|
||||
Expr: &binary.Pow{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -492,7 +492,7 @@ func TestShiftLeft(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.ShiftLeft{
|
||||
Expr: &binary.ShiftLeft{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -513,7 +513,7 @@ func TestShiftRight(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.ShiftRight{
|
||||
Expr: &binary.ShiftRight{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -534,7 +534,7 @@ func TestSmallerOrEqual(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.SmallerOrEqual{
|
||||
Expr: &binary.SmallerOrEqual{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -555,7 +555,7 @@ func TestSmaller(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Smaller{
|
||||
Expr: &binary.Smaller{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -576,7 +576,7 @@ func TestSpaceship(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Spaceship{
|
||||
Expr: &binary.Spaceship{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
@ -1,4 +1,4 @@
|
||||
package binary_op_test
|
||||
package binary_test
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
@ -8,7 +8,7 @@ import (
|
||||
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/node/expr"
|
||||
"github.com/z7zmey/php-parser/node/expr/binary_op"
|
||||
"github.com/z7zmey/php-parser/node/expr/binary"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
)
|
||||
|
||||
@ -18,7 +18,7 @@ var nodesToTest = []struct {
|
||||
expectedAttributes map[string]interface{}
|
||||
}{
|
||||
{
|
||||
&binary_op.BitwiseAnd{
|
||||
&binary.BitwiseAnd{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -26,7 +26,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary_op.BitwiseOr{
|
||||
&binary.BitwiseOr{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -34,7 +34,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary_op.BitwiseXor{
|
||||
&binary.BitwiseXor{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -42,7 +42,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary_op.BooleanAnd{
|
||||
&binary.BooleanAnd{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -50,7 +50,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary_op.BooleanOr{
|
||||
&binary.BooleanOr{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -58,7 +58,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary_op.Coalesce{
|
||||
&binary.Coalesce{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -66,7 +66,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary_op.Concat{
|
||||
&binary.Concat{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -74,7 +74,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary_op.Div{
|
||||
&binary.Div{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -82,7 +82,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary_op.Equal{
|
||||
&binary.Equal{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -90,7 +90,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary_op.GreaterOrEqual{
|
||||
&binary.GreaterOrEqual{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -98,7 +98,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary_op.Greater{
|
||||
&binary.Greater{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -106,7 +106,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary_op.Identical{
|
||||
&binary.Identical{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -114,7 +114,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary_op.LogicalAnd{
|
||||
&binary.LogicalAnd{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -122,7 +122,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary_op.LogicalOr{
|
||||
&binary.LogicalOr{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -130,7 +130,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary_op.LogicalXor{
|
||||
&binary.LogicalXor{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -138,7 +138,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary_op.Minus{
|
||||
&binary.Minus{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -146,7 +146,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary_op.Mod{
|
||||
&binary.Mod{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -154,7 +154,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary_op.Mul{
|
||||
&binary.Mul{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -162,7 +162,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary_op.NotEqual{
|
||||
&binary.NotEqual{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -170,7 +170,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary_op.NotIdentical{
|
||||
&binary.NotIdentical{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -178,7 +178,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary_op.Plus{
|
||||
&binary.Plus{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -186,7 +186,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary_op.Pow{
|
||||
&binary.Pow{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -194,7 +194,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary_op.ShiftLeft{
|
||||
&binary.ShiftLeft{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -202,7 +202,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary_op.ShiftRight{
|
||||
&binary.ShiftRight{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -210,7 +210,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary_op.SmallerOrEqual{
|
||||
&binary.SmallerOrEqual{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -218,7 +218,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary_op.Smaller{
|
||||
&binary.Smaller{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -226,7 +226,7 @@ var nodesToTest = []struct {
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary_op.Spaceship{
|
||||
&binary.Spaceship{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
@ -4,7 +4,7 @@ import (
|
||||
"bytes"
|
||||
"testing"
|
||||
|
||||
"github.com/z7zmey/php-parser/node/expr/assign_op"
|
||||
"github.com/z7zmey/php-parser/node/expr/assign"
|
||||
|
||||
"github.com/z7zmey/php-parser/node/expr"
|
||||
|
||||
@ -20,7 +20,7 @@ func TestEmptyList(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Assign{
|
||||
Expr: &assign.Assign{
|
||||
Variable: &expr.List{
|
||||
Items: []node.Node{},
|
||||
},
|
||||
@ -43,7 +43,7 @@ func TestList(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Assign{
|
||||
Expr: &assign.Assign{
|
||||
Variable: &expr.List{
|
||||
Items: []node.Node{
|
||||
&expr.ArrayItem{
|
||||
@ -71,7 +71,7 @@ func TestListArrayIndex(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Assign{
|
||||
Expr: &assign.Assign{
|
||||
Variable: &expr.List{
|
||||
Items: []node.Node{
|
||||
&expr.ArrayItem{
|
||||
@ -101,7 +101,7 @@ func TestListList(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Assign{
|
||||
Expr: &assign.Assign{
|
||||
Variable: &expr.List{
|
||||
Items: []node.Node{
|
||||
&expr.ArrayItem{
|
||||
|
@ -4,7 +4,7 @@ import (
|
||||
"bytes"
|
||||
"testing"
|
||||
|
||||
"github.com/z7zmey/php-parser/node/expr/assign_op"
|
||||
"github.com/z7zmey/php-parser/node/expr/assign"
|
||||
|
||||
"github.com/z7zmey/php-parser/node/expr"
|
||||
|
||||
@ -19,7 +19,7 @@ func TestShortList(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Assign{
|
||||
Expr: &assign.Assign{
|
||||
Variable: &expr.ShortList{
|
||||
Items: []node.Node{
|
||||
&expr.ArrayItem{
|
||||
@ -44,7 +44,7 @@ func TestShortListArrayIndex(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Assign{
|
||||
Expr: &assign.Assign{
|
||||
Variable: &expr.ShortList{
|
||||
Items: []node.Node{
|
||||
&expr.ArrayItem{
|
||||
@ -71,7 +71,7 @@ func TestShortListList(t *testing.T) {
|
||||
expected := &stmt.StmtList{
|
||||
Stmts: []node.Node{
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Assign{
|
||||
Expr: &assign.Assign{
|
||||
Variable: &expr.ShortList{
|
||||
Items: []node.Node{
|
||||
&expr.ArrayItem{
|
||||
|
@ -4,10 +4,10 @@ import (
|
||||
"bytes"
|
||||
"testing"
|
||||
|
||||
"github.com/z7zmey/php-parser/node/expr/binary_op"
|
||||
"github.com/z7zmey/php-parser/node/expr/binary"
|
||||
|
||||
"github.com/z7zmey/php-parser/node/expr"
|
||||
"github.com/z7zmey/php-parser/node/expr/assign_op"
|
||||
"github.com/z7zmey/php-parser/node/expr/assign"
|
||||
|
||||
"github.com/z7zmey/php-parser/node/scalar"
|
||||
|
||||
@ -24,13 +24,13 @@ func TestFor(t *testing.T) {
|
||||
Stmts: []node.Node{
|
||||
&stmt.For{
|
||||
Init: []node.Node{
|
||||
&assign_op.Assign{
|
||||
&assign.Assign{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$i"}},
|
||||
Expression: &scalar.Lnumber{Value: "0"},
|
||||
},
|
||||
},
|
||||
Cond: []node.Node{
|
||||
&binary_op.Smaller{
|
||||
&binary.Smaller{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$i"}},
|
||||
Right: &scalar.Lnumber{Value: "10"},
|
||||
},
|
||||
@ -62,7 +62,7 @@ func TestAltFor(t *testing.T) {
|
||||
Stmts: []node.Node{
|
||||
&stmt.AltFor{
|
||||
Cond: []node.Node{
|
||||
&binary_op.Smaller{
|
||||
&binary.Smaller{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$i"}},
|
||||
Right: &scalar.Lnumber{Value: "10"},
|
||||
},
|
||||
|
136
php5/php5.go
136
php5/php5.go
@ -10,8 +10,8 @@ import (
|
||||
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/node/expr"
|
||||
"github.com/z7zmey/php-parser/node/expr/assign_op"
|
||||
"github.com/z7zmey/php-parser/node/expr/binary_op"
|
||||
"github.com/z7zmey/php-parser/node/expr/assign"
|
||||
"github.com/z7zmey/php-parser/node/expr/binary"
|
||||
"github.com/z7zmey/php-parser/node/expr/cast"
|
||||
"github.com/z7zmey/php-parser/node/name"
|
||||
"github.com/z7zmey/php-parser/node/scalar"
|
||||
@ -4239,7 +4239,7 @@ yydefault:
|
||||
{
|
||||
list := expr.NewList(yyDollar[3].list)
|
||||
positions.AddPosition(list, positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token))
|
||||
yyVAL.node = assign_op.NewAssign(list, yyDollar[6].node)
|
||||
yyVAL.node = assign.NewAssign(list, yyDollar[6].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[6].node))
|
||||
|
||||
comments.AddComments(list, yyDollar[1].token.Comments())
|
||||
@ -4249,7 +4249,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:1860
|
||||
{
|
||||
yyVAL.node = assign_op.NewAssign(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4257,7 +4257,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-4 : yypt+1]
|
||||
//line php5/php5.y:1866
|
||||
{
|
||||
yyVAL.node = assign_op.NewAssignRef(yyDollar[1].node, yyDollar[4].node)
|
||||
yyVAL.node = assign.NewAssignRef(yyDollar[1].node, yyDollar[4].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4274,7 +4274,7 @@ yydefault:
|
||||
}
|
||||
comments.AddComments(_new, comments[yyDollar[1].node])
|
||||
|
||||
yyVAL.node = assign_op.NewAssignRef(yyDollar[1].node, _new)
|
||||
yyVAL.node = assign.NewAssignRef(yyDollar[1].node, _new)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, _new))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4290,7 +4290,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:1893
|
||||
{
|
||||
yyVAL.node = assign_op.NewPlus(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4298,7 +4298,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:1899
|
||||
{
|
||||
yyVAL.node = assign_op.NewMinus(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4306,7 +4306,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:1905
|
||||
{
|
||||
yyVAL.node = assign_op.NewMul(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4314,7 +4314,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:1911
|
||||
{
|
||||
yyVAL.node = assign_op.NewPow(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4322,7 +4322,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:1917
|
||||
{
|
||||
yyVAL.node = assign_op.NewDiv(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4330,7 +4330,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:1923
|
||||
{
|
||||
yyVAL.node = assign_op.NewConcat(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4338,7 +4338,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:1929
|
||||
{
|
||||
yyVAL.node = assign_op.NewMod(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4346,7 +4346,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:1935
|
||||
{
|
||||
yyVAL.node = assign_op.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4354,7 +4354,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:1941
|
||||
{
|
||||
yyVAL.node = assign_op.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4362,7 +4362,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:1947
|
||||
{
|
||||
yyVAL.node = assign_op.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4370,7 +4370,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:1953
|
||||
{
|
||||
yyVAL.node = assign_op.NewShiftLeft(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4378,7 +4378,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:1959
|
||||
{
|
||||
yyVAL.node = assign_op.NewShiftRight(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4418,7 +4418,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:1989
|
||||
{
|
||||
yyVAL.node = binary_op.NewBooleanOr(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4426,7 +4426,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:1995
|
||||
{
|
||||
yyVAL.node = binary_op.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4434,7 +4434,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2001
|
||||
{
|
||||
yyVAL.node = binary_op.NewLogicalOr(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4442,7 +4442,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2007
|
||||
{
|
||||
yyVAL.node = binary_op.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4450,7 +4450,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2013
|
||||
{
|
||||
yyVAL.node = binary_op.NewLogicalXor(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4458,7 +4458,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2019
|
||||
{
|
||||
yyVAL.node = binary_op.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4466,7 +4466,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2025
|
||||
{
|
||||
yyVAL.node = binary_op.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4474,7 +4474,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2031
|
||||
{
|
||||
yyVAL.node = binary_op.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4482,7 +4482,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2037
|
||||
{
|
||||
yyVAL.node = binary_op.NewConcat(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4490,7 +4490,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2043
|
||||
{
|
||||
yyVAL.node = binary_op.NewPlus(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4498,7 +4498,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2049
|
||||
{
|
||||
yyVAL.node = binary_op.NewMinus(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4506,7 +4506,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2055
|
||||
{
|
||||
yyVAL.node = binary_op.NewMul(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4514,7 +4514,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2061
|
||||
{
|
||||
yyVAL.node = binary_op.NewPow(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4522,7 +4522,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2067
|
||||
{
|
||||
yyVAL.node = binary_op.NewDiv(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4530,7 +4530,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2073
|
||||
{
|
||||
yyVAL.node = binary_op.NewMod(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4538,7 +4538,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2079
|
||||
{
|
||||
yyVAL.node = binary_op.NewShiftLeft(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4546,7 +4546,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2085
|
||||
{
|
||||
yyVAL.node = binary_op.NewShiftRight(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4586,7 +4586,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2115
|
||||
{
|
||||
yyVAL.node = binary_op.NewIdentical(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4594,7 +4594,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2121
|
||||
{
|
||||
yyVAL.node = binary_op.NewNotIdentical(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4602,7 +4602,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2127
|
||||
{
|
||||
yyVAL.node = binary_op.NewEqual(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4610,7 +4610,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2133
|
||||
{
|
||||
yyVAL.node = binary_op.NewNotEqual(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4618,7 +4618,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2139
|
||||
{
|
||||
yyVAL.node = binary_op.NewSmaller(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4626,7 +4626,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2145
|
||||
{
|
||||
yyVAL.node = binary_op.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4634,7 +4634,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2151
|
||||
{
|
||||
yyVAL.node = binary_op.NewGreater(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4642,7 +4642,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2157
|
||||
{
|
||||
yyVAL.node = binary_op.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -5490,7 +5490,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2819
|
||||
{
|
||||
yyVAL.node = binary_op.NewPlus(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -5498,7 +5498,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2825
|
||||
{
|
||||
yyVAL.node = binary_op.NewMinus(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -5506,7 +5506,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2831
|
||||
{
|
||||
yyVAL.node = binary_op.NewMul(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -5514,7 +5514,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2837
|
||||
{
|
||||
yyVAL.node = binary_op.NewPow(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -5522,7 +5522,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2843
|
||||
{
|
||||
yyVAL.node = binary_op.NewDiv(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -5530,7 +5530,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2849
|
||||
{
|
||||
yyVAL.node = binary_op.NewMod(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -5554,7 +5554,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2867
|
||||
{
|
||||
yyVAL.node = binary_op.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -5562,7 +5562,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2873
|
||||
{
|
||||
yyVAL.node = binary_op.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -5570,7 +5570,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2879
|
||||
{
|
||||
yyVAL.node = binary_op.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -5578,7 +5578,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2885
|
||||
{
|
||||
yyVAL.node = binary_op.NewShiftLeft(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -5586,7 +5586,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2891
|
||||
{
|
||||
yyVAL.node = binary_op.NewShiftRight(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -5594,7 +5594,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2897
|
||||
{
|
||||
yyVAL.node = binary_op.NewConcat(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -5602,7 +5602,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2903
|
||||
{
|
||||
yyVAL.node = binary_op.NewLogicalXor(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -5610,7 +5610,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2909
|
||||
{
|
||||
yyVAL.node = binary_op.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -5618,7 +5618,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2915
|
||||
{
|
||||
yyVAL.node = binary_op.NewLogicalOr(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -5626,7 +5626,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2921
|
||||
{
|
||||
yyVAL.node = binary_op.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -5634,7 +5634,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2927
|
||||
{
|
||||
yyVAL.node = binary_op.NewBooleanOr(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -5642,7 +5642,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2933
|
||||
{
|
||||
yyVAL.node = binary_op.NewIdentical(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -5650,7 +5650,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2939
|
||||
{
|
||||
yyVAL.node = binary_op.NewNotIdentical(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -5658,7 +5658,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2945
|
||||
{
|
||||
yyVAL.node = binary_op.NewEqual(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -5666,7 +5666,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2951
|
||||
{
|
||||
yyVAL.node = binary_op.NewNotEqual(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -5674,7 +5674,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2957
|
||||
{
|
||||
yyVAL.node = binary_op.NewSmaller(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -5682,7 +5682,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2963
|
||||
{
|
||||
yyVAL.node = binary_op.NewGreater(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -5690,7 +5690,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2969
|
||||
{
|
||||
yyVAL.node = binary_op.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -5698,7 +5698,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php5/php5.y:2975
|
||||
{
|
||||
yyVAL.node = binary_op.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
|
136
php5/php5.y
136
php5/php5.y
@ -11,8 +11,8 @@ import (
|
||||
"github.com/z7zmey/php-parser/node/name"
|
||||
"github.com/z7zmey/php-parser/node/stmt"
|
||||
"github.com/z7zmey/php-parser/node/expr"
|
||||
"github.com/z7zmey/php-parser/node/expr/assign_op"
|
||||
"github.com/z7zmey/php-parser/node/expr/binary_op"
|
||||
"github.com/z7zmey/php-parser/node/expr/assign"
|
||||
"github.com/z7zmey/php-parser/node/expr/binary"
|
||||
"github.com/z7zmey/php-parser/node/expr/cast"
|
||||
)
|
||||
|
||||
@ -1850,7 +1850,7 @@ expr_without_variable:
|
||||
{
|
||||
list := expr.NewList($3)
|
||||
positions.AddPosition(list, positionBuilder.NewTokensPosition($1, $4))
|
||||
$$ = assign_op.NewAssign(list, $6)
|
||||
$$ = assign.NewAssign(list, $6)
|
||||
positions.AddPosition($$, positionBuilder.NewTokenNodePosition($1, $6))
|
||||
|
||||
comments.AddComments(list, $1.Comments())
|
||||
@ -1858,13 +1858,13 @@ expr_without_variable:
|
||||
}
|
||||
| variable '=' expr
|
||||
{
|
||||
$$ = assign_op.NewAssign($1, $3)
|
||||
$$ = assign.NewAssign($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| variable '=' '&' variable
|
||||
{
|
||||
$$ = assign_op.NewAssignRef($1, $4)
|
||||
$$ = assign.NewAssignRef($1, $4)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $4))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
@ -1879,7 +1879,7 @@ expr_without_variable:
|
||||
}
|
||||
comments.AddComments(_new, comments[$1])
|
||||
|
||||
$$ = assign_op.NewAssignRef($1, _new)
|
||||
$$ = assign.NewAssignRef($1, _new)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, _new))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
@ -1891,73 +1891,73 @@ expr_without_variable:
|
||||
}
|
||||
| variable T_PLUS_EQUAL expr
|
||||
{
|
||||
$$ = assign_op.NewPlus($1, $3)
|
||||
$$ = assign.NewPlus($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| variable T_MINUS_EQUAL expr
|
||||
{
|
||||
$$ = assign_op.NewMinus($1, $3)
|
||||
$$ = assign.NewMinus($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| variable T_MUL_EQUAL expr
|
||||
{
|
||||
$$ = assign_op.NewMul($1, $3)
|
||||
$$ = assign.NewMul($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| variable T_POW_EQUAL expr
|
||||
{
|
||||
$$ = assign_op.NewPow($1, $3)
|
||||
$$ = assign.NewPow($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| variable T_DIV_EQUAL expr
|
||||
{
|
||||
$$ = assign_op.NewDiv($1, $3)
|
||||
$$ = assign.NewDiv($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| variable T_CONCAT_EQUAL expr
|
||||
{
|
||||
$$ = assign_op.NewConcat($1, $3)
|
||||
$$ = assign.NewConcat($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| variable T_MOD_EQUAL expr
|
||||
{
|
||||
$$ = assign_op.NewMod($1, $3)
|
||||
$$ = assign.NewMod($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| variable T_AND_EQUAL expr
|
||||
{
|
||||
$$ = assign_op.NewBitwiseAnd($1, $3)
|
||||
$$ = assign.NewBitwiseAnd($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| variable T_OR_EQUAL expr
|
||||
{
|
||||
$$ = assign_op.NewBitwiseOr($1, $3)
|
||||
$$ = assign.NewBitwiseOr($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| variable T_XOR_EQUAL expr
|
||||
{
|
||||
$$ = assign_op.NewBitwiseXor($1, $3)
|
||||
$$ = assign.NewBitwiseXor($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| variable T_SL_EQUAL expr
|
||||
{
|
||||
$$ = assign_op.NewShiftLeft($1, $3)
|
||||
$$ = assign.NewShiftLeft($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| variable T_SR_EQUAL expr
|
||||
{
|
||||
$$ = assign_op.NewShiftRight($1, $3)
|
||||
$$ = assign.NewShiftRight($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
@ -1987,103 +1987,103 @@ expr_without_variable:
|
||||
}
|
||||
| expr T_BOOLEAN_OR expr
|
||||
{
|
||||
$$ = binary_op.NewBooleanOr($1, $3)
|
||||
$$ = binary.NewBooleanOr($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr T_BOOLEAN_AND expr
|
||||
{
|
||||
$$ = binary_op.NewBooleanAnd($1, $3)
|
||||
$$ = binary.NewBooleanAnd($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr T_LOGICAL_OR expr
|
||||
{
|
||||
$$ = binary_op.NewLogicalOr($1, $3)
|
||||
$$ = binary.NewLogicalOr($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr T_LOGICAL_AND expr
|
||||
{
|
||||
$$ = binary_op.NewLogicalAnd($1, $3)
|
||||
$$ = binary.NewLogicalAnd($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr T_LOGICAL_XOR expr
|
||||
{
|
||||
$$ = binary_op.NewLogicalXor($1, $3)
|
||||
$$ = binary.NewLogicalXor($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr '|' expr
|
||||
{
|
||||
$$ = binary_op.NewBitwiseOr($1, $3)
|
||||
$$ = binary.NewBitwiseOr($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr '&' expr
|
||||
{
|
||||
$$ = binary_op.NewBitwiseAnd($1, $3)
|
||||
$$ = binary.NewBitwiseAnd($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr '^' expr
|
||||
{
|
||||
$$ = binary_op.NewBitwiseXor($1, $3)
|
||||
$$ = binary.NewBitwiseXor($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr '.' expr
|
||||
{
|
||||
$$ = binary_op.NewConcat($1, $3)
|
||||
$$ = binary.NewConcat($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr '+' expr
|
||||
{
|
||||
$$ = binary_op.NewPlus($1, $3)
|
||||
$$ = binary.NewPlus($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr '-' expr
|
||||
{
|
||||
$$ = binary_op.NewMinus($1, $3)
|
||||
$$ = binary.NewMinus($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr '*' expr
|
||||
{
|
||||
$$ = binary_op.NewMul($1, $3)
|
||||
$$ = binary.NewMul($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr T_POW expr
|
||||
{
|
||||
$$ = binary_op.NewPow($1, $3)
|
||||
$$ = binary.NewPow($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr '/' expr
|
||||
{
|
||||
$$ = binary_op.NewDiv($1, $3)
|
||||
$$ = binary.NewDiv($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr '%' expr
|
||||
{
|
||||
$$ = binary_op.NewMod($1, $3)
|
||||
$$ = binary.NewMod($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr T_SL expr
|
||||
{
|
||||
$$ = binary_op.NewShiftLeft($1, $3)
|
||||
$$ = binary.NewShiftLeft($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr T_SR expr
|
||||
{
|
||||
$$ = binary_op.NewShiftRight($1, $3)
|
||||
$$ = binary.NewShiftRight($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
@ -2113,49 +2113,49 @@ expr_without_variable:
|
||||
}
|
||||
| expr T_IS_IDENTICAL expr
|
||||
{
|
||||
$$ = binary_op.NewIdentical($1, $3)
|
||||
$$ = binary.NewIdentical($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr T_IS_NOT_IDENTICAL expr
|
||||
{
|
||||
$$ = binary_op.NewNotIdentical($1, $3)
|
||||
$$ = binary.NewNotIdentical($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr T_IS_EQUAL expr
|
||||
{
|
||||
$$ = binary_op.NewEqual($1, $3)
|
||||
$$ = binary.NewEqual($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr T_IS_NOT_EQUAL expr
|
||||
{
|
||||
$$ = binary_op.NewNotEqual($1, $3)
|
||||
$$ = binary.NewNotEqual($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr '<' expr
|
||||
{
|
||||
$$ = binary_op.NewSmaller($1, $3)
|
||||
$$ = binary.NewSmaller($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr T_IS_SMALLER_OR_EQUAL expr
|
||||
{
|
||||
$$ = binary_op.NewSmallerOrEqual($1, $3)
|
||||
$$ = binary.NewSmallerOrEqual($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr '>' expr
|
||||
{
|
||||
$$ = binary_op.NewGreater($1, $3)
|
||||
$$ = binary.NewGreater($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr T_IS_GREATER_OR_EQUAL expr
|
||||
{
|
||||
$$ = binary_op.NewGreaterOrEqual($1, $3)
|
||||
$$ = binary.NewGreaterOrEqual($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
@ -2818,37 +2818,37 @@ static_operation:
|
||||
}
|
||||
| static_scalar_value '+' static_scalar_value
|
||||
{
|
||||
$$ = binary_op.NewPlus($1, $3)
|
||||
$$ = binary.NewPlus($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| static_scalar_value '-' static_scalar_value
|
||||
{
|
||||
$$ = binary_op.NewMinus($1, $3)
|
||||
$$ = binary.NewMinus($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| static_scalar_value '*' static_scalar_value
|
||||
{
|
||||
$$ = binary_op.NewMul($1, $3)
|
||||
$$ = binary.NewMul($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| static_scalar_value T_POW static_scalar_value
|
||||
{
|
||||
$$ = binary_op.NewPow($1, $3)
|
||||
$$ = binary.NewPow($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| static_scalar_value '/' static_scalar_value
|
||||
{
|
||||
$$ = binary_op.NewDiv($1, $3)
|
||||
$$ = binary.NewDiv($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| static_scalar_value '%' static_scalar_value
|
||||
{
|
||||
$$ = binary_op.NewMod($1, $3)
|
||||
$$ = binary.NewMod($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
@ -2866,115 +2866,115 @@ static_operation:
|
||||
}
|
||||
| static_scalar_value '|' static_scalar_value
|
||||
{
|
||||
$$ = binary_op.NewBitwiseOr($1, $3)
|
||||
$$ = binary.NewBitwiseOr($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| static_scalar_value '&' static_scalar_value
|
||||
{
|
||||
$$ = binary_op.NewBitwiseAnd($1, $3)
|
||||
$$ = binary.NewBitwiseAnd($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| static_scalar_value '^' static_scalar_value
|
||||
{
|
||||
$$ = binary_op.NewBitwiseXor($1, $3)
|
||||
$$ = binary.NewBitwiseXor($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| static_scalar_value T_SL static_scalar_value
|
||||
{
|
||||
$$ = binary_op.NewShiftLeft($1, $3)
|
||||
$$ = binary.NewShiftLeft($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| static_scalar_value T_SR static_scalar_value
|
||||
{
|
||||
$$ = binary_op.NewShiftRight($1, $3)
|
||||
$$ = binary.NewShiftRight($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| static_scalar_value '.' static_scalar_value
|
||||
{
|
||||
$$ = binary_op.NewConcat($1, $3)
|
||||
$$ = binary.NewConcat($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| static_scalar_value T_LOGICAL_XOR static_scalar_value
|
||||
{
|
||||
$$ = binary_op.NewLogicalXor($1, $3)
|
||||
$$ = binary.NewLogicalXor($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| static_scalar_value T_LOGICAL_AND static_scalar_value
|
||||
{
|
||||
$$ = binary_op.NewLogicalAnd($1, $3)
|
||||
$$ = binary.NewLogicalAnd($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| static_scalar_value T_LOGICAL_OR static_scalar_value
|
||||
{
|
||||
$$ = binary_op.NewLogicalOr($1, $3)
|
||||
$$ = binary.NewLogicalOr($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| static_scalar_value T_BOOLEAN_AND static_scalar_value
|
||||
{
|
||||
$$ = binary_op.NewBooleanAnd($1, $3)
|
||||
$$ = binary.NewBooleanAnd($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| static_scalar_value T_BOOLEAN_OR static_scalar_value
|
||||
{
|
||||
$$ = binary_op.NewBooleanOr($1, $3)
|
||||
$$ = binary.NewBooleanOr($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| static_scalar_value T_IS_IDENTICAL static_scalar_value
|
||||
{
|
||||
$$ = binary_op.NewIdentical($1, $3)
|
||||
$$ = binary.NewIdentical($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| static_scalar_value T_IS_NOT_IDENTICAL static_scalar_value
|
||||
{
|
||||
$$ = binary_op.NewNotIdentical($1, $3)
|
||||
$$ = binary.NewNotIdentical($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| static_scalar_value T_IS_EQUAL static_scalar_value
|
||||
{
|
||||
$$ = binary_op.NewEqual($1, $3)
|
||||
$$ = binary.NewEqual($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| static_scalar_value T_IS_NOT_EQUAL static_scalar_value
|
||||
{
|
||||
$$ = binary_op.NewNotEqual($1, $3)
|
||||
$$ = binary.NewNotEqual($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| static_scalar_value '<' static_scalar_value
|
||||
{
|
||||
$$ = binary_op.NewSmaller($1, $3)
|
||||
$$ = binary.NewSmaller($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| static_scalar_value '>' static_scalar_value
|
||||
{
|
||||
$$ = binary_op.NewGreater($1, $3)
|
||||
$$ = binary.NewGreater($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| static_scalar_value T_IS_SMALLER_OR_EQUAL static_scalar_value
|
||||
{
|
||||
$$ = binary_op.NewSmallerOrEqual($1, $3)
|
||||
$$ = binary.NewSmallerOrEqual($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| static_scalar_value T_IS_GREATER_OR_EQUAL static_scalar_value
|
||||
{
|
||||
$$ = binary_op.NewGreaterOrEqual($1, $3)
|
||||
$$ = binary.NewGreaterOrEqual($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
|
@ -7,8 +7,8 @@ import (
|
||||
|
||||
"github.com/kylelemons/godebug/pretty"
|
||||
"github.com/z7zmey/php-parser/node/expr"
|
||||
"github.com/z7zmey/php-parser/node/expr/assign_op"
|
||||
"github.com/z7zmey/php-parser/node/expr/binary_op"
|
||||
"github.com/z7zmey/php-parser/node/expr/assign"
|
||||
"github.com/z7zmey/php-parser/node/expr/binary"
|
||||
"github.com/z7zmey/php-parser/node/expr/cast"
|
||||
"github.com/z7zmey/php-parser/node/name"
|
||||
"github.com/z7zmey/php-parser/node/scalar"
|
||||
@ -1033,13 +1033,13 @@ CAD;
|
||||
},
|
||||
&stmt.For{
|
||||
Init: []node.Node{
|
||||
&assign_op.Assign{
|
||||
&assign.Assign{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$i"}},
|
||||
Expression: &scalar.Lnumber{Value: "0"},
|
||||
},
|
||||
},
|
||||
Cond: []node.Node{
|
||||
&binary_op.Smaller{
|
||||
&binary.Smaller{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$i"}},
|
||||
Right: &scalar.Lnumber{Value: "10"},
|
||||
},
|
||||
@ -1056,7 +1056,7 @@ CAD;
|
||||
},
|
||||
&stmt.AltFor{
|
||||
Cond: []node.Node{
|
||||
&binary_op.Smaller{
|
||||
&binary.Smaller{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$i"}},
|
||||
Right: &scalar.Lnumber{Value: "10"},
|
||||
},
|
||||
@ -2280,7 +2280,7 @@ CAD;
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Assign{
|
||||
Expr: &assign.Assign{
|
||||
Variable: &expr.List{
|
||||
Items: []node.Node{},
|
||||
},
|
||||
@ -2288,7 +2288,7 @@ CAD;
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Assign{
|
||||
Expr: &assign.Assign{
|
||||
Variable: &expr.List{
|
||||
Items: []node.Node{
|
||||
&expr.ArrayItem{
|
||||
@ -2305,7 +2305,7 @@ CAD;
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Assign{
|
||||
Expr: &assign.Assign{
|
||||
Variable: &expr.List{
|
||||
Items: []node.Node{
|
||||
&expr.ArrayItem{
|
||||
@ -2320,7 +2320,7 @@ CAD;
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Assign{
|
||||
Expr: &assign.Assign{
|
||||
Variable: &expr.List{
|
||||
Items: []node.Node{
|
||||
&expr.ArrayItem{
|
||||
@ -2699,163 +2699,163 @@ CAD;
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.BitwiseAnd{
|
||||
Expr: &binary.BitwiseAnd{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.BitwiseOr{
|
||||
Expr: &binary.BitwiseOr{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.BitwiseXor{
|
||||
Expr: &binary.BitwiseXor{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.BooleanAnd{
|
||||
Expr: &binary.BooleanAnd{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.BooleanOr{
|
||||
Expr: &binary.BooleanOr{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Concat{
|
||||
Expr: &binary.Concat{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Div{
|
||||
Expr: &binary.Div{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Equal{
|
||||
Expr: &binary.Equal{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.GreaterOrEqual{
|
||||
Expr: &binary.GreaterOrEqual{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Greater{
|
||||
Expr: &binary.Greater{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Identical{
|
||||
Expr: &binary.Identical{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.LogicalAnd{
|
||||
Expr: &binary.LogicalAnd{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.LogicalOr{
|
||||
Expr: &binary.LogicalOr{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.LogicalXor{
|
||||
Expr: &binary.LogicalXor{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Minus{
|
||||
Expr: &binary.Minus{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Mod{
|
||||
Expr: &binary.Mod{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Mul{
|
||||
Expr: &binary.Mul{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.NotEqual{
|
||||
Expr: &binary.NotEqual{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.NotIdentical{
|
||||
Expr: &binary.NotIdentical{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Plus{
|
||||
Expr: &binary.Plus{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Pow{
|
||||
Expr: &binary.Pow{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.ShiftLeft{
|
||||
Expr: &binary.ShiftLeft{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.ShiftRight{
|
||||
Expr: &binary.ShiftRight{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.SmallerOrEqual{
|
||||
Expr: &binary.SmallerOrEqual{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Smaller{
|
||||
Expr: &binary.Smaller{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.AssignRef{
|
||||
Expr: &assign.AssignRef{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.AssignRef{
|
||||
Expr: &assign.AssignRef{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.New{
|
||||
Class: &name.Name{
|
||||
@ -2867,7 +2867,7 @@ CAD;
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.AssignRef{
|
||||
Expr: &assign.AssignRef{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.New{
|
||||
Class: &name.Name{
|
||||
@ -2886,79 +2886,79 @@ CAD;
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Assign{
|
||||
Expr: &assign.Assign{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.BitwiseAnd{
|
||||
Expr: &assign.BitwiseAnd{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.BitwiseOr{
|
||||
Expr: &assign.BitwiseOr{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.BitwiseXor{
|
||||
Expr: &assign.BitwiseXor{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Concat{
|
||||
Expr: &assign.Concat{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Div{
|
||||
Expr: &assign.Div{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Minus{
|
||||
Expr: &assign.Minus{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Mod{
|
||||
Expr: &assign.Mod{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Mul{
|
||||
Expr: &assign.Mul{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Plus{
|
||||
Expr: &assign.Plus{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Pow{
|
||||
Expr: &assign.Pow{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.ShiftLeft{
|
||||
Expr: &assign.ShiftLeft{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.ShiftRight{
|
||||
Expr: &assign.ShiftRight{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
@ -3216,7 +3216,7 @@ CAD;
|
||||
Vars: []node.Node{
|
||||
&stmt.StaticVar{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expr: &binary_op.BitwiseAnd{
|
||||
Expr: &binary.BitwiseAnd{
|
||||
Left: &scalar.Lnumber{Value: "1"},
|
||||
Right: &scalar.Lnumber{Value: "2"},
|
||||
},
|
||||
@ -3227,7 +3227,7 @@ CAD;
|
||||
Vars: []node.Node{
|
||||
&stmt.StaticVar{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expr: &binary_op.BitwiseOr{
|
||||
Expr: &binary.BitwiseOr{
|
||||
Left: &scalar.Lnumber{Value: "1"},
|
||||
Right: &scalar.Lnumber{Value: "2"},
|
||||
},
|
||||
@ -3238,7 +3238,7 @@ CAD;
|
||||
Vars: []node.Node{
|
||||
&stmt.StaticVar{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expr: &binary_op.BitwiseXor{
|
||||
Expr: &binary.BitwiseXor{
|
||||
Left: &scalar.Lnumber{Value: "1"},
|
||||
Right: &scalar.Lnumber{Value: "2"},
|
||||
},
|
||||
@ -3249,7 +3249,7 @@ CAD;
|
||||
Vars: []node.Node{
|
||||
&stmt.StaticVar{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expr: &binary_op.BooleanAnd{
|
||||
Expr: &binary.BooleanAnd{
|
||||
Left: &scalar.Lnumber{Value: "1"},
|
||||
Right: &scalar.Lnumber{Value: "2"},
|
||||
},
|
||||
@ -3260,7 +3260,7 @@ CAD;
|
||||
Vars: []node.Node{
|
||||
&stmt.StaticVar{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expr: &binary_op.BooleanOr{
|
||||
Expr: &binary.BooleanOr{
|
||||
Left: &scalar.Lnumber{Value: "1"},
|
||||
Right: &scalar.Lnumber{Value: "2"},
|
||||
},
|
||||
@ -3271,7 +3271,7 @@ CAD;
|
||||
Vars: []node.Node{
|
||||
&stmt.StaticVar{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expr: &binary_op.Concat{
|
||||
Expr: &binary.Concat{
|
||||
Left: &scalar.Lnumber{Value: "1"},
|
||||
Right: &scalar.Lnumber{Value: "2"},
|
||||
},
|
||||
@ -3282,7 +3282,7 @@ CAD;
|
||||
Vars: []node.Node{
|
||||
&stmt.StaticVar{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expr: &binary_op.Div{
|
||||
Expr: &binary.Div{
|
||||
Left: &scalar.Lnumber{Value: "1"},
|
||||
Right: &scalar.Lnumber{Value: "2"},
|
||||
},
|
||||
@ -3293,7 +3293,7 @@ CAD;
|
||||
Vars: []node.Node{
|
||||
&stmt.StaticVar{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expr: &binary_op.Equal{
|
||||
Expr: &binary.Equal{
|
||||
Left: &scalar.Lnumber{Value: "1"},
|
||||
Right: &scalar.Lnumber{Value: "2"},
|
||||
},
|
||||
@ -3304,7 +3304,7 @@ CAD;
|
||||
Vars: []node.Node{
|
||||
&stmt.StaticVar{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expr: &binary_op.GreaterOrEqual{
|
||||
Expr: &binary.GreaterOrEqual{
|
||||
Left: &scalar.Lnumber{Value: "1"},
|
||||
Right: &scalar.Lnumber{Value: "2"},
|
||||
},
|
||||
@ -3315,7 +3315,7 @@ CAD;
|
||||
Vars: []node.Node{
|
||||
&stmt.StaticVar{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expr: &binary_op.Greater{
|
||||
Expr: &binary.Greater{
|
||||
Left: &scalar.Lnumber{Value: "1"},
|
||||
Right: &scalar.Lnumber{Value: "2"},
|
||||
},
|
||||
@ -3326,7 +3326,7 @@ CAD;
|
||||
Vars: []node.Node{
|
||||
&stmt.StaticVar{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expr: &binary_op.Identical{
|
||||
Expr: &binary.Identical{
|
||||
Left: &scalar.Lnumber{Value: "1"},
|
||||
Right: &scalar.Lnumber{Value: "2"},
|
||||
},
|
||||
@ -3337,7 +3337,7 @@ CAD;
|
||||
Vars: []node.Node{
|
||||
&stmt.StaticVar{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expr: &binary_op.LogicalAnd{
|
||||
Expr: &binary.LogicalAnd{
|
||||
Left: &scalar.Lnumber{Value: "1"},
|
||||
Right: &scalar.Lnumber{Value: "2"},
|
||||
},
|
||||
@ -3348,7 +3348,7 @@ CAD;
|
||||
Vars: []node.Node{
|
||||
&stmt.StaticVar{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expr: &binary_op.LogicalOr{
|
||||
Expr: &binary.LogicalOr{
|
||||
Left: &scalar.Lnumber{Value: "1"},
|
||||
Right: &scalar.Lnumber{Value: "2"},
|
||||
},
|
||||
@ -3359,7 +3359,7 @@ CAD;
|
||||
Vars: []node.Node{
|
||||
&stmt.StaticVar{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expr: &binary_op.LogicalXor{
|
||||
Expr: &binary.LogicalXor{
|
||||
Left: &scalar.Lnumber{Value: "1"},
|
||||
Right: &scalar.Lnumber{Value: "2"},
|
||||
},
|
||||
@ -3370,7 +3370,7 @@ CAD;
|
||||
Vars: []node.Node{
|
||||
&stmt.StaticVar{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expr: &binary_op.Minus{
|
||||
Expr: &binary.Minus{
|
||||
Left: &scalar.Lnumber{Value: "1"},
|
||||
Right: &scalar.Lnumber{Value: "2"},
|
||||
},
|
||||
@ -3381,7 +3381,7 @@ CAD;
|
||||
Vars: []node.Node{
|
||||
&stmt.StaticVar{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expr: &binary_op.Mod{
|
||||
Expr: &binary.Mod{
|
||||
Left: &scalar.Lnumber{Value: "1"},
|
||||
Right: &scalar.Lnumber{Value: "2"},
|
||||
},
|
||||
@ -3392,7 +3392,7 @@ CAD;
|
||||
Vars: []node.Node{
|
||||
&stmt.StaticVar{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expr: &binary_op.Mul{
|
||||
Expr: &binary.Mul{
|
||||
Left: &scalar.Lnumber{Value: "1"},
|
||||
Right: &scalar.Lnumber{Value: "2"},
|
||||
},
|
||||
@ -3403,7 +3403,7 @@ CAD;
|
||||
Vars: []node.Node{
|
||||
&stmt.StaticVar{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expr: &binary_op.NotEqual{
|
||||
Expr: &binary.NotEqual{
|
||||
Left: &scalar.Lnumber{Value: "1"},
|
||||
Right: &scalar.Lnumber{Value: "2"},
|
||||
},
|
||||
@ -3414,7 +3414,7 @@ CAD;
|
||||
Vars: []node.Node{
|
||||
&stmt.StaticVar{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expr: &binary_op.NotIdentical{
|
||||
Expr: &binary.NotIdentical{
|
||||
Left: &scalar.Lnumber{Value: "1"},
|
||||
Right: &scalar.Lnumber{Value: "2"},
|
||||
},
|
||||
@ -3425,7 +3425,7 @@ CAD;
|
||||
Vars: []node.Node{
|
||||
&stmt.StaticVar{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expr: &binary_op.Plus{
|
||||
Expr: &binary.Plus{
|
||||
Left: &scalar.Lnumber{Value: "1"},
|
||||
Right: &scalar.Lnumber{Value: "2"},
|
||||
},
|
||||
@ -3436,7 +3436,7 @@ CAD;
|
||||
Vars: []node.Node{
|
||||
&stmt.StaticVar{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expr: &binary_op.Pow{
|
||||
Expr: &binary.Pow{
|
||||
Left: &scalar.Lnumber{Value: "1"},
|
||||
Right: &scalar.Lnumber{Value: "2"},
|
||||
},
|
||||
@ -3447,7 +3447,7 @@ CAD;
|
||||
Vars: []node.Node{
|
||||
&stmt.StaticVar{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expr: &binary_op.ShiftLeft{
|
||||
Expr: &binary.ShiftLeft{
|
||||
Left: &scalar.Lnumber{Value: "1"},
|
||||
Right: &scalar.Lnumber{Value: "2"},
|
||||
},
|
||||
@ -3458,7 +3458,7 @@ CAD;
|
||||
Vars: []node.Node{
|
||||
&stmt.StaticVar{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expr: &binary_op.ShiftRight{
|
||||
Expr: &binary.ShiftRight{
|
||||
Left: &scalar.Lnumber{Value: "1"},
|
||||
Right: &scalar.Lnumber{Value: "2"},
|
||||
},
|
||||
@ -3469,7 +3469,7 @@ CAD;
|
||||
Vars: []node.Node{
|
||||
&stmt.StaticVar{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expr: &binary_op.SmallerOrEqual{
|
||||
Expr: &binary.SmallerOrEqual{
|
||||
Left: &scalar.Lnumber{Value: "1"},
|
||||
Right: &scalar.Lnumber{Value: "2"},
|
||||
},
|
||||
@ -3480,7 +3480,7 @@ CAD;
|
||||
Vars: []node.Node{
|
||||
&stmt.StaticVar{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expr: &binary_op.Smaller{
|
||||
Expr: &binary.Smaller{
|
||||
Left: &scalar.Lnumber{Value: "1"},
|
||||
Right: &scalar.Lnumber{Value: "2"},
|
||||
},
|
||||
|
90
php7/php7.go
90
php7/php7.go
@ -10,8 +10,8 @@ import (
|
||||
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/node/expr"
|
||||
"github.com/z7zmey/php-parser/node/expr/assign_op"
|
||||
"github.com/z7zmey/php-parser/node/expr/binary_op"
|
||||
"github.com/z7zmey/php-parser/node/expr/assign"
|
||||
"github.com/z7zmey/php-parser/node/expr/binary"
|
||||
"github.com/z7zmey/php-parser/node/expr/cast"
|
||||
"github.com/z7zmey/php-parser/node/name"
|
||||
"github.com/z7zmey/php-parser/node/scalar"
|
||||
@ -4193,7 +4193,7 @@ yydefault:
|
||||
{
|
||||
list := expr.NewList(yyDollar[3].list)
|
||||
positions.AddPosition(list, positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[4].token))
|
||||
yyVAL.node = assign_op.NewAssign(list, yyDollar[6].node)
|
||||
yyVAL.node = assign.NewAssign(list, yyDollar[6].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[6].node))
|
||||
|
||||
comments.AddComments(list, yyDollar[1].token.Comments())
|
||||
@ -4205,7 +4205,7 @@ yydefault:
|
||||
{
|
||||
shortList := expr.NewShortList(yyDollar[2].list)
|
||||
positions.AddPosition(shortList, positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token))
|
||||
yyVAL.node = assign_op.NewAssign(shortList, yyDollar[5].node)
|
||||
yyVAL.node = assign.NewAssign(shortList, yyDollar[5].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node))
|
||||
|
||||
comments.AddComments(shortList, yyDollar[1].token.Comments())
|
||||
@ -4215,7 +4215,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1506
|
||||
{
|
||||
yyVAL.node = assign_op.NewAssign(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = assign.NewAssign(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4223,7 +4223,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-4 : yypt+1]
|
||||
//line php7/php7.y:1512
|
||||
{
|
||||
yyVAL.node = assign_op.NewAssignRef(yyDollar[1].node, yyDollar[4].node)
|
||||
yyVAL.node = assign.NewAssignRef(yyDollar[1].node, yyDollar[4].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[4].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4239,7 +4239,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1524
|
||||
{
|
||||
yyVAL.node = assign_op.NewPlus(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = assign.NewPlus(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4247,7 +4247,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1530
|
||||
{
|
||||
yyVAL.node = assign_op.NewMinus(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = assign.NewMinus(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4255,7 +4255,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1536
|
||||
{
|
||||
yyVAL.node = assign_op.NewMul(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = assign.NewMul(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4263,7 +4263,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1542
|
||||
{
|
||||
yyVAL.node = assign_op.NewPow(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = assign.NewPow(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4271,7 +4271,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1548
|
||||
{
|
||||
yyVAL.node = assign_op.NewDiv(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = assign.NewDiv(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4279,7 +4279,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1554
|
||||
{
|
||||
yyVAL.node = assign_op.NewConcat(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = assign.NewConcat(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4287,7 +4287,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1560
|
||||
{
|
||||
yyVAL.node = assign_op.NewMod(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = assign.NewMod(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4295,7 +4295,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1566
|
||||
{
|
||||
yyVAL.node = assign_op.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = assign.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4303,7 +4303,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1572
|
||||
{
|
||||
yyVAL.node = assign_op.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = assign.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4311,7 +4311,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1578
|
||||
{
|
||||
yyVAL.node = assign_op.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = assign.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4319,7 +4319,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1584
|
||||
{
|
||||
yyVAL.node = assign_op.NewShiftLeft(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = assign.NewShiftLeft(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4327,7 +4327,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1590
|
||||
{
|
||||
yyVAL.node = assign_op.NewShiftRight(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = assign.NewShiftRight(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4367,7 +4367,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1620
|
||||
{
|
||||
yyVAL.node = binary_op.NewBooleanOr(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewBooleanOr(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4375,7 +4375,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1626
|
||||
{
|
||||
yyVAL.node = binary_op.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewBooleanAnd(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4383,7 +4383,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1632
|
||||
{
|
||||
yyVAL.node = binary_op.NewLogicalOr(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewLogicalOr(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4391,7 +4391,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1638
|
||||
{
|
||||
yyVAL.node = binary_op.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewLogicalAnd(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4399,7 +4399,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1644
|
||||
{
|
||||
yyVAL.node = binary_op.NewLogicalXor(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewLogicalXor(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4407,7 +4407,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1650
|
||||
{
|
||||
yyVAL.node = binary_op.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewBitwiseOr(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4415,7 +4415,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1656
|
||||
{
|
||||
yyVAL.node = binary_op.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewBitwiseAnd(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4423,7 +4423,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1662
|
||||
{
|
||||
yyVAL.node = binary_op.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewBitwiseXor(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4431,7 +4431,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1668
|
||||
{
|
||||
yyVAL.node = binary_op.NewConcat(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewConcat(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4439,7 +4439,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1674
|
||||
{
|
||||
yyVAL.node = binary_op.NewPlus(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewPlus(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4447,7 +4447,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1680
|
||||
{
|
||||
yyVAL.node = binary_op.NewMinus(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewMinus(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4455,7 +4455,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1686
|
||||
{
|
||||
yyVAL.node = binary_op.NewMul(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewMul(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4463,7 +4463,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1692
|
||||
{
|
||||
yyVAL.node = binary_op.NewPow(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewPow(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4471,7 +4471,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1698
|
||||
{
|
||||
yyVAL.node = binary_op.NewDiv(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewDiv(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4479,7 +4479,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1704
|
||||
{
|
||||
yyVAL.node = binary_op.NewMod(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewMod(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4487,7 +4487,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1710
|
||||
{
|
||||
yyVAL.node = binary_op.NewShiftLeft(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewShiftLeft(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4495,7 +4495,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1716
|
||||
{
|
||||
yyVAL.node = binary_op.NewShiftRight(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewShiftRight(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4535,7 +4535,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1746
|
||||
{
|
||||
yyVAL.node = binary_op.NewIdentical(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewIdentical(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4543,7 +4543,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1752
|
||||
{
|
||||
yyVAL.node = binary_op.NewNotIdentical(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewNotIdentical(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4551,7 +4551,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1758
|
||||
{
|
||||
yyVAL.node = binary_op.NewEqual(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewEqual(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4559,7 +4559,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1764
|
||||
{
|
||||
yyVAL.node = binary_op.NewNotEqual(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewNotEqual(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4567,7 +4567,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1770
|
||||
{
|
||||
yyVAL.node = binary_op.NewSmaller(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewSmaller(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4575,7 +4575,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1776
|
||||
{
|
||||
yyVAL.node = binary_op.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewSmallerOrEqual(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4583,7 +4583,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1782
|
||||
{
|
||||
yyVAL.node = binary_op.NewGreater(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewGreater(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4591,7 +4591,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1788
|
||||
{
|
||||
yyVAL.node = binary_op.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewGreaterOrEqual(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4599,7 +4599,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1794
|
||||
{
|
||||
yyVAL.node = binary_op.NewSpaceship(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewSpaceship(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
@ -4643,7 +4643,7 @@ yydefault:
|
||||
yyDollar = yyS[yypt-3 : yypt+1]
|
||||
//line php7/php7.y:1820
|
||||
{
|
||||
yyVAL.node = binary_op.NewCoalesce(yyDollar[1].node, yyDollar[3].node)
|
||||
yyVAL.node = binary.NewCoalesce(yyDollar[1].node, yyDollar[3].node)
|
||||
positions.AddPosition(yyVAL.node, positionBuilder.NewNodesPosition(yyDollar[1].node, yyDollar[3].node))
|
||||
comments.AddComments(yyVAL.node, comments[yyDollar[1].node])
|
||||
}
|
||||
|
90
php7/php7.y
90
php7/php7.y
@ -11,8 +11,8 @@ import (
|
||||
"github.com/z7zmey/php-parser/node/name"
|
||||
"github.com/z7zmey/php-parser/node/stmt"
|
||||
"github.com/z7zmey/php-parser/node/expr"
|
||||
"github.com/z7zmey/php-parser/node/expr/assign_op"
|
||||
"github.com/z7zmey/php-parser/node/expr/binary_op"
|
||||
"github.com/z7zmey/php-parser/node/expr/assign"
|
||||
"github.com/z7zmey/php-parser/node/expr/binary"
|
||||
"github.com/z7zmey/php-parser/node/expr/cast"
|
||||
)
|
||||
|
||||
@ -1486,7 +1486,7 @@ expr_without_variable:
|
||||
{
|
||||
list := expr.NewList($3)
|
||||
positions.AddPosition(list, positionBuilder.NewTokensPosition($1, $4))
|
||||
$$ = assign_op.NewAssign(list, $6)
|
||||
$$ = assign.NewAssign(list, $6)
|
||||
positions.AddPosition($$, positionBuilder.NewTokenNodePosition($1, $6))
|
||||
|
||||
comments.AddComments(list, $1.Comments())
|
||||
@ -1496,7 +1496,7 @@ expr_without_variable:
|
||||
{
|
||||
shortList := expr.NewShortList($2)
|
||||
positions.AddPosition(shortList, positionBuilder.NewTokensPosition($1, $3))
|
||||
$$ = assign_op.NewAssign(shortList, $5)
|
||||
$$ = assign.NewAssign(shortList, $5)
|
||||
positions.AddPosition($$, positionBuilder.NewTokenNodePosition($1, $5))
|
||||
|
||||
comments.AddComments(shortList, $1.Comments())
|
||||
@ -1504,13 +1504,13 @@ expr_without_variable:
|
||||
}
|
||||
| variable '=' expr
|
||||
{
|
||||
$$ = assign_op.NewAssign($1, $3)
|
||||
$$ = assign.NewAssign($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| variable '=' '&' expr
|
||||
{
|
||||
$$ = assign_op.NewAssignRef($1, $4)
|
||||
$$ = assign.NewAssignRef($1, $4)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $4))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
@ -1522,73 +1522,73 @@ expr_without_variable:
|
||||
}
|
||||
| variable T_PLUS_EQUAL expr
|
||||
{
|
||||
$$ = assign_op.NewPlus($1, $3)
|
||||
$$ = assign.NewPlus($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| variable T_MINUS_EQUAL expr
|
||||
{
|
||||
$$ = assign_op.NewMinus($1, $3)
|
||||
$$ = assign.NewMinus($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| variable T_MUL_EQUAL expr
|
||||
{
|
||||
$$ = assign_op.NewMul($1, $3)
|
||||
$$ = assign.NewMul($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| variable T_POW_EQUAL expr
|
||||
{
|
||||
$$ = assign_op.NewPow($1, $3)
|
||||
$$ = assign.NewPow($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| variable T_DIV_EQUAL expr
|
||||
{
|
||||
$$ = assign_op.NewDiv($1, $3)
|
||||
$$ = assign.NewDiv($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| variable T_CONCAT_EQUAL expr
|
||||
{
|
||||
$$ = assign_op.NewConcat($1, $3)
|
||||
$$ = assign.NewConcat($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| variable T_MOD_EQUAL expr
|
||||
{
|
||||
$$ = assign_op.NewMod($1, $3)
|
||||
$$ = assign.NewMod($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| variable T_AND_EQUAL expr
|
||||
{
|
||||
$$ = assign_op.NewBitwiseAnd($1, $3)
|
||||
$$ = assign.NewBitwiseAnd($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| variable T_OR_EQUAL expr
|
||||
{
|
||||
$$ = assign_op.NewBitwiseOr($1, $3)
|
||||
$$ = assign.NewBitwiseOr($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| variable T_XOR_EQUAL expr
|
||||
{
|
||||
$$ = assign_op.NewBitwiseXor($1, $3)
|
||||
$$ = assign.NewBitwiseXor($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| variable T_SL_EQUAL expr
|
||||
{
|
||||
$$ = assign_op.NewShiftLeft($1, $3)
|
||||
$$ = assign.NewShiftLeft($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| variable T_SR_EQUAL expr
|
||||
{
|
||||
$$ = assign_op.NewShiftRight($1, $3)
|
||||
$$ = assign.NewShiftRight($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
@ -1618,103 +1618,103 @@ expr_without_variable:
|
||||
}
|
||||
| expr T_BOOLEAN_OR expr
|
||||
{
|
||||
$$ = binary_op.NewBooleanOr($1, $3)
|
||||
$$ = binary.NewBooleanOr($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr T_BOOLEAN_AND expr
|
||||
{
|
||||
$$ = binary_op.NewBooleanAnd($1, $3)
|
||||
$$ = binary.NewBooleanAnd($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr T_LOGICAL_OR expr
|
||||
{
|
||||
$$ = binary_op.NewLogicalOr($1, $3)
|
||||
$$ = binary.NewLogicalOr($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr T_LOGICAL_AND expr
|
||||
{
|
||||
$$ = binary_op.NewLogicalAnd($1, $3)
|
||||
$$ = binary.NewLogicalAnd($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr T_LOGICAL_XOR expr
|
||||
{
|
||||
$$ = binary_op.NewLogicalXor($1, $3)
|
||||
$$ = binary.NewLogicalXor($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr '|' expr
|
||||
{
|
||||
$$ = binary_op.NewBitwiseOr($1, $3)
|
||||
$$ = binary.NewBitwiseOr($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr '&' expr
|
||||
{
|
||||
$$ = binary_op.NewBitwiseAnd($1, $3)
|
||||
$$ = binary.NewBitwiseAnd($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr '^' expr
|
||||
{
|
||||
$$ = binary_op.NewBitwiseXor($1, $3)
|
||||
$$ = binary.NewBitwiseXor($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr '.' expr
|
||||
{
|
||||
$$ = binary_op.NewConcat($1, $3)
|
||||
$$ = binary.NewConcat($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr '+' expr
|
||||
{
|
||||
$$ = binary_op.NewPlus($1, $3)
|
||||
$$ = binary.NewPlus($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr '-' expr
|
||||
{
|
||||
$$ = binary_op.NewMinus($1, $3)
|
||||
$$ = binary.NewMinus($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr '*' expr
|
||||
{
|
||||
$$ = binary_op.NewMul($1, $3)
|
||||
$$ = binary.NewMul($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr T_POW expr
|
||||
{
|
||||
$$ = binary_op.NewPow($1, $3)
|
||||
$$ = binary.NewPow($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr '/' expr
|
||||
{
|
||||
$$ = binary_op.NewDiv($1, $3)
|
||||
$$ = binary.NewDiv($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr '%' expr
|
||||
{
|
||||
$$ = binary_op.NewMod($1, $3)
|
||||
$$ = binary.NewMod($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr T_SL expr
|
||||
{
|
||||
$$ = binary_op.NewShiftLeft($1, $3)
|
||||
$$ = binary.NewShiftLeft($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr T_SR expr
|
||||
{
|
||||
$$ = binary_op.NewShiftRight($1, $3)
|
||||
$$ = binary.NewShiftRight($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
@ -1744,55 +1744,55 @@ expr_without_variable:
|
||||
}
|
||||
| expr T_IS_IDENTICAL expr
|
||||
{
|
||||
$$ = binary_op.NewIdentical($1, $3)
|
||||
$$ = binary.NewIdentical($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr T_IS_NOT_IDENTICAL expr
|
||||
{
|
||||
$$ = binary_op.NewNotIdentical($1, $3)
|
||||
$$ = binary.NewNotIdentical($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr T_IS_EQUAL expr
|
||||
{
|
||||
$$ = binary_op.NewEqual($1, $3)
|
||||
$$ = binary.NewEqual($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr T_IS_NOT_EQUAL expr
|
||||
{
|
||||
$$ = binary_op.NewNotEqual($1, $3)
|
||||
$$ = binary.NewNotEqual($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr '<' expr
|
||||
{
|
||||
$$ = binary_op.NewSmaller($1, $3)
|
||||
$$ = binary.NewSmaller($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr T_IS_SMALLER_OR_EQUAL expr
|
||||
{
|
||||
$$ = binary_op.NewSmallerOrEqual($1, $3)
|
||||
$$ = binary.NewSmallerOrEqual($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr '>' expr
|
||||
{
|
||||
$$ = binary_op.NewGreater($1, $3)
|
||||
$$ = binary.NewGreater($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr T_IS_GREATER_OR_EQUAL expr
|
||||
{
|
||||
$$ = binary_op.NewGreaterOrEqual($1, $3)
|
||||
$$ = binary.NewGreaterOrEqual($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
| expr T_SPACESHIP expr
|
||||
{
|
||||
$$ = binary_op.NewSpaceship($1, $3)
|
||||
$$ = binary.NewSpaceship($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
@ -1818,7 +1818,7 @@ expr_without_variable:
|
||||
}
|
||||
| expr T_COALESCE expr
|
||||
{
|
||||
$$ = binary_op.NewCoalesce($1, $3)
|
||||
$$ = binary.NewCoalesce($1, $3)
|
||||
positions.AddPosition($$, positionBuilder.NewNodesPosition($1, $3))
|
||||
comments.AddComments($$, comments[$1])
|
||||
}
|
||||
|
@ -7,8 +7,8 @@ import (
|
||||
|
||||
"github.com/kylelemons/godebug/pretty"
|
||||
"github.com/z7zmey/php-parser/node/expr"
|
||||
"github.com/z7zmey/php-parser/node/expr/assign_op"
|
||||
"github.com/z7zmey/php-parser/node/expr/binary_op"
|
||||
"github.com/z7zmey/php-parser/node/expr/assign"
|
||||
"github.com/z7zmey/php-parser/node/expr/binary"
|
||||
"github.com/z7zmey/php-parser/node/expr/cast"
|
||||
"github.com/z7zmey/php-parser/node/name"
|
||||
"github.com/z7zmey/php-parser/node/scalar"
|
||||
@ -1126,13 +1126,13 @@ CAD;
|
||||
},
|
||||
&stmt.For{
|
||||
Init: []node.Node{
|
||||
&assign_op.Assign{
|
||||
&assign.Assign{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$i"}},
|
||||
Expression: &scalar.Lnumber{Value: "0"},
|
||||
},
|
||||
},
|
||||
Cond: []node.Node{
|
||||
&binary_op.Smaller{
|
||||
&binary.Smaller{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$i"}},
|
||||
Right: &scalar.Lnumber{Value: "10"},
|
||||
},
|
||||
@ -1149,7 +1149,7 @@ CAD;
|
||||
},
|
||||
&stmt.AltFor{
|
||||
Cond: []node.Node{
|
||||
&binary_op.Smaller{
|
||||
&binary.Smaller{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$i"}},
|
||||
Right: &scalar.Lnumber{Value: "10"},
|
||||
},
|
||||
@ -2336,7 +2336,7 @@ CAD;
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Assign{
|
||||
Expr: &assign.Assign{
|
||||
Variable: &expr.List{
|
||||
Items: []node.Node{
|
||||
&expr.ArrayItem{
|
||||
@ -2349,7 +2349,7 @@ CAD;
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Assign{
|
||||
Expr: &assign.Assign{
|
||||
Variable: &expr.List{
|
||||
Items: []node.Node{
|
||||
&expr.ArrayItem{
|
||||
@ -2364,7 +2364,7 @@ CAD;
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Assign{
|
||||
Expr: &assign.Assign{
|
||||
Variable: &expr.List{
|
||||
Items: []node.Node{
|
||||
&expr.ArrayItem{
|
||||
@ -2494,7 +2494,7 @@ CAD;
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Assign{
|
||||
Expr: &assign.Assign{
|
||||
Variable: &expr.ShortList{
|
||||
Items: []node.Node{
|
||||
&expr.ArrayItem{
|
||||
@ -2507,7 +2507,7 @@ CAD;
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Assign{
|
||||
Expr: &assign.Assign{
|
||||
Variable: &expr.ShortList{
|
||||
Items: []node.Node{
|
||||
&expr.ArrayItem{
|
||||
@ -2522,7 +2522,7 @@ CAD;
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Assign{
|
||||
Expr: &assign.Assign{
|
||||
Variable: &expr.ShortList{
|
||||
Items: []node.Node{
|
||||
&expr.ArrayItem{
|
||||
@ -2728,247 +2728,247 @@ CAD;
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.BitwiseAnd{
|
||||
Expr: &binary.BitwiseAnd{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.BitwiseOr{
|
||||
Expr: &binary.BitwiseOr{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.BitwiseXor{
|
||||
Expr: &binary.BitwiseXor{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.BooleanAnd{
|
||||
Expr: &binary.BooleanAnd{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.BooleanOr{
|
||||
Expr: &binary.BooleanOr{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Coalesce{
|
||||
Expr: &binary.Coalesce{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Concat{
|
||||
Expr: &binary.Concat{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Div{
|
||||
Expr: &binary.Div{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Equal{
|
||||
Expr: &binary.Equal{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.GreaterOrEqual{
|
||||
Expr: &binary.GreaterOrEqual{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Greater{
|
||||
Expr: &binary.Greater{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Identical{
|
||||
Expr: &binary.Identical{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.LogicalAnd{
|
||||
Expr: &binary.LogicalAnd{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.LogicalOr{
|
||||
Expr: &binary.LogicalOr{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.LogicalXor{
|
||||
Expr: &binary.LogicalXor{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Minus{
|
||||
Expr: &binary.Minus{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Mod{
|
||||
Expr: &binary.Mod{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Mul{
|
||||
Expr: &binary.Mul{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.NotEqual{
|
||||
Expr: &binary.NotEqual{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.NotIdentical{
|
||||
Expr: &binary.NotIdentical{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Plus{
|
||||
Expr: &binary.Plus{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Pow{
|
||||
Expr: &binary.Pow{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.ShiftLeft{
|
||||
Expr: &binary.ShiftLeft{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.ShiftRight{
|
||||
Expr: &binary.ShiftRight{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.SmallerOrEqual{
|
||||
Expr: &binary.SmallerOrEqual{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Smaller{
|
||||
Expr: &binary.Smaller{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &binary_op.Spaceship{
|
||||
Expr: &binary.Spaceship{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.AssignRef{
|
||||
Expr: &assign.AssignRef{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Assign{
|
||||
Expr: &assign.Assign{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.BitwiseAnd{
|
||||
Expr: &assign.BitwiseAnd{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.BitwiseOr{
|
||||
Expr: &assign.BitwiseOr{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.BitwiseXor{
|
||||
Expr: &assign.BitwiseXor{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Concat{
|
||||
Expr: &assign.Concat{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Div{
|
||||
Expr: &assign.Div{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Minus{
|
||||
Expr: &assign.Minus{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Mod{
|
||||
Expr: &assign.Mod{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Mul{
|
||||
Expr: &assign.Mul{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Plus{
|
||||
Expr: &assign.Plus{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.Pow{
|
||||
Expr: &assign.Pow{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.ShiftLeft{
|
||||
Expr: &assign.ShiftLeft{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
},
|
||||
&stmt.Expression{
|
||||
Expr: &assign_op.ShiftRight{
|
||||
Expr: &assign.ShiftRight{
|
||||
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
|
||||
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user