mirror of
https://github.com/janet-lang/janet
synced 2025-05-25 10:44:12 +00:00
Use print-module-entry function to display docstring
This commit is contained in:
parent
28076b9385
commit
4dd512ad28
@ -2848,6 +2848,7 @@
|
|||||||
(cond
|
(cond
|
||||||
(x :ref) (string :var " (" (type (in (x :ref) 0)) ")")
|
(x :ref) (string :var " (" (type (in (x :ref) 0)) ")")
|
||||||
(x :macro) :macro
|
(x :macro) :macro
|
||||||
|
(x :module) (string :module " (" (x :kind) ": " (x :path) ")")
|
||||||
(type (x :value)))
|
(type (x :value)))
|
||||||
"\n"))
|
"\n"))
|
||||||
(def sm (x :source-map))
|
(def sm (x :source-map))
|
||||||
@ -2873,9 +2874,12 @@
|
|||||||
(def x (dyn sym))
|
(def x (dyn sym))
|
||||||
(if (not x)
|
(if (not x)
|
||||||
(do
|
(do
|
||||||
(def [fullpath _] (module/find (string sym)))
|
(def [fullpath mod-kind] (module/find (string sym)))
|
||||||
(if-let [mod-env (in module/cache fullpath)]
|
(if-let [mod-env (in module/cache fullpath)]
|
||||||
(in mod-env :doc)
|
(print-module-entry {:module true
|
||||||
|
:path fullpath
|
||||||
|
:kind mod-kind
|
||||||
|
:doc (in mod-env :doc)})
|
||||||
(print "symbol " sym " not found.")))
|
(print "symbol " sym " not found.")))
|
||||||
(print-module-entry x)))
|
(print-module-entry x)))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user