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)
sig = expression.pop(0)
ret = ast.FunctionDef(name=name,
lineno=expression.start_line,
col_offset=expression.start_column,
args=ast.arguments(args=[
ast.Name(arg=str(x), id=str(x),
ctx=ast.Param(),
lineno=x.start_line,
col_offset=x.start_column)
for x in sig],
vararg=None,
kwarg=None,
kwonlyargs=[],
kw_defaults=[],
defaults=[]),
body=self._code_branch([
self.compile(x) for x in expression]),
decorator_list=[])
ret = ast.FunctionDef(
name=name,
lineno=expression.start_line,
col_offset=expression.start_column,
args=ast.arguments(
args=[
ast.Name(
arg=str(x), id=str(x),
ctx=ast.Param(),
lineno=x.start_line,
col_offset=x.start_column)
for x in sig],
vararg=None,
kwarg=None,
kwonlyargs=[],
kw_defaults=[],
defaults=[]),
body=self._code_branch([
self.compile(x) for x in expression]),
decorator_list=[])
self.returnable = ret_status
return ret