From 65ad7a3b877ef809ca2e563fc1201ee143f4feec Mon Sep 17 00:00:00 2001 From: "Paul R. Tagliamonte" Date: Fri, 5 Apr 2013 19:46:27 -0400 Subject: [PATCH] Adding FunctionDef as a returnable --- hy/compiler.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hy/compiler.py b/hy/compiler.py index d97df00..4a72b1a 100644 --- a/hy/compiler.py +++ b/hy/compiler.py @@ -75,6 +75,12 @@ class HyASTCompiler(object): ret.append(ast.Return(value=el, lineno=el.lineno, 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: if isinstance(el, ast.stmt):