[refactoring] update ast structure of "Break", "Continue" nodes

This commit is contained in:
Vadym Slizov
2020-09-06 13:02:13 +03:00
parent f6cb2bff4d
commit e817f8dd8d
9 changed files with 1089 additions and 1108 deletions

View File

@@ -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) {

View File

@@ -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
}