summaryrefslogtreecommitdiff
path: root/com32/lua/test/table.lua
diff options
context:
space:
mode:
authorAlexey Zaytsev <alexey.zaytsev@gmail.com>2008-07-18 00:47:28 +0400
committerAlexey Zaytsev <zaytsev.a@protei.ru>2008-07-18 00:47:28 +0400
commit5589a6e296427110474e74fbbd3ef9c512fe0ff4 (patch)
tree388c521c3b6262ccda9385fa29f36df7a4851e6d /com32/lua/test/table.lua
parentfa6a60e177786fea2b834691a66319fd3b177038 (diff)
downloadsyslinux-5589a6e296427110474e74fbbd3ef9c512fe0ff4.tar.gz
Import Lua 5.1.3
Signed-off-by: Alexey Zaytsev <zaytsev.a@protei.ru>
Diffstat (limited to 'com32/lua/test/table.lua')
-rw-r--r--com32/lua/test/table.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/com32/lua/test/table.lua b/com32/lua/test/table.lua
new file mode 100644
index 00000000..235089c0
--- /dev/null
+++ b/com32/lua/test/table.lua
@@ -0,0 +1,12 @@
+-- make table, grouping all data for the same item
+-- input is 2 columns (item, data)
+
+local A
+while 1 do
+ local l=io.read()
+ if l==nil then break end
+ local _,_,a,b=string.find(l,'"?([_%w]+)"?%s*(.*)$')
+ if a~=A then A=a io.write("\n",a,":") end
+ io.write(" ",b)
+end
+io.write("\n")