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
Post a Comment