Tech, emailconfirmed, Administrators (Semantic MediaWiki), Curators (Semantic MediaWiki), Administrators
12,495
edits
Bongolium500 (talk | contribs) No edit summary Tag: Reverted |
Bongolium500 (talk | contribs) No edit summary Tag: Reverted |
||
Line 1: | Line 1: | ||
local p = {} | local p = {} | ||
local 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) |
edits