lua/tests/Smoke/globals.lua
Petr Šabata ac515e8d0a RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/lua#3e03dd9b69dff7f2f87fff9e2f8cc2403fea046a
2020-10-15 18:42:25 +02:00

24 lines
373 B
Lua

-- 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,"")