janet/src/webclient/webinit.janet

13 lines
407 B
Clojure
Raw Normal View History

# Copyright 2017-2019 (C) Calvin Rose
2019-02-03 20:34:41 +00:00
(print (string "Janet " janet/version "-" janet/build " Copyright (C) 2017-2019 Calvin Rose"))
(setdyn :pretty-format "%.20P")
2018-10-17 03:08:26 +00:00
2018-12-01 03:54:17 +00:00
(fiber/new (fn webrepl []
(repl (fn get-line [buf p]
2018-12-14 02:36:19 +00:00
(def offset (parser/where p))
(def prompt (string "janet:" offset ":" (parser/state p) "> "))
(repl-yield prompt buf)
(yield)
buf))))