33 if type(o) == "number" then |
33 if type(o) == "number" then |
34 func(t, tostring(o)); |
34 func(t, tostring(o)); |
35 elseif type(o) == "string" then |
35 elseif type(o) == "string" then |
36 func(t, (("%q"):format(o):gsub("\\\n", "\\n"))); |
36 func(t, (("%q"):format(o):gsub("\\\n", "\\n"))); |
37 elseif type(o) == "table" then |
37 elseif type(o) == "table" then |
38 if next(o) then |
38 if next(o) ~= nil then |
39 func(t, "{\n"); |
39 func(t, "{\n"); |
40 for k,v in pairs(o) do |
40 for k,v in pairs(o) do |
41 func(t, indent(ind)); |
41 func(t, indent(ind)); |
42 func(t, "["); |
42 func(t, "["); |
43 func(t, basicSerialize(k)); |
43 func(t, basicSerialize(k)); |