Peter Münster wrote:
Hello,
Hey, it's really fun to code in lua: pattern matching, easy table manipulation and so on, I should have learned it earlier!
Since it's my first experience with lua, I would like to ask you for comments on the t-inifile.tex module, attached to this message.
I tried to implement a demo-mode, but there are two small problems: - I don't know how to use \savebuffer, all line-endings disappear in the saved file - the utf-thinspace is ignored
Cheers and thanks a lot to the luatex and MKIV developers!
i have no time to look into it ... a few comments ... inifile = {} ^^^ there are three predefined namespaces: userdata = userdata or { } thirddata = thirddata or { } document = document or { } in your case, use thirddata.inifile = { } -- just for debugging: print the table to stdout local function print_table() for i = 1,#inifile.t do print("") print(i, inifile.t[i].key) for k, v in pairs(inifile.t[i]) do print("", k, v) end print("") end end just do: print(table.serialize(thirddata.inifile.t) (there are quite some helpers defined in l-string, l-table cum suis) ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------