local u="    "local function q(l,r)r=r or 0 local P={}if typeof(l)=="\116\097\098\108\101"then table.insert(P,"\123\n")for l,y in l do table.insert(P,u:rep(r+1))table.insert(P,tostring(l))table.insert(P," \061 ")table.insert(P,q(y,r+1))table.insert(P,"\n")end table.insert(P,u:rep(r))table.insert(P,"\125")elseif typeof(l)=="\115\116\114\105\110\103"then table.insert(P,string.format("\037\113",l))table.insert(P," \040\115\116\114\105\110\103\041")else table.insert(P,tostring(l))table.insert(P," \040")table.insert(P,typeof(l))table.insert(P,"\041")end return table.concat(P,"")end return q
local indent = "    "

local function prettyPrint(value, indentLevel)
	indentLevel = indentLevel or 0
	local output = {}

	if typeof(value) == "table" then
		table.insert(output, "{\n")

		for tableKey, tableValue in value do
			table.insert(output, indent:rep(indentLevel + 1))
			table.insert(output, tostring(tableKey))
			table.insert(output, " = ")

			table.insert(output, prettyPrint(tableValue, indentLevel + 1))
			table.insert(output, "\n")
		end

		table.insert(output, indent:rep(indentLevel))
		table.insert(output, "}")
	elseif typeof(value) == "string" then
		table.insert(output, string.format("%q", value))
		table.insert(output, " (string)")
	else
		table.insert(output, tostring(value))
		table.insert(output, " (")
		table.insert(output, typeof(value))
		table.insert(output, ")")
	end

	return table.concat(output, "")
end

return prettyPrint
