Browse files

added :doc entries for ns and def

  • Loading branch information...
1 parent 69897cf commit bef56a74f2eeecabfe0c0a28d89b455dce576ea3 @franks42 franks42 committed with David Nolen Oct 16, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/clj/cljs/analyzer.clj
@@ -331,8 +331,10 @@
(str "WARNING: " (symbol (str ns-name) (str sym))
" no longer fn, references are stale"))))
(swap! namespaces assoc-in [ns-name :defs sym]
- (merge {:name name}
+ (merge
+ {:name name}
+ (when doc {:doc doc})
(when dynamic {:dynamic true})
(when-let [line (:line env)]
{:file *cljs-file* :line line})
@@ -671,6 +673,7 @@
(clojure.core/require nsym))
(swap! namespaces #(-> %
(assoc-in [name :name] name)
+ (assoc-in [name :doc] docstring)
(assoc-in [name :excludes] excludes)
(assoc-in [name :uses] uses)
(assoc-in [name :requires] requires)
@@ -680,7 +683,7 @@
[alias (find-ns nsym)])
(assoc-in [name :imports] imports)))
- {:env env :op :ns :form form :name name :uses uses :requires requires :imports imports
+ {:env env :op :ns :form form :name name :doc docstring :uses uses :requires requires :imports imports
:uses-macros uses-macros :requires-macros requires-macros :excludes excludes}))
(defmethod parse 'deftype*

0 comments on commit bef56a7

Please sign in to comment.