45,660
edits
No edit summary |
No edit summary |
||
Line 27: | Line 27: | ||
end | end | ||
function | function detect_decl(word, number, class) | ||
if number and class then | if number and class then | ||
local decl = number .. "-" .. class | local decl = number .. "-" .. class | ||
Line 35: | Line 34: | ||
for ending, decl in pairs(endings) do | for ending, decl in pairs(endings) do | ||
if find(word, ending .. "$") then | if find(word, ending .. "$") then | ||
return decl, | return decl, {sub(word, 1, -(#ending + 1))} | ||
end | end | ||
end | end | ||
Line 62: | Line 61: | ||
numbers = {parent_args[1]} | numbers = {parent_args[1]} | ||
else | else | ||
decl_type, numbers = | decl_type, numbers = detect_decl(word, parent_args.n, parent_args.c) | ||
end | end | ||
end | end | ||
Line 72: | Line 71: | ||
args = require("Module:parameters").process(parent_args, alldata[decl_type].params, true) | args = require("Module:parameters").process(parent_args, alldata[decl_type].params, true) | ||
if | if numbers then | ||
for i, | for i, number in ipairs(numbers) do | ||
args[i] = | args[i] = number | ||
end | end | ||
end | end |