aboutsummaryrefslogtreecommitdiff
path: root/engines/sword25/util/lua/test/globals.lua
diff options
context:
space:
mode:
authorEugene Sandulenko2010-07-29 19:53:02 +0000
committerEugene Sandulenko2010-10-12 21:38:20 +0000
commita683a420a9e43705c972b5e74d55e319729e1a81 (patch)
treebde6e4abd417bdfaec120aa951da9a19be36b654 /engines/sword25/util/lua/test/globals.lua
parent7723d91c957d07205c51be32498d45cd0a78568f (diff)
downloadscummvm-rg350-a683a420a9e43705c972b5e74d55e319729e1a81.tar.gz
scummvm-rg350-a683a420a9e43705c972b5e74d55e319729e1a81.tar.bz2
scummvm-rg350-a683a420a9e43705c972b5e74d55e319729e1a81.zip
SWORD25: Importing original sources
svn-id: r53171
Diffstat (limited to 'engines/sword25/util/lua/test/globals.lua')
-rwxr-xr-xengines/sword25/util/lua/test/globals.lua13
1 files changed, 13 insertions, 0 deletions
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