Skip to content

Commit 72be637

Browse files
committed
Inser blank lines
1 parent 48a8038 commit 72be637

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pyverilog/vparser/ast.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ def children(self):
2929
def show(self, buf=sys.stdout, offset=0, attrnames=False, showlineno=True):
3030
indent = 2
3131
lead = ' ' * offset
32+
3233
buf.write(lead + self.__class__.__name__ + ': ')
34+
3335
if self.attr_names:
3436
if attrnames:
3537
nvlist = [(n, getattr(self, n)) for n in self.attr_names]
@@ -38,23 +40,31 @@ def show(self, buf=sys.stdout, offset=0, attrnames=False, showlineno=True):
3840
vlist = [getattr(self, n) for n in self.attr_names]
3941
attrstr = ', '.join('%s' % v for v in vlist)
4042
buf.write(attrstr)
43+
4144
if showlineno:
4245
buf.write(' (at %s)' % self.lineno)
46+
4347
buf.write('\n')
48+
4449
for c in self.children():
4550
c.show(buf, offset + indent, attrnames, showlineno)
4651

4752
def __eq__(self, other):
4853
if type(self) != type(other):
4954
return False
55+
5056
self_attrs = tuple([getattr(self, a) for a in self.attr_names])
5157
other_attrs = tuple([getattr(other, a) for a in other.attr_names])
58+
5259
if self_attrs != other_attrs:
5360
return False
61+
5462
other_children = other.children()
63+
5564
for i, c in enumerate(self.children()):
5665
if c != other_children[i]:
5766
return False
67+
5868
return True
5969

6070
def __ne__(self, other):

0 commit comments

Comments
 (0)