aboutsummaryrefslogtreecommitdiff
path: root/tools/repl.nom
diff options
context:
space:
mode:
Diffstat (limited to 'tools/repl.nom')
-rw-r--r--tools/repl.nom20
1 files changed, 12 insertions, 8 deletions
diff --git a/tools/repl.nom b/tools/repl.nom
index 3f1eff3..49a4d3d 100644
--- a/tools/repl.nom
+++ b/tools/repl.nom
@@ -1,4 +1,4 @@
-#!/usr/bin/env nomsu -V5.12.12.8
+#!/usr/bin/env nomsu -V6.12.12.8
#
This file defines a Read-Evaluate-Print-Loop (REPL) for Nomsu
@@ -9,16 +9,18 @@ use "lib/os.nom"
externally [quit, exit] all mean: lua> "os.exit(0)"
externally (help) means:
- say "
+ say ("
This is the Nomsu v\(Nomsu version) interactive console.
You can type in Nomsu code here and hit 'enter' twice to run it.
- To exit, type 'exit' or 'quit' and hit enter twice."
+ To exit, type 'exit' or 'quit' and hit enter twice.
+ ")
-say "
+say ("
\(bright)\(underscore)Welcome to the Nomsu v\(Nomsu version) interactive console!\(reset color)
press 'enter' twice to run a command
- "
+
+")
repeat:
say (bright (yellow ">> ")) inline
@@ -32,11 +34,13 @@ repeat:
# clear the line
say "\027[1A\027[2K" inline
go to (run buffer)
- $buff|add ($line|with "\t" -> " ")
+ $buff, add ($line, with "\t" -> " ")
say (dim (yellow ".. ")) inline
+
--- (run buffer) ---
+
if ((size of $buff) == 0): stop
- $buff = ($buff|joined)
+ $buff = ($buff, joined)
# TODO: support local variables
spoof file $buff
@@ -53,7 +57,7 @@ repeat:
"table":
if $ret.as_nomsu:
- say "= \($ret|as nomsu)"
+ say "= \($ret, as nomsu)"
..else:
say "= \$ret"