mirror of
https://github.com/janet-lang/janet
synced 2025-07-17 01:12:53 +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"
|
||||
"<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))]
|
||||
(gen-one k d)))
|
||||
|
||||
(print prelude ;parts postlude)
|
||||
|
@ -1297,20 +1297,19 @@ value, one key will be ignored."
|
||||
(buffer/clear buf)
|
||||
(chunks buf p)
|
||||
(var pindex 0)
|
||||
(var pstatus nil)
|
||||
(def len (length buf))
|
||||
(if (= len 0) (:= going false))
|
||||
(while (> len pindex)
|
||||
(+= pindex (parser/consume p buf pindex))
|
||||
(case (parser/status p)
|
||||
:full (eval1 (parser/produce p))
|
||||
:error (do
|
||||
(def (line col) (parser/where p))
|
||||
(while (= (:= pstatus (parser/status p)) :full)
|
||||
(eval1 (parser/produce p)))
|
||||
(when (= pstatus :error)
|
||||
(onstatus :parse
|
||||
(string (parser/error p)
|
||||
" on line " line
|
||||
", column " col)
|
||||
" around byte " (parser/where p))
|
||||
nil
|
||||
where)))))
|
||||
where))))
|
||||
|
||||
(:= *env* oldenv)
|
||||
|
||||
@ -1495,6 +1494,9 @@ value, one key will be ignored."
|
||||
newenv)))))
|
||||
|
||||
(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]
|
||||
(def targs (table ;args))
|
||||
(def {:as as
|
||||
|
Loading…
x
Reference in New Issue
Block a user