create TraitAdaptationList node
This commit is contained in:
@@ -2066,9 +2066,10 @@ func (p *Printer) printStmtTraitUse(n node.Node) {
|
||||
io.WriteString(p.w, "use ")
|
||||
p.joinPrint(", ", nn.Traits)
|
||||
|
||||
if nn.Adaptations != nil {
|
||||
if nn.TraitAdaptationList != nil {
|
||||
adaptations := nn.TraitAdaptationList.Adaptations
|
||||
io.WriteString(p.w, " {\n")
|
||||
p.printNodes(nn.Adaptations)
|
||||
p.printNodes(adaptations)
|
||||
io.WriteString(p.w, "\n")
|
||||
p.printIndent()
|
||||
io.WriteString(p.w, "}")
|
||||
|
||||
@@ -3789,13 +3789,15 @@ func TestPrintStmtTraitAdaptations(t *testing.T) {
|
||||
&name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}},
|
||||
&name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}},
|
||||
},
|
||||
Adaptations: []node.Node{
|
||||
&stmt.TraitUseAlias{
|
||||
Ref: &stmt.TraitMethodRef{
|
||||
Trait: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}},
|
||||
Method: &node.Identifier{Value: "a"},
|
||||
TraitAdaptationList: &stmt.TraitAdaptationList{
|
||||
Adaptations: []node.Node{
|
||||
&stmt.TraitUseAlias{
|
||||
Ref: &stmt.TraitMethodRef{
|
||||
Trait: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}},
|
||||
Method: &node.Identifier{Value: "a"},
|
||||
},
|
||||
Alias: &node.Identifier{Value: "b"},
|
||||
},
|
||||
Alias: &node.Identifier{Value: "b"},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user