Fix bugs in Debugging.render() and Playfield:load().
Chris Pressey
7 months ago
22 | 22 | do_debug(what, function() print("--> (" .. s .. ")") end) |
23 | 23 | end |
24 | 24 | |
25 | local render = function(v, count) | |
25 | local render | |
26 | render = function(v, count) | |
26 | 27 | if not count then count = 0 end |
27 | 28 | if count > 100 then return "!!OVERFLOW!!" end |
28 | 29 | if type(v) == "table" then |
29 | 30 | local s = "{" |
30 | 31 | local key, value |
32 | -- FIXME it would be great if this could be sorted by key. | |
33 | -- alas, in Lua that will take a little work. | |
31 | 34 | for key, value in pairs(v) do |
32 | 35 | s = s .. render(key, count + 1) .. ": " .. render(value, count + 1) .. "," |
33 | 36 | end |