"ഘടകം:Decimals" എന്ന താളിന്റെ പതിപ്പുകൾ തമ്മിലുള്ള വ്യത്യാസം

Content deleted Content added
imported>Izkala
Catch expr errors
Undid revision 671492526 by Alakzi (talk): This results in errors being silently suppressed, rather than doing anything to actually fix them.
വരി 2:
 
local p = {}
 
local function parseExpr(...)
return pcall(mw.ext.ParserFunctions.expr, ...)
end
 
function p._main(n, d)
Line 29 ⟶ 25:
function p.main(frame)
local args, pargs = frame.args, frame:getParent().args
return p._main(mw.ext.ParserFunctions.expr(args[1] or pargs[1]), mw.ext.ParserFunctions.expr(args[2] or pargs[2]))
 
local success1, result1 = parseExpr(args[1] or pargs[1])
local success2, result2 = parseExpr(args[2] or pargs[2])
if success1 and success2 then
return p._main(result1, result2)
end
end
 
"https://ml.wikipedia.org/wiki/ഘടകം:Decimals" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്