#31 dump to native golang struct
This commit is contained in:
@@ -32,13 +32,15 @@ func (n *BitwiseAnd) Walk(v walker.Visitor) {
|
||||
}
|
||||
|
||||
if n.Left != nil {
|
||||
vv := v.GetChildrenVisitor("Left")
|
||||
n.Left.Walk(vv)
|
||||
v.EnterChildNode("Left", n)
|
||||
n.Left.Walk(v)
|
||||
v.LeaveChildNode("Left", n)
|
||||
}
|
||||
|
||||
if n.Right != nil {
|
||||
vv := v.GetChildrenVisitor("Right")
|
||||
n.Right.Walk(vv)
|
||||
v.EnterChildNode("Right", n)
|
||||
n.Right.Walk(v)
|
||||
v.LeaveChildNode("Right", n)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
|
||||
@@ -32,13 +32,15 @@ func (n *BitwiseOr) Walk(v walker.Visitor) {
|
||||
}
|
||||
|
||||
if n.Left != nil {
|
||||
vv := v.GetChildrenVisitor("Left")
|
||||
n.Left.Walk(vv)
|
||||
v.EnterChildNode("Left", n)
|
||||
n.Left.Walk(v)
|
||||
v.LeaveChildNode("Left", n)
|
||||
}
|
||||
|
||||
if n.Right != nil {
|
||||
vv := v.GetChildrenVisitor("Right")
|
||||
n.Right.Walk(vv)
|
||||
v.EnterChildNode("Right", n)
|
||||
n.Right.Walk(v)
|
||||
v.LeaveChildNode("Right", n)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
|
||||
@@ -32,13 +32,15 @@ func (n *BitwiseXor) Walk(v walker.Visitor) {
|
||||
}
|
||||
|
||||
if n.Left != nil {
|
||||
vv := v.GetChildrenVisitor("Left")
|
||||
n.Left.Walk(vv)
|
||||
v.EnterChildNode("Left", n)
|
||||
n.Left.Walk(v)
|
||||
v.LeaveChildNode("Left", n)
|
||||
}
|
||||
|
||||
if n.Right != nil {
|
||||
vv := v.GetChildrenVisitor("Right")
|
||||
n.Right.Walk(vv)
|
||||
v.EnterChildNode("Right", n)
|
||||
n.Right.Walk(v)
|
||||
v.LeaveChildNode("Right", n)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
|
||||
@@ -32,13 +32,15 @@ func (n *BooleanAnd) Walk(v walker.Visitor) {
|
||||
}
|
||||
|
||||
if n.Left != nil {
|
||||
vv := v.GetChildrenVisitor("Left")
|
||||
n.Left.Walk(vv)
|
||||
v.EnterChildNode("Left", n)
|
||||
n.Left.Walk(v)
|
||||
v.LeaveChildNode("Left", n)
|
||||
}
|
||||
|
||||
if n.Right != nil {
|
||||
vv := v.GetChildrenVisitor("Right")
|
||||
n.Right.Walk(vv)
|
||||
v.EnterChildNode("Right", n)
|
||||
n.Right.Walk(v)
|
||||
v.LeaveChildNode("Right", n)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
|
||||
@@ -32,13 +32,15 @@ func (n *BooleanOr) Walk(v walker.Visitor) {
|
||||
}
|
||||
|
||||
if n.Left != nil {
|
||||
vv := v.GetChildrenVisitor("Left")
|
||||
n.Left.Walk(vv)
|
||||
v.EnterChildNode("Left", n)
|
||||
n.Left.Walk(v)
|
||||
v.LeaveChildNode("Left", n)
|
||||
}
|
||||
|
||||
if n.Right != nil {
|
||||
vv := v.GetChildrenVisitor("Right")
|
||||
n.Right.Walk(vv)
|
||||
v.EnterChildNode("Right", n)
|
||||
n.Right.Walk(v)
|
||||
v.LeaveChildNode("Right", n)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
|
||||
@@ -32,13 +32,15 @@ func (n *Coalesce) Walk(v walker.Visitor) {
|
||||
}
|
||||
|
||||
if n.Left != nil {
|
||||
vv := v.GetChildrenVisitor("Left")
|
||||
n.Left.Walk(vv)
|
||||
v.EnterChildNode("Left", n)
|
||||
n.Left.Walk(v)
|
||||
v.LeaveChildNode("Left", n)
|
||||
}
|
||||
|
||||
if n.Right != nil {
|
||||
vv := v.GetChildrenVisitor("Right")
|
||||
n.Right.Walk(vv)
|
||||
v.EnterChildNode("Right", n)
|
||||
n.Right.Walk(v)
|
||||
v.LeaveChildNode("Right", n)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
|
||||
@@ -32,13 +32,15 @@ func (n *Concat) Walk(v walker.Visitor) {
|
||||
}
|
||||
|
||||
if n.Left != nil {
|
||||
vv := v.GetChildrenVisitor("Left")
|
||||
n.Left.Walk(vv)
|
||||
v.EnterChildNode("Left", n)
|
||||
n.Left.Walk(v)
|
||||
v.LeaveChildNode("Left", n)
|
||||
}
|
||||
|
||||
if n.Right != nil {
|
||||
vv := v.GetChildrenVisitor("Right")
|
||||
n.Right.Walk(vv)
|
||||
v.EnterChildNode("Right", n)
|
||||
n.Right.Walk(v)
|
||||
v.LeaveChildNode("Right", n)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
|
||||
@@ -32,13 +32,15 @@ func (n *Div) Walk(v walker.Visitor) {
|
||||
}
|
||||
|
||||
if n.Left != nil {
|
||||
vv := v.GetChildrenVisitor("Left")
|
||||
n.Left.Walk(vv)
|
||||
v.EnterChildNode("Left", n)
|
||||
n.Left.Walk(v)
|
||||
v.LeaveChildNode("Left", n)
|
||||
}
|
||||
|
||||
if n.Right != nil {
|
||||
vv := v.GetChildrenVisitor("Right")
|
||||
n.Right.Walk(vv)
|
||||
v.EnterChildNode("Right", n)
|
||||
n.Right.Walk(v)
|
||||
v.LeaveChildNode("Right", n)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
|
||||
@@ -32,13 +32,15 @@ func (n *Equal) Walk(v walker.Visitor) {
|
||||
}
|
||||
|
||||
if n.Left != nil {
|
||||
vv := v.GetChildrenVisitor("Left")
|
||||
n.Left.Walk(vv)
|
||||
v.EnterChildNode("Left", n)
|
||||
n.Left.Walk(v)
|
||||
v.LeaveChildNode("Left", n)
|
||||
}
|
||||
|
||||
if n.Right != nil {
|
||||
vv := v.GetChildrenVisitor("Right")
|
||||
n.Right.Walk(vv)
|
||||
v.EnterChildNode("Right", n)
|
||||
n.Right.Walk(v)
|
||||
v.LeaveChildNode("Right", n)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
|
||||
@@ -32,13 +32,15 @@ func (n *Greater) Walk(v walker.Visitor) {
|
||||
}
|
||||
|
||||
if n.Left != nil {
|
||||
vv := v.GetChildrenVisitor("Left")
|
||||
n.Left.Walk(vv)
|
||||
v.EnterChildNode("Left", n)
|
||||
n.Left.Walk(v)
|
||||
v.LeaveChildNode("Left", n)
|
||||
}
|
||||
|
||||
if n.Right != nil {
|
||||
vv := v.GetChildrenVisitor("Right")
|
||||
n.Right.Walk(vv)
|
||||
v.EnterChildNode("Right", n)
|
||||
n.Right.Walk(v)
|
||||
v.LeaveChildNode("Right", n)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
|
||||
@@ -32,13 +32,15 @@ func (n *GreaterOrEqual) Walk(v walker.Visitor) {
|
||||
}
|
||||
|
||||
if n.Left != nil {
|
||||
vv := v.GetChildrenVisitor("Left")
|
||||
n.Left.Walk(vv)
|
||||
v.EnterChildNode("Left", n)
|
||||
n.Left.Walk(v)
|
||||
v.LeaveChildNode("Left", n)
|
||||
}
|
||||
|
||||
if n.Right != nil {
|
||||
vv := v.GetChildrenVisitor("Right")
|
||||
n.Right.Walk(vv)
|
||||
v.EnterChildNode("Right", n)
|
||||
n.Right.Walk(v)
|
||||
v.LeaveChildNode("Right", n)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
|
||||
@@ -32,13 +32,15 @@ func (n *Identical) Walk(v walker.Visitor) {
|
||||
}
|
||||
|
||||
if n.Left != nil {
|
||||
vv := v.GetChildrenVisitor("Left")
|
||||
n.Left.Walk(vv)
|
||||
v.EnterChildNode("Left", n)
|
||||
n.Left.Walk(v)
|
||||
v.LeaveChildNode("Left", n)
|
||||
}
|
||||
|
||||
if n.Right != nil {
|
||||
vv := v.GetChildrenVisitor("Right")
|
||||
n.Right.Walk(vv)
|
||||
v.EnterChildNode("Right", n)
|
||||
n.Right.Walk(v)
|
||||
v.LeaveChildNode("Right", n)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
|
||||
@@ -32,13 +32,15 @@ func (n *LogicalAnd) Walk(v walker.Visitor) {
|
||||
}
|
||||
|
||||
if n.Left != nil {
|
||||
vv := v.GetChildrenVisitor("Left")
|
||||
n.Left.Walk(vv)
|
||||
v.EnterChildNode("Left", n)
|
||||
n.Left.Walk(v)
|
||||
v.LeaveChildNode("Left", n)
|
||||
}
|
||||
|
||||
if n.Right != nil {
|
||||
vv := v.GetChildrenVisitor("Right")
|
||||
n.Right.Walk(vv)
|
||||
v.EnterChildNode("Right", n)
|
||||
n.Right.Walk(v)
|
||||
v.LeaveChildNode("Right", n)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
|
||||
@@ -32,13 +32,15 @@ func (n *LogicalOr) Walk(v walker.Visitor) {
|
||||
}
|
||||
|
||||
if n.Left != nil {
|
||||
vv := v.GetChildrenVisitor("Left")
|
||||
n.Left.Walk(vv)
|
||||
v.EnterChildNode("Left", n)
|
||||
n.Left.Walk(v)
|
||||
v.LeaveChildNode("Left", n)
|
||||
}
|
||||
|
||||
if n.Right != nil {
|
||||
vv := v.GetChildrenVisitor("Right")
|
||||
n.Right.Walk(vv)
|
||||
v.EnterChildNode("Right", n)
|
||||
n.Right.Walk(v)
|
||||
v.LeaveChildNode("Right", n)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
|
||||
@@ -32,13 +32,15 @@ func (n *LogicalXor) Walk(v walker.Visitor) {
|
||||
}
|
||||
|
||||
if n.Left != nil {
|
||||
vv := v.GetChildrenVisitor("Left")
|
||||
n.Left.Walk(vv)
|
||||
v.EnterChildNode("Left", n)
|
||||
n.Left.Walk(v)
|
||||
v.LeaveChildNode("Left", n)
|
||||
}
|
||||
|
||||
if n.Right != nil {
|
||||
vv := v.GetChildrenVisitor("Right")
|
||||
n.Right.Walk(vv)
|
||||
v.EnterChildNode("Right", n)
|
||||
n.Right.Walk(v)
|
||||
v.LeaveChildNode("Right", n)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
|
||||
@@ -32,13 +32,15 @@ func (n *Minus) Walk(v walker.Visitor) {
|
||||
}
|
||||
|
||||
if n.Left != nil {
|
||||
vv := v.GetChildrenVisitor("Left")
|
||||
n.Left.Walk(vv)
|
||||
v.EnterChildNode("Left", n)
|
||||
n.Left.Walk(v)
|
||||
v.LeaveChildNode("Left", n)
|
||||
}
|
||||
|
||||
if n.Right != nil {
|
||||
vv := v.GetChildrenVisitor("Right")
|
||||
n.Right.Walk(vv)
|
||||
v.EnterChildNode("Right", n)
|
||||
n.Right.Walk(v)
|
||||
v.LeaveChildNode("Right", n)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
|
||||
@@ -32,13 +32,15 @@ func (n *Mod) Walk(v walker.Visitor) {
|
||||
}
|
||||
|
||||
if n.Left != nil {
|
||||
vv := v.GetChildrenVisitor("Left")
|
||||
n.Left.Walk(vv)
|
||||
v.EnterChildNode("Left", n)
|
||||
n.Left.Walk(v)
|
||||
v.LeaveChildNode("Left", n)
|
||||
}
|
||||
|
||||
if n.Right != nil {
|
||||
vv := v.GetChildrenVisitor("Right")
|
||||
n.Right.Walk(vv)
|
||||
v.EnterChildNode("Right", n)
|
||||
n.Right.Walk(v)
|
||||
v.LeaveChildNode("Right", n)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
|
||||
@@ -32,13 +32,15 @@ func (n *Mul) Walk(v walker.Visitor) {
|
||||
}
|
||||
|
||||
if n.Left != nil {
|
||||
vv := v.GetChildrenVisitor("Left")
|
||||
n.Left.Walk(vv)
|
||||
v.EnterChildNode("Left", n)
|
||||
n.Left.Walk(v)
|
||||
v.LeaveChildNode("Left", n)
|
||||
}
|
||||
|
||||
if n.Right != nil {
|
||||
vv := v.GetChildrenVisitor("Right")
|
||||
n.Right.Walk(vv)
|
||||
v.EnterChildNode("Right", n)
|
||||
n.Right.Walk(v)
|
||||
v.LeaveChildNode("Right", n)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
|
||||
@@ -32,13 +32,15 @@ func (n *NotEqual) Walk(v walker.Visitor) {
|
||||
}
|
||||
|
||||
if n.Left != nil {
|
||||
vv := v.GetChildrenVisitor("Left")
|
||||
n.Left.Walk(vv)
|
||||
v.EnterChildNode("Left", n)
|
||||
n.Left.Walk(v)
|
||||
v.LeaveChildNode("Left", n)
|
||||
}
|
||||
|
||||
if n.Right != nil {
|
||||
vv := v.GetChildrenVisitor("Right")
|
||||
n.Right.Walk(vv)
|
||||
v.EnterChildNode("Right", n)
|
||||
n.Right.Walk(v)
|
||||
v.LeaveChildNode("Right", n)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
|
||||
@@ -32,13 +32,15 @@ func (n *NotIdentical) Walk(v walker.Visitor) {
|
||||
}
|
||||
|
||||
if n.Left != nil {
|
||||
vv := v.GetChildrenVisitor("Left")
|
||||
n.Left.Walk(vv)
|
||||
v.EnterChildNode("Left", n)
|
||||
n.Left.Walk(v)
|
||||
v.LeaveChildNode("Left", n)
|
||||
}
|
||||
|
||||
if n.Right != nil {
|
||||
vv := v.GetChildrenVisitor("Right")
|
||||
n.Right.Walk(vv)
|
||||
v.EnterChildNode("Right", n)
|
||||
n.Right.Walk(v)
|
||||
v.LeaveChildNode("Right", n)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
|
||||
@@ -32,13 +32,15 @@ func (n *Plus) Walk(v walker.Visitor) {
|
||||
}
|
||||
|
||||
if n.Left != nil {
|
||||
vv := v.GetChildrenVisitor("Left")
|
||||
n.Left.Walk(vv)
|
||||
v.EnterChildNode("Left", n)
|
||||
n.Left.Walk(v)
|
||||
v.LeaveChildNode("Left", n)
|
||||
}
|
||||
|
||||
if n.Right != nil {
|
||||
vv := v.GetChildrenVisitor("Right")
|
||||
n.Right.Walk(vv)
|
||||
v.EnterChildNode("Right", n)
|
||||
n.Right.Walk(v)
|
||||
v.LeaveChildNode("Right", n)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
|
||||
@@ -32,13 +32,15 @@ func (n *Pow) Walk(v walker.Visitor) {
|
||||
}
|
||||
|
||||
if n.Left != nil {
|
||||
vv := v.GetChildrenVisitor("Left")
|
||||
n.Left.Walk(vv)
|
||||
v.EnterChildNode("Left", n)
|
||||
n.Left.Walk(v)
|
||||
v.LeaveChildNode("Left", n)
|
||||
}
|
||||
|
||||
if n.Right != nil {
|
||||
vv := v.GetChildrenVisitor("Right")
|
||||
n.Right.Walk(vv)
|
||||
v.EnterChildNode("Right", n)
|
||||
n.Right.Walk(v)
|
||||
v.LeaveChildNode("Right", n)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
|
||||
@@ -32,13 +32,15 @@ func (n *ShiftLeft) Walk(v walker.Visitor) {
|
||||
}
|
||||
|
||||
if n.Left != nil {
|
||||
vv := v.GetChildrenVisitor("Left")
|
||||
n.Left.Walk(vv)
|
||||
v.EnterChildNode("Left", n)
|
||||
n.Left.Walk(v)
|
||||
v.LeaveChildNode("Left", n)
|
||||
}
|
||||
|
||||
if n.Right != nil {
|
||||
vv := v.GetChildrenVisitor("Right")
|
||||
n.Right.Walk(vv)
|
||||
v.EnterChildNode("Right", n)
|
||||
n.Right.Walk(v)
|
||||
v.LeaveChildNode("Right", n)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
|
||||
@@ -32,13 +32,15 @@ func (n *ShiftRight) Walk(v walker.Visitor) {
|
||||
}
|
||||
|
||||
if n.Left != nil {
|
||||
vv := v.GetChildrenVisitor("Left")
|
||||
n.Left.Walk(vv)
|
||||
v.EnterChildNode("Left", n)
|
||||
n.Left.Walk(v)
|
||||
v.LeaveChildNode("Left", n)
|
||||
}
|
||||
|
||||
if n.Right != nil {
|
||||
vv := v.GetChildrenVisitor("Right")
|
||||
n.Right.Walk(vv)
|
||||
v.EnterChildNode("Right", n)
|
||||
n.Right.Walk(v)
|
||||
v.LeaveChildNode("Right", n)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
|
||||
@@ -32,13 +32,15 @@ func (n *Smaller) Walk(v walker.Visitor) {
|
||||
}
|
||||
|
||||
if n.Left != nil {
|
||||
vv := v.GetChildrenVisitor("Left")
|
||||
n.Left.Walk(vv)
|
||||
v.EnterChildNode("Left", n)
|
||||
n.Left.Walk(v)
|
||||
v.LeaveChildNode("Left", n)
|
||||
}
|
||||
|
||||
if n.Right != nil {
|
||||
vv := v.GetChildrenVisitor("Right")
|
||||
n.Right.Walk(vv)
|
||||
v.EnterChildNode("Right", n)
|
||||
n.Right.Walk(v)
|
||||
v.LeaveChildNode("Right", n)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
|
||||
@@ -32,13 +32,15 @@ func (n *SmallerOrEqual) Walk(v walker.Visitor) {
|
||||
}
|
||||
|
||||
if n.Left != nil {
|
||||
vv := v.GetChildrenVisitor("Left")
|
||||
n.Left.Walk(vv)
|
||||
v.EnterChildNode("Left", n)
|
||||
n.Left.Walk(v)
|
||||
v.LeaveChildNode("Left", n)
|
||||
}
|
||||
|
||||
if n.Right != nil {
|
||||
vv := v.GetChildrenVisitor("Right")
|
||||
n.Right.Walk(vv)
|
||||
v.EnterChildNode("Right", n)
|
||||
n.Right.Walk(v)
|
||||
v.LeaveChildNode("Right", n)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
|
||||
@@ -32,13 +32,15 @@ func (n *Spaceship) Walk(v walker.Visitor) {
|
||||
}
|
||||
|
||||
if n.Left != nil {
|
||||
vv := v.GetChildrenVisitor("Left")
|
||||
n.Left.Walk(vv)
|
||||
v.EnterChildNode("Left", n)
|
||||
n.Left.Walk(v)
|
||||
v.LeaveChildNode("Left", n)
|
||||
}
|
||||
|
||||
if n.Right != nil {
|
||||
vv := v.GetChildrenVisitor("Right")
|
||||
n.Right.Walk(vv)
|
||||
v.EnterChildNode("Right", n)
|
||||
n.Right.Walk(v)
|
||||
v.LeaveChildNode("Right", n)
|
||||
}
|
||||
|
||||
v.LeaveNode(n)
|
||||
|
||||
@@ -19,216 +19,216 @@ var nodesToTest = []struct {
|
||||
}{
|
||||
{
|
||||
&binary.BitwiseAnd{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
|
||||
Left: &expr.Variable{},
|
||||
Right: &expr.Variable{},
|
||||
},
|
||||
[]string{"Left", "Right"},
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary.BitwiseOr{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
|
||||
Left: &expr.Variable{},
|
||||
Right: &expr.Variable{},
|
||||
},
|
||||
[]string{"Left", "Right"},
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary.BitwiseXor{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
|
||||
Left: &expr.Variable{},
|
||||
Right: &expr.Variable{},
|
||||
},
|
||||
[]string{"Left", "Right"},
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary.BooleanAnd{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
|
||||
Left: &expr.Variable{},
|
||||
Right: &expr.Variable{},
|
||||
},
|
||||
[]string{"Left", "Right"},
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary.BooleanOr{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
|
||||
Left: &expr.Variable{},
|
||||
Right: &expr.Variable{},
|
||||
},
|
||||
[]string{"Left", "Right"},
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary.Coalesce{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
|
||||
Left: &expr.Variable{},
|
||||
Right: &expr.Variable{},
|
||||
},
|
||||
[]string{"Left", "Right"},
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary.Concat{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
|
||||
Left: &expr.Variable{},
|
||||
Right: &expr.Variable{},
|
||||
},
|
||||
[]string{"Left", "Right"},
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary.Div{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
|
||||
Left: &expr.Variable{},
|
||||
Right: &expr.Variable{},
|
||||
},
|
||||
[]string{"Left", "Right"},
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary.Equal{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
|
||||
Left: &expr.Variable{},
|
||||
Right: &expr.Variable{},
|
||||
},
|
||||
[]string{"Left", "Right"},
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary.GreaterOrEqual{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
|
||||
Left: &expr.Variable{},
|
||||
Right: &expr.Variable{},
|
||||
},
|
||||
[]string{"Left", "Right"},
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary.Greater{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
|
||||
Left: &expr.Variable{},
|
||||
Right: &expr.Variable{},
|
||||
},
|
||||
[]string{"Left", "Right"},
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary.Identical{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
|
||||
Left: &expr.Variable{},
|
||||
Right: &expr.Variable{},
|
||||
},
|
||||
[]string{"Left", "Right"},
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary.LogicalAnd{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
|
||||
Left: &expr.Variable{},
|
||||
Right: &expr.Variable{},
|
||||
},
|
||||
[]string{"Left", "Right"},
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary.LogicalOr{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
|
||||
Left: &expr.Variable{},
|
||||
Right: &expr.Variable{},
|
||||
},
|
||||
[]string{"Left", "Right"},
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary.LogicalXor{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
|
||||
Left: &expr.Variable{},
|
||||
Right: &expr.Variable{},
|
||||
},
|
||||
[]string{"Left", "Right"},
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary.Minus{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
|
||||
Left: &expr.Variable{},
|
||||
Right: &expr.Variable{},
|
||||
},
|
||||
[]string{"Left", "Right"},
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary.Mod{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
|
||||
Left: &expr.Variable{},
|
||||
Right: &expr.Variable{},
|
||||
},
|
||||
[]string{"Left", "Right"},
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary.Mul{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
|
||||
Left: &expr.Variable{},
|
||||
Right: &expr.Variable{},
|
||||
},
|
||||
[]string{"Left", "Right"},
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary.NotEqual{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
|
||||
Left: &expr.Variable{},
|
||||
Right: &expr.Variable{},
|
||||
},
|
||||
[]string{"Left", "Right"},
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary.NotIdentical{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
|
||||
Left: &expr.Variable{},
|
||||
Right: &expr.Variable{},
|
||||
},
|
||||
[]string{"Left", "Right"},
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary.Plus{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
|
||||
Left: &expr.Variable{},
|
||||
Right: &expr.Variable{},
|
||||
},
|
||||
[]string{"Left", "Right"},
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary.Pow{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
|
||||
Left: &expr.Variable{},
|
||||
Right: &expr.Variable{},
|
||||
},
|
||||
[]string{"Left", "Right"},
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary.ShiftLeft{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
|
||||
Left: &expr.Variable{},
|
||||
Right: &expr.Variable{},
|
||||
},
|
||||
[]string{"Left", "Right"},
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary.ShiftRight{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
|
||||
Left: &expr.Variable{},
|
||||
Right: &expr.Variable{},
|
||||
},
|
||||
[]string{"Left", "Right"},
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary.SmallerOrEqual{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
|
||||
Left: &expr.Variable{},
|
||||
Right: &expr.Variable{},
|
||||
},
|
||||
[]string{"Left", "Right"},
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary.Smaller{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
|
||||
Left: &expr.Variable{},
|
||||
Right: &expr.Variable{},
|
||||
},
|
||||
[]string{"Left", "Right"},
|
||||
map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
&binary.Spaceship{
|
||||
Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
|
||||
Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
|
||||
Left: &expr.Variable{},
|
||||
Right: &expr.Variable{},
|
||||
},
|
||||
[]string{"Left", "Right"},
|
||||
map[string]interface{}{},
|
||||
@@ -241,11 +241,15 @@ type visitorMock struct {
|
||||
}
|
||||
|
||||
func (v *visitorMock) EnterNode(n walker.Walkable) bool { return v.visitChildren }
|
||||
func (v *visitorMock) GetChildrenVisitor(key string) walker.Visitor {
|
||||
func (v *visitorMock) LeaveNode(n walker.Walkable) {}
|
||||
func (v *visitorMock) EnterChildNode(key string, w walker.Walkable) {
|
||||
v.visitedKeys = append(v.visitedKeys, key)
|
||||
return &visitorMock{v.visitChildren, nil}
|
||||
}
|
||||
func (v *visitorMock) LeaveNode(n walker.Walkable) {}
|
||||
func (v *visitorMock) LeaveChildNode(key string, w walker.Walkable) {}
|
||||
func (v *visitorMock) EnterChildList(key string, w walker.Walkable) {
|
||||
v.visitedKeys = append(v.visitedKeys, key)
|
||||
}
|
||||
func (v *visitorMock) LeaveChildList(key string, w walker.Walkable) {}
|
||||
|
||||
func TestVisitorDisableChildren(t *testing.T) {
|
||||
for _, tt := range nodesToTest {
|
||||
|
||||
Reference in New Issue
Block a user