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):
|
||||
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")
|
||||
def compile_assert_expression(self, expr):
|
||||
expr.pop(0) # assert
|
||||
|
@ -26,7 +26,5 @@ from hy.models.symbol import HySymbol
|
||||
|
||||
@macro("defn")
|
||||
def defn_macro(tree):
|
||||
# (defn foo [x] ...)
|
||||
# (def foo (fn [x] ...))
|
||||
return HyExpression([HySymbol("def"),
|
||||
tree[1], HyExpression([HySymbol("fn")] + tree[2:])])
|
||||
|
@ -52,6 +52,14 @@ def _resolve_atom(obj):
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
table = {
|
||||
"true": "True",
|
||||
"false": "False",
|
||||
"null": "None",
|
||||
}
|
||||
if obj in table:
|
||||
return HySymbol(table[obj])
|
||||
|
||||
return HySymbol(obj)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user