blob: 6b23aa8528b470ed28b17f5bd74f9e4c5b79669e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
print "Lua eXtended helpers for Kogata v1"
do
local old_tostring = tostring
function tostring(x)
if type(x) == "table" then
if next(x) == nil then
return '{}'
end
local q = '{\n '
for k, v in pairs(x) do
if q:len() > 4 then
q = q .. ',\n '
end
q = q .. k .. ': ' .. tostring(v):gsub('\n', '\n ')
end
return q .. '\n}'
else
return old_tostring(x)
end
end
end
|