parsing - Get AST from expression at runtime -


i want retrieve ast expression in ironpython @ runtime:

at moment this:

def sum(a, b):     return + b 

and then:

source = inspect.getsource(sum) ast = ast.parse(source) 

it works perfect, think bit awkward turn code string , reparse ast.

is there way ast directly expression?

something like: ast = ast.get_ast(sum) ??

thank much.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -