Module:Infobox: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
(use page name not infobox name for default subobject linking)
(Old version cut off after first nil)
Line 368: Line 368:
local func_name = func.name
local func_name = func.name
local func_params = func.params
local func_params = func.params
local func_fetched_params = {}
local n_params = #func_params
local i = 1
if n_params == 0 then
return func_name()
for _, func_param in ipairs(func_params) do
func_fetched_params[i] = self:get_param(func_param, version)
i = i + 1
end
end
local function get_params(i)
return func_name(unpack(func_fetched_params))
if i == n_params then
return self:get_param(func_params[i], version)
else
return self:get_param(func_params[i], version), get_params(i + 1)
end
end
return func_name(get_params(1))
else
else
table.insert(self.errors, 'Invalid param definition for '..param_name)
table.insert(self.errors, 'Invalid param definition for '..param_name)