php-parser/node/expr/static_call.go
2017-12-27 19:55:58 +02:00

50 lines
878 B
Go

package expr
import (
"fmt"
"io"
"github.com/z7zmey/php-parser/node"
)
func (n StaticCall) Name() string {
return "StaticCall"
}
type StaticCall struct {
name string
class node.Node
call node.Node
arguments []node.Node
}
func NewStaticCall(class node.Node, call node.Node, arguments []node.Node) node.Node {
return StaticCall{
"StaticCall",
class,
call,
arguments,
}
}
func (n StaticCall) Print(out io.Writer, indent string) {
fmt.Fprintf(out, "\n%v%v [- -]", indent, n.name)
if n.class != nil {
fmt.Fprintf(out, "\n%vclass:", indent+" ")
n.class.Print(out, indent+" ")
}
if n.call != nil {
fmt.Fprintf(out, "\n%vcall:", indent+" ")
n.call.Print(out, indent+" ")
}
if n.arguments != nil {
fmt.Fprintf(out, "\n%varguments:", indent+" ")
for _, nn := range n.arguments {
nn.Print(out, indent+" ")
}
}
}