thinking about some new stuff.
This commit is contained in:
parent
7c7a613c9c
commit
8c07829ff9
@ -82,6 +82,10 @@ class HyASTCompiler(object):
|
|||||||
def compile_raw_list(self, entries):
|
def compile_raw_list(self, entries):
|
||||||
return [self.compile(x) for x in entries]
|
return [self.compile(x) for x in entries]
|
||||||
|
|
||||||
|
#@builds("do")
|
||||||
|
#def compile_do_expression(self, expr):
|
||||||
|
# return [self.compile(x) for x in expr[1:]]
|
||||||
|
|
||||||
@builds("assert")
|
@builds("assert")
|
||||||
def compile_assert_expression(self, expr):
|
def compile_assert_expression(self, expr):
|
||||||
expr.pop(0) # assert
|
expr.pop(0) # assert
|
||||||
|
@ -26,7 +26,5 @@ from hy.models.symbol import HySymbol
|
|||||||
|
|
||||||
@macro("defn")
|
@macro("defn")
|
||||||
def defn_macro(tree):
|
def defn_macro(tree):
|
||||||
# (defn foo [x] ...)
|
|
||||||
# (def foo (fn [x] ...))
|
|
||||||
return HyExpression([HySymbol("def"),
|
return HyExpression([HySymbol("def"),
|
||||||
tree[1], HyExpression([HySymbol("fn")] + tree[2:])])
|
tree[1], HyExpression([HySymbol("fn")] + tree[2:])])
|
||||||
|
@ -52,6 +52,14 @@ def _resolve_atom(obj):
|
|||||||
except ValueError:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
table = {
|
||||||
|
"true": "True",
|
||||||
|
"false": "False",
|
||||||
|
"null": "None",
|
||||||
|
}
|
||||||
|
if obj in table:
|
||||||
|
return HySymbol(table[obj])
|
||||||
|
|
||||||
return HySymbol(obj)
|
return HySymbol(obj)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user