Make empty macroexpansions do the right thing

This commit is contained in:
Nicolas Dandrimont 2014-01-23 20:03:01 +01:00
parent 54757b8316
commit bb2b868aaf

View File

@ -1645,15 +1645,15 @@ class HyASTCompiler(object):
@builds(HyExpression)
def compile_expression(self, expression):
if expression == []:
return self.compile_list(expression)
# Perform macro expansions
expression = macroexpand(expression, self.module_name)
if not isinstance(expression, HyExpression):
# Go through compile again if the type changed.
return self.compile(expression)
if expression == []:
return self.compile_list(expression)
fn = expression[0]
func = None
if isinstance(fn, HyKeyword):