php-parser/node/node_expr_shellexec.go

34 lines
700 B
Go
Raw Normal View History

2017-12-03 21:29:17 +00:00
package node
import (
"fmt"
"github.com/z7zmey/php-parser/token"
"io"
)
type NodeExprShellExec struct {
2017-12-04 21:24:12 +00:00
*SimpleNode
2017-12-03 21:29:17 +00:00
startToken token.Token
endToken token.Token
parts []Node
}
func NewNodeExprShellExec(startToken token.Token, parts []Node, endToken token.Token) Node {
return NodeExprShellExec{
2017-12-04 21:24:12 +00:00
&SimpleNode{Name: "NodeExprShellExec", Attributes: make(map[string]string)},
2017-12-03 21:29:17 +00:00
startToken,
endToken,
parts,
}
}
func (n NodeExprShellExec) Print(out io.Writer, indent string) {
2017-12-04 21:24:12 +00:00
fmt.Fprintf(out, "\n%v%v [%d %d]", indent, n.Name, n.startToken.StartLine, n.endToken.EndLine)
2017-12-03 21:29:17 +00:00
fmt.Fprintf(out, "\n%vparts:", indent+" ",)
for _, nn := range n.parts {
nn.Print(out, indent+" ")
}
}