mirror of
https://github.com/janet-lang/janet
synced 2025-02-26 04:40:01 +00:00
Fix doc generation.
This commit is contained in:
parent
b84b0e4828
commit
26818a5e5c
@ -89,7 +89,7 @@
|
|||||||
|
|
||||||
# Generate parts and print them to stdout
|
# Generate parts and print them to stdout
|
||||||
(def parts (seq [[k entry]
|
(def parts (seq [[k entry]
|
||||||
:in (sort (pairs (table/getproto _env)))
|
:in (sort (pairs (table/getproto *env*)))
|
||||||
:when (and (get entry :doc) (not (get entry :private)))]
|
:when (and (get entry :doc) (not (get entry :private)))]
|
||||||
(emit-item k entry)))
|
(emit-item k entry)))
|
||||||
(print
|
(print
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
# Constants for checking if symbols should be
|
# Constants for checking if symbols should be
|
||||||
# highlighted.
|
# highlighted.
|
||||||
(def- core-env (table/getproto _env))
|
(def- core-env (table/getproto *env*))
|
||||||
(def- specials {'fn true
|
(def- specials {'fn true
|
||||||
'var true
|
'var true
|
||||||
'do true
|
'do true
|
||||||
|
@ -10,11 +10,11 @@
|
|||||||
# can be written to an image (no cfunctions, no abstracts (stdout, stdin, stderr)),
|
# can be written to an image (no cfunctions, no abstracts (stdout, stdin, stderr)),
|
||||||
# everything else goes. Cfunctions and abstracts will be referenced from a register
|
# everything else goes. Cfunctions and abstracts will be referenced from a register
|
||||||
# table which will be generated on janet startup.
|
# table which will be generated on janet startup.
|
||||||
(def image (let [env-pairs (pairs (env-lookup _env))
|
(def image (let [env-pairs (pairs (env-lookup *env*))
|
||||||
essential-pairs (filter (fn [[k v]] (or (cfunction? v) (abstract? v))) env-pairs)
|
essential-pairs (filter (fn [[k v]] (or (cfunction? v) (abstract? v))) env-pairs)
|
||||||
lookup (table ;(mapcat identity essential-pairs))
|
lookup (table ;(mapcat identity essential-pairs))
|
||||||
reverse-lookup (invert lookup)]
|
reverse-lookup (invert lookup)]
|
||||||
(marshal (table/getproto _env) reverse-lookup)))
|
(marshal (table/getproto *env*) reverse-lookup)))
|
||||||
|
|
||||||
# Write image
|
# Write image
|
||||||
(file/write stdout image)
|
(file/write stdout image)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user