updating the nested mangles
This commit is contained in:
parent
a729b52155
commit
db3e2bd346
@ -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
|
||||
|
@ -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)))))
|
||||
|
Loading…
x
Reference in New Issue
Block a user