add comments
This commit is contained in:
@@ -4,10 +4,12 @@ import (
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
)
|
||||
|
||||
// FullyQualified node
|
||||
type FullyQualified struct {
|
||||
Name
|
||||
}
|
||||
|
||||
// NewFullyQualified node constuctor
|
||||
func NewFullyQualified(Parts []node.Node) *FullyQualified {
|
||||
return &FullyQualified{
|
||||
Name{
|
||||
|
||||
@@ -4,20 +4,25 @@ import (
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
)
|
||||
|
||||
// Name node
|
||||
type Name struct {
|
||||
Parts []node.Node
|
||||
}
|
||||
|
||||
// NewName node constuctor
|
||||
func NewName(Parts []node.Node) *Name {
|
||||
return &Name{
|
||||
Parts,
|
||||
}
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
func (n *Name) Attributes() map[string]interface{} {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Walk traverses nodes
|
||||
// Walk is invoked recursively until v.EnterNode returns true
|
||||
func (n *Name) Walk(v node.Visitor) {
|
||||
if v.EnterNode(n) == false {
|
||||
return
|
||||
|
||||
@@ -4,22 +4,27 @@ import (
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
)
|
||||
|
||||
// NamePart node
|
||||
type NamePart struct {
|
||||
Value string
|
||||
}
|
||||
|
||||
// NewNamePart node constuctor
|
||||
func NewNamePart(Value string) *NamePart {
|
||||
return &NamePart{
|
||||
Value,
|
||||
}
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
func (n *NamePart) Attributes() map[string]interface{} {
|
||||
return map[string]interface{}{
|
||||
"Value": n.Value,
|
||||
}
|
||||
}
|
||||
|
||||
// Walk traverses nodes
|
||||
// Walk is invoked recursively until v.EnterNode returns true
|
||||
func (n *NamePart) Walk(v node.Visitor) {
|
||||
if v.EnterNode(n) == false {
|
||||
return
|
||||
|
||||
@@ -4,10 +4,12 @@ import (
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
)
|
||||
|
||||
// Relative node
|
||||
type Relative struct {
|
||||
Name
|
||||
}
|
||||
|
||||
// NewRelative node constuctor
|
||||
func NewRelative(Parts []node.Node) *Relative {
|
||||
return &Relative{
|
||||
Name{
|
||||
|
||||
Reference in New Issue
Block a user