mirror of
https://github.com/samba-team/samba.git
synced 2025-01-15 23:24:37 +03:00
390f19b649
Available under the MIT license. Adding it to see how the build farm likes it. They claim to be 100% pure ANSI C and compile everywhere. Lets see. If it breaks badly, we can remove it again.
14 lines
418 B
Lua
14 lines
418 B
Lua
-- reads luac listings and reports global variable usage
|
|
-- lines where a global is written to are marked with "*"
|
|
-- typical usage: luac -p -l file.lua | lua globals.lua | sort | lua table.lua
|
|
|
|
while 1 do
|
|
local s=io.read()
|
|
if s==nil then break end
|
|
local ok,_,l,op,g=string.find(s,"%[%-?(%d*)%]%s*([GS])ETGLOBAL.-;%s+(.*)$")
|
|
if ok then
|
|
if op=="S" then op="*" else op="" end
|
|
io.write(g,"\t",l,op,"\n")
|
|
end
|
|
end
|