record: return offset
This commit is contained in:
parent
a6e5f3e766
commit
c93eb5f482
|
@ -67,7 +67,7 @@ class Record:
|
|||
tpl2 = other.flatten()
|
||||
return len(tpl1) == len(tpl2)
|
||||
|
||||
def flatten(self, align=False, offset=0):
|
||||
def flatten(self, align=False, offset=0, return_offset=False):
|
||||
l = []
|
||||
for key, alignment in self.field_order:
|
||||
if align:
|
||||
|
@ -86,6 +86,9 @@ class Record:
|
|||
for x in added:
|
||||
offset += x.bv.width
|
||||
l += added
|
||||
if return_offset:
|
||||
return (l, offset)
|
||||
else:
|
||||
return l
|
||||
|
||||
def __repr__(self):
|
||||
|
|
Loading…
Reference in New Issue