[refactoring] update ast structure of "Do" node

This commit is contained in:
Vadym Slizov
2020-09-04 10:53:07 +03:00
parent 3b85f5e82b
commit c274c4f92f
12 changed files with 900 additions and 930 deletions

View File

@@ -13,16 +13,6 @@ func (v *FilterParserNodes) EnterNode(n ast.Vertex) bool {
return true
}
func (v *FilterParserNodes) StmtDo(n *ast.StmtDo) {
for {
if nn, ok := n.Cond.(*ast.ParserBrackets); ok {
n.Cond = nn.Child
} else {
break
}
}
}
func (v *FilterParserNodes) StmtSwitch(n *ast.StmtSwitch) {
for {
if nn, ok := n.Cond.(*ast.ParserBrackets); ok {

View File

@@ -122,3 +122,11 @@ func (v *FilterTokens) StmtWhile(n *ast.StmtWhile) {
n.EndWhileTkn = nil
n.SemiColonTkn = nil
}
func (v *FilterTokens) StmtDo(n *ast.StmtDo) {
n.DoTkn = nil
n.WhileTkn = nil
n.OpenParenthesisTkn = nil
n.CloseParenthesisTkn = nil
n.SemiColonTkn = nil
}