From 2d1df4714e2736dbde7855ddcd76b4c1de822fa5 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Mon, 23 Jan 2012 21:58:02 +1000 Subject: Added a big bunch of example lua scripts for testing the speed of lua compiling. --- LuaSL/testLua/yueliang-0.4.1/test_lua/5.0/globals.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 LuaSL/testLua/yueliang-0.4.1/test_lua/5.0/globals.lua (limited to 'LuaSL/testLua/yueliang-0.4.1/test_lua/5.0/globals.lua') diff --git a/LuaSL/testLua/yueliang-0.4.1/test_lua/5.0/globals.lua b/LuaSL/testLua/yueliang-0.4.1/test_lua/5.0/globals.lua new file mode 100644 index 0000000..d4c20e1 --- /dev/null +++ b/LuaSL/testLua/yueliang-0.4.1/test_lua/5.0/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.1