Module:DisplayLuaTableContents

local p={} function p.main(frame) local args=frame.args local pargs=frame.getParent(frame) local dispvar="mw" if pargs then dispvar=pargs.dispvar or pargs[1] or dispvar end if args then dispvar=args.dispvar or args[1] or dispvar end local base=_G[dispvar] local novar, containssomething if base then else base={};novar=yes end local output="Contents of the array '''" .. tostring(dispvar) .. "''':"  if novar then output = output .. " nil ." end local ns=0 local count=0 for i,j in pairs(base) do     containssomething="yes" output=output .. " mw." .. tostring (i) .. ":" .. tostring(j) if tostring(j)~= "table" then j={} end for a,b in pairs(j) do     output=output .. " mw." .. tostring(i) .. "." .. tostring(a) .. ":" .. tostring(b) if tostring(b)~="table" then b={} end for x,y in pairs(b) do     output=output .. " mw." .. tostring(i) .. "." .. tostring(a) .. "." .. tostring(x) .. ":" .. tostring(y) if tostring(y)~="table" then y={} end for w,z in pairs(y) do         output=output .. " -->" .. tostring(w) .. ":" .. tostring(z) if tostring(z)~="table" then z={} end for u,v in pairs(z) do               output=output .. " ->" .. tostring(u) .. ":" .. tostring(v) end end end end end --local getc=mw.title.getcontent --output=output .. " P.S.: mw.title.getcontent is:" .. tostring(getc) --if tostring(getc) == "function" then output = output .. " " .. tostring (getc(mw.title)) end if containssomething then else output = output .. " No pairs(" .. tostring(dispvar) .. ") found!" end return output end return p