isset node
This commit is contained in:
31
node/expr/isset.go
Normal file
31
node/expr/isset.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
)
|
||||
|
||||
type Isset struct {
|
||||
node.SimpleNode
|
||||
variables []node.Node
|
||||
}
|
||||
|
||||
func NewIsset(variables []node.Node) node.Node {
|
||||
return Isset{
|
||||
node.SimpleNode{Name: "Isset", Attributes: make(map[string]string)},
|
||||
variables,
|
||||
}
|
||||
}
|
||||
|
||||
func (n Isset) Print(out io.Writer, indent string) {
|
||||
fmt.Fprintf(out, "\n%v%v [- -]", indent, n.Name)
|
||||
|
||||
if n.variables != nil {
|
||||
fmt.Fprintf(out, "\n%vvariables:", indent+" ")
|
||||
for _, nn := range n.variables {
|
||||
nn.Print(out, indent+" ")
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user