Revision 6281 of "Модуль:Listing" on ukwikivoyage

-- мало б виводити всі аргументи фрейму
local p = {}
 
function _get(frame)
    --
end
 
--Parent args to _get func
function p.cl(frame)
    local origArgs
    -- If called via #invoke, use the args passed into the invoking template.
    -- Otherwise, for testing purposes, assume args are being passed directly in.
    if frame == mw.getCurrentFrame() then
        origArgs = frame:getParent().args
    else
        origArgs = frame
    end
 
    -- ParserFunctions considers the empty string to be false, so to preserve the previous 
    -- behavior of template, change any empty arguments to nil, so Lua will consider
    -- them false too.
    local args = {}
    for k, v in pairs(origArgs) do
        if v ~= '' then
            args[k] = v
        end
    end
    return _get(args)
end
return p