Skip to content

Commit

Permalink
fix: fennel aware tracebacks
Browse files Browse the repository at this point in the history
  • Loading branch information
winny- committed Sep 19, 2024
1 parent eaeb9da commit 188f14a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,21 @@ local make_love_searcher = function(env)
if love.filesystem.getInfo(path) then
return function(...)
local code = love.filesystem.read(path)
return fennel.eval(code, {env=env}, ...)
return fennel.eval(code, {env=env, filename=path}, ...)
end, path
end
path = module_name:gsub("%.", "/") .. "/init.fnl"
if love.filesystem.getInfo(path) then
return function(...)
local code = love.filesystem.read(path)
return fennel.eval(code, {env=env}, ...)
return fennel.eval(code, {env=env, filename=path}, ...)
end, path
end
end
end

table.insert(package.loaders, make_love_searcher(_G))
table.insert(fennel["macro-searchers"], make_love_searcher("_COMPILER"))
debug.traceback = fennel.traceback

require("game")

0 comments on commit 188f14a

Please sign in to comment.