extract comments package

This commit is contained in:
z7zmey
2018-01-09 00:30:28 +02:00
parent b7b859edaa
commit 99856ae32f
165 changed files with 2447 additions and 3015 deletions

View File

@@ -11,7 +11,6 @@ type FullyQualified struct {
func NewFullyQualified(Parts []node.Node) *FullyQualified {
return &FullyQualified{
Name{
nil,
nil,
Parts,
},

View File

@@ -1,19 +1,16 @@
package name
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
type Name struct {
position *node.Position
comments []comment.Comment
Parts []node.Node
}
func NewName(Parts []node.Node) *Name {
return &Name{
nil,
nil,
Parts,
}
@@ -32,15 +29,6 @@ func (n *Name) SetPosition(p *node.Position) node.Node {
return n
}
func (n *Name) Comments() []comment.Comment {
return n.comments
}
func (n *Name) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *Name) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -1,19 +1,16 @@
package name
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
type NamePart struct {
position *node.Position
comments []comment.Comment
Value string
}
func NewNamePart(Value string) *NamePart {
return &NamePart{
nil,
nil,
Value,
}
@@ -34,15 +31,6 @@ func (n *NamePart) SetPosition(p *node.Position) node.Node {
return n
}
func (n *NamePart) Comments() []comment.Comment {
return n.comments
}
func (n *NamePart) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *NamePart) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -11,7 +11,6 @@ type Relative struct {
func NewRelative(Parts []node.Node) *Relative {
return &Relative{
Name{
nil,
nil,
Parts,
},