summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/rewrite.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/rewrite.lua b/tools/rewrite.lua
index 503a0c8..e26a8c3 100644
--- a/tools/rewrite.lua
+++ b/tools/rewrite.lua
@@ -1,7 +1,7 @@
--[[Script to rewrite a stack traceback in terms of moonscript instead of lua]]
for data in io.lines() do
- local filename, linenum, rest = data:gmatch("%s+(.*%.lua):(%d+):(.*)")()
+ local spaces, filename, linenum, rest = data:gmatch("(%s*)(.*%.lua):(%d+):(.*)")()
if filename and linenum and rest then
local moonfilename = filename:gsub(".lua$",".moon")
@@ -18,7 +18,7 @@ for data in io.lines() do
for line in debugfile:lines() do
_,_,pos,lua,moon = line:find("(%d+)%s+(%d+):%b[] >> (%d+)")
if tonumber(linenum) == tonumber(lua) then
- print(string.format("\t%s:%d: %s",moonfilename,moon,rest))
+ print(string.format("%s%s:%d: %s",spaces,moonfilename,moon,rest))
goto next
end
end