From a683a420a9e43705c972b5e74d55e319729e1a81 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 29 Jul 2010 19:53:02 +0000 Subject: SWORD25: Importing original sources svn-id: r53171 --- engines/sword25/util/lua/test/globals.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 engines/sword25/util/lua/test/globals.lua (limited to 'engines/sword25/util/lua/test/globals.lua') diff --git a/engines/sword25/util/lua/test/globals.lua b/engines/sword25/util/lua/test/globals.lua new file mode 100755 index 0000000000..d4c20e1565 --- /dev/null +++ b/engines/sword25/util/lua/test/globals.lua @@ -0,0 +1,13 @@ +-- 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 -- cgit v1.2.3