Decent to Descent (#154040)
[lldb] Rename RecursiveDecentFormatter to RecursiveDescentFormatter (NFC)
This commit is contained in:
parent
7f27482a32
commit
350f4a3e3b
@ -1464,8 +1464,8 @@ class ChildVisitingFormatter(BasicFormatter):
|
||||
return output.getvalue()
|
||||
|
||||
|
||||
class RecursiveDecentFormatter(BasicFormatter):
|
||||
"""The recursive decent formatter prints the value and the decendents.
|
||||
class RecursiveDescentFormatter(BasicFormatter):
|
||||
"""The recursive descent formatter prints the value and the descendents.
|
||||
|
||||
The constructor takes two keyword args: indent_level, which defaults to 0,
|
||||
and indent_child, which defaults to 2. The current indentation level is
|
||||
@ -1482,7 +1482,6 @@ class RecursiveDecentFormatter(BasicFormatter):
|
||||
output = io.StringIO()
|
||||
else:
|
||||
output = buffer
|
||||
|
||||
BasicFormatter.format(self, value, buffer=output, indent=self.lindent)
|
||||
new_indent = self.lindent + self.cindent
|
||||
for child in value:
|
||||
@ -1490,7 +1489,7 @@ class RecursiveDecentFormatter(BasicFormatter):
|
||||
BasicFormatter.format(self, child, buffer=output, indent=new_indent)
|
||||
else:
|
||||
if child.GetNumChildren() > 0:
|
||||
rdf = RecursiveDecentFormatter(indent_level=new_indent)
|
||||
rdf = RecursiveDescentFormatter(indent_level=new_indent)
|
||||
rdf.format(child, buffer=output)
|
||||
else:
|
||||
BasicFormatter.format(self, child, buffer=output, indent=new_indent)
|
||||
|
@ -83,7 +83,7 @@ class ValueAPITestCase(TestBase):
|
||||
|
||||
fmt = lldbutil.BasicFormatter()
|
||||
cvf = lldbutil.ChildVisitingFormatter(indent_child=2)
|
||||
rdf = lldbutil.RecursiveDecentFormatter(indent_child=2)
|
||||
rdf = lldbutil.RecursiveDescentFormatter(indent_child=2)
|
||||
if self.TraceOn():
|
||||
print(fmt.format(days_of_week))
|
||||
print(cvf.format(days_of_week))
|
||||
|
@ -1040,8 +1040,8 @@ class ChildVisitingFormatter(BasicFormatter):
|
||||
return output.getvalue()
|
||||
|
||||
|
||||
class RecursiveDecentFormatter(BasicFormatter):
|
||||
"""The recursive decent formatter prints the value and the decendents.
|
||||
class RecursiveDescentFormatter(BasicFormatter):
|
||||
"""The recursive descent formatter prints the value and the descendents.
|
||||
|
||||
The constructor takes two keyword args: indent_level, which defaults to 0,
|
||||
and indent_child, which defaults to 2. The current indentation level is
|
||||
@ -1058,7 +1058,6 @@ class RecursiveDecentFormatter(BasicFormatter):
|
||||
output = io.StringIO()
|
||||
else:
|
||||
output = buffer
|
||||
|
||||
BasicFormatter.format(self, value, buffer=output, indent=self.lindent)
|
||||
new_indent = self.lindent + self.cindent
|
||||
for child in value:
|
||||
@ -1066,7 +1065,7 @@ class RecursiveDecentFormatter(BasicFormatter):
|
||||
BasicFormatter.format(self, child, buffer=output, indent=new_indent)
|
||||
else:
|
||||
if child.GetNumChildren() > 0:
|
||||
rdf = RecursiveDecentFormatter(indent_level=new_indent)
|
||||
rdf = RecursiveDescentFormatter(indent_level=new_indent)
|
||||
rdf.format(child, buffer=output)
|
||||
else:
|
||||
BasicFormatter.format(self, child, buffer=output, indent=new_indent)
|
||||
|
Loading…
x
Reference in New Issue
Block a user