php-parser/node/expr/property_fetch.go
2017-12-28 01:23:32 +02:00

40 lines
611 B
Go

package expr
import (
"github.com/z7zmey/php-parser/node"
)
func (n PropertyFetch) Name() string {
return "PropertyFetch"
}
type PropertyFetch struct {
name string
variable node.Node
property node.Node
}
func NewPropertyFetch(variable node.Node, property node.Node) node.Node {
return PropertyFetch{
"PropertyFetch",
variable,
property,
}
}
func (n PropertyFetch) Walk(v node.Visitor) {
if v.Visit(n) == false {
return
}
if n.variable != nil {
vv := v.Children("variable")
n.variable.Walk(vv)
}
if n.property != nil {
vv := v.Children("property")
n.property.Walk(vv)
}
}