1
0
mirror of https://github.com/janet-lang/janet synced 2024-06-16 02:09:56 +00:00

Conform display of path with existing display of source map info

This commit is contained in:
Michael Camilleri 2021-01-20 10:47:55 +09:00
parent 4dd512ad28
commit c6467be60d
No known key found for this signature in database
GPG Key ID: 7EB218A48DF8B572

View File

@ -2848,16 +2848,16 @@
(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) ")") (x :module) (string :module " (" (x :kind) ")")
(type (x :value))) (type (x :value)))
"\n")) "\n"))
(def sm (x :source-map)) (def sm (x :source-map))
(def d (x :doc)) (def d (x :doc))
(print "\n\n" (print "\n\n"
(if d bind-type "") (when d bind-type)
(if-let [[path line col] sm] (when-let [[path line col] sm]
(string " " path " on line " line ", column " col "\n") "") (string " " path (when (and line col) (string " on line " line ", column " col)) "\n"))
(if (or d sm) "\n" "") (when (or d sm) "\n")
(if d (doc-format d) " no documentation found.") (if d (doc-format d) " no documentation found.")
"\n\n")) "\n\n"))
@ -2876,10 +2876,10 @@
(do (do
(def [fullpath mod-kind] (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)]
(print-module-entry {:module true (print-module-entry {:module true
:path fullpath :kind mod-kind
:kind mod-kind :source-map [fullpath nil nil]
:doc (in mod-env :doc)}) :doc (in mod-env :doc)})
(print "symbol " sym " not found."))) (print "symbol " sym " not found.")))
(print-module-entry x))) (print-module-entry x)))