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 2058
2058
(let [refs (second fs)]
2059
2059
(cond
2060
2060
(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))))
2062
2062
(recur fs ret true )
2063
2063
2064
2064
(= kw :exclude )
2065
2065
(recur (nnext fs) (update-in ret [:excludes ] into refs) false )
2066
2066
2067
2067
(= kw :rename )
2068
2068
(recur (nnext fs) (update-in ret [:renames ] merge refs) false )))
2069
- (recur fs ret true )))
2069
+ (recur fs ret true )))
2070
2070
2071
2071
:else ret))]
2072
2072
(merge-with into s xs)))
2238
2238
(if (keyword? quoted-spec-or-kw)
2239
2239
quoted-spec-or-kw
2240
2240
(as-> (second quoted-spec-or-kw) spec
2241
- (if (vector? spec) spec [spec]))))]
2241
+ (if (or ( vector? spec) ( map? spec) ) spec [spec]))))]
2242
2242
(map canonicalize specs)))
2243
2243
2244
2244
(defn canonicalize-import-specs [specs]
Original file line number Diff line number Diff line change 490
490
(is (= (a/canonicalize-specs '(:require (quote [clojure.set :as set])))
491
491
'(:require [clojure.set :as set])))
492
492
(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}))))
494
496
495
497
(deftest test-canonicalize-import-specs
496
498
(is (= (a/canonicalize-import-specs '(:import (quote [goog Uri])))
556
558
Integer goog.math.Integer})))
557
559
(let [test-env (a/empty-env )
558
560
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}))]
559
565
(is (= (-> parsed :excludes )
560
566
'#{map mapv})))))
561
567
(testing " arguments to require should be quoted"
861
867
(map (comp :externs second)
862
868
(get @test-cenv ::a/namespaces )))))))
863
869
864
- )
870
+ )
You can’t perform that action at this time.
0 commit comments