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

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

View File

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

View File

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

View File

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

View File

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

View File

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