fix l5 env issues
This commit is contained in:
parent
b4f9aaa39f
commit
ac70953ae9
2 changed files with 16 additions and 19 deletions
9
main.fnl
9
main.fnl
|
|
@ -1,11 +1,14 @@
|
||||||
(require :L5)
|
(require :L5)
|
||||||
|
|
||||||
|
(var yellow nil) ; #ffe470
|
||||||
|
(var dark nil) ; #403830
|
||||||
|
|
||||||
(fn setup []
|
(fn setup []
|
||||||
(size 640 480)
|
(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))
|
(local steps (* 24 60))
|
||||||
(var step 0)
|
(var step 0)
|
||||||
|
|
||||||
|
|
|
||||||
14
main.lua
14
main.lua
|
|
@ -1,20 +1,14 @@
|
||||||
-- Mostly from https://sr.ht/~benthor/absolutely-minimal-love2d-fennel/
|
|
||||||
-- But added the allowedGlobals=false option
|
|
||||||
|
|
||||||
fennel = require("fennel")
|
fennel = require("fennel")
|
||||||
debug.traceback = fennel.traceback
|
debug.traceback = fennel.traceback
|
||||||
table.insert(package.loaders, function(filename)
|
table.insert(package.loaders,
|
||||||
|
function(filename)
|
||||||
if love.filesystem.getInfo(filename) then
|
if love.filesystem.getInfo(filename) then
|
||||||
return function(...)
|
return function(...)
|
||||||
return fennel.eval(
|
return fennel.eval(love.filesystem.read(filename),
|
||||||
love.filesystem.read(filename),
|
|
||||||
{ env = _G, filename = filename, allowedGlobals = false },
|
{ env = _G, filename = filename, allowedGlobals = false },
|
||||||
...
|
...), filename
|
||||||
),
|
|
||||||
filename
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- jump into Fennel
|
-- jump into Fennel
|
||||||
require("bootstrap.fnl")
|
require("bootstrap.fnl")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue