From 4efe44ed271aeed8e25e909344788d92a0d9f82b Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 11 Nov 2018 15:50:46 -0800 Subject: Fully upgraded to 4.10.12.7, including deprecating the old list/dict comprehension methods, in favor of the new native support. --- tools/repl.nom | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'tools/repl.nom') diff --git a/tools/repl.nom b/tools/repl.nom index 00efd77..9d9e88d 100644 --- a/tools/repl.nom +++ b/tools/repl.nom @@ -1,12 +1,13 @@ -#!/usr/bin/env nomsu -V4 +#!/usr/bin/env nomsu -V4.10.12.7 use "lib/consolecolor.nom" use "lib/os.nom" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -[quit, exit] all mean: lua> "os.exit(0)" +externally [quit, exit] all mean: + lua> "os.exit(0)" -(help) means: +externally (help) means: say "\ ..This is the Nomsu v\(Nomsu version) interactive console. You can type in Nomsu code here and hit 'enter' twice to run it. @@ -15,7 +16,7 @@ use "lib/os.nom" say "\ .. \(bright)\(underscore)Welcome to the Nomsu v\(Nomsu version) interactive console!\(reset color) - press 'enter' twice to run a command + press 'enter' twice to run a command " %repl_line = 0 @@ -33,29 +34,28 @@ repeat: go to (run buffer) %buff::add (%line::with "\t" -> " ") %io.write (dim (yellow ".. ")) - === (run buffer) === - if ((size of %buff) == 0): - stop - + if ((size of %buff) == 0): stop %buff = (%buff::joined) - + # TODO: support local variables spoof file %buff try: %ret = (run %buff) - ..and if it barfs %err: - say %err + ..and if it barfs %err: say %err ..or if it succeeds: if (type of %ret) is: "nil": do nothing + "boolean": say "= \("yes" if %ret else "no")" + "table": if %ret.as_nomsu: say "= \(%ret::as nomsu)" ..else: say "= \%ret" + else: say "= \%ret" -- cgit v1.2.3