Form incredibly high energy bee structures from infinitely dense radioactive apioforms occupying a 4m side length hexagon with 1cm internal thickness and extruded 2.3234cm evenly into the dimension perpendicular to the 2 current dimensions in use #5

Merged
osmarks merged 2 commits from :master into master 2021-01-29 23:26:04 +00:00
2 changed files with 4 additions and 4 deletions
Showing only changes of commit 3086955653 - Show all commits

View File

@ -220,7 +220,7 @@ local load_log = {}
local set_last_loaded = potatOS.set_last_loaded local set_last_loaded = potatOS.set_last_loaded
potatOS.set_last_loaded = nil potatOS.set_last_loaded = nil
-- Check safety of code. Also log executed code if Protocol Epsilon diagnostics mode is enabled. I should probably develop a better format. -- Check safety of code. Also log executed code if Protocol Epsilon diagnostics mode is enabled. I should probably develop a better format.
function load(code, file, ...) function load(code, file, mode, env)
local start, end_, pxsig = code:find "%-%-%-PXSIG:([0-9A-Fa-f]+)\n" local start, end_, pxsig = code:find "%-%-%-PXSIG:([0-9A-Fa-f]+)\n"
if pxsig then if pxsig then
local rest = code:sub(1, start - 1) .. code:sub(end_ + 1) local rest = code:sub(1, start - 1) .. code:sub(end_ + 1)
@ -247,11 +247,11 @@ function load(code, file, ...)
local ok, ast = pcall(function() return heavlisp.into_ast(heavlisp.tokenize(code)) end) local ok, ast = pcall(function() return heavlisp.into_ast(heavlisp.tokenize(code)) end)
if not ok then return false, ast end if not ok then return false, ast end
return function(imports) return function(imports)
imports = imports or {} imports = imports or env or {}
return heavlisp.interpret(ast, imports) return heavlisp.interpret(ast, imports)
end end
end end
return real_load(code, file, ...) return real_load(code, file, mode, env)
end end
do_something "load" do_something "load"

View File

@ -578,4 +578,4 @@ end
local function run(x,lua) local function run(x,lua)
return interpret(into_ast(tokenize(x)),lua) return interpret(into_ast(tokenize(x)),lua)
end end
return {run=run} return {run=run, interpret=interpret, into_ast=into_ast, tokenize=tokenize}