aboutsummaryrefslogtreecommitdiff
path: root/nomsu.lua
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2018-10-31 03:51:37 -0700
committerBruce Hill <bruce@bruce-hill.com>2018-10-31 03:52:00 -0700
commit83219f8522271ae4f278abc5687921cc8267bb33 (patch)
tree17ad8aa28d94d5442fac990cf3a0fae204d90850 /nomsu.lua
parentea3197aaffba00318920ed5e1e33ca5f2a5e6c5c (diff)
Bumped version number, fixed REPL, and simplified/fixed (use %).
Diffstat (limited to 'nomsu.lua')
-rw-r--r--nomsu.lua15
1 files changed, 5 insertions, 10 deletions
diff --git a/nomsu.lua b/nomsu.lua
index fa6a6ce..bd1ee85 100644
--- a/nomsu.lua
+++ b/nomsu.lua
@@ -133,8 +133,7 @@ end
local nomsu = NomsuCompiler
nomsu.environment.arg = NomsuCompiler.environment._List(args.nomsu_args)
if args.version then
- nomsu:run([[use "core"
-say (Nomsu version)]])
+ nomsu:run([[(: use "core"; say (Nomsu version))]])
os.exit(EXIT_SUCCESS)
end
FILE_CACHE = setmetatable({ }, {
@@ -183,11 +182,7 @@ run = function()
return true
end
if not (args.no_core) then
- for _, filename in Files.walk('core') do
- if filename:match("%.nom$") then
- nomsu:import(nomsu:run_file(filename))
- end
- end
+ nomsu:import_file('core')
end
local get_file_and_source
get_file_and_source = function(filename)
@@ -280,8 +275,8 @@ run = function()
if not (args.primary_file or args.exec_strings) then
nomsu:run([[#!/usr/bin/env nomsu -V4
use "lib/consolecolor.nom"
-action [quit, exit]: lua> "os.exit(0)"
-action [help]:
+[quit, exit] all mean: lua> "os.exit(0)"
+(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.
@@ -320,7 +315,7 @@ say "\
return Errhand.print_error(error_message)
end
local ret
- ok, ret = xpcall(nomsu.run, err_hand, nomsu, buff, Source(pseudo_filename, 1, #buff))
+ ok, ret = xpcall(nomsu.run, err_hand, nomsu, NomsuCode(Source(pseudo_filename, 1, #buff), buff))
if ok and ret ~= nil then
if type(ret) == 'number' then
print("= " .. tostring(ret))