style fixes

This commit is contained in:
Paul Tagliamonte 2013-06-08 20:10:27 -04:00
parent 12abef5ed5
commit d15aa31a32

View File

@ -57,20 +57,25 @@ def _wrap_value(x):
else: else:
return wrapper(x) return wrapper(x)
_wrappers = {int: HyInteger, _wrappers = {
bool: lambda x: HySymbol("True") if x else HySymbol("False"), int: HyInteger,
float: HyFloat, bool: lambda x: HySymbol("True") if x else HySymbol("False"),
complex: HyComplex, float: HyFloat,
str_type: HyString, complex: HyComplex,
dict: lambda d: HyDict(_wrap_value(x) for x in sum(d.items(), ())), str_type: HyString,
list: lambda l: HyList(_wrap_value(x) for x in l)} dict: lambda d: HyDict(_wrap_value(x) for x in sum(d.items(), ())),
list: lambda l: HyList(_wrap_value(x) for x in l)
}
def process(tree, module_name): def process(tree, module_name):
if isinstance(tree, HyExpression): if isinstance(tree, HyExpression):
fn = tree[0] fn = tree[0]
if fn in ("quote", "quasiquote"): if fn in ("quote", "quasiquote"):
return tree return tree
ntree = HyExpression([fn] + [process(x, module_name) for x in tree[1:]]) ntree = HyExpression(
[fn] + [process(x, module_name) for x in tree[1:]]
)
ntree.replace(tree) ntree.replace(tree)
if isinstance(fn, HyString): if isinstance(fn, HyString):