extract comments package
This commit is contained in:
@@ -11,7 +11,6 @@ type FullyQualified struct {
|
||||
func NewFullyQualified(Parts []node.Node) *FullyQualified {
|
||||
return &FullyQualified{
|
||||
Name{
|
||||
nil,
|
||||
nil,
|
||||
Parts,
|
||||
},
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -11,7 +11,6 @@ type Relative struct {
|
||||
func NewRelative(Parts []node.Node) *Relative {
|
||||
return &Relative{
|
||||
Name{
|
||||
nil,
|
||||
nil,
|
||||
Parts,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user