From b884eca7bf7e33b3fa36ce8bd46f48e9279fbaec Mon Sep 17 00:00:00 2001 From: Paul Tagliamonte Date: Sat, 11 May 2013 09:41:05 -0400 Subject: [PATCH] Confusingly fun. --- hy/compiler.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hy/compiler.py b/hy/compiler.py index c6264ac..e3a1c5a 100644 --- a/hy/compiler.py +++ b/hy/compiler.py @@ -93,6 +93,14 @@ def ast_str(foobar): def builds(_type): + + unpythonic_chars = ["-"] + really_ok = ["-"] + if True in (x in str_type(_type) for x in unpythonic_chars): + if _type not in really_ok: + raise TypeError("`build' needs to be *post* translated strings, " + "Mr. / Mrs. Hypser. -- `%s' sucks." % (_type)) + def _dec(fn): _compile_table[_type] = fn return fn @@ -569,7 +577,7 @@ class HyASTCompiler(object): return ret @builds("unquote") - @builds("unquote-splicing") + @builds("unquote_splicing") def compile_unquote(self, expr): raise HyTypeError(expr, "`%s' can't be used at the top-level" % expr[0])