[refactoring] update ast structure of "ClassExtends", "ClassImplements", "InterfaceExtends", "StmtTraitUse" and "StmtTraitUsePrecedence" nodes

This commit is contained in:
Vadym Slizov
2020-11-22 13:02:36 +02:00
parent fe2e097d8f
commit 4c54c56af5
9 changed files with 1665 additions and 1654 deletions

View File

@@ -1482,12 +1482,12 @@ func (p *PrettyPrinter) printStmtClass(n ast.Vertex) {
if nn.Extends != nil {
io.WriteString(p.w, " extends ")
p.Print(nn.Extends.ClassName)
p.Print(nn.Extends.(*ast.StmtClassExtends).ClassName)
}
if nn.Implements != nil {
io.WriteString(p.w, " implements ")
p.joinPrint(", ", nn.Implements.InterfaceNames)
p.joinPrint(", ", nn.Implements.(*ast.StmtClassImplements).InterfaceNames)
}
io.WriteString(p.w, "\n")
@@ -1888,7 +1888,7 @@ func (p *PrettyPrinter) printStmtInterface(n ast.Vertex) {
if nn.Extends != nil {
io.WriteString(p.w, " extends ")
p.joinPrint(", ", nn.Extends.InterfaceNames)
p.joinPrint(", ", nn.Extends.(*ast.StmtInterfaceExtends).InterfaceNames)
}
io.WriteString(p.w, "\n")
@@ -2073,7 +2073,7 @@ func (p *PrettyPrinter) printStmtTraitUse(n ast.Vertex) {
io.WriteString(p.w, "use ")
p.joinPrint(", ", nn.Traits)
if adaptationList, ok := nn.TraitAdaptationList.(*ast.StmtTraitAdaptationList); ok {
if adaptationList, ok := nn.Adaptations.(*ast.StmtTraitAdaptationList); ok {
adaptations := adaptationList.Adaptations
io.WriteString(p.w, " {\n")
p.printNodes(adaptations)

View File

@@ -2108,7 +2108,7 @@ func (p *Printer) printStmtClass(n ast.Vertex) {
}
p.write([]byte("extends"))
p.bufStart = " "
p.Print(nn.Extends.ClassName)
p.Print(nn.Extends.(*ast.StmtClassExtends).ClassName)
}
if nn.Implements != nil {
@@ -2118,7 +2118,7 @@ func (p *Printer) printStmtClass(n ast.Vertex) {
}
p.write([]byte("implements"))
p.bufStart = " "
p.joinPrintRefactored(",", nn.Implements.InterfaceNames)
p.joinPrintRefactored(",", nn.Implements.(*ast.StmtClassImplements).InterfaceNames)
}
@@ -2503,7 +2503,7 @@ func (p *Printer) printStmtInterface(n ast.Vertex) {
}
p.write([]byte("extends"))
p.bufStart = " "
p.joinPrintRefactored(",", nn.Extends.InterfaceNames)
p.joinPrintRefactored(",", nn.Extends.(*ast.StmtInterfaceExtends).InterfaceNames)
}
p.printFreeFloating(nn, token.Name)
@@ -2755,7 +2755,7 @@ func (p *Printer) printStmtTraitUse(n ast.Vertex) {
p.bufStart = " "
p.joinPrintRefactored(",", nn.Traits)
p.Print(nn.TraitAdaptationList)
p.Print(nn.Adaptations)
p.printFreeFloating(nn, token.End)
}