Allow empty `do'

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2013-04-08 15:17:11 +02:00
parent 57fa5c8127
commit cd36a1d7eb
2 changed files with 1 additions and 6 deletions

View File

@ -157,7 +157,6 @@ class HyASTCompiler(object):
@builds("do")
@builds("progn")
@checkargs(min=1)
def compile_do_expression(self, expr):
return [self.compile(x) for x in expr[1:]]

View File

@ -88,14 +88,10 @@ def test_ast_bad_while():
def test_ast_good_do():
"Make sure AST can compile valid do"
hy_compile(tokenize("(do)"))
hy_compile(tokenize("(do 1)"))
def test_ast_bad_do():
"Make sure AST can't compile invalid do"
cant_compile("(do)")
def test_ast_good_throw():
"Make sure AST can compile valid throw"
hy_compile(tokenize("(throw 1)"))