Hi,

Does anyone know of a code generator for Python that can handle comments?
 I would like to construct an abstract syntax tree of a module, including
comments and docstrings, and then serialize it into a file.  I do not
necessarily need a parser, since the code will be constructed from a
TurtleArt program.

So far, I only found codegen [1] and unparse [2], which use Python's ast
module, which doesn't support comments.  I know that lib2to3 [3] does
support comments, but it has no stable API.

Thank you.
Marion

[1] http://dev.pocoo.org/hg/sandbox/file/b2aea937f5bb/ast/codegen.py
[2]
http://svn.python.org/view/python/trunk/Demo/parser/unparse.py?view=markup
[3] http://docs.python.org/2/library/2to3.html#module-lib2to3
_______________________________________________
Sugar-devel mailing list
[email protected]
http://lists.sugarlabs.org/listinfo/sugar-devel

Reply via email to