From 188f14a0c3faa6f9af021778b29710501884d953 Mon Sep 17 00:00:00 2001 From: Winston Weinert Date: Thu, 19 Sep 2024 15:51:53 -0500 Subject: [PATCH] fix: fennel aware tracebacks See https://sr.ht/~benthor/absolutely-minimal-love2d-fennel/#fennel-aware-stack-traces --- src/main.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.lua b/src/main.lua index 32158d4..714d132 100644 --- a/src/main.lua +++ b/src/main.lua @@ -7,14 +7,14 @@ 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 @@ -22,5 +22,6 @@ end table.insert(package.loaders, make_love_searcher(_G)) table.insert(fennel["macro-searchers"], make_love_searcher("_COMPILER")) +debug.traceback = fennel.traceback require("game")