diff options
Diffstat (limited to 'lib/tools/repl.nom')
| -rwxr-xr-x | lib/tools/repl.nom | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/tools/repl.nom b/lib/tools/repl.nom index 76b35cb..2e0c7da 100755 --- a/lib/tools/repl.nom +++ b/lib/tools/repl.nom @@ -1,5 +1,6 @@ -#!/usr/bin/env nomsu -V6.15.13.8 -# +#!/usr/bin/env nomsu -V7.0.0 + +### This file defines a Read-Evaluate-Print-Loop (REPL) for Nomsu use "consolecolor" @@ -30,12 +31,12 @@ command line program with $args: ") - # Best way I know of to detect the number of return values and only + ### Best way I know of to detect the number of return values and only print if it's >0: (say results of (*extra arguments*)) means: $N = (select "#" (*extra arguments*)) if ($N == 0): return - for $ in 1 to $N: + for $ in (1 to $N): $ret = (select $ (*extra arguments*)) if ($ret is "Text"): $ret = (quote $ret) @@ -49,15 +50,15 @@ command line program with $args: $line = ($io.read "*L") say (reset color) inline if (($line == "\n") or (not $line)): - if ((#$buff) > 0): - # clear the line + if (#$buff > 0): + ### clear the line if $(COLOR ENABLED): say "\027[1A\027[2K" inline go to (run buffer) $buff, add ($line, with "\t" -> " ") say (dim (yellow ".. ")) inline --- (run buffer) --- - if ((#$buff) == 0): stop + if (#$buff == 0): stop $buff = ($buff, joined) spoof file $buff try: @@ -82,7 +83,7 @@ command line program with $args: unless $lua: do next - # TODO: this is a bit hacky, it just defaults variables to global + ### TODO: this is a bit hacky, it just defaults variables to global so that stuff mostly works across multiple lines. It would be nicer if local variables actually worked. $lua, remove free vars |
