This commit is contained in:
Kovid Goyal 2011-07-22 13:31:57 -06:00
parent 37ac80e2ca
commit 542bb7b81b

View File

@ -987,17 +987,26 @@ class TBSIndexing(object): # {{{
arg3, consumed = decint(byts)
byts = byts[consumed:]
fsi = arg3 >> 4
extra = arg3 & 0b1111
flags = arg3 & 0b1111
ans.append('First section index (fvwi): %d'%fsi)
psi = self.get_index(fsi)
ans.append('Extra bits (flag: always 0?): %d'%extra)
ans.append('Flags (flag: always 0?): %d'%flags)
if flags == 4:
ans.append('Number of articles in this section: %d'%byts[0])
byts = byts[1:]
elif flags == 0:
pass
else:
raise ValueError('Unknown flags value: %d'%flags)
if byts:
byts = tbs_type_6(byts, psi=psi,
msg=('First article of ending section, relative to its'
' parent\'s index'),
fmsg=('->Offset from start of record to beginning of'
' last starting section'))
while True:
while byts:
# We have a transition not just an opening first section
psi = self.get_index(psi.index+1)
arg, consumed = decint(byts)