Files

12 lines
257 B
Python
Raw Permalink Normal View History

import libfoolang
ctx = libfoolang.AnalysisContext()
unit = ctx.get_from_buffer('foo.txt', b'a b c')
for i in range(-4, 5):
try:
child = unit.root[i]
except IndexError:
child = '<IndexError>'
print('i={}: {}'.format(i, child))