fix l5 env issues

This commit is contained in:
Travis Shears 2026-05-27 19:24:13 +01:00
parent b4f9aaa39f
commit ac70953ae9
Signed by: travisshears
GPG key ID: CB9BF1910F3F7469
2 changed files with 16 additions and 19 deletions

View file

@ -1,11 +1,14 @@
(require :L5)
(var yellow nil) ; #ffe470
(var dark nil) ; #403830
(fn setup []
(size 640 480)
(textSize 100))
(textSize 100)
(set yellow (color 255 228 112))
(set dark (color 64 56 48)))
(local yellow (color 255 228 112)) ; #ffe470
(local dark (color 64 56 48)) ; #403830
(local steps (* 24 60))
(var step 0)

View file

@ -1,20 +1,14 @@
-- Mostly from https://sr.ht/~benthor/absolutely-minimal-love2d-fennel/
-- But added the allowedGlobals=false option
fennel = require("fennel")
debug.traceback = fennel.traceback
table.insert(package.loaders, function(filename)
table.insert(package.loaders,
function(filename)
if love.filesystem.getInfo(filename) then
return function(...)
return fennel.eval(
love.filesystem.read(filename),
return fennel.eval(love.filesystem.read(filename),
{ env = _G, filename = filename, allowedGlobals = false },
...
),
filename
...), filename
end
end
end)
end)
-- jump into Fennel
require("bootstrap.fnl")