We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 19893e8 commit 9bb35a5Copy full SHA for 9bb35a5
src/main/clojure/clojure/tools/namespace/parse.cljc
@@ -24,6 +24,14 @@
24
[form]
25
(and (list? form) (= 'ns (first form))))
26
27
+(def clojure-read-opts
28
+ {:read-cond :allow
29
+ :features #{:clj}})
30
+
31
+(def clojurescript-read-opts
32
33
+ :features #{:cljs}})
34
35
(defn read-ns-decl
36
"Attempts to read a (ns ...) declaration from a reader, and returns
37
the unevaluated form. Returns the first top-level ns form found.
@@ -35,8 +43,7 @@
43
([rdr]
44
(read-ns-decl rdr nil))
45
([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)
40
47
:eof ::eof)]
41
48
(loop []
42
49
(let [form (reader/read opts rdr)]
0 commit comments