Module:Electowidget: Difference between revisions

Still futzing
(Adding a function to parse the abif contents)
(Still futzing)
Line 2:
-- Date: ~~~~
-- Comment: I think I'd like the new version of Electowidget to use ABIF
 
local p = {}
-- Function to parse the line and return a Lua native data structure
function p.parse_prefs_line(line)
if not line or line == '' then
return {}
else
return line
end
 
local qty, prefs = line:match('(%d+):%s*(.*)')
local prefs_table = {}
Line 25 ⟶ 30:
return {
qty = tonumber(qty),
prefs = prefs_table or {},
comment = nil,
orderedlist = true