-- 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.luawhile1dolocals=io.read()ifs==nilthenbreakendlocalok,_,l,op,g=string.find(s,"%[%-?(%d*)%]%s*([GS])ETGLOBAL.-;%s+(.*)$")ifokthenifop=="S"thenop="*"elseop=""endio.write(g,"\t",l,op,"\n")endend