(defn
regex-spec-impl
"Do not call this directly, use 'spec' with a regex op argument"
[re gfn]
(reify
Specize
(specize* [s] s)
(specize* [s _] s)
Spec
(conform*
[_ x]
(if
(c/or (nil? x) (coll? x))
(re-conform re (seq x))
:clojure.core/invalid))
(unform* [_ x] (op-unform re x))
(explain*
[_ path via in x]
(if
(c/or (nil? x) (coll? x))
(re-explain path via in re (seq x))
[{:path path, :pred (op-describe re), :val x, :via via, :in in}]))
(gen*
[_ overrides path rmap]
(if gfn (gfn) (re-gen re overrides path rmap (op-describe re))))
(with-gen* [_ gfn] (regex-spec-impl re gfn))
(describe* [_] (op-describe re))))