Skip to content

Commit 5abc27f

Browse files
committed
Filter :refer'd macros via env-supplied :built-in-macro-nss
1 parent ae9ac01 commit 5abc27f

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
- `:cherry` target of `resolve-ns` now honors the `:resolve-ns` env
1111
hook for non-builtin symbol libnames, matching the existing
1212
`:squint` target behavior.
13+
- Filter `:refer`'d macros via env-supplied `:built-in-macro-nss`
14+
map (`{libname-sym #{macro-syms}}`), so hosts (e.g. cherry) can
15+
register additional macro namespaces beyond the hardcoded
16+
`cljs.test`/`clojure.test`/etc set without patching squint.
1317

1418
## 0.11.189
1519

src/squint/compiler_common.cljc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,10 @@
762762
(get rename refer refer)) refer)
763763
(repeat (if (symbol? original-libname)
764764
original-libname libname)))))))))
765-
(let [runtime-refer (remove #(builtin-refer-is-macro? original-libname %) refer)]
765+
(let [runtime-refer (remove (fn [refer-sym]
766+
(or (builtin-refer-is-macro? original-libname refer-sym)
767+
(contains? (get (:built-in-macro-nss env) original-libname) refer-sym)))
768+
refer)]
766769
(str
767770
(when (seq runtime-refer)
768771
(let [referred+renamed (str/join ", "

0 commit comments

Comments
 (0)