[refactoring] update ast structure of "Nop" node
This commit is contained in:
@@ -597,6 +597,7 @@ func (n *StmtNamespace) Accept(v NodeVisitor) {
|
||||
// StmtNop node
|
||||
type StmtNop struct {
|
||||
Node
|
||||
SemiColonTkn *token.Token
|
||||
}
|
||||
|
||||
func (n *StmtNop) Accept(v NodeVisitor) {
|
||||
|
||||
@@ -235,3 +235,7 @@ func (v *FilterTokens) StmtDeclare(n *ast.StmtDeclare) {
|
||||
n.EndDeclareTkn = nil
|
||||
n.SemiColonTkn = nil
|
||||
}
|
||||
|
||||
func (v *FilterTokens) StmtNop(n *ast.StmtNop) {
|
||||
n.SemiColonTkn = nil
|
||||
}
|
||||
|
||||
@@ -2581,13 +2581,8 @@ func (p *Printer) printStmtNamespace(n *ast.StmtNamespace) {
|
||||
p.printToken(n.SemiColonTkn, ";")
|
||||
}
|
||||
|
||||
func (p *Printer) printStmtNop(n ast.Vertex) {
|
||||
p.printFreeFloatingOrDefault(n, token.Start, p.bufStart)
|
||||
p.printFreeFloating(n, token.SemiColon)
|
||||
if n.GetNode().Tokens.IsEmpty() {
|
||||
p.write([]byte(";"))
|
||||
}
|
||||
p.printFreeFloating(n, token.End)
|
||||
func (p *Printer) printStmtNop(n *ast.StmtNop) {
|
||||
p.printToken(n.SemiColonTkn, ";")
|
||||
}
|
||||
|
||||
func (p *Printer) printStmtPropertyList(n ast.Vertex) {
|
||||
|
||||
Reference in New Issue
Block a user