summary refs log tree commit diff stats
path: root/src/cratera/bootstrap.lua
diff options
context:
space:
mode:
authorSoniEx2 <endermoneymod@gmail.com>2024-06-04 23:48:59 -0300
committerSoniEx2 <endermoneymod@gmail.com>2024-06-04 23:48:59 -0300
commitdba1285ca98d7a325f05b77b805089b3edd61867 (patch)
treef5ddfbd1c86a7db464dc1c459c38c5e256e49089 /src/cratera/bootstrap.lua
parent5eecbd6ef771a54b455d96f4033212062d7c3f8f (diff)
Implement cratera REPL
Diffstat (limited to 'src/cratera/bootstrap.lua')
-rw-r--r--src/cratera/bootstrap.lua4
1 files changed, 3 insertions, 1 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