From 155857c120049821adda2396a5387226155cc7ab Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Tue, 21 May 2024 20:35:49 -0700 Subject: [PATCH] Launch repl on run --- examples/repl.modal | 8 -------- makefile | 2 +- src/repl.modal | 17 +++++++++++++++++ 3 files changed, 18 insertions(+), 9 deletions(-) delete mode 100644 examples/repl.modal create mode 100644 src/repl.modal diff --git a/examples/repl.modal b/examples/repl.modal deleted file mode 100644 index 15cbd7f..0000000 --- a/examples/repl.modal +++ /dev/null @@ -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! \ No newline at end of file diff --git a/makefile b/makefile index ccee82f..f36c470 100644 --- a/makefile +++ b/makefile @@ -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 diff --git a/src/repl.modal b/src/repl.modal new file mode 100644 index 0000000..d3875a8 --- /dev/null +++ b/src/repl.modal @@ -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! \ No newline at end of file