diff options
Diffstat (limited to 'tests/Smoke/globals.lua')
-rw-r--r-- | tests/Smoke/globals.lua | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/Smoke/globals.lua b/tests/Smoke/globals.lua new file mode 100644 index 0000000..e053f36 --- /dev/null +++ b/tests/Smoke/globals.lua @@ -0,0 +1,23 @@ +-- 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,"") |