remove SimpleNode

This commit is contained in:
vadim
2017-12-27 19:55:58 +02:00
parent e83ab79344
commit 32a285b437
159 changed files with 1195 additions and 622 deletions

View File

@@ -4,6 +4,10 @@ import (
"github.com/z7zmey/php-parser/node"
)
func (n Assign) Name() string {
return "Assign"
}
type Assign struct {
AssignOp
}
@@ -11,7 +15,7 @@ type Assign struct {
func NewAssign(variable node.Node, expression node.Node) node.Node {
return Assign{
AssignOp{
node.SimpleNode{Name: "Assign", Attributes: make(map[string]string)},
"Assign",
variable,
expression,
},

View File

@@ -8,13 +8,13 @@ import (
)
type AssignOp struct {
node.SimpleNode
name string
variable node.Node
expression node.Node
}
func (n AssignOp) Print(out io.Writer, indent string) {
fmt.Fprintf(out, "\n%v%v [- -]", indent, n.Name)
fmt.Fprintf(out, "\n%v%v [- -]", indent, n.name)
if n.variable != nil {
fmt.Fprintf(out, "\n%vvariable:", indent+" ")

View File

@@ -4,6 +4,10 @@ import (
"github.com/z7zmey/php-parser/node"
)
func (n AssignRef) Name() string {
return "AssignRef"
}
type AssignRef struct {
AssignOp
}
@@ -11,7 +15,7 @@ type AssignRef struct {
func NewAssignRef(variable node.Node, expression node.Node) node.Node {
return AssignRef{
AssignOp{
node.SimpleNode{Name: "AssignRef", Attributes: make(map[string]string)},
"AssignRef",
variable,
expression,
},

View File

@@ -4,14 +4,18 @@ import (
"github.com/z7zmey/php-parser/node"
)
func (n BitwiseAnd) Name() string {
return "BitwiseAnd"
}
type BitwiseAnd struct {
AssignOp
}
func NewBitwiseAnd(variable node.Node, expression node.Node) node.Node {
func NewBitwiseAnd(variable node.Node, expression node.Node) node.Node {
return BitwiseAnd{
AssignOp{
node.SimpleNode{Name: "AssignBitwiseAnd", Attributes: make(map[string]string)},
"AssignBitwiseAnd",
variable,
expression,
},

View File

@@ -4,14 +4,18 @@ import (
"github.com/z7zmey/php-parser/node"
)
func (n BitwiseOr) Name() string {
return "BitwiseOr"
}
type BitwiseOr struct {
AssignOp
}
func NewBitwiseOr(variable node.Node, expression node.Node) node.Node {
func NewBitwiseOr(variable node.Node, expression node.Node) node.Node {
return BitwiseOr{
AssignOp{
node.SimpleNode{Name: "AssignBitwiseOr", Attributes: make(map[string]string)},
"AssignBitwiseOr",
variable,
expression,
},

View File

@@ -8,12 +8,16 @@ type BitwiseXor struct {
AssignOp
}
func NewBitwiseXor(variable node.Node, expression node.Node) node.Node {
func NewBitwiseXor(variable node.Node, expression node.Node) node.Node {
return BitwiseXor{
AssignOp{
node.SimpleNode{Name: "AssignBitwiseXor", Attributes: make(map[string]string)},
"AssignBitwiseXor",
variable,
expression,
},
}
}
func (n BitwiseXor) Name() string {
return "BitwiseXor"
}

View File

@@ -4,14 +4,18 @@ import (
"github.com/z7zmey/php-parser/node"
)
func (n Concat) Name() string {
return "Concat"
}
type Concat struct {
AssignOp
}
func NewConcat(variable node.Node, expression node.Node) node.Node {
func NewConcat(variable node.Node, expression node.Node) node.Node {
return Concat{
AssignOp{
node.SimpleNode{Name: "AssignConcat", Attributes: make(map[string]string)},
"AssignConcat",
variable,
expression,
},

View File

@@ -4,14 +4,18 @@ import (
"github.com/z7zmey/php-parser/node"
)
func (n Div) Name() string {
return "Div"
}
type Div struct {
AssignOp
}
func NewDiv(variable node.Node, expression node.Node) node.Node {
func NewDiv(variable node.Node, expression node.Node) node.Node {
return Div{
AssignOp{
node.SimpleNode{Name: "AssignDiv", Attributes: make(map[string]string)},
"AssignDiv",
variable,
expression,
},

View File

@@ -4,14 +4,18 @@ import (
"github.com/z7zmey/php-parser/node"
)
func (n Minus) Name() string {
return "Minus"
}
type Minus struct {
AssignOp
}
func NewMinus(variable node.Node, expression node.Node) node.Node {
func NewMinus(variable node.Node, expression node.Node) node.Node {
return Minus{
AssignOp{
node.SimpleNode{Name: "AssignMinus", Attributes: make(map[string]string)},
"AssignMinus",
variable,
expression,
},

View File

@@ -4,14 +4,18 @@ import (
"github.com/z7zmey/php-parser/node"
)
func (n Mod) Name() string {
return "Mod"
}
type Mod struct {
AssignOp
}
func NewMod(variable node.Node, expression node.Node) node.Node {
func NewMod(variable node.Node, expression node.Node) node.Node {
return Mod{
AssignOp{
node.SimpleNode{Name: "AssignMod", Attributes: make(map[string]string)},
"AssignMod",
variable,
expression,
},

View File

@@ -4,14 +4,18 @@ import (
"github.com/z7zmey/php-parser/node"
)
func (n Mul) Name() string {
return "Mul"
}
type Mul struct {
AssignOp
}
func NewMul(variable node.Node, expression node.Node) node.Node {
func NewMul(variable node.Node, expression node.Node) node.Node {
return Mul{
AssignOp{
node.SimpleNode{Name: "AssignMul", Attributes: make(map[string]string)},
"AssignMul",
variable,
expression,
},

View File

@@ -4,14 +4,18 @@ import (
"github.com/z7zmey/php-parser/node"
)
func (n Plus) Name() string {
return "Plus"
}
type Plus struct {
AssignOp
}
func NewPlus(variable node.Node, expression node.Node) node.Node {
func NewPlus(variable node.Node, expression node.Node) node.Node {
return Plus{
AssignOp{
node.SimpleNode{Name: "AssignPlus", Attributes: make(map[string]string)},
"AssignPlus",
variable,
expression,
},

View File

@@ -4,14 +4,18 @@ import (
"github.com/z7zmey/php-parser/node"
)
func (n Pow) Name() string {
return "Pow"
}
type Pow struct {
AssignOp
}
func NewPow(variable node.Node, expression node.Node) node.Node {
func NewPow(variable node.Node, expression node.Node) node.Node {
return Pow{
AssignOp{
node.SimpleNode{Name: "AssignPow", Attributes: make(map[string]string)},
"AssignPow",
variable,
expression,
},

View File

@@ -4,14 +4,18 @@ import (
"github.com/z7zmey/php-parser/node"
)
func (n ShiftLeft) Name() string {
return "ShiftLeft"
}
type ShiftLeft struct {
AssignOp
}
func NewShiftLeft(variable node.Node, expression node.Node) node.Node {
func NewShiftLeft(variable node.Node, expression node.Node) node.Node {
return ShiftLeft{
AssignOp{
node.SimpleNode{Name: "AssignShiftLeft", Attributes: make(map[string]string)},
"AssignShiftLeft",
variable,
expression,
},

View File

@@ -4,14 +4,18 @@ import (
"github.com/z7zmey/php-parser/node"
)
func (n ShiftRight) Name() string {
return "ShiftRight"
}
type ShiftRight struct {
AssignOp
}
func NewShiftRight(variable node.Node, expression node.Node) node.Node {
func NewShiftRight(variable node.Node, expression node.Node) node.Node {
return ShiftRight{
AssignOp{
node.SimpleNode{Name: "AssignShiftRight", Attributes: make(map[string]string)},
"AssignShiftRight",
variable,
expression,
},