add attributes fiald to all nodes
This commit is contained in:
@@ -5,7 +5,8 @@ import (
|
||||
)
|
||||
|
||||
type BinaryOp struct {
|
||||
name string
|
||||
left node.Node
|
||||
right node.Node
|
||||
name string
|
||||
attributes map[string]interface{}
|
||||
left node.Node
|
||||
right node.Node
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ func NewBitwiseAnd(variable node.Node, expression node.Node) node.Node {
|
||||
return BitwiseAnd{
|
||||
BinaryOp{
|
||||
"BinaryBitwiseAnd",
|
||||
map[string]interface{}{},
|
||||
variable,
|
||||
expression,
|
||||
},
|
||||
@@ -23,7 +24,7 @@ func (n BitwiseAnd) Name() string {
|
||||
}
|
||||
|
||||
func (n BitwiseAnd) Attributes() map[string]interface{} {
|
||||
return nil
|
||||
return n.attributes
|
||||
}
|
||||
|
||||
func (n BitwiseAnd) Walk(v node.Visitor) {
|
||||
|
||||
@@ -12,6 +12,7 @@ func NewBitwiseOr(variable node.Node, expression node.Node) node.Node {
|
||||
return BitwiseOr{
|
||||
BinaryOp{
|
||||
"BinaryBitwiseOr",
|
||||
map[string]interface{}{},
|
||||
variable,
|
||||
expression,
|
||||
},
|
||||
@@ -19,7 +20,7 @@ func NewBitwiseOr(variable node.Node, expression node.Node) node.Node {
|
||||
}
|
||||
|
||||
func (n BitwiseOr) Attributes() map[string]interface{} {
|
||||
return nil
|
||||
return n.attributes
|
||||
}
|
||||
|
||||
func (n BitwiseOr) Name() string {
|
||||
|
||||
@@ -12,6 +12,7 @@ func NewBitwiseXor(variable node.Node, expression node.Node) node.Node {
|
||||
return BitwiseXor{
|
||||
BinaryOp{
|
||||
"BinaryBitwiseXor",
|
||||
map[string]interface{}{},
|
||||
variable,
|
||||
expression,
|
||||
},
|
||||
@@ -19,7 +20,7 @@ func NewBitwiseXor(variable node.Node, expression node.Node) node.Node {
|
||||
}
|
||||
|
||||
func (n BitwiseXor) Attributes() map[string]interface{} {
|
||||
return nil
|
||||
return n.attributes
|
||||
}
|
||||
|
||||
func (n BitwiseXor) Name() string {
|
||||
|
||||
@@ -12,6 +12,7 @@ func NewBooleanAnd(variable node.Node, expression node.Node) node.Node {
|
||||
return BooleanAnd{
|
||||
BinaryOp{
|
||||
"BinaryBooleanAnd",
|
||||
map[string]interface{}{},
|
||||
variable,
|
||||
expression,
|
||||
},
|
||||
@@ -23,7 +24,7 @@ func (n BooleanAnd) Name() string {
|
||||
}
|
||||
|
||||
func (n BooleanAnd) Attributes() map[string]interface{} {
|
||||
return nil
|
||||
return n.attributes
|
||||
}
|
||||
|
||||
func (n BooleanAnd) Walk(v node.Visitor) {
|
||||
|
||||
@@ -12,6 +12,7 @@ func NewBooleanOr(variable node.Node, expression node.Node) node.Node {
|
||||
return BooleanOr{
|
||||
BinaryOp{
|
||||
"BinaryBooleanOr",
|
||||
map[string]interface{}{},
|
||||
variable,
|
||||
expression,
|
||||
},
|
||||
@@ -23,7 +24,7 @@ func (n BooleanOr) Name() string {
|
||||
}
|
||||
|
||||
func (n BooleanOr) Attributes() map[string]interface{} {
|
||||
return nil
|
||||
return n.attributes
|
||||
}
|
||||
|
||||
func (n BooleanOr) Walk(v node.Visitor) {
|
||||
|
||||
@@ -12,6 +12,7 @@ func NewCoalesce(variable node.Node, expression node.Node) node.Node {
|
||||
return Coalesce{
|
||||
BinaryOp{
|
||||
"BinaryCoalesce",
|
||||
map[string]interface{}{},
|
||||
variable,
|
||||
expression,
|
||||
},
|
||||
@@ -23,7 +24,7 @@ func (n Coalesce) Name() string {
|
||||
}
|
||||
|
||||
func (n Coalesce) Attributes() map[string]interface{} {
|
||||
return nil
|
||||
return n.attributes
|
||||
}
|
||||
|
||||
func (n Coalesce) Walk(v node.Visitor) {
|
||||
|
||||
@@ -12,6 +12,7 @@ func NewConcat(variable node.Node, expression node.Node) node.Node {
|
||||
return Concat{
|
||||
BinaryOp{
|
||||
"BinaryConcat",
|
||||
map[string]interface{}{},
|
||||
variable,
|
||||
expression,
|
||||
},
|
||||
@@ -23,7 +24,7 @@ func (n Concat) Name() string {
|
||||
}
|
||||
|
||||
func (n Concat) Attributes() map[string]interface{} {
|
||||
return nil
|
||||
return n.attributes
|
||||
}
|
||||
|
||||
func (n Concat) Walk(v node.Visitor) {
|
||||
|
||||
@@ -12,6 +12,7 @@ func NewDiv(variable node.Node, expression node.Node) node.Node {
|
||||
return Div{
|
||||
BinaryOp{
|
||||
"BinaryDiv",
|
||||
map[string]interface{}{},
|
||||
variable,
|
||||
expression,
|
||||
},
|
||||
@@ -23,7 +24,7 @@ func (n Div) Name() string {
|
||||
}
|
||||
|
||||
func (n Div) Attributes() map[string]interface{} {
|
||||
return nil
|
||||
return n.attributes
|
||||
}
|
||||
|
||||
func (n Div) Walk(v node.Visitor) {
|
||||
|
||||
@@ -12,6 +12,7 @@ func NewEqual(variable node.Node, expression node.Node) node.Node {
|
||||
return Equal{
|
||||
BinaryOp{
|
||||
"BinaryEqual",
|
||||
map[string]interface{}{},
|
||||
variable,
|
||||
expression,
|
||||
},
|
||||
@@ -23,7 +24,7 @@ func (n Equal) Name() string {
|
||||
}
|
||||
|
||||
func (n Equal) Attributes() map[string]interface{} {
|
||||
return nil
|
||||
return n.attributes
|
||||
}
|
||||
|
||||
func (n Equal) Walk(v node.Visitor) {
|
||||
|
||||
@@ -12,6 +12,7 @@ func NewGreater(variable node.Node, expression node.Node) node.Node {
|
||||
return Greater{
|
||||
BinaryOp{
|
||||
"BinaryGreater",
|
||||
map[string]interface{}{},
|
||||
variable,
|
||||
expression,
|
||||
},
|
||||
@@ -23,7 +24,7 @@ func (n Greater) Name() string {
|
||||
}
|
||||
|
||||
func (n Greater) Attributes() map[string]interface{} {
|
||||
return nil
|
||||
return n.attributes
|
||||
}
|
||||
|
||||
func (n Greater) Walk(v node.Visitor) {
|
||||
|
||||
@@ -12,6 +12,7 @@ func NewGreaterOrEqual(variable node.Node, expression node.Node) node.Node {
|
||||
return GreaterOrEqual{
|
||||
BinaryOp{
|
||||
"BinaryGreaterOrEqual",
|
||||
map[string]interface{}{},
|
||||
variable,
|
||||
expression,
|
||||
},
|
||||
@@ -23,7 +24,7 @@ func (n GreaterOrEqual) Name() string {
|
||||
}
|
||||
|
||||
func (n GreaterOrEqual) Attributes() map[string]interface{} {
|
||||
return nil
|
||||
return n.attributes
|
||||
}
|
||||
|
||||
func (n GreaterOrEqual) Walk(v node.Visitor) {
|
||||
|
||||
@@ -12,6 +12,7 @@ func NewIdentical(variable node.Node, expression node.Node) node.Node {
|
||||
return Identical{
|
||||
BinaryOp{
|
||||
"BinaryIdentical",
|
||||
map[string]interface{}{},
|
||||
variable,
|
||||
expression,
|
||||
},
|
||||
@@ -23,7 +24,7 @@ func (n Identical) Name() string {
|
||||
}
|
||||
|
||||
func (n Identical) Attributes() map[string]interface{} {
|
||||
return nil
|
||||
return n.attributes
|
||||
}
|
||||
|
||||
func (n Identical) Walk(v node.Visitor) {
|
||||
|
||||
@@ -12,6 +12,7 @@ func NewLogicalAnd(variable node.Node, expression node.Node) node.Node {
|
||||
return LogicalAnd{
|
||||
BinaryOp{
|
||||
"BinaryLogicalAnd",
|
||||
map[string]interface{}{},
|
||||
variable,
|
||||
expression,
|
||||
},
|
||||
@@ -23,7 +24,7 @@ func (n LogicalAnd) Name() string {
|
||||
}
|
||||
|
||||
func (n LogicalAnd) Attributes() map[string]interface{} {
|
||||
return nil
|
||||
return n.attributes
|
||||
}
|
||||
|
||||
func (n LogicalAnd) Walk(v node.Visitor) {
|
||||
|
||||
@@ -12,6 +12,7 @@ func NewLogicalOr(variable node.Node, expression node.Node) node.Node {
|
||||
return LogicalOr{
|
||||
BinaryOp{
|
||||
"BinaryLogicalOr",
|
||||
map[string]interface{}{},
|
||||
variable,
|
||||
expression,
|
||||
},
|
||||
@@ -23,7 +24,7 @@ func (n LogicalOr) Name() string {
|
||||
}
|
||||
|
||||
func (n LogicalOr) Attributes() map[string]interface{} {
|
||||
return nil
|
||||
return n.attributes
|
||||
}
|
||||
|
||||
func (n LogicalOr) Walk(v node.Visitor) {
|
||||
|
||||
@@ -12,6 +12,7 @@ func NewLogicalXor(variable node.Node, expression node.Node) node.Node {
|
||||
return LogicalXor{
|
||||
BinaryOp{
|
||||
"BinaryLogicalXor",
|
||||
map[string]interface{}{},
|
||||
variable,
|
||||
expression,
|
||||
},
|
||||
@@ -23,7 +24,7 @@ func (n LogicalXor) Name() string {
|
||||
}
|
||||
|
||||
func (n LogicalXor) Attributes() map[string]interface{} {
|
||||
return nil
|
||||
return n.attributes
|
||||
}
|
||||
|
||||
func (n LogicalXor) Walk(v node.Visitor) {
|
||||
|
||||
@@ -12,6 +12,7 @@ func NewMinus(variable node.Node, expression node.Node) node.Node {
|
||||
return Minus{
|
||||
BinaryOp{
|
||||
"BinaryMinus",
|
||||
map[string]interface{}{},
|
||||
variable,
|
||||
expression,
|
||||
},
|
||||
@@ -23,7 +24,7 @@ func (n Minus) Name() string {
|
||||
}
|
||||
|
||||
func (n Minus) Attributes() map[string]interface{} {
|
||||
return nil
|
||||
return n.attributes
|
||||
}
|
||||
|
||||
func (n Minus) Walk(v node.Visitor) {
|
||||
|
||||
@@ -12,6 +12,7 @@ func NewMod(variable node.Node, expression node.Node) node.Node {
|
||||
return Mod{
|
||||
BinaryOp{
|
||||
"BinaryMod",
|
||||
map[string]interface{}{},
|
||||
variable,
|
||||
expression,
|
||||
},
|
||||
@@ -23,7 +24,7 @@ func (n Mod) Name() string {
|
||||
}
|
||||
|
||||
func (n Mod) Attributes() map[string]interface{} {
|
||||
return nil
|
||||
return n.attributes
|
||||
}
|
||||
|
||||
func (n Mod) Walk(v node.Visitor) {
|
||||
|
||||
@@ -12,6 +12,7 @@ func NewMul(variable node.Node, expression node.Node) node.Node {
|
||||
return Mul{
|
||||
BinaryOp{
|
||||
"BinaryMul",
|
||||
map[string]interface{}{},
|
||||
variable,
|
||||
expression,
|
||||
},
|
||||
@@ -23,7 +24,7 @@ func (n Mul) Name() string {
|
||||
}
|
||||
|
||||
func (n Mul) Attributes() map[string]interface{} {
|
||||
return nil
|
||||
return n.attributes
|
||||
}
|
||||
|
||||
func (n Mul) Walk(v node.Visitor) {
|
||||
|
||||
@@ -12,6 +12,7 @@ func NewNotEqual(variable node.Node, expression node.Node) node.Node {
|
||||
return NotEqual{
|
||||
BinaryOp{
|
||||
"BinaryNotEqual",
|
||||
map[string]interface{}{},
|
||||
variable,
|
||||
expression,
|
||||
},
|
||||
@@ -23,7 +24,7 @@ func (n NotEqual) Name() string {
|
||||
}
|
||||
|
||||
func (n NotEqual) Attributes() map[string]interface{} {
|
||||
return nil
|
||||
return n.attributes
|
||||
}
|
||||
|
||||
func (n NotEqual) Walk(v node.Visitor) {
|
||||
|
||||
@@ -12,6 +12,7 @@ func NewNotIdentical(variable node.Node, expression node.Node) node.Node {
|
||||
return NotIdentical{
|
||||
BinaryOp{
|
||||
"BinaryNotIdentical",
|
||||
map[string]interface{}{},
|
||||
variable,
|
||||
expression,
|
||||
},
|
||||
@@ -23,7 +24,7 @@ func (n NotIdentical) Name() string {
|
||||
}
|
||||
|
||||
func (n NotIdentical) Attributes() map[string]interface{} {
|
||||
return nil
|
||||
return n.attributes
|
||||
}
|
||||
|
||||
func (n NotIdentical) Walk(v node.Visitor) {
|
||||
|
||||
@@ -12,6 +12,7 @@ func NewPlus(variable node.Node, expression node.Node) node.Node {
|
||||
return Plus{
|
||||
BinaryOp{
|
||||
"BinaryPlus",
|
||||
map[string]interface{}{},
|
||||
variable,
|
||||
expression,
|
||||
},
|
||||
@@ -23,7 +24,7 @@ func (n Plus) Name() string {
|
||||
}
|
||||
|
||||
func (n Plus) Attributes() map[string]interface{} {
|
||||
return nil
|
||||
return n.attributes
|
||||
}
|
||||
|
||||
func (n Plus) Walk(v node.Visitor) {
|
||||
|
||||
@@ -12,6 +12,7 @@ func NewPow(variable node.Node, expression node.Node) node.Node {
|
||||
return Pow{
|
||||
BinaryOp{
|
||||
"BinaryPow",
|
||||
map[string]interface{}{},
|
||||
variable,
|
||||
expression,
|
||||
},
|
||||
@@ -23,7 +24,7 @@ func (n Pow) Name() string {
|
||||
}
|
||||
|
||||
func (n Pow) Attributes() map[string]interface{} {
|
||||
return nil
|
||||
return n.attributes
|
||||
}
|
||||
|
||||
func (n Pow) Walk(v node.Visitor) {
|
||||
|
||||
@@ -12,6 +12,7 @@ func NewShiftLeft(variable node.Node, expression node.Node) node.Node {
|
||||
return ShiftLeft{
|
||||
BinaryOp{
|
||||
"BinaryShiftLeft",
|
||||
map[string]interface{}{},
|
||||
variable,
|
||||
expression,
|
||||
},
|
||||
@@ -23,7 +24,7 @@ func (n ShiftLeft) Name() string {
|
||||
}
|
||||
|
||||
func (n ShiftLeft) Attributes() map[string]interface{} {
|
||||
return nil
|
||||
return n.attributes
|
||||
}
|
||||
|
||||
func (n ShiftLeft) Walk(v node.Visitor) {
|
||||
|
||||
@@ -12,6 +12,7 @@ func NewShiftRight(variable node.Node, expression node.Node) node.Node {
|
||||
return ShiftRight{
|
||||
BinaryOp{
|
||||
"BinaryShiftRight",
|
||||
map[string]interface{}{},
|
||||
variable,
|
||||
expression,
|
||||
},
|
||||
@@ -23,7 +24,7 @@ func (n ShiftRight) Name() string {
|
||||
}
|
||||
|
||||
func (n ShiftRight) Attributes() map[string]interface{} {
|
||||
return nil
|
||||
return n.attributes
|
||||
}
|
||||
|
||||
func (n ShiftRight) Walk(v node.Visitor) {
|
||||
|
||||
@@ -12,6 +12,7 @@ func NewSmaller(variable node.Node, expression node.Node) node.Node {
|
||||
return Smaller{
|
||||
BinaryOp{
|
||||
"BinarySmaller",
|
||||
map[string]interface{}{},
|
||||
variable,
|
||||
expression,
|
||||
},
|
||||
@@ -23,7 +24,7 @@ func (n Smaller) Name() string {
|
||||
}
|
||||
|
||||
func (n Smaller) Attributes() map[string]interface{} {
|
||||
return nil
|
||||
return n.attributes
|
||||
}
|
||||
|
||||
func (n Smaller) Walk(v node.Visitor) {
|
||||
|
||||
@@ -12,6 +12,7 @@ func NewSmallerOrEqual(variable node.Node, expression node.Node) node.Node {
|
||||
return SmallerOrEqual{
|
||||
BinaryOp{
|
||||
"BinarySmallerOrEqual",
|
||||
map[string]interface{}{},
|
||||
variable,
|
||||
expression,
|
||||
},
|
||||
@@ -23,7 +24,7 @@ func (n SmallerOrEqual) Name() string {
|
||||
}
|
||||
|
||||
func (n SmallerOrEqual) Attributes() map[string]interface{} {
|
||||
return nil
|
||||
return n.attributes
|
||||
}
|
||||
|
||||
func (n SmallerOrEqual) Walk(v node.Visitor) {
|
||||
|
||||
@@ -12,6 +12,7 @@ func NewSpaceship(variable node.Node, expression node.Node) node.Node {
|
||||
return Spaceship{
|
||||
BinaryOp{
|
||||
"BinarySpaceship",
|
||||
map[string]interface{}{},
|
||||
variable,
|
||||
expression,
|
||||
},
|
||||
@@ -23,7 +24,7 @@ func (n Spaceship) Name() string {
|
||||
}
|
||||
|
||||
func (n Spaceship) Attributes() map[string]interface{} {
|
||||
return nil
|
||||
return n.attributes
|
||||
}
|
||||
|
||||
func (n Spaceship) Walk(v node.Visitor) {
|
||||
|
||||
Reference in New Issue
Block a user