Mangle a macro until it stops moving
this helps if we use a macro in something that got tree-mangled back out.
This commit is contained in:
parent
48ae1b1e26
commit
e22a0ff73c
@ -31,9 +31,12 @@ MACROS = [
|
|||||||
|
|
||||||
def process(tree):
|
def process(tree):
|
||||||
load_macros()
|
load_macros()
|
||||||
tree = mprocess(tree)
|
old = None
|
||||||
for m in hy.mangle.MANGLES:
|
while old != tree:
|
||||||
m().mangle(tree)
|
old = tree
|
||||||
|
tree = mprocess(tree)
|
||||||
|
for m in hy.mangle.MANGLES:
|
||||||
|
m().mangle(tree)
|
||||||
return tree
|
return tree
|
||||||
|
|
||||||
|
|
||||||
|
@ -377,6 +377,11 @@
|
|||||||
(assert (= true (if true true true))))
|
(assert (= true (if true true true))))
|
||||||
|
|
||||||
|
|
||||||
|
(defn test-nested-mangles []
|
||||||
|
"NATIVE: test that we can use macros in mangled code"
|
||||||
|
(assert (= ((fn [] (-> 2 (+ 1 1) (* 1 2)))) 8)))
|
||||||
|
|
||||||
|
|
||||||
(defn test-let-scope []
|
(defn test-let-scope []
|
||||||
"NATIVE: test let works rightish"
|
"NATIVE: test let works rightish"
|
||||||
(setv y 123)
|
(setv y 123)
|
||||||
|
Loading…
Reference in New Issue
Block a user