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

@@ -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+" ")

View File

@@ -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,
},
}

View File

@@ -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,
},
}

View File

@@ -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,
},
}

View File

@@ -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,
},
}

View File

@@ -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,
},
}

View File

@@ -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,
},
}

View File

@@ -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,
},
}