local temp = k:gsub ('%d+', '#'); -- make a copy; digits replaced with single '#'
local enum = k:match ('%d+'); -- get the enumerator  
if alias_map[temp] then -- if this parameter is a recognized enumerated alias
pframe_args[alias_map[temp]:gsub('#', enum)] = v; -- use canonical name and replace '#' with enumerator and add to pframe_args
pframe_args[k] = nil; -- unset the alias
end
end
end
end  
-- pframe parameters that are _reused are 'reused' have the form something like this:
-- |chapter=}
-- where a parameter in the wrapping template is modified and then passed to the working template
-- using the same parameter name (in this example |chapter=)  
-- remove parameters that will be reused
for k, v in ipairs (reuse_list) do -- k is numerical index, v is canonical parameter name to ignore
if pframe_args[v] then -- if pframe_args has parameter that should be ignored
pframe_args[v] = nil; -- unset the ignored parameter
end
end  
pframe_args_get (pframe_args, args, exclude, _include_positional, list); -- add parameters and values to args that are not listed in the exclude table  
return template; -- args now has all default and live parameters, return working template name
end  
----------------------------< W R A P >----------------------------------------------------------------------  
Template entry point. Call this function to 'execute' the working template  
local function wrap
local args = {}; -- table of default and live parameters and their values to be passed to the wrapped template
local template; -- the name of the working template  
template = _main (, args, false); -- get default and live parameters and the name of the working template
if not template then -- template name is required
return error_msg; -- emit error message and abandon if template name not present
end  
return :expandTemplate {title=template, args=args}; -- render the working template
end  
----------------------------< L I S T >----------------------------------------------------------------------  
Template entry point. Call this function to 'display' the source for the working template. This function added
as a result of a TfD here: Wikipedia:Templates_for_discussion/Log/2018_April_28#Module:PassArguments  
This function replaces a similarly named function which was used in and  
Values in the args table are numerically indexed strings in the form 'name=value'  
local function list(, do_link)
local args = {}; -- table of default and live parameters and their values to be passed to the listed template
local template; -- the name of the listed template  
template = _main (, args, true); -- get default and live parameters and the name of the listed template
if not template then -- template name is required
return error_msg; -- emit error message and abandon if template name not present
end
if do_link then
template = ('%s'):format(:expandTemplate{ title='Transclude', args = {template} }, template)
end
table.sort(args)
for i = 1, #args do
local stripped = args[i]:match('^' .. i .. '=([^=]*)$')
if stripped then args[i] = stripped else break end
end
return :preprocess(table.concat({
'<code>&#123;&#123;',
template,
('<wbr>'):rep(#args):format(unpack(args)), '&#125;&#125;</code>'})); -- render the template
end  
local function link
return list(, true)
end  
----------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------  
return {
link = link,
list = list,
wrap = wrap,
};