post_inc post_dec pre_inc pre_dec nodes
This commit is contained in:
29
node/expr/post_dec.go
Normal file
29
node/expr/post_dec.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
)
|
||||
|
||||
type PostDec struct {
|
||||
node.SimpleNode
|
||||
variable node.Node
|
||||
}
|
||||
|
||||
func NewPostDec(variableession node.Node) node.Node {
|
||||
return PostDec{
|
||||
node.SimpleNode{Name: "PostDec", Attributes: make(map[string]string)},
|
||||
variableession,
|
||||
}
|
||||
}
|
||||
|
||||
func (n PostDec) Print(out io.Writer, indent string) {
|
||||
fmt.Fprintf(out, "\n%v%v [- -]", indent, n.Name)
|
||||
|
||||
if n.variable != nil {
|
||||
fmt.Fprintf(out, "\n%vvariable:", indent+" ")
|
||||
n.variable.Print(out, indent+" ")
|
||||
}
|
||||
}
|
||||
29
node/expr/post_inc.go
Normal file
29
node/expr/post_inc.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
)
|
||||
|
||||
type PostInc struct {
|
||||
node.SimpleNode
|
||||
variable node.Node
|
||||
}
|
||||
|
||||
func NewPostInc(variableession node.Node) node.Node {
|
||||
return PostInc{
|
||||
node.SimpleNode{Name: "PostInc", Attributes: make(map[string]string)},
|
||||
variableession,
|
||||
}
|
||||
}
|
||||
|
||||
func (n PostInc) Print(out io.Writer, indent string) {
|
||||
fmt.Fprintf(out, "\n%v%v [- -]", indent, n.Name)
|
||||
|
||||
if n.variable != nil {
|
||||
fmt.Fprintf(out, "\n%vvariable:", indent+" ")
|
||||
n.variable.Print(out, indent+" ")
|
||||
}
|
||||
}
|
||||
29
node/expr/pre_dec.go
Normal file
29
node/expr/pre_dec.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
)
|
||||
|
||||
type PreDec struct {
|
||||
node.SimpleNode
|
||||
variable node.Node
|
||||
}
|
||||
|
||||
func NewPreDec(variableession node.Node) node.Node {
|
||||
return PreDec{
|
||||
node.SimpleNode{Name: "PreDec", Attributes: make(map[string]string)},
|
||||
variableession,
|
||||
}
|
||||
}
|
||||
|
||||
func (n PreDec) Print(out io.Writer, indent string) {
|
||||
fmt.Fprintf(out, "\n%v%v [- -]", indent, n.Name)
|
||||
|
||||
if n.variable != nil {
|
||||
fmt.Fprintf(out, "\n%vvariable:", indent+" ")
|
||||
n.variable.Print(out, indent+" ")
|
||||
}
|
||||
}
|
||||
29
node/expr/pre_inc.go
Normal file
29
node/expr/pre_inc.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
)
|
||||
|
||||
type PreInc struct {
|
||||
node.SimpleNode
|
||||
variable node.Node
|
||||
}
|
||||
|
||||
func NewPreInc(variableession node.Node) node.Node {
|
||||
return PreInc{
|
||||
node.SimpleNode{Name: "PreInc", Attributes: make(map[string]string)},
|
||||
variableession,
|
||||
}
|
||||
}
|
||||
|
||||
func (n PreInc) Print(out io.Writer, indent string) {
|
||||
fmt.Fprintf(out, "\n%v%v [- -]", indent, n.Name)
|
||||
|
||||
if n.variable != nil {
|
||||
fmt.Fprintf(out, "\n%vvariable:", indent+" ")
|
||||
n.variable.Print(out, indent+" ")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user