add comments
This commit is contained in:
@@ -4,22 +4,27 @@ import (
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
)
|
||||
|
||||
// Dnumber node
|
||||
type Dnumber struct {
|
||||
Value string
|
||||
}
|
||||
|
||||
// NewDnumber node constuctor
|
||||
func NewDnumber(Value string) *Dnumber {
|
||||
return &Dnumber{
|
||||
Value,
|
||||
}
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
func (n *Dnumber) 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 *Dnumber) Walk(v node.Visitor) {
|
||||
if v.EnterNode(n) == false {
|
||||
return
|
||||
|
||||
@@ -4,20 +4,25 @@ import (
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
)
|
||||
|
||||
// Encapsed node
|
||||
type Encapsed struct {
|
||||
Parts []node.Node
|
||||
}
|
||||
|
||||
// NewEncapsed node constuctor
|
||||
func NewEncapsed(Parts []node.Node) *Encapsed {
|
||||
return &Encapsed{
|
||||
Parts,
|
||||
}
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
func (n *Encapsed) Attributes() map[string]interface{} {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Walk traverses nodes
|
||||
// Walk is invoked recursively until v.EnterNode returns true
|
||||
func (n *Encapsed) Walk(v node.Visitor) {
|
||||
if v.EnterNode(n) == false {
|
||||
return
|
||||
|
||||
@@ -4,22 +4,27 @@ import (
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
)
|
||||
|
||||
// EncapsedStringPart node
|
||||
type EncapsedStringPart struct {
|
||||
Value string
|
||||
}
|
||||
|
||||
// NewEncapsedStringPart node constuctor
|
||||
func NewEncapsedStringPart(Value string) *EncapsedStringPart {
|
||||
return &EncapsedStringPart{
|
||||
Value,
|
||||
}
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
func (n *EncapsedStringPart) 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 *EncapsedStringPart) Walk(v node.Visitor) {
|
||||
if v.EnterNode(n) == false {
|
||||
return
|
||||
|
||||
@@ -4,22 +4,27 @@ import (
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
)
|
||||
|
||||
// Lnumber node
|
||||
type Lnumber struct {
|
||||
Value string
|
||||
}
|
||||
|
||||
// NewLnumber node constuctor
|
||||
func NewLnumber(Value string) *Lnumber {
|
||||
return &Lnumber{
|
||||
Value,
|
||||
}
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
func (n *Lnumber) 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 *Lnumber) Walk(v node.Visitor) {
|
||||
if v.EnterNode(n) == false {
|
||||
return
|
||||
|
||||
@@ -4,22 +4,27 @@ import (
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
)
|
||||
|
||||
// MagicConstant node
|
||||
type MagicConstant struct {
|
||||
Value string
|
||||
}
|
||||
|
||||
// NewMagicConstant node constuctor
|
||||
func NewMagicConstant(Value string) *MagicConstant {
|
||||
return &MagicConstant{
|
||||
Value,
|
||||
}
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
func (n *MagicConstant) 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 *MagicConstant) Walk(v node.Visitor) {
|
||||
if v.EnterNode(n) == false {
|
||||
return
|
||||
|
||||
@@ -4,22 +4,27 @@ import (
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
)
|
||||
|
||||
// String node
|
||||
type String struct {
|
||||
Value string
|
||||
}
|
||||
|
||||
// NewString node constuctor
|
||||
func NewString(Value string) *String {
|
||||
return &String{
|
||||
Value,
|
||||
}
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
func (n *String) 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 *String) Walk(v node.Visitor) {
|
||||
if v.EnterNode(n) == false {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user