Module:MOS intervals: Difference between revisions

Ganaram inukshuk (talk | contribs)
m Lookup-and-split function returns "mos" if lookup fails to find a tamnams mosprefix
Ganaram inukshuk (talk | contribs)
mNo edit summary
Line 52: Line 52:
local parsed = {}
local parsed = {}
for entry in string.gmatch(unparsed, '([^-]+)') do
local trimmed = entry:gsub("^%s*(.-)%s*$", "%1")
table.insert(parsed, trimmed) -- Add to array
end
if parsed == nil then
if unparsed == nil then
return "mos"
return "mos"
else
else
for entry in string.gmatch(unparsed, '([^-]+)') do
local trimmed = entry:gsub("^%s*(.-)%s*$", "%1")
table.insert(parsed, trimmed) -- Add to array
end
return parsed[1]
return parsed[1]
end
end