Skip to content

Commit b69abbd

Browse files
committed
Remove binding from PredicateMatcher clauses in literal syntax from parser.
1 parent d1a3c8e commit b69abbd

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/active/clojure/match.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@
280280

281281
(s/def ::regex regex?)
282282
(s/def ::compare-fn-token #{:compare-fn})
283-
(s/def ::compare-fn (s/cat :binding symbol? :compare-fn ::compare-fn-token :fn ifn?))
283+
(s/def ::compare-fn (s/cat :compare-fn ::compare-fn-token :fn ifn?))
284284

285285
(s/def ::or-token #{:or})
286286

test/active/clojure/match_test.clj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@
5757

5858
(t/testing "with a predicate matcher"
5959
(t/is (= (p/make-key-matches-clause :k (p/make-predicate-matcher even?) 'Binding)
60-
(p/parse-clause (list :k (list 'k :compare-fn even?) :as 'Binding))))
60+
(p/parse-clause (list :k (list :compare-fn even?) :as 'Binding))))
6161
(t/is (= (p/make-key-matches-clause :k (p/make-predicate-matcher (f/partial = 42)) 'Binding)
62-
(p/parse-clause (list :k (list 'k :compare-fn (f/partial = 42)) :as 'Binding)))))
62+
(p/parse-clause (list :k (list :compare-fn (f/partial = 42)) :as 'Binding)))))
6363

6464
(t/testing "optional clauses"
6565
(t/is (= (p/make-optional-clause (p/make-key-exists-clause :k p/the-existence-matcher 'k))
@@ -210,15 +210,15 @@
210210

211211
(def predicate-matcher
212212
(p/map-matcher
213-
[(:x (x :compare-fn even?))] ::even
214-
[(:x (x :compare-fn odd?))] ::odd))
213+
[(:x (:compare-fn even?))] ::even
214+
[(:x (:compare-fn odd?))] ::odd))
215215

216216
(t/deftest map-matcher-predicate-test
217217
(t/is (= ::even (predicate-matcher {:x 42})))
218218
(t/is (= ::odd (predicate-matcher {:x 41}))))
219219

220220
(p/defpattern predicate-pattern
221-
[(:x (x :compare-fn even?))])
221+
[(:x (:compare-fn even?))])
222222

223223
(t/deftest map-matcher-polymorphism-test
224224
(t/testing "works with a pattern record"
@@ -228,5 +228,5 @@
228228

229229
(t/testing "works with pattern syntax"
230230
(t/is (= ::even
231-
((p/map-matcher [(:x (x :compare-fn even?))] ::even)
231+
((p/map-matcher [(:x (:compare-fn even?))] ::even)
232232
{:x 42})))))

0 commit comments

Comments
 (0)