tests/fail/demo_globals.lua

Wed, 24 Nov 2010 02:52:37 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Wed, 24 Nov 2010 02:52:37 +0000
changeset 138
f9bb0e212d28
parent 57
3e148db7f933
permissions
-rw-r--r--

Replace error reporting code with calls to LVM.traceback()

-- globals.lua
-- show all global variables

local seen={}

function dump(t,i)
	seen[t]=true
	local s={}
	local n=0
	for k in pairs(t) do
		n=n+1 s[n]=k
	end
	table.sort(s)
	for k,v in ipairs(s) do
		print(i,v)
		v=t[v]
		if type(v)=="table" and not seen[v] then
			dump(v,i.."\t")
		end
	end
end

dump(_G,"")

mercurial