At http://www.secnetix.de/olli/Python/block_indentation.hawk
I find that the python code

>>> if foo:
...     if bar:
...         x = 42
... else:
...   print foo
...

has its indentation structure made explicit as

<if> <foo> <:>                    [0]
<INDENT> <if> <bar> <:>           [0, 4]
<INDENT> <x> <=> <42>             [0, 4, 8]
<DEDENT> <DEDENT> <else> <:>      [0]
<INDENT> <print> <foo>            [0, 2]
<DEDENT>                          [0]

Is there any api in python for going from 1st to 2nd and back?

Context: I am trying to generate some python code and its
indentation=structure is giving me a headache!
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to