Skip to content

Instantly share code, notes, and snippets.

@spotco
Created March 17, 2019 01:33
Show Gist options
  • Select an option

  • Save spotco/d4afc5b8115faf76eef8df7679f58fef to your computer and use it in GitHub Desktop.

Select an option

Save spotco/d4afc5b8115faf76eef8df7679f58fef to your computer and use it in GitHub Desktop.
locals.lua
return function()
local rtv = {}
local level = 1
while true do
local level_table = {}
local ln, lv = debug.getlocal(2, level)
if ln ~= nil then
level_table[ln] = lv
else
break
end
rtv[level] = level_table
level = level + 1
end
return rtv
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment