#25: save comments within node

This commit is contained in:
z7zmey 2018-06-25 15:38:31 +03:00
parent 1ebb0c6fad
commit 3cd45ecac5
183 changed files with 16743 additions and 14671 deletions

View File

@ -6,35 +6,25 @@ import (
// Comment aggrigates information about comment /**
type Comment struct {
value string
position *position.Position
tokenName TokenName
Value string
Position *position.Position
TokenName TokenName
}
// NewComment - Comment constructor
func NewComment(value string, pos *position.Position) *Comment {
return &Comment{
value,
pos,
UnknownToken,
Value: value,
Position: pos,
TokenName: UnknownToken,
}
}
// SetTokenName sets token name
func (c *Comment) SetTokenName(tokenName TokenName) {
c.tokenName = tokenName
}
// TokenName returns token name
func (c *Comment) TokenName() TokenName {
return c.tokenName
c.TokenName = tokenName
}
func (c *Comment) String() string {
return c.value
}
// Position returns comment position
func (c *Comment) Position() *position.Position {
return c.position
return c.Value
}

View File

@ -3,23 +3,9 @@ package comment_test
import (
"testing"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/comment"
)
func TestCommentGetPosition(t *testing.T) {
expected := position.NewPosition(0, 0, 0, 0)
comment := comment.NewComment("/** hello world */", expected)
actual := comment.Position()
if expected != actual {
t.Errorf("expected and actual are not equal\n")
}
}
func TestCommentPrint(t *testing.T) {
expected := "/** hello world */"
@ -31,3 +17,15 @@ func TestCommentPrint(t *testing.T) {
t.Errorf("expected and actual are not equal\n")
}
}
func TestCommentSetTokenName(t *testing.T) {
expected := comment.ArrayToken
c := comment.NewComment("/** hello world */", nil)
c.SetTokenName(expected)
actual := c.TokenName
if expected != actual {
t.Errorf("expected and actual are not equal\n")
}
}

View File

@ -1,6 +1,7 @@
package assign
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Assign node
type Assign struct {
Comments []*comment.Comment
Position *position.Position
Variable node.Node
Expression node.Node
@ -31,6 +33,17 @@ func (n *Assign) GetPosition() *position.Position {
return n.Position
}
func (n *Assign) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Assign) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Assign) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package assign
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Reference node
type Reference struct {
Comments []*comment.Comment
Position *position.Position
Variable node.Node
Expression node.Node
@ -31,6 +33,17 @@ func (n *Reference) GetPosition() *position.Position {
return n.Position
}
func (n *Reference) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Reference) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Reference) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package assign
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// BitwiseAnd node
type BitwiseAnd struct {
Comments []*comment.Comment
Position *position.Position
Variable node.Node
Expression node.Node
@ -31,6 +33,17 @@ func (n *BitwiseAnd) GetPosition() *position.Position {
return n.Position
}
func (n *BitwiseAnd) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *BitwiseAnd) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *BitwiseAnd) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package assign
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// BitwiseOr node
type BitwiseOr struct {
Comments []*comment.Comment
Position *position.Position
Variable node.Node
Expression node.Node
@ -31,6 +33,17 @@ func (n *BitwiseOr) GetPosition() *position.Position {
return n.Position
}
func (n *BitwiseOr) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *BitwiseOr) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *BitwiseOr) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package assign
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// BitwiseXor node
type BitwiseXor struct {
Comments []*comment.Comment
Position *position.Position
Variable node.Node
Expression node.Node
@ -31,6 +33,17 @@ func (n *BitwiseXor) GetPosition() *position.Position {
return n.Position
}
func (n *BitwiseXor) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *BitwiseXor) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *BitwiseXor) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package assign
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Concat node
type Concat struct {
Comments []*comment.Comment
Position *position.Position
Variable node.Node
Expression node.Node
@ -31,6 +33,17 @@ func (n *Concat) GetPosition() *position.Position {
return n.Position
}
func (n *Concat) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Concat) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Concat) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package assign
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Div node
type Div struct {
Comments []*comment.Comment
Position *position.Position
Variable node.Node
Expression node.Node
@ -31,6 +33,17 @@ func (n *Div) GetPosition() *position.Position {
return n.Position
}
func (n *Div) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Div) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Div) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package assign
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Minus node
type Minus struct {
Comments []*comment.Comment
Position *position.Position
Variable node.Node
Expression node.Node
@ -31,6 +33,17 @@ func (n *Minus) GetPosition() *position.Position {
return n.Position
}
func (n *Minus) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Minus) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Minus) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package assign
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Mod node
type Mod struct {
Comments []*comment.Comment
Position *position.Position
Variable node.Node
Expression node.Node
@ -31,6 +33,17 @@ func (n *Mod) GetPosition() *position.Position {
return n.Position
}
func (n *Mod) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Mod) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Mod) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package assign
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Mul node
type Mul struct {
Comments []*comment.Comment
Position *position.Position
Variable node.Node
Expression node.Node
@ -31,6 +33,17 @@ func (n *Mul) GetPosition() *position.Position {
return n.Position
}
func (n *Mul) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Mul) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Mul) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package assign
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Plus node
type Plus struct {
Comments []*comment.Comment
Position *position.Position
Variable node.Node
Expression node.Node
@ -31,6 +33,17 @@ func (n *Plus) GetPosition() *position.Position {
return n.Position
}
func (n *Plus) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Plus) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Plus) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package assign
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Pow node
type Pow struct {
Comments []*comment.Comment
Position *position.Position
Variable node.Node
Expression node.Node
@ -31,6 +33,17 @@ func (n *Pow) GetPosition() *position.Position {
return n.Position
}
func (n *Pow) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Pow) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Pow) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package assign
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// ShiftLeft node
type ShiftLeft struct {
Comments []*comment.Comment
Position *position.Position
Variable node.Node
Expression node.Node
@ -31,6 +33,17 @@ func (n *ShiftLeft) GetPosition() *position.Position {
return n.Position
}
func (n *ShiftLeft) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *ShiftLeft) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *ShiftLeft) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package assign
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// ShiftRight node
type ShiftRight struct {
Comments []*comment.Comment
Position *position.Position
Variable node.Node
Expression node.Node
@ -31,6 +33,17 @@ func (n *ShiftRight) GetPosition() *position.Position {
return n.Position
}
func (n *ShiftRight) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *ShiftRight) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *ShiftRight) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// BitwiseAnd node
type BitwiseAnd struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@ -31,6 +33,17 @@ func (n *BitwiseAnd) GetPosition() *position.Position {
return n.Position
}
func (n *BitwiseAnd) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *BitwiseAnd) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *BitwiseAnd) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// BitwiseOr node
type BitwiseOr struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@ -31,6 +33,17 @@ func (n *BitwiseOr) GetPosition() *position.Position {
return n.Position
}
func (n *BitwiseOr) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *BitwiseOr) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *BitwiseOr) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// BitwiseXor node
type BitwiseXor struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@ -31,6 +33,17 @@ func (n *BitwiseXor) GetPosition() *position.Position {
return n.Position
}
func (n *BitwiseXor) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *BitwiseXor) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *BitwiseXor) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// BooleanAnd node
type BooleanAnd struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@ -31,6 +33,17 @@ func (n *BooleanAnd) GetPosition() *position.Position {
return n.Position
}
func (n *BooleanAnd) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *BooleanAnd) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *BooleanAnd) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// BooleanOr node
type BooleanOr struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@ -31,6 +33,17 @@ func (n *BooleanOr) GetPosition() *position.Position {
return n.Position
}
func (n *BooleanOr) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *BooleanOr) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *BooleanOr) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Coalesce node
type Coalesce struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@ -31,6 +33,17 @@ func (n *Coalesce) GetPosition() *position.Position {
return n.Position
}
func (n *Coalesce) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Coalesce) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Coalesce) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Concat node
type Concat struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@ -31,6 +33,17 @@ func (n *Concat) GetPosition() *position.Position {
return n.Position
}
func (n *Concat) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Concat) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Concat) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Div node
type Div struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@ -31,6 +33,17 @@ func (n *Div) GetPosition() *position.Position {
return n.Position
}
func (n *Div) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Div) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Div) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Equal node
type Equal struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@ -31,6 +33,17 @@ func (n *Equal) GetPosition() *position.Position {
return n.Position
}
func (n *Equal) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Equal) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Equal) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Greater node
type Greater struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@ -31,6 +33,17 @@ func (n *Greater) GetPosition() *position.Position {
return n.Position
}
func (n *Greater) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Greater) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Greater) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// GreaterOrEqual node
type GreaterOrEqual struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@ -31,6 +33,17 @@ func (n *GreaterOrEqual) GetPosition() *position.Position {
return n.Position
}
func (n *GreaterOrEqual) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *GreaterOrEqual) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *GreaterOrEqual) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Identical node
type Identical struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@ -31,6 +33,17 @@ func (n *Identical) GetPosition() *position.Position {
return n.Position
}
func (n *Identical) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Identical) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Identical) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// LogicalAnd node
type LogicalAnd struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@ -31,6 +33,17 @@ func (n *LogicalAnd) GetPosition() *position.Position {
return n.Position
}
func (n *LogicalAnd) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *LogicalAnd) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *LogicalAnd) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// LogicalOr node
type LogicalOr struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@ -31,6 +33,17 @@ func (n *LogicalOr) GetPosition() *position.Position {
return n.Position
}
func (n *LogicalOr) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *LogicalOr) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *LogicalOr) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// LogicalXor node
type LogicalXor struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@ -31,6 +33,17 @@ func (n *LogicalXor) GetPosition() *position.Position {
return n.Position
}
func (n *LogicalXor) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *LogicalXor) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *LogicalXor) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Minus node
type Minus struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@ -31,6 +33,17 @@ func (n *Minus) GetPosition() *position.Position {
return n.Position
}
func (n *Minus) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Minus) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Minus) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Mod node
type Mod struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@ -31,6 +33,17 @@ func (n *Mod) GetPosition() *position.Position {
return n.Position
}
func (n *Mod) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Mod) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Mod) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Mul node
type Mul struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@ -31,6 +33,17 @@ func (n *Mul) GetPosition() *position.Position {
return n.Position
}
func (n *Mul) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Mul) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Mul) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// NotEqual node
type NotEqual struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@ -31,6 +33,17 @@ func (n *NotEqual) GetPosition() *position.Position {
return n.Position
}
func (n *NotEqual) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *NotEqual) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *NotEqual) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// NotIdentical node
type NotIdentical struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@ -31,6 +33,17 @@ func (n *NotIdentical) GetPosition() *position.Position {
return n.Position
}
func (n *NotIdentical) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *NotIdentical) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *NotIdentical) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Plus node
type Plus struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@ -31,6 +33,17 @@ func (n *Plus) GetPosition() *position.Position {
return n.Position
}
func (n *Plus) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Plus) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Plus) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Pow node
type Pow struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@ -31,6 +33,17 @@ func (n *Pow) GetPosition() *position.Position {
return n.Position
}
func (n *Pow) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Pow) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Pow) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// ShiftLeft node
type ShiftLeft struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@ -31,6 +33,17 @@ func (n *ShiftLeft) GetPosition() *position.Position {
return n.Position
}
func (n *ShiftLeft) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *ShiftLeft) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *ShiftLeft) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// ShiftRight node
type ShiftRight struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@ -31,6 +33,17 @@ func (n *ShiftRight) GetPosition() *position.Position {
return n.Position
}
func (n *ShiftRight) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *ShiftRight) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *ShiftRight) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Smaller node
type Smaller struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@ -31,6 +33,17 @@ func (n *Smaller) GetPosition() *position.Position {
return n.Position
}
func (n *Smaller) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Smaller) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Smaller) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// SmallerOrEqual node
type SmallerOrEqual struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@ -31,6 +33,17 @@ func (n *SmallerOrEqual) GetPosition() *position.Position {
return n.Position
}
func (n *SmallerOrEqual) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *SmallerOrEqual) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *SmallerOrEqual) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package binary
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Spaceship node
type Spaceship struct {
Comments []*comment.Comment
Position *position.Position
Left node.Node
Right node.Node
@ -31,6 +33,17 @@ func (n *Spaceship) GetPosition() *position.Position {
return n.Position
}
func (n *Spaceship) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Spaceship) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Spaceship) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package cast
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Array node
type Array struct {
Comments []*comment.Comment
Position *position.Position
Expr node.Node
}
@ -29,6 +31,17 @@ func (n *Array) GetPosition() *position.Position {
return n.Position
}
func (n *Array) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Array) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Array) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package cast
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Bool node
type Bool struct {
Comments []*comment.Comment
Position *position.Position
Expr node.Node
}
@ -29,6 +31,17 @@ func (n *Bool) GetPosition() *position.Position {
return n.Position
}
func (n *Bool) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Bool) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Bool) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package cast
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Double node
type Double struct {
Comments []*comment.Comment
Position *position.Position
Expr node.Node
}
@ -29,6 +31,17 @@ func (n *Double) GetPosition() *position.Position {
return n.Position
}
func (n *Double) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Double) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Double) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package cast
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Int node
type Int struct {
Comments []*comment.Comment
Position *position.Position
Expr node.Node
}
@ -29,6 +31,17 @@ func (n *Int) GetPosition() *position.Position {
return n.Position
}
func (n *Int) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Int) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Int) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package cast
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Object node
type Object struct {
Comments []*comment.Comment
Position *position.Position
Expr node.Node
}
@ -29,6 +31,17 @@ func (n *Object) GetPosition() *position.Position {
return n.Position
}
func (n *Object) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Object) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Object) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package cast
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// String node
type String struct {
Comments []*comment.Comment
Position *position.Position
Expr node.Node
}
@ -29,6 +31,17 @@ func (n *String) GetPosition() *position.Position {
return n.Position
}
func (n *String) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *String) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *String) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package cast
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Unset node
type Unset struct {
Comments []*comment.Comment
Position *position.Position
Expr node.Node
}
@ -29,6 +31,17 @@ func (n *Unset) GetPosition() *position.Position {
return n.Position
}
func (n *Unset) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Unset) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Unset) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Array node
type Array struct {
Comments []*comment.Comment
Position *position.Position
Items []node.Node
}
@ -29,6 +31,17 @@ func (n *Array) GetPosition() *position.Position {
return n.Position
}
func (n *Array) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Array) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Array) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// ArrayDimFetch node
type ArrayDimFetch struct {
Comments []*comment.Comment
Position *position.Position
Variable node.Node
Dim node.Node
@ -31,6 +33,17 @@ func (n *ArrayDimFetch) GetPosition() *position.Position {
return n.Position
}
func (n *ArrayDimFetch) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *ArrayDimFetch) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *ArrayDimFetch) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// ArrayItem node
type ArrayItem struct {
Comments []*comment.Comment
Position *position.Position
Key node.Node
Val node.Node
@ -31,6 +33,17 @@ func (n *ArrayItem) GetPosition() *position.Position {
return n.Position
}
func (n *ArrayItem) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *ArrayItem) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *ArrayItem) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// BitwiseNot node
type BitwiseNot struct {
Comments []*comment.Comment
Position *position.Position
Expr node.Node
}
@ -29,6 +31,17 @@ func (n *BitwiseNot) GetPosition() *position.Position {
return n.Position
}
func (n *BitwiseNot) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *BitwiseNot) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *BitwiseNot) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// BooleanNot node
type BooleanNot struct {
Comments []*comment.Comment
Position *position.Position
Expr node.Node
}
@ -29,6 +31,17 @@ func (n *BooleanNot) GetPosition() *position.Position {
return n.Position
}
func (n *BooleanNot) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *BooleanNot) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *BooleanNot) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// ClassConstFetch node
type ClassConstFetch struct {
Comments []*comment.Comment
Position *position.Position
Class node.Node
ConstantName node.Node
@ -31,6 +33,17 @@ func (n *ClassConstFetch) GetPosition() *position.Position {
return n.Position
}
func (n *ClassConstFetch) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *ClassConstFetch) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *ClassConstFetch) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Clone node
type Clone struct {
Comments []*comment.Comment
Position *position.Position
Expr node.Node
}
@ -29,6 +31,17 @@ func (n *Clone) GetPosition() *position.Position {
return n.Position
}
func (n *Clone) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Clone) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Clone) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Closure node
type Closure struct {
Comments []*comment.Comment
Position *position.Position
ReturnsRef bool
Static bool
@ -41,6 +43,17 @@ func (n *Closure) GetPosition() *position.Position {
return n.Position
}
func (n *Closure) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Closure) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Closure) Attributes() map[string]interface{} {
return map[string]interface{}{

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// ClosureUse node
type ClosureUse struct {
Comments []*comment.Comment
Position *position.Position
Uses []node.Node
}
@ -29,6 +31,17 @@ func (n *ClosureUse) GetPosition() *position.Position {
return n.Position
}
func (n *ClosureUse) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *ClosureUse) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *ClosureUse) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// ConstFetch node
type ConstFetch struct {
Comments []*comment.Comment
Position *position.Position
Constant node.Node
}
@ -29,6 +31,17 @@ func (n *ConstFetch) GetPosition() *position.Position {
return n.Position
}
func (n *ConstFetch) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *ConstFetch) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *ConstFetch) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Die node
type Die struct {
Comments []*comment.Comment
Position *position.Position
Expr node.Node
}
@ -29,6 +31,17 @@ func (n *Die) GetPosition() *position.Position {
return n.Position
}
func (n *Die) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Die) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Die) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Empty node
type Empty struct {
Comments []*comment.Comment
Position *position.Position
Expr node.Node
}
@ -29,6 +31,17 @@ func (n *Empty) GetPosition() *position.Position {
return n.Position
}
func (n *Empty) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Empty) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Empty) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// ErrorSuppress node
type ErrorSuppress struct {
Comments []*comment.Comment
Position *position.Position
Expr node.Node
}
@ -29,6 +31,17 @@ func (n *ErrorSuppress) GetPosition() *position.Position {
return n.Position
}
func (n *ErrorSuppress) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *ErrorSuppress) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *ErrorSuppress) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Eval node
type Eval struct {
Comments []*comment.Comment
Position *position.Position
Expr node.Node
}
@ -29,6 +31,17 @@ func (n *Eval) GetPosition() *position.Position {
return n.Position
}
func (n *Eval) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Eval) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Eval) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Exit node
type Exit struct {
Comments []*comment.Comment
Position *position.Position
Expr node.Node
}
@ -29,6 +31,17 @@ func (n *Exit) GetPosition() *position.Position {
return n.Position
}
func (n *Exit) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Exit) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Exit) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// FunctionCall node
type FunctionCall struct {
Comments []*comment.Comment
Position *position.Position
Function node.Node
ArgumentList *node.ArgumentList
@ -31,6 +33,17 @@ func (n *FunctionCall) GetPosition() *position.Position {
return n.Position
}
func (n *FunctionCall) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *FunctionCall) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *FunctionCall) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Include node
type Include struct {
Comments []*comment.Comment
Position *position.Position
Expr node.Node
}
@ -29,6 +31,17 @@ func (n *Include) GetPosition() *position.Position {
return n.Position
}
func (n *Include) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Include) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Include) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// IncludeOnce node
type IncludeOnce struct {
Comments []*comment.Comment
Position *position.Position
Expr node.Node
}
@ -29,6 +31,17 @@ func (n *IncludeOnce) GetPosition() *position.Position {
return n.Position
}
func (n *IncludeOnce) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *IncludeOnce) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *IncludeOnce) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// InstanceOf node
type InstanceOf struct {
Comments []*comment.Comment
Position *position.Position
Expr node.Node
Class node.Node
@ -31,6 +33,17 @@ func (n *InstanceOf) GetPosition() *position.Position {
return n.Position
}
func (n *InstanceOf) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *InstanceOf) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *InstanceOf) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Isset node
type Isset struct {
Comments []*comment.Comment
Position *position.Position
Variables []node.Node
}
@ -29,6 +31,17 @@ func (n *Isset) GetPosition() *position.Position {
return n.Position
}
func (n *Isset) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Isset) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Isset) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// List node
type List struct {
Comments []*comment.Comment
Position *position.Position
Items []node.Node
}
@ -29,6 +31,17 @@ func (n *List) GetPosition() *position.Position {
return n.Position
}
func (n *List) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *List) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *List) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// MethodCall node
type MethodCall struct {
Comments []*comment.Comment
Position *position.Position
Variable node.Node
Method node.Node
@ -33,6 +35,17 @@ func (n *MethodCall) GetPosition() *position.Position {
return n.Position
}
func (n *MethodCall) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *MethodCall) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *MethodCall) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// New node
type New struct {
Comments []*comment.Comment
Position *position.Position
Class node.Node
ArgumentList *node.ArgumentList
@ -31,6 +33,17 @@ func (n *New) GetPosition() *position.Position {
return n.Position
}
func (n *New) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *New) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *New) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// PostDec node
type PostDec struct {
Comments []*comment.Comment
Position *position.Position
Variable node.Node
}
@ -29,6 +31,17 @@ func (n *PostDec) GetPosition() *position.Position {
return n.Position
}
func (n *PostDec) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *PostDec) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *PostDec) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// PostInc node
type PostInc struct {
Comments []*comment.Comment
Position *position.Position
Variable node.Node
}
@ -29,6 +31,17 @@ func (n *PostInc) GetPosition() *position.Position {
return n.Position
}
func (n *PostInc) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *PostInc) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *PostInc) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// PreDec node
type PreDec struct {
Comments []*comment.Comment
Position *position.Position
Variable node.Node
}
@ -29,6 +31,17 @@ func (n *PreDec) GetPosition() *position.Position {
return n.Position
}
func (n *PreDec) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *PreDec) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *PreDec) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// PreInc node
type PreInc struct {
Comments []*comment.Comment
Position *position.Position
Variable node.Node
}
@ -29,6 +31,17 @@ func (n *PreInc) GetPosition() *position.Position {
return n.Position
}
func (n *PreInc) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *PreInc) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *PreInc) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Print node
type Print struct {
Comments []*comment.Comment
Position *position.Position
Expr node.Node
}
@ -29,6 +31,17 @@ func (n *Print) GetPosition() *position.Position {
return n.Position
}
func (n *Print) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Print) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Print) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// PropertyFetch node
type PropertyFetch struct {
Comments []*comment.Comment
Position *position.Position
Variable node.Node
Property node.Node
@ -31,6 +33,17 @@ func (n *PropertyFetch) GetPosition() *position.Position {
return n.Position
}
func (n *PropertyFetch) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *PropertyFetch) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *PropertyFetch) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Reference node
type Reference struct {
Comments []*comment.Comment
Position *position.Position
Variable node.Node
}
@ -29,6 +31,17 @@ func (n *Reference) GetPosition() *position.Position {
return n.Position
}
func (n *Reference) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Reference) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Reference) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Require node
type Require struct {
Comments []*comment.Comment
Position *position.Position
Expr node.Node
}
@ -29,6 +31,17 @@ func (n *Require) GetPosition() *position.Position {
return n.Position
}
func (n *Require) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Require) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Require) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// RequireOnce node
type RequireOnce struct {
Comments []*comment.Comment
Position *position.Position
Expr node.Node
}
@ -29,6 +31,17 @@ func (n *RequireOnce) GetPosition() *position.Position {
return n.Position
}
func (n *RequireOnce) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *RequireOnce) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *RequireOnce) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// ShellExec node
type ShellExec struct {
Comments []*comment.Comment
Position *position.Position
Parts []node.Node
}
@ -29,6 +31,17 @@ func (n *ShellExec) GetPosition() *position.Position {
return n.Position
}
func (n *ShellExec) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *ShellExec) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *ShellExec) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// ShortArray node
type ShortArray struct {
Comments []*comment.Comment
Position *position.Position
Items []node.Node
}
@ -29,6 +31,17 @@ func (n *ShortArray) GetPosition() *position.Position {
return n.Position
}
func (n *ShortArray) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *ShortArray) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *ShortArray) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// ShortList node
type ShortList struct {
Comments []*comment.Comment
Position *position.Position
Items []node.Node
}
@ -29,6 +31,17 @@ func (n *ShortList) GetPosition() *position.Position {
return n.Position
}
func (n *ShortList) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *ShortList) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *ShortList) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// StaticCall node
type StaticCall struct {
Comments []*comment.Comment
Position *position.Position
Class node.Node
Call node.Node
@ -33,6 +35,17 @@ func (n *StaticCall) GetPosition() *position.Position {
return n.Position
}
func (n *StaticCall) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *StaticCall) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *StaticCall) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// StaticPropertyFetch node
type StaticPropertyFetch struct {
Comments []*comment.Comment
Position *position.Position
Class node.Node
Property node.Node
@ -31,6 +33,17 @@ func (n *StaticPropertyFetch) GetPosition() *position.Position {
return n.Position
}
func (n *StaticPropertyFetch) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *StaticPropertyFetch) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *StaticPropertyFetch) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Ternary node
type Ternary struct {
Comments []*comment.Comment
Position *position.Position
Condition node.Node
IfTrue node.Node
@ -33,6 +35,17 @@ func (n *Ternary) GetPosition() *position.Position {
return n.Position
}
func (n *Ternary) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Ternary) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Ternary) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// UnaryMinus node
type UnaryMinus struct {
Comments []*comment.Comment
Position *position.Position
Expr node.Node
}
@ -29,6 +31,17 @@ func (n *UnaryMinus) GetPosition() *position.Position {
return n.Position
}
func (n *UnaryMinus) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *UnaryMinus) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *UnaryMinus) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// UnaryPlus node
type UnaryPlus struct {
Comments []*comment.Comment
Position *position.Position
Expr node.Node
}
@ -29,6 +31,17 @@ func (n *UnaryPlus) GetPosition() *position.Position {
return n.Position
}
func (n *UnaryPlus) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *UnaryPlus) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *UnaryPlus) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Variable node
type Variable struct {
Comments []*comment.Comment
Position *position.Position
VarName node.Node
}
@ -29,6 +31,17 @@ func (n *Variable) GetPosition() *position.Position {
return n.Position
}
func (n *Variable) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Variable) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Variable) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// Yield node
type Yield struct {
Comments []*comment.Comment
Position *position.Position
Key node.Node
Value node.Node
@ -31,6 +33,17 @@ func (n *Yield) GetPosition() *position.Position {
return n.Position
}
func (n *Yield) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Yield) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Yield) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package expr
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// YieldFrom node
type YieldFrom struct {
Comments []*comment.Comment
Position *position.Position
Expr node.Node
}
@ -29,6 +31,17 @@ func (n *YieldFrom) GetPosition() *position.Position {
return n.Position
}
func (n *YieldFrom) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *YieldFrom) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *YieldFrom) Attributes() map[string]interface{} {
return nil

View File

@ -1,12 +1,14 @@
package node
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Argument node
type Argument struct {
Comments []*comment.Comment
Position *position.Position
Variadic bool // if ... before variable
IsReference bool // if & before variable
@ -32,6 +34,17 @@ func (n *Argument) GetPosition() *position.Position {
return n.Position
}
func (n *Argument) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Argument) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Argument) Attributes() map[string]interface{} {
return map[string]interface{}{

View File

@ -1,12 +1,14 @@
package node
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// ArgumentList node
type ArgumentList struct {
Comments []*comment.Comment
Position *position.Position
Arguments []Node
}
@ -28,6 +30,18 @@ func (n *ArgumentList) GetPosition() *position.Position {
return n.Position
}
func (n *ArgumentList) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *ArgumentList) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *ArgumentList) Attributes() map[string]interface{} {
return nil

View File

@ -1,12 +1,14 @@
package node
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Identifier node
type Identifier struct {
Comments []*comment.Comment
Position *position.Position
Value string
}
@ -28,6 +30,17 @@ func (n *Identifier) GetPosition() *position.Position {
return n.Position
}
func (n *Identifier) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Identifier) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Identifier) Attributes() map[string]interface{} {
return map[string]interface{}{

View File

@ -1,12 +1,14 @@
package node
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Nullable node
type Nullable struct {
Comments []*comment.Comment
Position *position.Position
Expr Node
}
@ -28,6 +30,17 @@ func (n *Nullable) GetPosition() *position.Position {
return n.Position
}
func (n *Nullable) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Nullable) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Nullable) Attributes() map[string]interface{} {
return nil

View File

@ -1,12 +1,14 @@
package node
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Parameter node
type Parameter struct {
Comments []*comment.Comment
Position *position.Position
ByRef bool
Variadic bool
@ -36,6 +38,17 @@ func (n *Parameter) GetPosition() *position.Position {
return n.Position
}
func (n *Parameter) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Parameter) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Parameter) Attributes() map[string]interface{} {
return map[string]interface{}{

View File

@ -1,12 +1,14 @@
package node
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Root node
type Root struct {
Comments []*comment.Comment
Position *position.Position
Stmts []Node
}
@ -28,6 +30,17 @@ func (n *Root) GetPosition() *position.Position {
return n.Position
}
func (n *Root) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *Root) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *Root) Attributes() map[string]interface{} {
return nil

View File

@ -1,6 +1,7 @@
package name
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
@ -8,6 +9,7 @@ import (
// FullyQualified node
type FullyQualified struct {
Comments []*comment.Comment
Position *position.Position
Parts []node.Node
}
@ -29,6 +31,17 @@ func (n *FullyQualified) GetPosition() *position.Position {
return n.Position
}
func (n *FullyQualified) AddComments(cc []*comment.Comment, tn comment.TokenName) {
for _, c := range cc {
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
}
func (n *FullyQualified) GetComments() []*comment.Comment {
return n.Comments
}
// Attributes returns node attributes as map
func (n *FullyQualified) Attributes() map[string]interface{} {
return nil

Some files were not shown because too many files have changed in this diff Show More