refactor binary_op nodes

This commit is contained in:
z7zmey 2018-02-10 01:02:50 +02:00
parent 03cffcc98b
commit 9dbc898d7f
30 changed files with 220 additions and 366 deletions

View File

@ -1,11 +0,0 @@
package binary_op
import (
"github.com/z7zmey/php-parser/node"
)
// BinaryOp node
type BinaryOp struct {
Left node.Node
Right node.Node
}

View File

@ -7,16 +7,15 @@ import (
// BitwiseAnd node // BitwiseAnd node
type BitwiseAnd struct { type BitwiseAnd struct {
BinaryOp Left node.Node
Right node.Node
} }
// NewBitwiseAnd node constuctor // NewBitwiseAnd node constuctor
func NewBitwiseAnd(Variable node.Node, Expression node.Node) *BitwiseAnd { func NewBitwiseAnd(Variable node.Node, Expression node.Node) *BitwiseAnd {
return &BitwiseAnd{ return &BitwiseAnd{
BinaryOp{
Variable, Variable,
Expression, Expression,
},
} }
} }

View File

@ -7,16 +7,15 @@ import (
// BitwiseOr node // BitwiseOr node
type BitwiseOr struct { type BitwiseOr struct {
BinaryOp Left node.Node
Right node.Node
} }
// NewBitwiseOr node constuctor // NewBitwiseOr node constuctor
func NewBitwiseOr(Variable node.Node, Expression node.Node) *BitwiseOr { func NewBitwiseOr(Variable node.Node, Expression node.Node) *BitwiseOr {
return &BitwiseOr{ return &BitwiseOr{
BinaryOp{
Variable, Variable,
Expression, Expression,
},
} }
} }

View File

@ -7,16 +7,15 @@ import (
// BitwiseXor node // BitwiseXor node
type BitwiseXor struct { type BitwiseXor struct {
BinaryOp Left node.Node
Right node.Node
} }
// NewBitwiseXor node constuctor // NewBitwiseXor node constuctor
func NewBitwiseXor(Variable node.Node, Expression node.Node) *BitwiseXor { func NewBitwiseXor(Variable node.Node, Expression node.Node) *BitwiseXor {
return &BitwiseXor{ return &BitwiseXor{
BinaryOp{
Variable, Variable,
Expression, Expression,
},
} }
} }

View File

@ -7,16 +7,15 @@ import (
// BooleanAnd node // BooleanAnd node
type BooleanAnd struct { type BooleanAnd struct {
BinaryOp Left node.Node
Right node.Node
} }
// NewBooleanAnd node constuctor // NewBooleanAnd node constuctor
func NewBooleanAnd(Variable node.Node, Expression node.Node) *BooleanAnd { func NewBooleanAnd(Variable node.Node, Expression node.Node) *BooleanAnd {
return &BooleanAnd{ return &BooleanAnd{
BinaryOp{
Variable, Variable,
Expression, Expression,
},
} }
} }

View File

@ -7,16 +7,15 @@ import (
// BooleanOr node // BooleanOr node
type BooleanOr struct { type BooleanOr struct {
BinaryOp Left node.Node
Right node.Node
} }
// NewBooleanOr node constuctor // NewBooleanOr node constuctor
func NewBooleanOr(Variable node.Node, Expression node.Node) *BooleanOr { func NewBooleanOr(Variable node.Node, Expression node.Node) *BooleanOr {
return &BooleanOr{ return &BooleanOr{
BinaryOp{
Variable, Variable,
Expression, Expression,
},
} }
} }

View File

@ -7,16 +7,15 @@ import (
// Coalesce node // Coalesce node
type Coalesce struct { type Coalesce struct {
BinaryOp Left node.Node
Right node.Node
} }
// NewCoalesce node constuctor // NewCoalesce node constuctor
func NewCoalesce(Variable node.Node, Expression node.Node) *Coalesce { func NewCoalesce(Variable node.Node, Expression node.Node) *Coalesce {
return &Coalesce{ return &Coalesce{
BinaryOp{
Variable, Variable,
Expression, Expression,
},
} }
} }

View File

@ -7,16 +7,15 @@ import (
// Concat node // Concat node
type Concat struct { type Concat struct {
BinaryOp Left node.Node
Right node.Node
} }
// NewConcat node constuctor // NewConcat node constuctor
func NewConcat(Variable node.Node, Expression node.Node) *Concat { func NewConcat(Variable node.Node, Expression node.Node) *Concat {
return &Concat{ return &Concat{
BinaryOp{
Variable, Variable,
Expression, Expression,
},
} }
} }

View File

@ -7,16 +7,15 @@ import (
// Div node // Div node
type Div struct { type Div struct {
BinaryOp Left node.Node
Right node.Node
} }
// NewDiv node constuctor // NewDiv node constuctor
func NewDiv(Variable node.Node, Expression node.Node) *Div { func NewDiv(Variable node.Node, Expression node.Node) *Div {
return &Div{ return &Div{
BinaryOp{
Variable, Variable,
Expression, Expression,
},
} }
} }

View File

@ -7,16 +7,15 @@ import (
// Equal node // Equal node
type Equal struct { type Equal struct {
BinaryOp Left node.Node
Right node.Node
} }
// NewEqual node constuctor // NewEqual node constuctor
func NewEqual(Variable node.Node, Expression node.Node) *Equal { func NewEqual(Variable node.Node, Expression node.Node) *Equal {
return &Equal{ return &Equal{
BinaryOp{
Variable, Variable,
Expression, Expression,
},
} }
} }

View File

@ -7,16 +7,15 @@ import (
// Greater node // Greater node
type Greater struct { type Greater struct {
BinaryOp Left node.Node
Right node.Node
} }
// NewGreater node constuctor // NewGreater node constuctor
func NewGreater(Variable node.Node, Expression node.Node) *Greater { func NewGreater(Variable node.Node, Expression node.Node) *Greater {
return &Greater{ return &Greater{
BinaryOp{
Variable, Variable,
Expression, Expression,
},
} }
} }

View File

@ -7,16 +7,15 @@ import (
// GreaterOrEqual node // GreaterOrEqual node
type GreaterOrEqual struct { type GreaterOrEqual struct {
BinaryOp Left node.Node
Right node.Node
} }
// NewGreaterOrEqual node constuctor // NewGreaterOrEqual node constuctor
func NewGreaterOrEqual(Variable node.Node, Expression node.Node) *GreaterOrEqual { func NewGreaterOrEqual(Variable node.Node, Expression node.Node) *GreaterOrEqual {
return &GreaterOrEqual{ return &GreaterOrEqual{
BinaryOp{
Variable, Variable,
Expression, Expression,
},
} }
} }

View File

@ -7,16 +7,15 @@ import (
// Identical node // Identical node
type Identical struct { type Identical struct {
BinaryOp Left node.Node
Right node.Node
} }
// NewIdentical node constuctor // NewIdentical node constuctor
func NewIdentical(Variable node.Node, Expression node.Node) *Identical { func NewIdentical(Variable node.Node, Expression node.Node) *Identical {
return &Identical{ return &Identical{
BinaryOp{
Variable, Variable,
Expression, Expression,
},
} }
} }

View File

@ -7,16 +7,15 @@ import (
// LogicalAnd node // LogicalAnd node
type LogicalAnd struct { type LogicalAnd struct {
BinaryOp Left node.Node
Right node.Node
} }
// NewLogicalAnd node constuctor // NewLogicalAnd node constuctor
func NewLogicalAnd(Variable node.Node, Expression node.Node) *LogicalAnd { func NewLogicalAnd(Variable node.Node, Expression node.Node) *LogicalAnd {
return &LogicalAnd{ return &LogicalAnd{
BinaryOp{
Variable, Variable,
Expression, Expression,
},
} }
} }

View File

@ -7,16 +7,15 @@ import (
// LogicalOr node // LogicalOr node
type LogicalOr struct { type LogicalOr struct {
BinaryOp Left node.Node
Right node.Node
} }
// NewLogicalOr node constuctor // NewLogicalOr node constuctor
func NewLogicalOr(Variable node.Node, Expression node.Node) *LogicalOr { func NewLogicalOr(Variable node.Node, Expression node.Node) *LogicalOr {
return &LogicalOr{ return &LogicalOr{
BinaryOp{
Variable, Variable,
Expression, Expression,
},
} }
} }

View File

@ -7,16 +7,15 @@ import (
// LogicalXor node // LogicalXor node
type LogicalXor struct { type LogicalXor struct {
BinaryOp Left node.Node
Right node.Node
} }
// NewLogicalXor node constuctor // NewLogicalXor node constuctor
func NewLogicalXor(Variable node.Node, Expression node.Node) *LogicalXor { func NewLogicalXor(Variable node.Node, Expression node.Node) *LogicalXor {
return &LogicalXor{ return &LogicalXor{
BinaryOp{
Variable, Variable,
Expression, Expression,
},
} }
} }

View File

@ -7,16 +7,15 @@ import (
// Minus node // Minus node
type Minus struct { type Minus struct {
BinaryOp Left node.Node
Right node.Node
} }
// NewMinus node constuctor // NewMinus node constuctor
func NewMinus(Variable node.Node, Expression node.Node) *Minus { func NewMinus(Variable node.Node, Expression node.Node) *Minus {
return &Minus{ return &Minus{
BinaryOp{
Variable, Variable,
Expression, Expression,
},
} }
} }

View File

@ -7,16 +7,15 @@ import (
// Mod node // Mod node
type Mod struct { type Mod struct {
BinaryOp Left node.Node
Right node.Node
} }
// NewMod node constuctor // NewMod node constuctor
func NewMod(Variable node.Node, Expression node.Node) *Mod { func NewMod(Variable node.Node, Expression node.Node) *Mod {
return &Mod{ return &Mod{
BinaryOp{
Variable, Variable,
Expression, Expression,
},
} }
} }

View File

@ -7,16 +7,15 @@ import (
// Mul node // Mul node
type Mul struct { type Mul struct {
BinaryOp Left node.Node
Right node.Node
} }
// NewMul node constuctor // NewMul node constuctor
func NewMul(Variable node.Node, Expression node.Node) *Mul { func NewMul(Variable node.Node, Expression node.Node) *Mul {
return &Mul{ return &Mul{
BinaryOp{
Variable, Variable,
Expression, Expression,
},
} }
} }

View File

@ -7,16 +7,15 @@ import (
// NotEqual node // NotEqual node
type NotEqual struct { type NotEqual struct {
BinaryOp Left node.Node
Right node.Node
} }
// NewNotEqual node constuctor // NewNotEqual node constuctor
func NewNotEqual(Variable node.Node, Expression node.Node) *NotEqual { func NewNotEqual(Variable node.Node, Expression node.Node) *NotEqual {
return &NotEqual{ return &NotEqual{
BinaryOp{
Variable, Variable,
Expression, Expression,
},
} }
} }

View File

@ -7,16 +7,15 @@ import (
// NotIdentical node // NotIdentical node
type NotIdentical struct { type NotIdentical struct {
BinaryOp Left node.Node
Right node.Node
} }
// NewNotIdentical node constuctor // NewNotIdentical node constuctor
func NewNotIdentical(Variable node.Node, Expression node.Node) *NotIdentical { func NewNotIdentical(Variable node.Node, Expression node.Node) *NotIdentical {
return &NotIdentical{ return &NotIdentical{
BinaryOp{
Variable, Variable,
Expression, Expression,
},
} }
} }

View File

@ -7,16 +7,15 @@ import (
// Plus node // Plus node
type Plus struct { type Plus struct {
BinaryOp Left node.Node
Right node.Node
} }
// NewPlus node constuctor // NewPlus node constuctor
func NewPlus(Variable node.Node, Expression node.Node) *Plus { func NewPlus(Variable node.Node, Expression node.Node) *Plus {
return &Plus{ return &Plus{
BinaryOp{
Variable, Variable,
Expression, Expression,
},
} }
} }

View File

@ -7,16 +7,15 @@ import (
// Pow node // Pow node
type Pow struct { type Pow struct {
BinaryOp Left node.Node
Right node.Node
} }
// NewPow node constuctor // NewPow node constuctor
func NewPow(Variable node.Node, Expression node.Node) *Pow { func NewPow(Variable node.Node, Expression node.Node) *Pow {
return &Pow{ return &Pow{
BinaryOp{
Variable, Variable,
Expression, Expression,
},
} }
} }

View File

@ -7,16 +7,15 @@ import (
// ShiftLeft node // ShiftLeft node
type ShiftLeft struct { type ShiftLeft struct {
BinaryOp Left node.Node
Right node.Node
} }
// NewShiftLeft node constuctor // NewShiftLeft node constuctor
func NewShiftLeft(Variable node.Node, Expression node.Node) *ShiftLeft { func NewShiftLeft(Variable node.Node, Expression node.Node) *ShiftLeft {
return &ShiftLeft{ return &ShiftLeft{
BinaryOp{
Variable, Variable,
Expression, Expression,
},
} }
} }

View File

@ -7,16 +7,15 @@ import (
// ShiftRight node // ShiftRight node
type ShiftRight struct { type ShiftRight struct {
BinaryOp Left node.Node
Right node.Node
} }
// NewShiftRight node constuctor // NewShiftRight node constuctor
func NewShiftRight(Variable node.Node, Expression node.Node) *ShiftRight { func NewShiftRight(Variable node.Node, Expression node.Node) *ShiftRight {
return &ShiftRight{ return &ShiftRight{
BinaryOp{
Variable, Variable,
Expression, Expression,
},
} }
} }

View File

@ -7,16 +7,15 @@ import (
// Smaller node // Smaller node
type Smaller struct { type Smaller struct {
BinaryOp Left node.Node
Right node.Node
} }
// NewSmaller node constuctor // NewSmaller node constuctor
func NewSmaller(Variable node.Node, Expression node.Node) *Smaller { func NewSmaller(Variable node.Node, Expression node.Node) *Smaller {
return &Smaller{ return &Smaller{
BinaryOp{
Variable, Variable,
Expression, Expression,
},
} }
} }

View File

@ -7,16 +7,15 @@ import (
// SmallerOrEqual node // SmallerOrEqual node
type SmallerOrEqual struct { type SmallerOrEqual struct {
BinaryOp Left node.Node
Right node.Node
} }
// NewSmallerOrEqual node constuctor // NewSmallerOrEqual node constuctor
func NewSmallerOrEqual(Variable node.Node, Expression node.Node) *SmallerOrEqual { func NewSmallerOrEqual(Variable node.Node, Expression node.Node) *SmallerOrEqual {
return &SmallerOrEqual{ return &SmallerOrEqual{
BinaryOp{
Variable, Variable,
Expression, Expression,
},
} }
} }

View File

@ -7,16 +7,15 @@ import (
// Spaceship node // Spaceship node
type Spaceship struct { type Spaceship struct {
BinaryOp Left node.Node
Right node.Node
} }
// NewSpaceship node constuctor // NewSpaceship node constuctor
func NewSpaceship(Variable node.Node, Expression node.Node) *Spaceship { func NewSpaceship(Variable node.Node, Expression node.Node) *Spaceship {
return &Spaceship{ return &Spaceship{
BinaryOp{
Variable, Variable,
Expression, Expression,
},
} }
} }

View File

@ -34,13 +34,11 @@ func TestBitwiseAnd(t *testing.T) {
Stmts: []node.Node{ Stmts: []node.Node{
&stmt.Expression{ &stmt.Expression{
Expr: &binary_op.BitwiseAnd{ Expr: &binary_op.BitwiseAnd{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
}, },
}, },
},
} }
actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
@ -57,13 +55,11 @@ func TestBitwiseOr(t *testing.T) {
Stmts: []node.Node{ Stmts: []node.Node{
&stmt.Expression{ &stmt.Expression{
Expr: &binary_op.BitwiseOr{ Expr: &binary_op.BitwiseOr{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
}, },
}, },
},
} }
actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
@ -80,13 +76,11 @@ func TestBitwiseXor(t *testing.T) {
Stmts: []node.Node{ Stmts: []node.Node{
&stmt.Expression{ &stmt.Expression{
Expr: &binary_op.BitwiseXor{ Expr: &binary_op.BitwiseXor{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
}, },
}, },
},
} }
actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
@ -103,13 +97,11 @@ func TestBooleanAnd(t *testing.T) {
Stmts: []node.Node{ Stmts: []node.Node{
&stmt.Expression{ &stmt.Expression{
Expr: &binary_op.BooleanAnd{ Expr: &binary_op.BooleanAnd{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
}, },
}, },
},
} }
actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
@ -126,13 +118,11 @@ func TestBooleanOr(t *testing.T) {
Stmts: []node.Node{ Stmts: []node.Node{
&stmt.Expression{ &stmt.Expression{
Expr: &binary_op.BooleanOr{ Expr: &binary_op.BooleanOr{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
}, },
}, },
},
} }
actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
@ -149,13 +139,11 @@ func TestCoalesce(t *testing.T) {
Stmts: []node.Node{ Stmts: []node.Node{
&stmt.Expression{ &stmt.Expression{
Expr: &binary_op.Coalesce{ Expr: &binary_op.Coalesce{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
}, },
}, },
},
} }
actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
@ -169,13 +157,11 @@ func TestConcat(t *testing.T) {
Stmts: []node.Node{ Stmts: []node.Node{
&stmt.Expression{ &stmt.Expression{
Expr: &binary_op.Concat{ Expr: &binary_op.Concat{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
}, },
}, },
},
} }
actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
@ -192,13 +178,11 @@ func TestDiv(t *testing.T) {
Stmts: []node.Node{ Stmts: []node.Node{
&stmt.Expression{ &stmt.Expression{
Expr: &binary_op.Div{ Expr: &binary_op.Div{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
}, },
}, },
},
} }
actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
@ -215,13 +199,11 @@ func TestEqual(t *testing.T) {
Stmts: []node.Node{ Stmts: []node.Node{
&stmt.Expression{ &stmt.Expression{
Expr: &binary_op.Equal{ Expr: &binary_op.Equal{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
}, },
}, },
},
} }
actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
@ -238,13 +220,11 @@ func TestGreaterOrEqual(t *testing.T) {
Stmts: []node.Node{ Stmts: []node.Node{
&stmt.Expression{ &stmt.Expression{
Expr: &binary_op.GreaterOrEqual{ Expr: &binary_op.GreaterOrEqual{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
}, },
}, },
},
} }
actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
@ -261,13 +241,11 @@ func TestGreater(t *testing.T) {
Stmts: []node.Node{ Stmts: []node.Node{
&stmt.Expression{ &stmt.Expression{
Expr: &binary_op.Greater{ Expr: &binary_op.Greater{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
}, },
}, },
},
} }
actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
@ -284,13 +262,11 @@ func TestIdentical(t *testing.T) {
Stmts: []node.Node{ Stmts: []node.Node{
&stmt.Expression{ &stmt.Expression{
Expr: &binary_op.Identical{ Expr: &binary_op.Identical{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
}, },
}, },
},
} }
actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
@ -307,13 +283,11 @@ func TestLogicalAnd(t *testing.T) {
Stmts: []node.Node{ Stmts: []node.Node{
&stmt.Expression{ &stmt.Expression{
Expr: &binary_op.LogicalAnd{ Expr: &binary_op.LogicalAnd{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
}, },
}, },
},
} }
actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
@ -330,13 +304,11 @@ func TestLogicalOr(t *testing.T) {
Stmts: []node.Node{ Stmts: []node.Node{
&stmt.Expression{ &stmt.Expression{
Expr: &binary_op.LogicalOr{ Expr: &binary_op.LogicalOr{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
}, },
}, },
},
} }
actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
@ -353,13 +325,11 @@ func TestLogicalXor(t *testing.T) {
Stmts: []node.Node{ Stmts: []node.Node{
&stmt.Expression{ &stmt.Expression{
Expr: &binary_op.LogicalXor{ Expr: &binary_op.LogicalXor{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
}, },
}, },
},
} }
actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
@ -376,13 +346,11 @@ func TestMinus(t *testing.T) {
Stmts: []node.Node{ Stmts: []node.Node{
&stmt.Expression{ &stmt.Expression{
Expr: &binary_op.Minus{ Expr: &binary_op.Minus{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
}, },
}, },
},
} }
actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
@ -399,13 +367,11 @@ func TestMod(t *testing.T) {
Stmts: []node.Node{ Stmts: []node.Node{
&stmt.Expression{ &stmt.Expression{
Expr: &binary_op.Mod{ Expr: &binary_op.Mod{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
}, },
}, },
},
} }
actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
@ -422,13 +388,11 @@ func TestMul(t *testing.T) {
Stmts: []node.Node{ Stmts: []node.Node{
&stmt.Expression{ &stmt.Expression{
Expr: &binary_op.Mul{ Expr: &binary_op.Mul{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
}, },
}, },
},
} }
actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
@ -445,13 +409,11 @@ func TestNotEqual(t *testing.T) {
Stmts: []node.Node{ Stmts: []node.Node{
&stmt.Expression{ &stmt.Expression{
Expr: &binary_op.NotEqual{ Expr: &binary_op.NotEqual{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
}, },
}, },
},
} }
actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
@ -468,13 +430,11 @@ func TestNotIdentical(t *testing.T) {
Stmts: []node.Node{ Stmts: []node.Node{
&stmt.Expression{ &stmt.Expression{
Expr: &binary_op.NotIdentical{ Expr: &binary_op.NotIdentical{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
}, },
}, },
},
} }
actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
@ -491,13 +451,11 @@ func TestPlus(t *testing.T) {
Stmts: []node.Node{ Stmts: []node.Node{
&stmt.Expression{ &stmt.Expression{
Expr: &binary_op.Plus{ Expr: &binary_op.Plus{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
}, },
}, },
},
} }
actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
@ -514,13 +472,11 @@ func TestPow(t *testing.T) {
Stmts: []node.Node{ Stmts: []node.Node{
&stmt.Expression{ &stmt.Expression{
Expr: &binary_op.Pow{ Expr: &binary_op.Pow{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
}, },
}, },
},
} }
actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
@ -537,13 +493,11 @@ func TestShiftLeft(t *testing.T) {
Stmts: []node.Node{ Stmts: []node.Node{
&stmt.Expression{ &stmt.Expression{
Expr: &binary_op.ShiftLeft{ Expr: &binary_op.ShiftLeft{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
}, },
}, },
},
} }
actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
@ -560,13 +514,11 @@ func TestShiftRight(t *testing.T) {
Stmts: []node.Node{ Stmts: []node.Node{
&stmt.Expression{ &stmt.Expression{
Expr: &binary_op.ShiftRight{ Expr: &binary_op.ShiftRight{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
}, },
}, },
},
} }
actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
@ -583,13 +535,11 @@ func TestSmallerOrEqual(t *testing.T) {
Stmts: []node.Node{ Stmts: []node.Node{
&stmt.Expression{ &stmt.Expression{
Expr: &binary_op.SmallerOrEqual{ Expr: &binary_op.SmallerOrEqual{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
}, },
}, },
},
} }
actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
@ -606,13 +556,11 @@ func TestSmaller(t *testing.T) {
Stmts: []node.Node{ Stmts: []node.Node{
&stmt.Expression{ &stmt.Expression{
Expr: &binary_op.Smaller{ Expr: &binary_op.Smaller{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
}, },
}, },
},
} }
actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
@ -629,13 +577,11 @@ func TestSpaceship(t *testing.T) {
Stmts: []node.Node{ Stmts: []node.Node{
&stmt.Expression{ &stmt.Expression{
Expr: &binary_op.Spaceship{ Expr: &binary_op.Spaceship{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
}, },
}, },
},
} }
actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")

View File

@ -19,271 +19,217 @@ var nodesToTest = []struct {
}{ }{
{ {
&binary_op.BitwiseAnd{ &binary_op.BitwiseAnd{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
},
[]string{"Left", "Right"}, []string{"Left", "Right"},
map[string]interface{}{}, map[string]interface{}{},
}, },
{ {
&binary_op.BitwiseOr{ &binary_op.BitwiseOr{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
},
[]string{"Left", "Right"}, []string{"Left", "Right"},
map[string]interface{}{}, map[string]interface{}{},
}, },
{ {
&binary_op.BitwiseXor{ &binary_op.BitwiseXor{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
},
[]string{"Left", "Right"}, []string{"Left", "Right"},
map[string]interface{}{}, map[string]interface{}{},
}, },
{ {
&binary_op.BooleanAnd{ &binary_op.BooleanAnd{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
},
[]string{"Left", "Right"}, []string{"Left", "Right"},
map[string]interface{}{}, map[string]interface{}{},
}, },
{ {
&binary_op.BooleanOr{ &binary_op.BooleanOr{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
},
[]string{"Left", "Right"}, []string{"Left", "Right"},
map[string]interface{}{}, map[string]interface{}{},
}, },
{ {
&binary_op.Coalesce{ &binary_op.Coalesce{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
},
[]string{"Left", "Right"}, []string{"Left", "Right"},
map[string]interface{}{}, map[string]interface{}{},
}, },
{ {
&binary_op.Concat{ &binary_op.Concat{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
},
[]string{"Left", "Right"}, []string{"Left", "Right"},
map[string]interface{}{}, map[string]interface{}{},
}, },
{ {
&binary_op.Div{ &binary_op.Div{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
},
[]string{"Left", "Right"}, []string{"Left", "Right"},
map[string]interface{}{}, map[string]interface{}{},
}, },
{ {
&binary_op.Equal{ &binary_op.Equal{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
},
[]string{"Left", "Right"}, []string{"Left", "Right"},
map[string]interface{}{}, map[string]interface{}{},
}, },
{ {
&binary_op.GreaterOrEqual{ &binary_op.GreaterOrEqual{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
},
[]string{"Left", "Right"}, []string{"Left", "Right"},
map[string]interface{}{}, map[string]interface{}{},
}, },
{ {
&binary_op.Greater{ &binary_op.Greater{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
},
[]string{"Left", "Right"}, []string{"Left", "Right"},
map[string]interface{}{}, map[string]interface{}{},
}, },
{ {
&binary_op.Identical{ &binary_op.Identical{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
},
[]string{"Left", "Right"}, []string{"Left", "Right"},
map[string]interface{}{}, map[string]interface{}{},
}, },
{ {
&binary_op.LogicalAnd{ &binary_op.LogicalAnd{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
},
[]string{"Left", "Right"}, []string{"Left", "Right"},
map[string]interface{}{}, map[string]interface{}{},
}, },
{ {
&binary_op.LogicalOr{ &binary_op.LogicalOr{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
},
[]string{"Left", "Right"}, []string{"Left", "Right"},
map[string]interface{}{}, map[string]interface{}{},
}, },
{ {
&binary_op.LogicalXor{ &binary_op.LogicalXor{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
},
[]string{"Left", "Right"}, []string{"Left", "Right"},
map[string]interface{}{}, map[string]interface{}{},
}, },
{ {
&binary_op.Minus{ &binary_op.Minus{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
},
[]string{"Left", "Right"}, []string{"Left", "Right"},
map[string]interface{}{}, map[string]interface{}{},
}, },
{ {
&binary_op.Mod{ &binary_op.Mod{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
},
[]string{"Left", "Right"}, []string{"Left", "Right"},
map[string]interface{}{}, map[string]interface{}{},
}, },
{ {
&binary_op.Mul{ &binary_op.Mul{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
},
[]string{"Left", "Right"}, []string{"Left", "Right"},
map[string]interface{}{}, map[string]interface{}{},
}, },
{ {
&binary_op.NotEqual{ &binary_op.NotEqual{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
},
[]string{"Left", "Right"}, []string{"Left", "Right"},
map[string]interface{}{}, map[string]interface{}{},
}, },
{ {
&binary_op.NotIdentical{ &binary_op.NotIdentical{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
},
[]string{"Left", "Right"}, []string{"Left", "Right"},
map[string]interface{}{}, map[string]interface{}{},
}, },
{ {
&binary_op.Plus{ &binary_op.Plus{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
},
[]string{"Left", "Right"}, []string{"Left", "Right"},
map[string]interface{}{}, map[string]interface{}{},
}, },
{ {
&binary_op.Pow{ &binary_op.Pow{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
},
[]string{"Left", "Right"}, []string{"Left", "Right"},
map[string]interface{}{}, map[string]interface{}{},
}, },
{ {
&binary_op.ShiftLeft{ &binary_op.ShiftLeft{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
},
[]string{"Left", "Right"}, []string{"Left", "Right"},
map[string]interface{}{}, map[string]interface{}{},
}, },
{ {
&binary_op.ShiftRight{ &binary_op.ShiftRight{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
},
[]string{"Left", "Right"}, []string{"Left", "Right"},
map[string]interface{}{}, map[string]interface{}{},
}, },
{ {
&binary_op.SmallerOrEqual{ &binary_op.SmallerOrEqual{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
},
[]string{"Left", "Right"}, []string{"Left", "Right"},
map[string]interface{}{}, map[string]interface{}{},
}, },
{ {
&binary_op.Smaller{ &binary_op.Smaller{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
},
[]string{"Left", "Right"}, []string{"Left", "Right"},
map[string]interface{}{}, map[string]interface{}{},
}, },
{ {
&binary_op.Spaceship{ &binary_op.Spaceship{
BinaryOp: binary_op.BinaryOp{
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}, Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}, Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
}, },
},
[]string{"Left", "Right"}, []string{"Left", "Right"},
map[string]interface{}{}, map[string]interface{}{},
}, },