diff options
author | SoniEx2 <endermoneymod@gmail.com> | 2024-06-04 23:48:59 -0300 |
---|---|---|
committer | SoniEx2 <endermoneymod@gmail.com> | 2024-06-04 23:48:59 -0300 |
commit | dba1285ca98d7a325f05b77b805089b3edd61867 (patch) | |
tree | f5ddfbd1c86a7db464dc1c459c38c5e256e49089 /src/cratera | |
parent | 5eecbd6ef771a54b455d96f4033212062d7c3f8f (diff) |
Implement cratera REPL
Diffstat (limited to 'src/cratera')
-rw-r--r-- | src/cratera/bootstrap.lua | 4 | ||||
-rw-r--r-- | src/cratera/init.lua | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/cratera/bootstrap.lua b/src/cratera/bootstrap.lua index 88cef17..c9c7096 100644 --- a/src/cratera/bootstrap.lua +++ b/src/cratera/bootstrap.lua @@ -55,11 +55,13 @@ local cratera = require "cratera" local cratera_env = setmetatable({lua=_G}, {__index=_G}) cratera_env._G = cratera_env +cratera_env._VERSION = cratera._VERSION -- cratera.lib actually injects itself into *us*! package.loaded[...] = cratera_env local io_open = io.open local stdin = io.stdin + -- only use setfenv if load doesn't support env argument local setfenv = (loadstring or load)("return setfenv", nil, nil, {})() -- we don't know the real BUFSIZ, use a common memory page size (16K, as on M1) @@ -155,7 +157,7 @@ local function cratera_loadfile(filename, mode, env) end local func, loader_err = cratera_loader_base(function() return reader() - end, filename, mode, env) + end, chunkname, mode, env) local closeok, closeerr = file:close() -- at this point, err_or_more_data *should* be nil. if err_or_more_data then diff --git a/src/cratera/init.lua b/src/cratera/init.lua index a354d56..f7453e4 100644 --- a/src/cratera/init.lua +++ b/src/cratera/init.lua @@ -83,4 +83,4 @@ local function cratera_load(reader, ...) end, ...) end -return {load = cratera_load} +return {load = cratera_load, _VERSION = "Cratera 2.1 on " .. _VERSION} |