tests/fail/demo_globals.lua

Wed, 24 Nov 2010 02:53:15 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Wed, 24 Nov 2010 02:53:15 +0000
changeset 139
055fe658d0b2
parent 57
3e148db7f933
permissions
-rw-r--r--

Implement string.find (mostly) and string.sub

-- 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