Launch repl on run

This commit is contained in:
Devine Lu Linvega 2024-05-21 20:35:49 -07:00
parent 44b04fa893
commit 155857c120
3 changed files with 18 additions and 9 deletions

View File

@ -1,8 +0,0 @@
?(?-) (This is a fully functional Modal REPL.)
<> quit EOF
<> wait?~ (?~ wait!)
<> (?: print) ?:
<> (EOF wait!) (Bye.\n print)
(Say something, or type "quit":\n) print wait!

View File

@ -8,7 +8,7 @@ all: dest
dest:
@ mkdir -p bin
run: all bin/modal
@ bin/modal -q examples/hello.modal
@ bin/modal src/repl.modal
debug: all bin/modal-debug
@ bin/modal-debug examples/rules.modal
test: all bin/modal-debug bin/modal

17
src/repl.modal Normal file
View File

@ -0,0 +1,17 @@
?(?: ?:) (
\n
\t Hello. Welcome to Modal\n
\t Start rewriting, or type "quit"\n
\n
\t <> Defines a rule\n
\t >< Undefines a rule\n
\t ?x Assigns a register\n
\n
\t Have fun!\n
\n
)
<> (quit listen!) (?(?: ?:) (\n\tSee you soon.\n\n))
<> listen?~ (?~ listen!)
listen!