Module:Smyth: Difference between revisions

Content deleted Content added
m Pppery moved page Module:Perseus to Module:Smyth without leaving a redirect: Match name with template
Remove pointless declarations of functions as local variables
Line 6:
}
}
 
local find, match, gmatch = mw.ustring.find, mw.ustring.match, mw.ustring.gmatch
 
local function makeURL(resourceCode, part, code)
Line 52 ⟶ 50:
if sectionParameter then
n = 1
if mw.ustring.find(sectionParameter, "[^%d%s]") then
for number, postscript, separator in mw.ustring.gmatch(sectionParameter, "(%d+ ?%u?)(%.?[%l%d]?)(%p?[^%d]*)") do
sections[n], postscripts[n], separators[n] = number, postscript, separator
if sections[n] == "" or sections[n] == nil then
Line 61 ⟶ 59:
end
else
sections[1], separators[1] = mw.ustring.match(sectionParameter, "(%d+)"), ""
end
else
Line 91 ⟶ 89:
function export.SmythPart(frame)
local sectionParameter = frame.args[1]
local section = mw.ustring.match(sectionParameter, "(%d+)")
return Smyth(section).Part
end