[refactoring] update ast structure of "Static", "Global" and "StaticVar" nodes
This commit is contained in:
@@ -476,7 +476,10 @@ func (n *StmtFunction) Accept(v NodeVisitor) {
|
||||
// StmtGlobal node
|
||||
type StmtGlobal struct {
|
||||
Node
|
||||
Vars []Vertex
|
||||
GlobalTkn *token.Token
|
||||
Vars []Vertex
|
||||
SeparatorTkns []*token.Token
|
||||
SemiColonTkn *token.Token
|
||||
}
|
||||
|
||||
func (n *StmtGlobal) Accept(v NodeVisitor) {
|
||||
@@ -630,7 +633,10 @@ func (n *StmtReturn) Accept(v NodeVisitor) {
|
||||
// StmtStatic node
|
||||
type StmtStatic struct {
|
||||
Node
|
||||
Vars []Vertex
|
||||
StaticTkn *token.Token
|
||||
Vars []Vertex
|
||||
SeparatorTkns []*token.Token
|
||||
SemiColonTkn *token.Token
|
||||
}
|
||||
|
||||
func (n *StmtStatic) Accept(v NodeVisitor) {
|
||||
@@ -640,8 +646,9 @@ func (n *StmtStatic) Accept(v NodeVisitor) {
|
||||
// StmtStaticVar node
|
||||
type StmtStaticVar struct {
|
||||
Node
|
||||
Var Vertex
|
||||
Expr Vertex
|
||||
Var Vertex
|
||||
EqualTkn *token.Token
|
||||
Expr Vertex
|
||||
}
|
||||
|
||||
func (n *StmtStaticVar) Accept(v NodeVisitor) {
|
||||
|
||||
@@ -178,3 +178,19 @@ func (v *FilterTokens) StmtReturn(n *ast.StmtReturn) {
|
||||
n.ReturnTkn = nil
|
||||
n.SemiColonTkn = nil
|
||||
}
|
||||
|
||||
func (v *FilterTokens) StmtGlobal(n *ast.StmtGlobal) {
|
||||
n.GlobalTkn = nil
|
||||
n.SeparatorTkns = nil
|
||||
n.SemiColonTkn = nil
|
||||
}
|
||||
|
||||
func (v *FilterTokens) StmtStatic(n *ast.StmtStatic) {
|
||||
n.StaticTkn = nil
|
||||
n.SeparatorTkns = nil
|
||||
n.SemiColonTkn = nil
|
||||
}
|
||||
|
||||
func (v *FilterTokens) StmtStaticVar(n *ast.StmtStaticVar) {
|
||||
n.EqualTkn = nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user