[refactoring] update ast structure of "Break", "Continue" nodes
This commit is contained in:
@@ -191,7 +191,9 @@ func (n *StmtAltForeach) Accept(v NodeVisitor) {
|
||||
// StmtBreak node
|
||||
type StmtBreak struct {
|
||||
Node
|
||||
Expr Vertex
|
||||
BreakTkn *token.Token
|
||||
Expr Vertex
|
||||
SemiColonTkn *token.Token
|
||||
}
|
||||
|
||||
func (n *StmtBreak) Accept(v NodeVisitor) {
|
||||
@@ -314,7 +316,9 @@ func (n *StmtConstant) Accept(v NodeVisitor) {
|
||||
// StmtContinue node
|
||||
type StmtContinue struct {
|
||||
Node
|
||||
Expr Vertex
|
||||
ContinueTkn *token.Token
|
||||
Expr Vertex
|
||||
SemiColonTkn *token.Token
|
||||
}
|
||||
|
||||
func (n *StmtContinue) Accept(v NodeVisitor) {
|
||||
|
||||
@@ -163,3 +163,13 @@ func (v *FilterTokens) StmtDefault(n *ast.StmtDefault) {
|
||||
n.DefaultTkn = nil
|
||||
n.CaseSeparatorTkn = nil
|
||||
}
|
||||
|
||||
func (v *FilterTokens) StmtBreak(n *ast.StmtBreak) {
|
||||
n.BreakTkn = nil
|
||||
n.SemiColonTkn = nil
|
||||
}
|
||||
|
||||
func (v *FilterTokens) StmtContinue(n *ast.StmtContinue) {
|
||||
n.ContinueTkn = nil
|
||||
n.SemiColonTkn = nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user