mirror of
https://github.com/janet-lang/janet
synced 2025-02-23 19:50:02 +00:00
Update gendoc and fix issue with run-context.
This commit is contained in:
parent
e286e82144
commit
8333c22e8a
@ -55,8 +55,9 @@
|
|||||||
(string "<h2>" (html-escape key) "</h2>\n"
|
(string "<h2>" (html-escape key) "</h2>\n"
|
||||||
"<p>" (html-escape docstring) "</p>\n")))
|
"<p>" (html-escape docstring) "</p>\n")))
|
||||||
|
|
||||||
(def parts (seq [[k {:doc d :private p}] :in (sort (pairs (table/getproto _env)))
|
# Generate parts and print them to stdout
|
||||||
|
(def parts (seq [[k {:doc d :private p}]
|
||||||
|
:in (sort (pairs (table/getproto _env)))
|
||||||
:when (and d (not p))]
|
:when (and d (not p))]
|
||||||
(gen-one k d)))
|
(gen-one k d)))
|
||||||
|
|
||||||
(print prelude ;parts postlude)
|
(print prelude ;parts postlude)
|
||||||
|
@ -1297,20 +1297,19 @@ value, one key will be ignored."
|
|||||||
(buffer/clear buf)
|
(buffer/clear buf)
|
||||||
(chunks buf p)
|
(chunks buf p)
|
||||||
(var pindex 0)
|
(var pindex 0)
|
||||||
|
(var pstatus nil)
|
||||||
(def len (length buf))
|
(def len (length buf))
|
||||||
(if (= len 0) (:= going false))
|
(if (= len 0) (:= going false))
|
||||||
(while (> len pindex)
|
(while (> len pindex)
|
||||||
(+= pindex (parser/consume p buf pindex))
|
(+= pindex (parser/consume p buf pindex))
|
||||||
(case (parser/status p)
|
(while (= (:= pstatus (parser/status p)) :full)
|
||||||
:full (eval1 (parser/produce p))
|
(eval1 (parser/produce p)))
|
||||||
:error (do
|
(when (= pstatus :error)
|
||||||
(def (line col) (parser/where p))
|
(onstatus :parse
|
||||||
(onstatus :parse
|
(string (parser/error p)
|
||||||
(string (parser/error p)
|
" around byte " (parser/where p))
|
||||||
" on line " line
|
nil
|
||||||
", column " col)
|
where))))
|
||||||
nil
|
|
||||||
where)))))
|
|
||||||
|
|
||||||
(:= *env* oldenv)
|
(:= *env* oldenv)
|
||||||
|
|
||||||
@ -1495,6 +1494,9 @@ value, one key will be ignored."
|
|||||||
newenv)))))
|
newenv)))))
|
||||||
|
|
||||||
(defn import*
|
(defn import*
|
||||||
|
"Import a module into a given environment table. This is the
|
||||||
|
functional form of (import ...) that expects and explicit environment
|
||||||
|
table."
|
||||||
[env path & args]
|
[env path & args]
|
||||||
(def targs (table ;args))
|
(def targs (table ;args))
|
||||||
(def {:as as
|
(def {:as as
|
||||||
|
Loading…
x
Reference in New Issue
Block a user