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 stmt
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
type AltElse struct {
position *node.Position
comments []comment.Comment
Stmt node.Node
}
func NewAltElse(Stmt node.Node) *AltElse {
return &AltElse{
nil,
nil,
Stmt,
}
@@ -32,15 +29,6 @@ func (n *AltElse) SetPosition(p *node.Position) node.Node {
return n
}
func (n *AltElse) Comments() []comment.Comment {
return n.comments
}
func (n *AltElse) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *AltElse) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -1,20 +1,17 @@
package stmt
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
type AltElseIf struct {
position *node.Position
comments []comment.Comment
Cond node.Node
Stmt node.Node
}
func NewAltElseIf(Cond node.Node, Stmt node.Node) *AltElseIf {
return &AltElseIf{
nil,
nil,
Cond,
Stmt,
@@ -34,15 +31,6 @@ func (n *AltElseIf) SetPosition(p *node.Position) node.Node {
return n
}
func (n *AltElseIf) Comments() []comment.Comment {
return n.comments
}
func (n *AltElseIf) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *AltElseIf) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -1,13 +1,11 @@
package stmt
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
type AltIf struct {
position *node.Position
comments []comment.Comment
Cond node.Node
Stmt node.Node
ElseIf []node.Node
@@ -16,7 +14,6 @@ type AltIf struct {
func NewAltIf(Cond node.Node, Stmt node.Node) *AltIf {
return &AltIf{
nil,
nil,
Cond,
Stmt,
@@ -38,15 +35,6 @@ func (n *AltIf) SetPosition(p *node.Position) node.Node {
return n
}
func (n *AltIf) Comments() []comment.Comment {
return n.comments
}
func (n *AltIf) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *AltIf) AddElseIf(ElseIf node.Node) node.Node {
if n.ElseIf == nil {
n.ElseIf = make([]node.Node, 0)

View File

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

View File

@@ -1,20 +1,17 @@
package stmt
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
type Case struct {
position *node.Position
comments []comment.Comment
Cond node.Node
Stmts []node.Node
}
func NewCase(Cond node.Node, Stmts []node.Node) *Case {
return &Case{
nil,
nil,
Cond,
Stmts,
@@ -34,15 +31,6 @@ func (n *Case) SetPosition(p *node.Position) node.Node {
return n
}
func (n *Case) Comments() []comment.Comment {
return n.comments
}
func (n *Case) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *Case) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -1,13 +1,11 @@
package stmt
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
type Catch struct {
position *node.Position
comments []comment.Comment
Types []node.Node
Variable node.Node
Stmts []node.Node
@@ -15,7 +13,6 @@ type Catch struct {
func NewCatch(Types []node.Node, Variable node.Node, Stmts []node.Node) *Catch {
return &Catch{
nil,
nil,
Types,
Variable,
@@ -36,15 +33,6 @@ func (n *Catch) SetPosition(p *node.Position) node.Node {
return n
}
func (n *Catch) Comments() []comment.Comment {
return n.comments
}
func (n *Catch) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *Catch) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -1,13 +1,11 @@
package stmt
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
type Class struct {
position *node.Position
comments []comment.Comment
PhpDocComment string
ClassName node.Node
Modifiers []node.Node
@@ -19,7 +17,6 @@ type Class struct {
func NewClass(ClassName node.Node, Modifiers []node.Node, args []node.Node, Extends node.Node, Implements []node.Node, Stmts []node.Node, PhpDocComment string) *Class {
return &Class{
nil,
nil,
PhpDocComment,
ClassName,
@@ -46,15 +43,6 @@ func (n *Class) SetPosition(p *node.Position) node.Node {
return n
}
func (n *Class) Comments() []comment.Comment {
return n.comments
}
func (n *Class) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *Class) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -1,20 +1,17 @@
package stmt
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
type ClassConstList struct {
position *node.Position
comments []comment.Comment
Modifiers []node.Node
Consts []node.Node
}
func NewClassConstList(Modifiers []node.Node, Consts []node.Node) *ClassConstList {
return &ClassConstList{
nil,
nil,
Modifiers,
Consts,
@@ -34,15 +31,6 @@ func (n *ClassConstList) SetPosition(p *node.Position) node.Node {
return n
}
func (n *ClassConstList) Comments() []comment.Comment {
return n.comments
}
func (n *ClassConstList) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *ClassConstList) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -1,13 +1,11 @@
package stmt
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
type ClassMethod struct {
position *node.Position
comments []comment.Comment
ReturnsRef bool
PhpDocComment string
MethodName node.Node
@@ -19,7 +17,6 @@ type ClassMethod struct {
func NewClassMethod(MethodName node.Node, Modifiers []node.Node, ReturnsRef bool, Params []node.Node, ReturnType node.Node, Stmts []node.Node, PhpDocComment string) *ClassMethod {
return &ClassMethod{
nil,
nil,
ReturnsRef,
PhpDocComment,
@@ -47,15 +44,6 @@ func (n *ClassMethod) SetPosition(p *node.Position) node.Node {
return n
}
func (n *ClassMethod) Comments() []comment.Comment {
return n.comments
}
func (n *ClassMethod) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *ClassMethod) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

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

View File

@@ -1,13 +1,11 @@
package stmt
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
type Constant struct {
position *node.Position
comments []comment.Comment
PhpDocComment string
ConstantName node.Node
Expr node.Node
@@ -15,7 +13,6 @@ type Constant struct {
func NewConstant(ConstantName node.Node, Expr node.Node, PhpDocComment string) *Constant {
return &Constant{
nil,
nil,
PhpDocComment,
ConstantName,
@@ -38,15 +35,6 @@ func (n *Constant) SetPosition(p *node.Position) node.Node {
return n
}
func (n *Constant) Comments() []comment.Comment {
return n.comments
}
func (n *Constant) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *Constant) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

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

View File

@@ -1,20 +1,17 @@
package stmt
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
type Declare struct {
position *node.Position
comments []comment.Comment
Consts []node.Node
Stmt node.Node
}
func NewDeclare(Consts []node.Node, Stmt node.Node) *Declare {
return &Declare{
nil,
nil,
Consts,
Stmt,
@@ -34,15 +31,6 @@ func (n *Declare) SetPosition(p *node.Position) node.Node {
return n
}
func (n *Declare) Comments() []comment.Comment {
return n.comments
}
func (n *Declare) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *Declare) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

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

View File

@@ -1,20 +1,17 @@
package stmt
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
type Do struct {
position *node.Position
comments []comment.Comment
Stmt node.Node
Cond node.Node
}
func NewDo(Stmt node.Node, Cond node.Node) *Do {
return &Do{
nil,
nil,
Stmt,
Cond,
@@ -34,15 +31,6 @@ func (n *Do) SetPosition(p *node.Position) node.Node {
return n
}
func (n *Do) Comments() []comment.Comment {
return n.comments
}
func (n *Do) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *Do) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

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

View File

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

View File

@@ -1,20 +1,17 @@
package stmt
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
type ElseIf struct {
position *node.Position
comments []comment.Comment
Cond node.Node
Stmt node.Node
}
func NewElseIf(Cond node.Node, Stmt node.Node) *ElseIf {
return &ElseIf{
nil,
nil,
Cond,
Stmt,
@@ -34,15 +31,6 @@ func (n *ElseIf) SetPosition(p *node.Position) node.Node {
return n
}
func (n *ElseIf) Comments() []comment.Comment {
return n.comments
}
func (n *ElseIf) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *ElseIf) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

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

View File

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

View File

@@ -1,13 +1,11 @@
package stmt
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
type For struct {
position *node.Position
comments []comment.Comment
Init []node.Node
Cond []node.Node
Loop []node.Node
@@ -16,7 +14,6 @@ type For struct {
func NewFor(Init []node.Node, Cond []node.Node, Loop []node.Node, Stmt node.Node) *For {
return &For{
nil,
nil,
Init,
Cond,
@@ -38,15 +35,6 @@ func (n *For) SetPosition(p *node.Position) node.Node {
return n
}
func (n *For) Comments() []comment.Comment {
return n.comments
}
func (n *For) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *For) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -1,13 +1,11 @@
package stmt
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
type Foreach struct {
position *node.Position
comments []comment.Comment
ByRef bool
Expr node.Node
Key node.Node
@@ -17,7 +15,6 @@ type Foreach struct {
func NewForeach(Expr node.Node, Key node.Node, Variable node.Node, Stmt node.Node, ByRef bool) *Foreach {
return &Foreach{
nil,
nil,
ByRef,
Expr,
@@ -42,15 +39,6 @@ func (n *Foreach) SetPosition(p *node.Position) node.Node {
return n
}
func (n *Foreach) Comments() []comment.Comment {
return n.comments
}
func (n *Foreach) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *Foreach) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -1,13 +1,11 @@
package stmt
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
type Function struct {
position *node.Position
comments []comment.Comment
ReturnsRef bool
PhpDocComment string
FunctionName node.Node
@@ -18,7 +16,6 @@ type Function struct {
func NewFunction(FunctionName node.Node, ReturnsRef bool, Params []node.Node, ReturnType node.Node, Stmts []node.Node, PhpDocComment string) *Function {
return &Function{
nil,
nil,
ReturnsRef,
PhpDocComment,
@@ -46,15 +43,6 @@ func (n *Function) SetPosition(p *node.Position) node.Node {
return n
}
func (n *Function) Comments() []comment.Comment {
return n.comments
}
func (n *Function) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *Function) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

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

View File

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

View File

@@ -1,13 +1,11 @@
package stmt
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
type GroupUse struct {
position *node.Position
comments []comment.Comment
UseType node.Node
pRefix node.Node
UseList []node.Node
@@ -15,7 +13,6 @@ type GroupUse struct {
func NewGroupUse(UseType node.Node, pRefix node.Node, UseList []node.Node) *GroupUse {
return &GroupUse{
nil,
nil,
UseType,
pRefix,
@@ -36,15 +33,6 @@ func (n *GroupUse) SetPosition(p *node.Position) node.Node {
return n
}
func (n *GroupUse) Comments() []comment.Comment {
return n.comments
}
func (n *GroupUse) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *GroupUse) SetUseType(UseType node.Node) node.Node {
n.UseType = UseType
return n

View File

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

View File

@@ -1,13 +1,11 @@
package stmt
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
type If struct {
position *node.Position
comments []comment.Comment
Cond node.Node
Stmt node.Node
ElseIf []node.Node
@@ -16,7 +14,6 @@ type If struct {
func NewIf(Cond node.Node, Stmt node.Node) *If {
return &If{
nil,
nil,
Cond,
Stmt,
@@ -38,15 +35,6 @@ func (n *If) SetPosition(p *node.Position) node.Node {
return n
}
func (n *If) Comments() []comment.Comment {
return n.comments
}
func (n *If) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *If) AddElseIf(ElseIf node.Node) node.Node {
if n.ElseIf == nil {
n.ElseIf = make([]node.Node, 0)

View File

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

View File

@@ -1,13 +1,11 @@
package stmt
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
type Interface struct {
position *node.Position
comments []comment.Comment
PhpDocComment string
InterfaceName node.Node
Extends []node.Node
@@ -16,7 +14,6 @@ type Interface struct {
func NewInterface(InterfaceName node.Node, Extends []node.Node, Stmts []node.Node, PhpDocComment string) *Interface {
return &Interface{
nil,
nil,
PhpDocComment,
InterfaceName,
@@ -40,15 +37,6 @@ func (n *Interface) SetPosition(p *node.Position) node.Node {
return n
}
func (n *Interface) Comments() []comment.Comment {
return n.comments
}
func (n *Interface) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *Interface) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

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

View File

@@ -1,20 +1,17 @@
package stmt
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
type Namespace struct {
position *node.Position
comments []comment.Comment
NamespaceName node.Node
Stmts []node.Node
}
func NewNamespace(NamespaceName node.Node, Stmts []node.Node) *Namespace {
return &Namespace{
nil,
nil,
NamespaceName,
Stmts,
@@ -34,15 +31,6 @@ func (n *Namespace) SetPosition(p *node.Position) node.Node {
return n
}
func (n *Namespace) Comments() []comment.Comment {
return n.comments
}
func (n *Namespace) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *Namespace) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

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

View File

@@ -1,13 +1,11 @@
package stmt
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
type Property struct {
position *node.Position
comments []comment.Comment
PhpDocComment string
Variable node.Node
Expr node.Node
@@ -15,7 +13,6 @@ type Property struct {
func NewProperty(Variable node.Node, Expr node.Node, PhpDocComment string) *Property {
return &Property{
nil,
nil,
PhpDocComment,
Variable,
@@ -37,15 +34,6 @@ func (n *Property) SetPosition(p *node.Position) node.Node {
return n
}
func (n *Property) Comments() []comment.Comment {
return n.comments
}
func (n *Property) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *Property) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -1,20 +1,17 @@
package stmt
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
type PropertyList struct {
position *node.Position
comments []comment.Comment
Modifiers []node.Node
Properties []node.Node
}
func NewPropertyList(Modifiers []node.Node, Properties []node.Node) *PropertyList {
return &PropertyList{
nil,
nil,
Modifiers,
Properties,
@@ -34,15 +31,6 @@ func (n *PropertyList) SetPosition(p *node.Position) node.Node {
return n
}
func (n *PropertyList) Comments() []comment.Comment {
return n.comments
}
func (n *PropertyList) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *PropertyList) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

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

View File

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

View File

@@ -1,20 +1,17 @@
package stmt
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
type StaticVar struct {
position *node.Position
comments []comment.Comment
Variable node.Node
Expr node.Node
}
func NewStaticVar(Variable node.Node, Expr node.Node) *StaticVar {
return &StaticVar{
nil,
nil,
Variable,
Expr,
@@ -34,15 +31,6 @@ func (n *StaticVar) SetPosition(p *node.Position) node.Node {
return n
}
func (n *StaticVar) Comments() []comment.Comment {
return n.comments
}
func (n *StaticVar) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *StaticVar) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

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

View File

@@ -1,14 +1,12 @@
package stmt
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/token"
)
type Switch struct {
position *node.Position
comments []comment.Comment
token token.Token
Cond node.Node
cases []node.Node
@@ -16,7 +14,6 @@ type Switch struct {
func NewSwitch(token token.Token, Cond node.Node, cases []node.Node) *Switch {
return &Switch{
nil,
nil,
token,
Cond,
@@ -37,15 +34,6 @@ func (n *Switch) SetPosition(p *node.Position) node.Node {
return n
}
func (n *Switch) Comments() []comment.Comment {
return n.comments
}
func (n *Switch) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *Switch) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

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

View File

@@ -1,13 +1,11 @@
package stmt
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
type Trait struct {
position *node.Position
comments []comment.Comment
PhpDocComment string
TraitName node.Node
Stmts []node.Node
@@ -15,7 +13,6 @@ type Trait struct {
func NewTrait(TraitName node.Node, Stmts []node.Node, PhpDocComment string) *Trait {
return &Trait{
nil,
nil,
PhpDocComment,
TraitName,
@@ -38,15 +35,6 @@ func (n *Trait) SetPosition(p *node.Position) node.Node {
return n
}
func (n *Trait) Comments() []comment.Comment {
return n.comments
}
func (n *Trait) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *Trait) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -1,20 +1,17 @@
package stmt
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
type TraitMethodRef struct {
position *node.Position
comments []comment.Comment
Trait node.Node
Method node.Node
}
func NewTraitMethodRef(Trait node.Node, Method node.Node) *TraitMethodRef {
return &TraitMethodRef{
nil,
nil,
Trait,
Method,
@@ -34,15 +31,6 @@ func (n *TraitMethodRef) SetPosition(p *node.Position) node.Node {
return n
}
func (n *TraitMethodRef) Comments() []comment.Comment {
return n.comments
}
func (n *TraitMethodRef) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *TraitMethodRef) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -1,20 +1,17 @@
package stmt
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
type TraitUse struct {
position *node.Position
comments []comment.Comment
Traits []node.Node
Adaptations []node.Node
}
func NewTraitUse(Traits []node.Node, Adaptations []node.Node) *TraitUse {
return &TraitUse{
nil,
nil,
Traits,
Adaptations,
@@ -34,15 +31,6 @@ func (n *TraitUse) SetPosition(p *node.Position) node.Node {
return n
}
func (n *TraitUse) Comments() []comment.Comment {
return n.comments
}
func (n *TraitUse) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *TraitUse) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -1,13 +1,11 @@
package stmt
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
type TraitUseAlias struct {
position *node.Position
comments []comment.Comment
Ref node.Node
Modifier node.Node
Alias node.Node
@@ -15,7 +13,6 @@ type TraitUseAlias struct {
func NewTraitUseAlias(Ref node.Node, Modifier node.Node, Alias node.Node) *TraitUseAlias {
return &TraitUseAlias{
nil,
nil,
Ref,
Modifier,
@@ -36,15 +33,6 @@ func (n *TraitUseAlias) SetPosition(p *node.Position) node.Node {
return n
}
func (n *TraitUseAlias) Comments() []comment.Comment {
return n.comments
}
func (n *TraitUseAlias) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *TraitUseAlias) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -1,20 +1,17 @@
package stmt
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
type TraitUsePrecedence struct {
position *node.Position
comments []comment.Comment
Ref node.Node
Insteadof node.Node
}
func NewTraitUsePrecedence(Ref node.Node, Insteadof node.Node) *TraitUsePrecedence {
return &TraitUsePrecedence{
nil,
nil,
Ref,
Insteadof,
@@ -34,15 +31,6 @@ func (n *TraitUsePrecedence) SetPosition(p *node.Position) node.Node {
return n
}
func (n *TraitUsePrecedence) Comments() []comment.Comment {
return n.comments
}
func (n *TraitUsePrecedence) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *TraitUsePrecedence) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -1,13 +1,11 @@
package stmt
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
type Try struct {
position *node.Position
comments []comment.Comment
Stmts []node.Node
Catches []node.Node
Finally node.Node
@@ -15,7 +13,6 @@ type Try struct {
func NewTry(Stmts []node.Node, Catches []node.Node, Finally node.Node) *Try {
return &Try{
nil,
nil,
Stmts,
Catches,
@@ -36,15 +33,6 @@ func (n *Try) SetPosition(p *node.Position) node.Node {
return n
}
func (n *Try) Comments() []comment.Comment {
return n.comments
}
func (n *Try) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *Try) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

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

View File

@@ -1,13 +1,11 @@
package stmt
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
type Use struct {
position *node.Position
comments []comment.Comment
UseType node.Node
Use node.Node
Alias node.Node
@@ -15,7 +13,6 @@ type Use struct {
func NewUse(UseType node.Node, use node.Node, Alias node.Node) *Use {
return &Use{
nil,
nil,
UseType,
use,
@@ -36,15 +33,6 @@ func (n *Use) SetPosition(p *node.Position) node.Node {
return n
}
func (n *Use) Comments() []comment.Comment {
return n.comments
}
func (n *Use) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *Use) SetUseType(UseType node.Node) node.Node {
n.UseType = UseType
return n

View File

@@ -1,20 +1,17 @@
package stmt
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
)
type UseList struct {
position *node.Position
comments []comment.Comment
UseType node.Node
Uses []node.Node
}
func NewUseList(UseType node.Node, Uses []node.Node) *UseList {
return &UseList{
nil,
nil,
UseType,
Uses,
@@ -34,15 +31,6 @@ func (n *UseList) SetPosition(p *node.Position) node.Node {
return n
}
func (n *UseList) Comments() []comment.Comment {
return n.comments
}
func (n *UseList) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *UseList) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return

View File

@@ -1,14 +1,12 @@
package stmt
import (
"github.com/z7zmey/php-parser/comment"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/token"
)
type While struct {
position *node.Position
comments []comment.Comment
Token token.Token
Cond node.Node
Stmt node.Node
@@ -16,7 +14,6 @@ type While struct {
func NewWhile(Token token.Token, Cond node.Node, Stmt node.Node) *While {
return &While{
nil,
nil,
Token,
Cond,
@@ -37,15 +34,6 @@ func (n *While) SetPosition(p *node.Position) node.Node {
return n
}
func (n *While) Comments() []comment.Comment {
return n.comments
}
func (n *While) SetComments(c []comment.Comment) node.Node {
n.comments = c
return n
}
func (n *While) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return