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,7 +1,6 @@
package assign_op
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
@@ -12,7 +11,6 @@ type Assign struct {
func NewAssign(Variable node.Node, Expression node.Node) *Assign {
return &Assign{
AssignOp{
nil,
nil,
Variable,
Expression,
@@ -33,15 +31,6 @@ func (n *Assign) SetPosition(p *node.Position) node.Node {
return n
}
func (n *Assign) Comments() []comment.Comment {
return n.comments
}
func (n *Assign) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *Assign) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -1,13 +1,11 @@
package assign_op
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
type AssignOp struct {
position *node.Position
comments []comment.Comment
Variable node.Node
Expression node.Node
}

View File

@@ -1,7 +1,6 @@
package assign_op
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
@@ -12,7 +11,6 @@ type AssignRef struct {
func NewAssignRef(Variable node.Node, Expression node.Node) *AssignRef {
return &AssignRef{
AssignOp{
nil,
nil,
Variable,
Expression,
@@ -33,15 +31,6 @@ func (n *AssignRef) SetPosition(p *node.Position) node.Node {
return n
}
func (n *AssignRef) Comments() []comment.Comment {
return n.comments
}
func (n *AssignRef) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *AssignRef) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -1,7 +1,6 @@
package assign_op
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
@@ -12,7 +11,6 @@ type BitwiseAnd struct {
func NewBitwiseAnd(Variable node.Node, Expression node.Node) *BitwiseAnd {
return &BitwiseAnd{
AssignOp{
nil,
nil,
Variable,
Expression,
@@ -33,15 +31,6 @@ func (n *BitwiseAnd) SetPosition(p *node.Position) node.Node {
return n
}
func (n *BitwiseAnd) Comments() []comment.Comment {
return n.comments
}
func (n *BitwiseAnd) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *BitwiseAnd) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -1,7 +1,6 @@
package assign_op
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
@@ -12,7 +11,6 @@ type BitwiseOr struct {
func NewBitwiseOr(Variable node.Node, Expression node.Node) *BitwiseOr {
return &BitwiseOr{
AssignOp{
nil,
nil,
Variable,
Expression,
@@ -33,15 +31,6 @@ func (n *BitwiseOr) SetPosition(p *node.Position) node.Node {
return n
}
func (n *BitwiseOr) Comments() []comment.Comment {
return n.comments
}
func (n *BitwiseOr) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *BitwiseOr) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -1,7 +1,6 @@
package assign_op
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
@@ -12,7 +11,6 @@ type BitwiseXor struct {
func NewBitwiseXor(Variable node.Node, Expression node.Node) *BitwiseXor {
return &BitwiseXor{
AssignOp{
nil,
nil,
Variable,
Expression,
@@ -33,15 +31,6 @@ func (n *BitwiseXor) SetPosition(p *node.Position) node.Node {
return n
}
func (n *BitwiseXor) Comments() []comment.Comment {
return n.comments
}
func (n *BitwiseXor) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *BitwiseXor) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -1,7 +1,6 @@
package assign_op
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
@@ -12,7 +11,6 @@ type Concat struct {
func NewConcat(Variable node.Node, Expression node.Node) *Concat {
return &Concat{
AssignOp{
nil,
nil,
Variable,
Expression,
@@ -33,15 +31,6 @@ func (n *Concat) SetPosition(p *node.Position) node.Node {
return n
}
func (n *Concat) Comments() []comment.Comment {
return n.comments
}
func (n *Concat) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *Concat) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -1,7 +1,6 @@
package assign_op
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
@@ -12,7 +11,6 @@ type Div struct {
func NewDiv(Variable node.Node, Expression node.Node) *Div {
return &Div{
AssignOp{
nil,
nil,
Variable,
Expression,
@@ -33,15 +31,6 @@ func (n *Div) SetPosition(p *node.Position) node.Node {
return n
}
func (n *Div) Comments() []comment.Comment {
return n.comments
}
func (n *Div) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *Div) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -1,7 +1,6 @@
package assign_op
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
@@ -12,7 +11,6 @@ type Minus struct {
func NewMinus(Variable node.Node, Expression node.Node) *Minus {
return &Minus{
AssignOp{
nil,
nil,
Variable,
Expression,
@@ -33,15 +31,6 @@ func (n *Minus) SetPosition(p *node.Position) node.Node {
return n
}
func (n *Minus) Comments() []comment.Comment {
return n.comments
}
func (n *Minus) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *Minus) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -1,7 +1,6 @@
package assign_op
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
@@ -12,7 +11,6 @@ type Mod struct {
func NewMod(Variable node.Node, Expression node.Node) *Mod {
return &Mod{
AssignOp{
nil,
nil,
Variable,
Expression,
@@ -33,15 +31,6 @@ func (n *Mod) SetPosition(p *node.Position) node.Node {
return n
}
func (n *Mod) Comments() []comment.Comment {
return n.comments
}
func (n *Mod) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *Mod) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -1,7 +1,6 @@
package assign_op
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
@@ -12,7 +11,6 @@ type Mul struct {
func NewMul(Variable node.Node, Expression node.Node) *Mul {
return &Mul{
AssignOp{
nil,
nil,
Variable,
Expression,
@@ -33,15 +31,6 @@ func (n *Mul) SetPosition(p *node.Position) node.Node {
return n
}
func (n *Mul) Comments() []comment.Comment {
return n.comments
}
func (n *Mul) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *Mul) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -1,7 +1,6 @@
package assign_op
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
@@ -12,7 +11,6 @@ type Plus struct {
func NewPlus(Variable node.Node, Expression node.Node) *Plus {
return &Plus{
AssignOp{
nil,
nil,
Variable,
Expression,
@@ -33,15 +31,6 @@ func (n *Plus) SetPosition(p *node.Position) node.Node {
return n
}
func (n *Plus) Comments() []comment.Comment {
return n.comments
}
func (n *Plus) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *Plus) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -1,7 +1,6 @@
package assign_op
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
@@ -12,7 +11,6 @@ type Pow struct {
func NewPow(Variable node.Node, Expression node.Node) *Pow {
return &Pow{
AssignOp{
nil,
nil,
Variable,
Expression,
@@ -33,15 +31,6 @@ func (n *Pow) SetPosition(p *node.Position) node.Node {
return n
}
func (n *Pow) Comments() []comment.Comment {
return n.comments
}
func (n *Pow) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *Pow) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -1,7 +1,6 @@
package assign_op
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
@@ -12,7 +11,6 @@ type ShiftLeft struct {
func NewShiftLeft(Variable node.Node, Expression node.Node) *ShiftLeft {
return &ShiftLeft{
AssignOp{
nil,
nil,
Variable,
Expression,
@@ -33,15 +31,6 @@ func (n *ShiftLeft) SetPosition(p *node.Position) node.Node {
return n
}
func (n *ShiftLeft) Comments() []comment.Comment {
return n.comments
}
func (n *ShiftLeft) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *ShiftLeft) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -1,7 +1,6 @@
package assign_op
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
@@ -12,7 +11,6 @@ type ShiftRight struct {
func NewShiftRight(Variable node.Node, Expression node.Node) *ShiftRight {
return &ShiftRight{
AssignOp{
nil,
nil,
Variable,
Expression,
@@ -33,15 +31,6 @@ func (n *ShiftRight) SetPosition(p *node.Position) node.Node {
return n
}
func (n *ShiftRight) Comments() []comment.Comment {
return n.comments
}
func (n *ShiftRight) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *ShiftRight) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return