handle nodes positions
This commit is contained in:
@@ -4,6 +4,28 @@ import (
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
)
|
||||
|
||||
type ClassConstFetch struct {
|
||||
name string
|
||||
attributes map[string]interface{}
|
||||
position *node.Position
|
||||
class node.Node
|
||||
constantName node.Node
|
||||
}
|
||||
|
||||
func NewClassConstFetch(class node.Node, constantName node.Node) node.Node {
|
||||
return ClassConstFetch{
|
||||
"ClassConstFetch",
|
||||
map[string]interface{}{},
|
||||
nil,
|
||||
class,
|
||||
constantName,
|
||||
}
|
||||
}
|
||||
|
||||
func (n ClassConstFetch) Name() string {
|
||||
return "ClassConstFetch"
|
||||
}
|
||||
|
||||
func (n ClassConstFetch) Attributes() map[string]interface{} {
|
||||
return n.attributes
|
||||
}
|
||||
@@ -25,28 +47,6 @@ func (n ClassConstFetch) SetPosition(p *node.Position) node.Node {
|
||||
return n
|
||||
}
|
||||
|
||||
func (n ClassConstFetch) Name() string {
|
||||
return "ClassConstFetch"
|
||||
}
|
||||
|
||||
type ClassConstFetch struct {
|
||||
name string
|
||||
attributes map[string]interface{}
|
||||
position *node.Position
|
||||
class node.Node
|
||||
constantName node.Node
|
||||
}
|
||||
|
||||
func NewClassConstFetch(class node.Node, constantName node.Node) node.Node {
|
||||
return ClassConstFetch{
|
||||
"ClassConstFetch",
|
||||
map[string]interface{}{},
|
||||
nil,
|
||||
class,
|
||||
constantName,
|
||||
}
|
||||
}
|
||||
|
||||
func (n ClassConstFetch) Walk(v node.Visitor) {
|
||||
if v.EnterNode(n) == false {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user