Minor stylistic change to compiler.py

This commit is contained in:
Christopher Allan Webber 2013-04-01 18:41:55 -05:00
parent 426c7cd829
commit b4ba4087df

View File

@ -528,23 +528,26 @@ class HyASTCompiler(object):
name = "_hy_anon_fn_%d" % (self.anon_fn_count) name = "_hy_anon_fn_%d" % (self.anon_fn_count)
sig = expression.pop(0) sig = expression.pop(0)
ret = ast.FunctionDef(name=name, ret = ast.FunctionDef(
lineno=expression.start_line, name=name,
col_offset=expression.start_column, lineno=expression.start_line,
args=ast.arguments(args=[ col_offset=expression.start_column,
ast.Name(arg=str(x), id=str(x), args=ast.arguments(
ctx=ast.Param(), args=[
lineno=x.start_line, ast.Name(
col_offset=x.start_column) arg=str(x), id=str(x),
for x in sig], ctx=ast.Param(),
vararg=None, lineno=x.start_line,
kwarg=None, col_offset=x.start_column)
kwonlyargs=[], for x in sig],
kw_defaults=[], vararg=None,
defaults=[]), kwarg=None,
body=self._code_branch([ kwonlyargs=[],
self.compile(x) for x in expression]), kw_defaults=[],
decorator_list=[]) defaults=[]),
body=self._code_branch([
self.compile(x) for x in expression]),
decorator_list=[])
self.returnable = ret_status self.returnable = ret_status
return ret return ret