Module:Proposal support: Difference between revisions

From Tardis Wiki, the free Doctor Who reference
no edit summary
No edit summary
Tag: Reverted
No edit summary
Tag: Reverted
Line 1: Line 1:
local p = {}
local p = {}
local dump = require('Module:SMW').dump
 
--from [[Module:SMW]]
dump = function(entity, indent, omitType)
    local entity = entity
    local indent = indent and indent or ''
    local omitType = omitType
    if type( entity ) == 'table' then
        local subtable
        if not omitType then
            subtable = '(table)[' .. #entity .. ']:'
        end
        indent = indent .. '\t'
        for k, v in pairs( entity ) do
            subtable = concat(subtable, '\n', indent, k, ': ', dump(v, indent, omitType))
        end
        return subtable
    elseif type( entity ) == 'nil' or type( entity ) == 'function' or type( entity ) == 'boolean' then
        return ( not omitType and '(' .. type(entity) .. ') ' or '' ) .. print(entity)
    elseif type( entity ) == 'string' then
        entity = mw.ustring.gsub(mw.ustring.gsub(entity, "\\'", "'"), "'", "\\'")
        return concat(omitType or '(string) ', '\'', entity, '\'')
    else
        -- number value expected
        return concat(omitType or '(' .. type( entity ) .. ') ', entity)
    end
end
 


function p.proposalSupport(frame)
function p.proposalSupport(frame)
Cookies help us deliver our services. By using our services, you agree to our use of cookies.