(defn propagate-recur
{:pass-info {:walk :post :depends #{#'annotate-loops #'propagate-transitions}}}
[ast]
(if (and (= (:op ast) :loop)
(::transform? ast))
;; If we are a loop and we need to transform, and
;; one of our children is a recur, then we must transform everything
;; that has a recur
(let [loop-id (:loop-id ast)]
(ast/postwalk ast #(if (contains? (:loops %) loop-id)
(assoc % ::transform? true)
%)))
ast))