From 8c07829ff9b1f5230fd279a94c32d3a375c494d1 Mon Sep 17 00:00:00 2001 From: "Paul R. Tagliamonte" Date: Fri, 8 Mar 2013 23:07:21 -0500 Subject: [PATCH] thinking about some new stuff. --- hy/compiler.py | 4 ++++ hy/core/bootstrap.py | 2 -- hy/lex/states.py | 8 ++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/hy/compiler.py b/hy/compiler.py index 7cd7362..4d53663 100644 --- a/hy/compiler.py +++ b/hy/compiler.py @@ -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 diff --git a/hy/core/bootstrap.py b/hy/core/bootstrap.py index dc04919..9ca002d 100644 --- a/hy/core/bootstrap.py +++ b/hy/core/bootstrap.py @@ -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:])]) diff --git a/hy/lex/states.py b/hy/lex/states.py index 8793be7..c5a3374 100644 --- a/hy/lex/states.py +++ b/hy/lex/states.py @@ -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)