php-parser/node/stmt/goto.go
2017-12-29 17:53:13 +02:00

41 lines
574 B
Go

package stmt
import (
"github.com/z7zmey/php-parser/node"
)
type Goto struct {
name string
attributes map[string]interface{}
label node.Node
}
func NewGoto(label node.Node) node.Node {
return Goto{
"Goto",
map[string]interface{}{},
label,
}
}
func (n Goto) Name() string {
return "Goto"
}
func (n Goto) Attributes() map[string]interface{} {
return n.attributes
}
func (n Goto) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.label != nil {
vv := v.GetChildrenVisitor("label")
n.label.Walk(vv)
}
v.LeaveNode(n)
}