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,13 +1,11 @@
package binary_op
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
type BinaryOp struct {
position *node.Position
comments []comment.Comment
Left node.Node
Right node.Node
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,7 +1,6 @@
package binary_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{
BinaryOp{
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 binary_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{
BinaryOp{
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 binary_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{
BinaryOp{
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 binary_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{
BinaryOp{
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

View File

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

View File

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

View File

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