actually fix indentation

This commit is contained in:
Kistaro Windrider 2023-09-30 14:03:06 -07:00
parent a4bf3f616a
commit 4ae0d05b47
Signed by: kistaro
SSH Key Fingerprint: SHA256:TBE2ynfmJqsAf0CP6gsflA0q5X5wD5fVKWPsZ7eVUg8

View File

@ -308,19 +308,20 @@ function puke(item, indent, seen, hidekey)
for _=1,indent do for _=1,indent do
pfx ..= " " pfx ..= " "
end end
local xpfx = pfx.." "
if item.is_linked_list then if item.is_linked_list then
local ret,n,xpfx = "linked_list <",0,pfx.." " local ret,n = "linked_list <",0
item:strip(function(x) item:strip(function(x)
n += 1 n += 1
ret ..= xpfx..tostr(n)..": "..puke(x, indent+1, seen, "next") ret ..= xpfx..tostr(n)..": "..puke(x, indent+2, seen, "next")
end) end)
return ret..pfx..">" return ret..pfx..">"
end end
local ret = "{" local ret = "{"
for k, v in pairs(item) do for k, v in pairs(item) do
if (k ~= hidekey) ret ..= pfx..tostr(k)..": "..puke(v, indent+1, seen) if (k ~= hidekey) ret ..= xpfx..tostr(k)..": "..puke(v, indent+2, seen)
end end
return ret..pfx.."}" return ret..pfx.."}"
end end