Adding FunctionDef as a returnable

This commit is contained in:
Paul R. Tagliamonte 2013-04-05 19:46:27 -04:00
parent 1d01d8874a
commit 65ad7a3b87

View File

@ -75,6 +75,12 @@ class HyASTCompiler(object):
ret.append(ast.Return(value=el, ret.append(ast.Return(value=el,
lineno=el.lineno, lineno=el.lineno,
col_offset=el.col_offset)) col_offset=el.col_offset))
if isinstance(el, ast.FunctionDef):
ret.append(ast.Return(
value=ast.Name(
arg=el.name, id=el.name, ctx=ast.Load(),
lineno=el.lineno, col_offset=el.col_offset),
lineno=el.lineno, col_offset=el.col_offset))
for el in tree: for el in tree:
if isinstance(el, ast.stmt): if isinstance(el, ast.stmt):