File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 20582058 (let [refs (second fs)]
20592059 (cond
20602060 (not (or (and (= kw :exclude ) (sequential? refs) (every? symbol? refs))
2061- (and (= kw :rename ) (map? refs) (every? #(every? symbol? %) refs))))
2061+ (and (= kw :rename ) (map? refs) (every? #(every? symbol? %) refs))))
20622062 (recur fs ret true )
20632063
20642064 (= kw :exclude )
20652065 (recur (nnext fs) (update-in ret [:excludes ] into refs) false )
20662066
20672067 (= kw :rename )
20682068 (recur (nnext fs) (update-in ret [:renames ] merge refs) false )))
2069- (recur fs ret true )))
2069+ (recur fs ret true )))
20702070
20712071 :else ret))]
20722072 (merge-with into s xs)))
22382238 (if (keyword? quoted-spec-or-kw)
22392239 quoted-spec-or-kw
22402240 (as-> (second quoted-spec-or-kw) spec
2241- (if (vector? spec) spec [spec]))))]
2241+ (if (or ( vector? spec) ( map? spec) ) spec [spec]))))]
22422242 (map canonicalize specs)))
22432243
22442244(defn canonicalize-import-specs [specs]
Original file line number Diff line number Diff line change 490490 (is (= (a/canonicalize-specs '(:require (quote [clojure.set :as set])))
491491 '(:require [clojure.set :as set])))
492492 (is (= (a/canonicalize-specs '(:require (quote clojure.set)))
493- '(:require [clojure.set]))))
493+ '(:require [clojure.set])))
494+ (is (= (a/canonicalize-specs '(:refer-clojure :exclude '[map] :rename '{map core-map}))
495+ '(:refer-clojure :exclude [map] :rename {map core-map}))))
494496
495497(deftest test-canonicalize-import-specs
496498 (is (= (a/canonicalize-import-specs '(:import (quote [goog Uri])))
556558 Integer goog.math.Integer})))
557559 (let [test-env (a/empty-env )
558560 parsed (a/analyze test-env '(refer-clojure :exclude '[map mapv]))]
561+ (is (= (-> parsed :excludes )
562+ '#{map mapv})))
563+ (let [test-env (a/empty-env )
564+ parsed (a/analyze test-env '(refer-clojure :exclude '[map mapv] :rename '{mapv core-mapv}))]
559565 (is (= (-> parsed :excludes )
560566 '#{map mapv})))))
561567 (testing " arguments to require should be quoted"
861867 (map (comp :externs second)
862868 (get @test-cenv ::a/namespaces )))))))
863869
864- )
870+ )
You can’t perform that action at this time.
0 commit comments