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:
parent
b7f92bd915
commit
3d8a3d589c
1161
hy/compiler.py
1161
hy/compiler.py
File diff suppressed because it is too large
Load Diff
@ -240,12 +240,13 @@ def test_ast_good_slice():
|
|||||||
hy_compile(tokenize("(slice x)"))
|
hy_compile(tokenize("(slice x)"))
|
||||||
hy_compile(tokenize("(slice x y)"))
|
hy_compile(tokenize("(slice x y)"))
|
||||||
hy_compile(tokenize("(slice x y z)"))
|
hy_compile(tokenize("(slice x y z)"))
|
||||||
|
hy_compile(tokenize("(slice x y z t)"))
|
||||||
|
|
||||||
|
|
||||||
def test_ast_bad_slice():
|
def test_ast_bad_slice():
|
||||||
"Make sure AST can't compile invalid slice"
|
"Make sure AST can't compile invalid slice"
|
||||||
cant_compile("(slice)")
|
cant_compile("(slice)")
|
||||||
cant_compile("(slice 1 2 3 4)")
|
cant_compile("(slice 1 2 3 4 5)")
|
||||||
|
|
||||||
|
|
||||||
def test_ast_good_take():
|
def test_ast_good_take():
|
||||||
|
Loading…
Reference in New Issue
Block a user