File tree 1 file changed +8
-6
lines changed
src/cmd/compile/internal/gc 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -1404,7 +1404,7 @@ func (p *printer) nodedump(n *Node, flag FmtFlag) *printer {
1404
1404
1405
1405
if recur {
1406
1406
p .indent ()
1407
- if p . dumpdepth > 10 {
1407
+ if dumpdepth > 10 {
1408
1408
return p .s ("..." )
1409
1409
}
1410
1410
@@ -1654,9 +1654,9 @@ func Nconv(n *Node, flag FmtFlag) string {
1654
1654
p .nodefmt (n , flag )
1655
1655
1656
1656
case FDbg :
1657
- p . dumpdepth ++
1657
+ dumpdepth ++
1658
1658
p .nodedump (n , flag )
1659
- p . dumpdepth --
1659
+ dumpdepth --
1660
1660
1661
1661
default :
1662
1662
Fatalf ("unhandled %%N mode" )
@@ -1715,8 +1715,7 @@ func Dump(s string, n *Node) {
1715
1715
1716
1716
// printer is a buffer for creating longer formatted strings.
1717
1717
type printer struct {
1718
- buf []byte
1719
- dumpdepth int
1718
+ buf []byte
1720
1719
}
1721
1720
1722
1721
// printer implements io.Writer.
@@ -1742,10 +1741,13 @@ func (p *printer) f(format string, args ...interface{}) *printer {
1742
1741
return p
1743
1742
}
1744
1743
1744
+ // TODO(gri) make this a field of printer
1745
+ var dumpdepth int
1746
+
1745
1747
// indent prints indentation to p.
1746
1748
func (p * printer ) indent () {
1747
1749
p .s ("\n " )
1748
- for i := 0 ; i < p . dumpdepth ; i ++ {
1750
+ for i := 0 ; i < dumpdepth ; i ++ {
1749
1751
p .s (". " )
1750
1752
}
1751
1753
}
You can’t perform that action at this time.
0 commit comments