#33 comment package has renamed to meta and parser now saves whitespaces
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// AltElse node
|
||||
type AltElse struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Stmt node.Node
|
||||
}
|
||||
@@ -31,15 +31,12 @@ func (n *AltElse) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *AltElse) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *AltElse) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *AltElse) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *AltElse) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// AltElseIf node
|
||||
type AltElseIf struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Cond node.Node
|
||||
Stmt node.Node
|
||||
@@ -33,15 +33,12 @@ func (n *AltElseIf) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *AltElseIf) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *AltElseIf) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *AltElseIf) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *AltElseIf) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// AltFor node
|
||||
type AltFor struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Init []node.Node
|
||||
Cond []node.Node
|
||||
@@ -37,15 +37,12 @@ func (n *AltFor) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *AltFor) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *AltFor) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *AltFor) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *AltFor) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// AltForeach node
|
||||
type AltForeach struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Expr node.Node
|
||||
Key node.Node
|
||||
@@ -37,15 +37,12 @@ func (n *AltForeach) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *AltForeach) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *AltForeach) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *AltForeach) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *AltForeach) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// AltIf node
|
||||
type AltIf struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Cond node.Node
|
||||
Stmt node.Node
|
||||
@@ -37,15 +37,12 @@ func (n *AltIf) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *AltIf) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *AltIf) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *AltIf) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *AltIf) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// AltSwitch node
|
||||
type AltSwitch struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Cond node.Node
|
||||
CaseList *CaseList
|
||||
@@ -33,15 +33,12 @@ func (n *AltSwitch) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *AltSwitch) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *AltSwitch) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *AltSwitch) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *AltSwitch) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// AltWhile node
|
||||
type AltWhile struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Cond node.Node
|
||||
Stmt node.Node
|
||||
@@ -33,15 +33,12 @@ func (n *AltWhile) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *AltWhile) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *AltWhile) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *AltWhile) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *AltWhile) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Break node
|
||||
type Break struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Expr node.Node
|
||||
}
|
||||
@@ -31,15 +31,12 @@ func (n *Break) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Break) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Break) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Break) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Break) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Case node
|
||||
type Case struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Cond node.Node
|
||||
Stmts []node.Node
|
||||
@@ -33,15 +33,12 @@ func (n *Case) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Case) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Case) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Case) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Case) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// CaseList node
|
||||
type CaseList struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Cases []node.Node
|
||||
}
|
||||
@@ -31,15 +31,12 @@ func (n *CaseList) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *CaseList) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *CaseList) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *CaseList) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *CaseList) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Catch node
|
||||
type Catch struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Types []node.Node
|
||||
Variable node.Node
|
||||
@@ -35,15 +35,12 @@ func (n *Catch) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Catch) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Catch) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Catch) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Catch) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Class node
|
||||
type Class struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
PhpDocComment string
|
||||
ClassName node.Node
|
||||
@@ -43,15 +43,12 @@ func (n *Class) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Class) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Class) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Class) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Class) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// ClassConstList node
|
||||
type ClassConstList struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Modifiers []node.Node
|
||||
Consts []node.Node
|
||||
@@ -33,15 +33,12 @@ func (n *ClassConstList) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *ClassConstList) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *ClassConstList) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *ClassConstList) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *ClassConstList) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// ClassExtends node
|
||||
type ClassExtends struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
ClassName node.Node
|
||||
}
|
||||
@@ -31,15 +31,12 @@ func (n *ClassExtends) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *ClassExtends) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *ClassExtends) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *ClassExtends) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *ClassExtends) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// ClassImplements node
|
||||
type ClassImplements struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
InterfaceNames []node.Node
|
||||
}
|
||||
@@ -31,15 +31,12 @@ func (n *ClassImplements) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *ClassImplements) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *ClassImplements) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *ClassImplements) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *ClassImplements) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// ClassMethod node
|
||||
type ClassMethod struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
ReturnsRef bool
|
||||
PhpDocComment string
|
||||
@@ -43,15 +43,12 @@ func (n *ClassMethod) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *ClassMethod) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *ClassMethod) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *ClassMethod) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *ClassMethod) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// ConstList node
|
||||
type ConstList struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Consts []node.Node
|
||||
}
|
||||
@@ -31,15 +31,12 @@ func (n *ConstList) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *ConstList) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *ConstList) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *ConstList) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *ConstList) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Constant node
|
||||
type Constant struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
PhpDocComment string
|
||||
ConstantName node.Node
|
||||
@@ -35,15 +35,12 @@ func (n *Constant) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Constant) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Constant) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Constant) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Constant) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Continue node
|
||||
type Continue struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Expr node.Node
|
||||
}
|
||||
@@ -31,15 +31,12 @@ func (n *Continue) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Continue) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Continue) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Continue) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Continue) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Declare node
|
||||
type Declare struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Consts []node.Node
|
||||
Stmt node.Node
|
||||
@@ -33,15 +33,12 @@ func (n *Declare) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Declare) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Declare) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Declare) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Declare) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Default node
|
||||
type Default struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Stmts []node.Node
|
||||
}
|
||||
@@ -31,15 +31,12 @@ func (n *Default) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Default) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Default) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Default) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Default) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Do node
|
||||
type Do struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Stmt node.Node
|
||||
Cond node.Node
|
||||
@@ -33,15 +33,12 @@ func (n *Do) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Do) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Do) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Do) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Do) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Echo node
|
||||
type Echo struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Exprs []node.Node
|
||||
}
|
||||
@@ -31,15 +31,12 @@ func (n *Echo) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Echo) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Echo) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Echo) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Echo) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Else node
|
||||
type Else struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Stmt node.Node
|
||||
}
|
||||
@@ -31,15 +31,12 @@ func (n *Else) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Else) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Else) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Else) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Else) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// ElseIf node
|
||||
type ElseIf struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Cond node.Node
|
||||
Stmt node.Node
|
||||
@@ -33,15 +33,12 @@ func (n *ElseIf) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *ElseIf) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *ElseIf) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *ElseIf) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *ElseIf) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Expression node
|
||||
type Expression struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Expr node.Node
|
||||
}
|
||||
@@ -31,15 +31,12 @@ func (n *Expression) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Expression) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Expression) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Expression) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Expression) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Finally node
|
||||
type Finally struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Stmts []node.Node
|
||||
}
|
||||
@@ -31,15 +31,12 @@ func (n *Finally) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Finally) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Finally) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Finally) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Finally) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// For node
|
||||
type For struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Init []node.Node
|
||||
Cond []node.Node
|
||||
@@ -37,15 +37,12 @@ func (n *For) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *For) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *For) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *For) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *For) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Foreach node
|
||||
type Foreach struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Expr node.Node
|
||||
Key node.Node
|
||||
@@ -37,15 +37,12 @@ func (n *Foreach) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Foreach) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Foreach) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Foreach) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Foreach) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Function node
|
||||
type Function struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
ReturnsRef bool
|
||||
PhpDocComment string
|
||||
@@ -41,15 +41,12 @@ func (n *Function) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Function) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Function) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Function) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Function) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Global node
|
||||
type Global struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Vars []node.Node
|
||||
}
|
||||
@@ -31,15 +31,12 @@ func (n *Global) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Global) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Global) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Global) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Global) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Goto node
|
||||
type Goto struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Label node.Node
|
||||
}
|
||||
@@ -31,15 +31,12 @@ func (n *Goto) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Goto) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Goto) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Goto) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Goto) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// GroupUse node
|
||||
type GroupUse struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
UseType node.Node
|
||||
Prefix node.Node
|
||||
@@ -35,15 +35,12 @@ func (n *GroupUse) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *GroupUse) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *GroupUse) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *GroupUse) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *GroupUse) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
)
|
||||
|
||||
// HaltCompiler node
|
||||
type HaltCompiler struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
}
|
||||
|
||||
@@ -27,15 +27,12 @@ func (n *HaltCompiler) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *HaltCompiler) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *HaltCompiler) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *HaltCompiler) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *HaltCompiler) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// If node
|
||||
type If struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Cond node.Node
|
||||
Stmt node.Node
|
||||
@@ -37,15 +37,12 @@ func (n *If) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *If) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *If) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *If) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *If) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
)
|
||||
|
||||
// InlineHtml node
|
||||
type InlineHtml struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Value string
|
||||
}
|
||||
@@ -30,15 +30,12 @@ func (n *InlineHtml) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *InlineHtml) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *InlineHtml) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *InlineHtml) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *InlineHtml) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Interface node
|
||||
type Interface struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
PhpDocComment string
|
||||
InterfaceName node.Node
|
||||
@@ -37,15 +37,12 @@ func (n *Interface) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Interface) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Interface) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Interface) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Interface) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// InterfaceExtends node
|
||||
type InterfaceExtends struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
InterfaceNames []node.Node
|
||||
}
|
||||
@@ -31,15 +31,12 @@ func (n *InterfaceExtends) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *InterfaceExtends) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *InterfaceExtends) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *InterfaceExtends) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *InterfaceExtends) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Label node
|
||||
type Label struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
LabelName node.Node
|
||||
}
|
||||
@@ -31,15 +31,12 @@ func (n *Label) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Label) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Label) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Label) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Label) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Namespace node
|
||||
type Namespace struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
NamespaceName node.Node
|
||||
Stmts []node.Node
|
||||
@@ -33,15 +33,12 @@ func (n *Namespace) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Namespace) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Namespace) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Namespace) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Namespace) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
)
|
||||
|
||||
// Nop node
|
||||
type Nop struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
}
|
||||
|
||||
@@ -27,15 +27,12 @@ func (n *Nop) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Nop) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Nop) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Nop) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Nop) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Property node
|
||||
type Property struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
PhpDocComment string
|
||||
Variable node.Node
|
||||
@@ -35,15 +35,12 @@ func (n *Property) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Property) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Property) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Property) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Property) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// PropertyList node
|
||||
type PropertyList struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Modifiers []node.Node
|
||||
Properties []node.Node
|
||||
@@ -33,15 +33,12 @@ func (n *PropertyList) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *PropertyList) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *PropertyList) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *PropertyList) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *PropertyList) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Return node
|
||||
type Return struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Expr node.Node
|
||||
}
|
||||
@@ -31,15 +31,12 @@ func (n *Return) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Return) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Return) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Return) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Return) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Static node
|
||||
type Static struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Vars []node.Node
|
||||
}
|
||||
@@ -31,15 +31,12 @@ func (n *Static) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Static) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Static) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Static) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Static) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// StaticVar node
|
||||
type StaticVar struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Variable node.Node
|
||||
Expr node.Node
|
||||
@@ -33,15 +33,12 @@ func (n *StaticVar) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *StaticVar) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *StaticVar) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *StaticVar) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *StaticVar) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// StmtList node
|
||||
type StmtList struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Stmts []node.Node
|
||||
}
|
||||
@@ -31,15 +31,12 @@ func (n *StmtList) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *StmtList) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *StmtList) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *StmtList) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *StmtList) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Switch node
|
||||
type Switch struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Cond node.Node
|
||||
CaseList *CaseList
|
||||
@@ -33,15 +33,12 @@ func (n *Switch) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Switch) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Switch) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Switch) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Switch) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Throw node
|
||||
type Throw struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Expr node.Node
|
||||
}
|
||||
@@ -31,15 +31,12 @@ func (n *Throw) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Throw) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Throw) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Throw) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Throw) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Trait node
|
||||
type Trait struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
PhpDocComment string
|
||||
TraitName node.Node
|
||||
@@ -35,15 +35,12 @@ func (n *Trait) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Trait) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Trait) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Trait) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Trait) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// TraitAdaptationList node
|
||||
type TraitAdaptationList struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Adaptations []node.Node
|
||||
}
|
||||
@@ -31,15 +31,12 @@ func (n *TraitAdaptationList) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *TraitAdaptationList) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *TraitAdaptationList) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *TraitAdaptationList) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *TraitAdaptationList) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// TraitMethodRef node
|
||||
type TraitMethodRef struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Trait node.Node
|
||||
Method node.Node
|
||||
@@ -33,15 +33,12 @@ func (n *TraitMethodRef) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *TraitMethodRef) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *TraitMethodRef) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *TraitMethodRef) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *TraitMethodRef) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// TraitUse node
|
||||
type TraitUse struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Traits []node.Node
|
||||
TraitAdaptationList *TraitAdaptationList
|
||||
@@ -33,15 +33,12 @@ func (n *TraitUse) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *TraitUse) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *TraitUse) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *TraitUse) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *TraitUse) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// TraitUseAlias node
|
||||
type TraitUseAlias struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Ref node.Node
|
||||
Modifier node.Node
|
||||
@@ -35,15 +35,12 @@ func (n *TraitUseAlias) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *TraitUseAlias) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *TraitUseAlias) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *TraitUseAlias) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *TraitUseAlias) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// TraitUsePrecedence node
|
||||
type TraitUsePrecedence struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Ref node.Node
|
||||
Insteadof []node.Node
|
||||
@@ -33,15 +33,12 @@ func (n *TraitUsePrecedence) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *TraitUsePrecedence) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *TraitUsePrecedence) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *TraitUsePrecedence) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *TraitUsePrecedence) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Try node
|
||||
type Try struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Stmts []node.Node
|
||||
Catches []node.Node
|
||||
@@ -35,15 +35,12 @@ func (n *Try) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Try) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Try) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Try) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Try) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Unset node
|
||||
type Unset struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Vars []node.Node
|
||||
}
|
||||
@@ -31,15 +31,12 @@ 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) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Unset) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Unset) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Use node
|
||||
type Use struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
UseType node.Node
|
||||
Use node.Node
|
||||
@@ -35,15 +35,12 @@ func (n *Use) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Use) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Use) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Use) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Use) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// UseList node
|
||||
type UseList struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
UseType node.Node
|
||||
Uses []node.Node
|
||||
@@ -33,15 +33,12 @@ func (n *UseList) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *UseList) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *UseList) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *UseList) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *UseList) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package stmt
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
// While node
|
||||
type While struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Cond node.Node
|
||||
Stmt node.Node
|
||||
@@ -33,15 +33,12 @@ func (n *While) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *While) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *While) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *While) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *While) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
||||
Reference in New Issue
Block a user