Module:User:Litzsch/Sandbox

local Variables = {} local frame

local function callParserFunction( func, args ) if not frame then frame = mw.getCurrentFrame end return frame:callParserFunction( func, args ) end

local metatable = {}

metatable.__index = function( _, key ) local value = callParserFunction( '#var', key ) if value ~= '' then return value else return nil end end

metatable.__newindex = function( _, key, value ) local value = tostring( value ) callParserFunction( '#vardefine', { key, value } ) end

setmetatable( Variables, metatable )

return Variables