Allow empty `do'
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
57fa5c8127
commit
cd36a1d7eb
@ -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:]]
|
||||
|
||||
|
@ -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)"))
|
||||
|
Loading…
Reference in New Issue
Block a user