[refactoring] update ast structure of "Goto" and "Label" nodes

This commit is contained in:
Vadym Slizov
2020-09-17 16:49:54 +03:00
parent 48aaa7cc47
commit 94aa9cf829
7 changed files with 904 additions and 879 deletions

View File

@@ -505,7 +505,9 @@ func (n *StmtGlobal) Accept(v NodeVisitor) {
// StmtGoto node
type StmtGoto struct {
Node
Label Vertex
GotoTkn *token.Token
Label Vertex
SemiColonTkn *token.Token
}
func (n *StmtGoto) Accept(v NodeVisitor) {
@@ -582,6 +584,7 @@ func (n *StmtInterfaceExtends) Accept(v NodeVisitor) {
type StmtLabel struct {
Node
LabelName Vertex
ColonTkn *token.Token
}
func (n *StmtLabel) Accept(v NodeVisitor) {

View File

@@ -265,3 +265,12 @@ func (v *FilterTokens) StmtThrow(n *ast.StmtThrow) {
n.ThrowTkn = nil
n.SemiColonTkn = nil
}
func (v *FilterTokens) StmtGoto(n *ast.StmtGoto) {
n.GotoTkn = nil
n.SemiColonTkn = nil
}
func (v *FilterTokens) StmtLabel(n *ast.StmtLabel) {
n.ColonTkn = nil
}