add comments

This commit is contained in:
z7zmey
2018-01-11 19:33:25 +02:00
parent 0676e0cb5a
commit e814483f37
158 changed files with 771 additions and 2 deletions

View File

@@ -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{

View File

@@ -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

View File

@@ -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

View File

@@ -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{