From cd36a1d7ebd4191296e7cb0fe65ce1d3cd1b344c Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 8 Apr 2013 15:17:11 +0200 Subject: [PATCH] Allow empty `do' Signed-off-by: Julien Danjou --- hy/compiler.py | 1 - tests/compilers/test_ast.py | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/hy/compiler.py b/hy/compiler.py index 6851749..35fa962 100644 --- a/hy/compiler.py +++ b/hy/compiler.py @@ -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:]] diff --git a/tests/compilers/test_ast.py b/tests/compilers/test_ast.py index 72f466f..f839feb 100644 --- a/tests/compilers/test_ast.py +++ b/tests/compilers/test_ast.py @@ -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)"))