Module:Decimals: Difference between revisions

214 bytes added ,  2 years ago
m
1 revision imported
(Undid revision 671492526 by Alakzi (talk): This results in errors being silently suppressed, rather than doing anything to actually fix them.)
 
m (1 revision imported)
 
(2 intermediate revisions by 2 users not shown)
Line 25:
function p.main(frame)
local args, pargs = frame.args, frame:getParent().args
local function work()
return p._main(mw.ext.ParserFunctions.expr(args[1] or pargs[1]), mw.ext.ParserFunctions.expr(args[2] or pargs[2]))
return p._main(
return p._main( mw.ext.ParserFunctions.expr(args[1] or pargs[1]), mw.ext.ParserFunctions.expr(args[2] or pargs[2]))
mw.ext.ParserFunctions.expr(args[2] or pargs[2])
)
end
local success, result = pcall(work)
if success then
return result
end
local errtext = args.error or pargs.error
if errtext then
return errtext
end
error(result, 0)
end