[refactoring] fix typo
This commit is contained in:
@@ -288,9 +288,9 @@ func (v *Dump) StmtClass(n *ast.StmtClass) {
|
||||
v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn)
|
||||
v.dumpVertex("Extends", n.Extends)
|
||||
v.dumpVertex("Implements", n.Implements)
|
||||
v.dumpToken("OpenCurlyBracket", n.OpenCurlyBracket)
|
||||
v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn)
|
||||
v.dumpVertexList("Stmts", n.Stmts)
|
||||
v.dumpToken("CloseCurlyBracket", n.CloseCurlyBracket)
|
||||
v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn)
|
||||
|
||||
v.indent--
|
||||
v.print(v.indent, "},\n")
|
||||
@@ -706,9 +706,9 @@ func (v *Dump) StmtNamespace(n *ast.StmtNamespace) {
|
||||
v.dumpPosition(n.Position)
|
||||
v.dumpToken("NsTkn", n.NsTkn)
|
||||
v.dumpVertex("Name", n.Name)
|
||||
v.dumpToken("OpenCurlyBracket", n.OpenCurlyBracket)
|
||||
v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn)
|
||||
v.dumpVertexList("Stmts", n.Stmts)
|
||||
v.dumpToken("CloseCurlyBracket", n.CloseCurlyBracket)
|
||||
v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn)
|
||||
v.dumpToken("SemiColonTkn", n.SemiColonTkn)
|
||||
|
||||
v.indent--
|
||||
@@ -799,9 +799,9 @@ func (v *Dump) StmtStmtList(n *ast.StmtStmtList) {
|
||||
v.indent++
|
||||
|
||||
v.dumpPosition(n.Position)
|
||||
v.dumpToken("OpenCurlyBracket", n.OpenCurlyBracket)
|
||||
v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn)
|
||||
v.dumpVertexList("Stmts", n.Stmts)
|
||||
v.dumpToken("CloseCurlyBracket", n.CloseCurlyBracket)
|
||||
v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn)
|
||||
|
||||
v.indent--
|
||||
v.print(v.indent, "},\n")
|
||||
@@ -850,9 +850,9 @@ func (v *Dump) StmtTrait(n *ast.StmtTrait) {
|
||||
v.dumpVertex("TraitName", n.TraitName)
|
||||
v.dumpVertex("Extends", n.Extends)
|
||||
v.dumpVertex("Implements", n.Implements)
|
||||
v.dumpToken("OpenCurlyBracket", n.OpenCurlyBracket)
|
||||
v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn)
|
||||
v.dumpVertexList("Stmts", n.Stmts)
|
||||
v.dumpToken("CloseCurlyBracket", n.CloseCurlyBracket)
|
||||
v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn)
|
||||
|
||||
v.indent--
|
||||
v.print(v.indent, "},\n")
|
||||
@@ -934,9 +934,9 @@ func (v *Dump) StmtTry(n *ast.StmtTry) {
|
||||
|
||||
v.dumpPosition(n.Position)
|
||||
v.dumpToken("TryTkn", n.TryTkn)
|
||||
v.dumpToken("OpenCurlyBracket", n.OpenCurlyBracket)
|
||||
v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn)
|
||||
v.dumpVertexList("Stmts", n.Stmts)
|
||||
v.dumpToken("CloseCurlyBracket", n.CloseCurlyBracket)
|
||||
v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn)
|
||||
v.dumpVertexList("Catches", n.Catches)
|
||||
v.dumpVertex("Finally", n.Finally)
|
||||
|
||||
@@ -2236,9 +2236,9 @@ func (v *Dump) ScalarEncapsed(n *ast.ScalarEncapsed) {
|
||||
v.indent++
|
||||
|
||||
v.dumpPosition(n.Position)
|
||||
v.dumpToken("OpenQoteTkn", n.OpenQoteTkn)
|
||||
v.dumpToken("OpenQuoteTkn", n.OpenQuoteTkn)
|
||||
v.dumpVertexList("Parts", n.Parts)
|
||||
v.dumpToken("CloseQoteTkn", n.CloseQoteTkn)
|
||||
v.dumpToken("CloseQuoteTkn", n.CloseQuoteTkn)
|
||||
|
||||
v.indent--
|
||||
v.print(v.indent, "},\n")
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
func TestDumper_root(t *testing.T) {
|
||||
o := bytes.NewBufferString("")
|
||||
|
||||
p := visitor.NewDump(o)
|
||||
p := visitor.NewDump(o).WithTokens().WithPositions()
|
||||
n := &ast.Root{
|
||||
Position: &position.Position{
|
||||
StartLine: 1,
|
||||
|
||||
@@ -196,9 +196,9 @@ func (p *printer) StmtClass(n *ast.StmtClass) {
|
||||
p.printToken(n.CloseParenthesisTkn, p.ifNodeList(n.Arguments, []byte(")")))
|
||||
p.printNode(n.Extends)
|
||||
p.printNode(n.Implements)
|
||||
p.printToken(n.OpenCurlyBracket, []byte("{"))
|
||||
p.printToken(n.OpenCurlyBracketTkn, []byte("{"))
|
||||
p.printList(n.Stmts)
|
||||
p.printToken(n.CloseCurlyBracket, []byte("}"))
|
||||
p.printToken(n.CloseCurlyBracketTkn, []byte("}"))
|
||||
}
|
||||
|
||||
func (p *printer) StmtClassConstList(n *ast.StmtClassConstList) {
|
||||
@@ -256,9 +256,9 @@ func (p *printer) StmtDeclare(n *ast.StmtDeclare) {
|
||||
p.printToken(n.CloseParenthesisTkn, []byte(")"))
|
||||
p.printToken(n.ColonTkn, nil)
|
||||
if stmt, ok := n.Stmt.(*ast.StmtStmtList); ok && n.ColonTkn != nil {
|
||||
p.printToken(stmt.OpenCurlyBracket, nil)
|
||||
p.printToken(stmt.OpenCurlyBracketTkn, nil)
|
||||
p.printList(stmt.Stmts)
|
||||
p.printToken(stmt.CloseCurlyBracket, nil)
|
||||
p.printToken(stmt.CloseCurlyBracketTkn, nil)
|
||||
} else {
|
||||
p.printNode(n.Stmt)
|
||||
}
|
||||
@@ -293,9 +293,9 @@ func (p *printer) StmtElse(n *ast.StmtElse) {
|
||||
p.printToken(n.ElseTkn, []byte("else"))
|
||||
p.printToken(n.ColonTkn, nil)
|
||||
if stmt, ok := n.Stmt.(*ast.StmtStmtList); ok && n.ColonTkn != nil {
|
||||
p.printToken(stmt.OpenCurlyBracket, nil)
|
||||
p.printToken(stmt.OpenCurlyBracketTkn, nil)
|
||||
p.printList(stmt.Stmts)
|
||||
p.printToken(stmt.CloseCurlyBracket, nil)
|
||||
p.printToken(stmt.CloseCurlyBracketTkn, nil)
|
||||
} else {
|
||||
p.printNode(n.Stmt)
|
||||
}
|
||||
@@ -308,9 +308,9 @@ func (p *printer) StmtElseIf(n *ast.StmtElseIf) {
|
||||
p.printToken(n.CloseParenthesisTkn, []byte(")"))
|
||||
p.printToken(n.ColonTkn, nil)
|
||||
if stmt, ok := n.Stmt.(*ast.StmtStmtList); ok && n.ColonTkn != nil {
|
||||
p.printToken(stmt.OpenCurlyBracket, nil)
|
||||
p.printToken(stmt.OpenCurlyBracketTkn, nil)
|
||||
p.printList(stmt.Stmts)
|
||||
p.printToken(stmt.CloseCurlyBracket, nil)
|
||||
p.printToken(stmt.CloseCurlyBracketTkn, nil)
|
||||
} else {
|
||||
p.printNode(n.Stmt)
|
||||
}
|
||||
@@ -339,9 +339,9 @@ func (p *printer) StmtFor(n *ast.StmtFor) {
|
||||
p.printToken(n.CloseParenthesisTkn, []byte(")"))
|
||||
p.printToken(n.ColonTkn, nil)
|
||||
if stmt, ok := n.Stmt.(*ast.StmtStmtList); ok && n.ColonTkn != nil {
|
||||
p.printToken(stmt.OpenCurlyBracket, nil)
|
||||
p.printToken(stmt.OpenCurlyBracketTkn, nil)
|
||||
p.printList(stmt.Stmts)
|
||||
p.printToken(stmt.CloseCurlyBracket, nil)
|
||||
p.printToken(stmt.CloseCurlyBracketTkn, nil)
|
||||
} else {
|
||||
p.printNode(n.Stmt)
|
||||
}
|
||||
@@ -360,9 +360,9 @@ func (p *printer) StmtForeach(n *ast.StmtForeach) {
|
||||
p.printToken(n.CloseParenthesisTkn, []byte(")"))
|
||||
p.printToken(n.ColonTkn, nil)
|
||||
if stmt, ok := n.Stmt.(*ast.StmtStmtList); ok && n.ColonTkn != nil {
|
||||
p.printToken(stmt.OpenCurlyBracket, nil)
|
||||
p.printToken(stmt.OpenCurlyBracketTkn, nil)
|
||||
p.printList(stmt.Stmts)
|
||||
p.printToken(stmt.CloseCurlyBracket, nil)
|
||||
p.printToken(stmt.CloseCurlyBracketTkn, nil)
|
||||
} else {
|
||||
p.printNode(n.Stmt)
|
||||
}
|
||||
@@ -410,9 +410,9 @@ func (p *printer) StmtIf(n *ast.StmtIf) {
|
||||
p.printToken(n.CloseParenthesisTkn, []byte(")"))
|
||||
p.printToken(n.ColonTkn, nil)
|
||||
if stmt, ok := n.Stmt.(*ast.StmtStmtList); ok && n.ColonTkn != nil {
|
||||
p.printToken(stmt.OpenCurlyBracket, nil)
|
||||
p.printToken(stmt.OpenCurlyBracketTkn, nil)
|
||||
p.printList(stmt.Stmts)
|
||||
p.printToken(stmt.CloseCurlyBracket, nil)
|
||||
p.printToken(stmt.CloseCurlyBracketTkn, nil)
|
||||
} else {
|
||||
p.printNode(n.Stmt)
|
||||
}
|
||||
@@ -454,9 +454,9 @@ func (p *printer) StmtLabel(n *ast.StmtLabel) {
|
||||
func (p *printer) StmtNamespace(n *ast.StmtNamespace) {
|
||||
p.printToken(n.NsTkn, []byte("namespace"))
|
||||
p.printNode(n.Name)
|
||||
p.printToken(n.OpenCurlyBracket, p.ifNodeList(n.Stmts, []byte("{")))
|
||||
p.printToken(n.OpenCurlyBracketTkn, p.ifNodeList(n.Stmts, []byte("{")))
|
||||
p.printList(n.Stmts)
|
||||
p.printToken(n.CloseCurlyBracket, p.ifNodeList(n.Stmts, []byte("}")))
|
||||
p.printToken(n.CloseCurlyBracketTkn, p.ifNodeList(n.Stmts, []byte("}")))
|
||||
p.printToken(n.SemiColonTkn, p.ifNotNodeList(n.Stmts, []byte(";")))
|
||||
}
|
||||
|
||||
@@ -496,9 +496,9 @@ func (p *printer) StmtStaticVar(n *ast.StmtStaticVar) {
|
||||
}
|
||||
|
||||
func (p *printer) StmtStmtList(n *ast.StmtStmtList) {
|
||||
p.printToken(n.OpenCurlyBracket, []byte("{"))
|
||||
p.printToken(n.OpenCurlyBracketTkn, []byte("{"))
|
||||
p.printList(n.Stmts)
|
||||
p.printToken(n.CloseCurlyBracket, []byte("}"))
|
||||
p.printToken(n.CloseCurlyBracketTkn, []byte("}"))
|
||||
}
|
||||
|
||||
func (p *printer) StmtSwitch(n *ast.StmtSwitch) {
|
||||
@@ -526,9 +526,9 @@ func (p *printer) StmtTrait(n *ast.StmtTrait) {
|
||||
p.printNode(n.TraitName)
|
||||
p.printNode(n.Extends)
|
||||
p.printNode(n.Implements)
|
||||
p.printToken(n.OpenCurlyBracket, []byte("{"))
|
||||
p.printToken(n.OpenCurlyBracketTkn, []byte("{"))
|
||||
p.printList(n.Stmts)
|
||||
p.printToken(n.CloseCurlyBracket, []byte("}"))
|
||||
p.printToken(n.CloseCurlyBracketTkn, []byte("}"))
|
||||
}
|
||||
|
||||
func (p *printer) StmtTraitAdaptationList(n *ast.StmtTraitAdaptationList) {
|
||||
@@ -566,9 +566,9 @@ func (p *printer) StmtTraitUsePrecedence(n *ast.StmtTraitUsePrecedence) {
|
||||
|
||||
func (p *printer) StmtTry(n *ast.StmtTry) {
|
||||
p.printToken(n.TryTkn, []byte("try"))
|
||||
p.printToken(n.OpenCurlyBracket, []byte("{"))
|
||||
p.printToken(n.OpenCurlyBracketTkn, []byte("{"))
|
||||
p.printList(n.Stmts)
|
||||
p.printToken(n.CloseCurlyBracket, []byte("}"))
|
||||
p.printToken(n.CloseCurlyBracketTkn, []byte("}"))
|
||||
p.printList(n.Catches)
|
||||
p.printNode(n.Finally)
|
||||
}
|
||||
@@ -615,9 +615,9 @@ func (p *printer) StmtWhile(n *ast.StmtWhile) {
|
||||
p.printToken(n.CloseParenthesisTkn, []byte(")"))
|
||||
p.printToken(n.ColonTkn, nil)
|
||||
if stmt, ok := n.Stmt.(*ast.StmtStmtList); ok && n.ColonTkn != nil {
|
||||
p.printToken(stmt.OpenCurlyBracket, nil)
|
||||
p.printToken(stmt.OpenCurlyBracketTkn, nil)
|
||||
p.printList(stmt.Stmts)
|
||||
p.printToken(stmt.CloseCurlyBracket, nil)
|
||||
p.printToken(stmt.CloseCurlyBracketTkn, nil)
|
||||
} else {
|
||||
p.printNode(n.Stmt)
|
||||
}
|
||||
@@ -1181,9 +1181,9 @@ func (p *printer) ScalarDnumber(n *ast.ScalarDnumber) {
|
||||
}
|
||||
|
||||
func (p *printer) ScalarEncapsed(n *ast.ScalarEncapsed) {
|
||||
p.printToken(n.OpenQoteTkn, []byte("\""))
|
||||
p.printToken(n.OpenQuoteTkn, []byte("\""))
|
||||
p.printList(n.Parts)
|
||||
p.printToken(n.CloseQoteTkn, []byte("\""))
|
||||
p.printToken(n.CloseQuoteTkn, []byte("\""))
|
||||
}
|
||||
|
||||
func (p *printer) ScalarEncapsedStringPart(n *ast.ScalarEncapsedStringPart) {
|
||||
|
||||
Reference in New Issue
Block a user