1
0
mirror of https://github.com/janet-lang/janet synced 2025-01-12 08:30:26 +00:00

Add simple example repl. Will eventually add

support for error handling, macros and other
compile time transformations. This will eventually become the full
language.
This commit is contained in:
Calvin Rose 2017-05-08 11:03:06 -04:00
parent 058780085b
commit 4fd398ac97

View File

@ -16,7 +16,12 @@
"Create a parser" "Create a parser"
(export! "p" (parser)) (export! "p" (parser))
"Run a simple repl. Does not handle errors and other
such details."
(while 1 (while 1
(write stdout ">> ")
(: line (readline)) (: line (readline))
(print "Read line: " line) (while line
) (: line (parse-charseq p line))
(if (parse-hasvalue p)
(print ((compile (parse-consume p)))))))