changed macro to ignore empty trees and made compiler do the substitution work
This commit is contained in:
parent
4c7b4f70e3
commit
482282178c
@ -1421,6 +1421,8 @@ class HyASTCompiler(object):
|
|||||||
|
|
||||||
@builds(HyExpression)
|
@builds(HyExpression)
|
||||||
def compile_expression(self, expression):
|
def compile_expression(self, expression):
|
||||||
|
if expression == []:
|
||||||
|
return self.compile_list(expression)
|
||||||
fn = expression[0]
|
fn = expression[0]
|
||||||
func = None
|
func = None
|
||||||
if isinstance(fn, HyKeyword):
|
if isinstance(fn, HyKeyword):
|
||||||
|
@ -71,10 +71,7 @@ _wrappers = {
|
|||||||
def process(tree, module_name):
|
def process(tree, module_name):
|
||||||
if isinstance(tree, HyExpression):
|
if isinstance(tree, HyExpression):
|
||||||
if tree == []:
|
if tree == []:
|
||||||
# set value to []
|
return tree
|
||||||
ntree = HyList()
|
|
||||||
ntree.replace(tree)
|
|
||||||
return ntree
|
|
||||||
|
|
||||||
fn = tree[0]
|
fn = tree[0]
|
||||||
if fn in ("quote", "quasiquote"):
|
if fn in ("quote", "quasiquote"):
|
||||||
|
Loading…
Reference in New Issue
Block a user