Skip to content

Commit 9bb35a5

Browse files
author
Stuart Sierra
committed
c.t.n.parse: define reader-opts for each platform
To be used in c.t.n.find
1 parent 19893e8 commit 9bb35a5

File tree

1 file changed

+9
-2
lines changed
  • src/main/clojure/clojure/tools/namespace

1 file changed

+9
-2
lines changed

src/main/clojure/clojure/tools/namespace/parse.cljc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@
2424
[form]
2525
(and (list? form) (= 'ns (first form))))
2626

27+
(def clojure-read-opts
28+
{:read-cond :allow
29+
:features #{:clj}})
30+
31+
(def clojurescript-read-opts
32+
{:read-cond :allow
33+
:features #{:cljs}})
34+
2735
(defn read-ns-decl
2836
"Attempts to read a (ns ...) declaration from a reader, and returns
2937
the unevaluated form. Returns the first top-level ns form found.
@@ -35,8 +43,7 @@
3543
([rdr]
3644
(read-ns-decl rdr nil))
3745
([rdr read-opts]
38-
(let [opts (assoc (or read-opts {:read-cond :allow
39-
:features #{:clj}})
46+
(let [opts (assoc (or read-opts clojure-read-opts)
4047
:eof ::eof)]
4148
(loop []
4249
(let [form (reader/read opts rdr)]

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy