Cleaned-up extract-common-docstring and made it ignore forms in which the second item isn't a symbol.
This commit is contained in:
parent
70a0b2f6bc
commit
3f63422e5c
1 changed files with 14 additions and 11 deletions
|
@ -102,17 +102,20 @@
|
|||
|
||||
(defn- extract-common-docstring
|
||||
[form raw nspace-sym]
|
||||
(let [sym (second form)
|
||||
_ (if (= 'ns (first form))
|
||||
(try (require sym)
|
||||
(catch Exception _)))
|
||||
nspace (find-ns sym)]
|
||||
(let [docstring (if nspace
|
||||
(-> nspace meta :doc)
|
||||
(get-var-docstring nspace-sym sym))]
|
||||
[docstring
|
||||
(strip-docstring docstring raw)
|
||||
(if nspace sym nspace-sym)])))
|
||||
(let [sym (second form)]
|
||||
(if (symbol? sym)
|
||||
(do
|
||||
(when (= 'ns (first form))
|
||||
(try (require sym)
|
||||
(catch Exception _)))
|
||||
(let [nspace (find-ns sym)
|
||||
docstring (if nspace
|
||||
(-> nspace meta :doc)
|
||||
(get-var-docstring nspace-sym sym))]
|
||||
[docstring
|
||||
(strip-docstring docstring raw)
|
||||
(if nspace sym nspace-sym)]))
|
||||
[nil raw nspace-sym])))
|
||||
|
||||
(defn- extract-impl-docstring
|
||||
[fn-body]
|
||||
|
|
Loading…
Reference in a new issue