Refactor compiler using a result carrying object

This object allows to coerce statements to an expression, if we need to use
them that way, which, with a lisp, is often.

This was collaborative work that has been rebased to make it bisectable.

Helped-by: Paul Tagliamonte <paultag@debian.org>
Helped-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Nicolas Dandrimont 2013-05-04 09:16:01 +02:00
parent b7f92bd915
commit 3d8a3d589c
2 changed files with 751 additions and 413 deletions

File diff suppressed because it is too large Load Diff

View File

@ -240,12 +240,13 @@ def test_ast_good_slice():
hy_compile(tokenize("(slice x)"))
hy_compile(tokenize("(slice x y)"))
hy_compile(tokenize("(slice x y z)"))
hy_compile(tokenize("(slice x y z t)"))
def test_ast_bad_slice():
"Make sure AST can't compile invalid slice"
cant_compile("(slice)")
cant_compile("(slice 1 2 3 4)")
cant_compile("(slice 1 2 3 4 5)")
def test_ast_good_take():