remove SimpleNode
This commit is contained in:
@@ -8,19 +8,12 @@ import (
|
||||
)
|
||||
|
||||
type Cast struct {
|
||||
node.SimpleNode
|
||||
name string
|
||||
expr node.Node
|
||||
}
|
||||
|
||||
func NewCast(expr node.Node) node.Node {
|
||||
return Cast{
|
||||
node.SimpleNode{Name: "Cast", Attributes: make(map[string]string)},
|
||||
expr,
|
||||
}
|
||||
}
|
||||
|
||||
func (n Cast) 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.expr != nil {
|
||||
fmt.Fprintf(out, "\n%vexpr:", indent+" ")
|
||||
|
||||
@@ -4,6 +4,10 @@ import (
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
)
|
||||
|
||||
func (n CastArray) Name() string {
|
||||
return "CastArray"
|
||||
}
|
||||
|
||||
type CastArray struct {
|
||||
Cast
|
||||
}
|
||||
@@ -11,7 +15,7 @@ type CastArray struct {
|
||||
func NewCastArray(expr node.Node) node.Node {
|
||||
return CastArray{
|
||||
Cast{
|
||||
node.SimpleNode{Name: "CastArray", Attributes: make(map[string]string)},
|
||||
"CastArray",
|
||||
expr,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -4,6 +4,10 @@ import (
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
)
|
||||
|
||||
func (n CastBool) Name() string {
|
||||
return "CastBool"
|
||||
}
|
||||
|
||||
type CastBool struct {
|
||||
Cast
|
||||
}
|
||||
@@ -11,7 +15,7 @@ type CastBool struct {
|
||||
func NewCastBool(expr node.Node) node.Node {
|
||||
return CastBool{
|
||||
Cast{
|
||||
node.SimpleNode{Name: "CastBool", Attributes: make(map[string]string)},
|
||||
"CastBool",
|
||||
expr,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -4,6 +4,10 @@ import (
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
)
|
||||
|
||||
func (n CastDouble) Name() string {
|
||||
return "CastDouble"
|
||||
}
|
||||
|
||||
type CastDouble struct {
|
||||
Cast
|
||||
}
|
||||
@@ -11,7 +15,7 @@ type CastDouble struct {
|
||||
func NewCastDouble(expr node.Node) node.Node {
|
||||
return CastDouble{
|
||||
Cast{
|
||||
node.SimpleNode{Name: "CastDouble", Attributes: make(map[string]string)},
|
||||
"CastDouble",
|
||||
expr,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -4,6 +4,10 @@ import (
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
)
|
||||
|
||||
func (n CastInt) Name() string {
|
||||
return "CastInt"
|
||||
}
|
||||
|
||||
type CastInt struct {
|
||||
Cast
|
||||
}
|
||||
@@ -11,7 +15,7 @@ type CastInt struct {
|
||||
func NewCastInt(expr node.Node) node.Node {
|
||||
return CastInt{
|
||||
Cast{
|
||||
node.SimpleNode{Name: "CastInt", Attributes: make(map[string]string)},
|
||||
"CastInt",
|
||||
expr,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -4,6 +4,10 @@ import (
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
)
|
||||
|
||||
func (n CastObject) Name() string {
|
||||
return "CastObject"
|
||||
}
|
||||
|
||||
type CastObject struct {
|
||||
Cast
|
||||
}
|
||||
@@ -11,7 +15,7 @@ type CastObject struct {
|
||||
func NewCastObject(expr node.Node) node.Node {
|
||||
return CastObject{
|
||||
Cast{
|
||||
node.SimpleNode{Name: "CastObject", Attributes: make(map[string]string)},
|
||||
"CastObject",
|
||||
expr,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -4,6 +4,10 @@ import (
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
)
|
||||
|
||||
func (n CastString) Name() string {
|
||||
return "CastString"
|
||||
}
|
||||
|
||||
type CastString struct {
|
||||
Cast
|
||||
}
|
||||
@@ -11,7 +15,7 @@ type CastString struct {
|
||||
func NewCastString(expr node.Node) node.Node {
|
||||
return CastString{
|
||||
Cast{
|
||||
node.SimpleNode{Name: "CastString", Attributes: make(map[string]string)},
|
||||
"CastString",
|
||||
expr,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -4,6 +4,10 @@ import (
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
)
|
||||
|
||||
func (n CastUnset) Name() string {
|
||||
return "CastUnset"
|
||||
}
|
||||
|
||||
type CastUnset struct {
|
||||
Cast
|
||||
}
|
||||
@@ -11,7 +15,7 @@ type CastUnset struct {
|
||||
func NewCastUnset(expr node.Node) node.Node {
|
||||
return CastUnset{
|
||||
Cast{
|
||||
node.SimpleNode{Name: "CastUnset", Attributes: make(map[string]string)},
|
||||
"CastUnset",
|
||||
expr,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user