mirror of
https://github.com/janet-lang/janet
synced 2024-07-15 00:04:20 +00:00
23 lines
389 B
Plaintext
23 lines
389 B
Plaintext
|
(namespace-set! "gst.repl")
|
||
|
|
||
|
"Hold all compile time evaluators"
|
||
|
(export! "evaluators" {})
|
||
|
|
||
|
"Read a line"
|
||
|
(export! "readline" (fn []
|
||
|
(: b (buffer))
|
||
|
(read stdin 1 b)
|
||
|
(while (not (= (get "\n" 0) (get b (- (length b) 1))))
|
||
|
(read stdin 1 b)
|
||
|
)
|
||
|
(string b)
|
||
|
))
|
||
|
|
||
|
"Create a parser"
|
||
|
(export! "p" (parser))
|
||
|
|
||
|
(while 1
|
||
|
(: line (readline))
|
||
|
(print "Read line: " line)
|
||
|
)
|