Module:Sandbox/User:Teamtoto/LuaModule: Difference between revisions

no edit summary
mNo edit summary
No edit summary
Line 2: Line 2:
local util_table = require('Module:Table Utility')
local util_table = require('Module:Table Utility')
local p = {}
local p = {}
function p.main(frame)
local frame = mw.getCurrentFrame()
if frame.args ~= nil and frame.args ~= '' then
-- argument in template call has to be named so the equal sign doesn't break input
if frame.args["code"]~= nil and frame.args["code"] ~= '' then
return p.a(mw.text.trim(frame:preprocess(frame.args[1])))
else
    error "There was no code in your input!"
end
end
end


function p.a(code)
function p.a(code)