remove underscore from package names

This commit is contained in:
z7zmey
2018-02-19 13:12:09 +02:00
parent 014b0576d6
commit 4dda4fe7af
54 changed files with 500 additions and 500 deletions

View File

@@ -1,4 +1,4 @@
package assign_op
package assign
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package assign_op
package assign
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package assign_op
package assign
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package assign_op
package assign
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package assign_op
package assign
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package assign_op
package assign
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package assign_op
package assign
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package assign_op
package assign
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package assign_op
package assign
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package assign_op
package assign
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package assign_op
package assign
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package assign_op
package assign
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package assign_op
package assign
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package assign_op
package assign
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -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"}},
},

View File

@@ -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"}},
},

View File

@@ -1,4 +1,4 @@
package binary_op
package binary
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package binary_op
package binary
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package binary_op
package binary
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package binary_op
package binary
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package binary_op
package binary
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package binary_op
package binary
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package binary_op
package binary
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package binary_op
package binary
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package binary_op
package binary
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package binary_op
package binary
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package binary_op
package binary
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package binary_op
package binary
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package binary_op
package binary
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package binary_op
package binary
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package binary_op
package binary
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package binary_op
package binary
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package binary_op
package binary
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package binary_op
package binary
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package binary_op
package binary
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package binary_op
package binary
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package binary_op
package binary
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package binary_op
package binary
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package binary_op
package binary
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package binary_op
package binary
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package binary_op
package binary
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package binary_op
package binary
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -1,4 +1,4 @@
package binary_op
package binary
import (
"github.com/z7zmey/php-parser/node"

View File

@@ -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"}},
},

View File

@@ -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"}},
},

View File

@@ -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{

View File

@@ -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{