Skip to content

Commit

Permalink
if we cannot find a macro namespace in the current namespace try one …
Browse files Browse the repository at this point in the history
…more time w/ a global lookup
  • Loading branch information
swannodette committed Jun 4, 2024
1 parent 9bf0706 commit f7e87a5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/clojure/cljs/analyzer.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -3954,8 +3954,11 @@
:cljs [(identical? "clojure.repl" nstr) (find-macros-ns 'cljs.repl)])
#?@(:clj [(.contains nstr ".") (find-ns (symbol nstr))]
:cljs [(goog.string/contains nstr ".") (find-macros-ns (symbol nstr))])
:else (some-> env :ns :require-macros (get (symbol nstr)) #?(:clj find-ns
:cljs find-macros-ns)))))
:else
(or (some-> env :ns :require-macros (get (symbol nstr)) #?(:clj find-ns
:cljs find-macros-ns))
#?(:clj (find-ns (symbol nstr))
:cljs (find-macros-ns (symbol nstr)))))))

(defn get-expander* [sym env]
(when-not (or (some? (gets env :locals sym)) ; locals hide macros
Expand Down

0 comments on commit f7e87a5

Please sign in to comment.