2017-12-09 11:13:12 +00:00
|
|
|
package stmt
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"io"
|
|
|
|
|
|
|
|
"github.com/z7zmey/php-parser/node"
|
|
|
|
"github.com/z7zmey/php-parser/token"
|
|
|
|
)
|
|
|
|
|
2017-12-27 17:55:58 +00:00
|
|
|
func(n TraitMethodRef) Name() string {
|
|
|
|
return "TraitMethodRef"
|
|
|
|
}
|
|
|
|
|
2017-12-09 11:13:12 +00:00
|
|
|
type TraitMethodRef struct {
|
2017-12-27 17:55:58 +00:00
|
|
|
name string
|
2017-12-09 11:13:12 +00:00
|
|
|
trait node.Node
|
|
|
|
method token.Token
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewTraitMethodRef(trait node.Node, method token.Token) node.Node {
|
|
|
|
return TraitMethodRef{
|
2017-12-27 17:55:58 +00:00
|
|
|
"TraitMethodRef",
|
2017-12-09 11:13:12 +00:00
|
|
|
trait,
|
|
|
|
method,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (n TraitMethodRef) Print(out io.Writer, indent string) {
|
2017-12-27 17:55:58 +00:00
|
|
|
fmt.Fprintf(out, "\n%v%v [- -] %q", indent, n.name, n.method.Value)
|
2017-12-09 11:13:12 +00:00
|
|
|
|
|
|
|
if n.trait != nil {
|
|
|
|
fmt.Fprintf(out, "\n%vtrait", indent+" ")
|
|
|
|
n.trait.Print(out, indent+" ")
|
|
|
|
}
|
|
|
|
}
|