updating the nested mangles

This commit is contained in:
Paul R. Tagliamonte 2013-04-11 22:25:23 -04:00
parent a729b52155
commit db3e2bd346
2 changed files with 12 additions and 2 deletions

View File

@ -41,7 +41,7 @@ class HoistableMangle(hy.mangle.Mangle):
class FunctionMangle(HoistableMangle):
hoistable = ["fn"]
ignore = ["def", "decorate_with", "setf", "setv"]
ignore = ["def", "decorate_with", "setf", "setv", "foreach", "do"]
def __init__(self):
self.series = 0
@ -65,7 +65,7 @@ class FunctionMangle(HoistableMangle):
class IfMangle(HoistableMangle):
ignore = []
ignore = ["foreach", "do"]
def __init__(self):
self.series = 0

View File

@ -511,6 +511,16 @@
((fn [] 1))))))
(defn test-nested-if []
"NATIVE: test nested if"
(for [x (range 10)]
(if (in "foo" "foobar")
(do
(if true true true))
(do
(if false false false)))))
(defn test-eval []
"NATIVE: test eval"
(assert (= 2 (eval (quote (+ 1 1)))))