Module:LuaCall: Difference between revisions

From Test Wiki
Content deleted Content added
m step
Found a bug at the end - wrong variable
Line 39: Line 39:
local reserved_call=reserved_arraypart[reserved_function]
local reserved_call=reserved_arraypart[reserved_function]
debuglog=debuglog..tostring(reserved_call)
debuglog=debuglog..tostring(reserved_call)
if type(reserved_call)~="function" then
-- while reserved_function do
return tostring(reserved_call)
-- if reserved_call then reserved_call=reserved_call[mw.ustring.match(reserved_function,"^(%a[^%.]*)%.") or reserved_call] else debuglog=debuglog.."NIL error" end
-- local reserved_function=mw.ustring.match(reserved_function,"^%a[^%.]*%.(.*)$")
elseif reserved_debug or not reserved_function then return frame.preprocess(frame,"<nowiki>"..debuglog.."</nowiki>")
else return reserved_call(unpack(reserved_value))
-- debuglog=debuglog.."->"..reserved_function.."</nowiki><br /><nowiki>"
-- end
end
debuglog=debuglog.."Lookup _G value is "..tostring(reserved_call)
if reserved_debug or not reserved_function then return frame.preprocess(frame,"<nowiki>"..debuglog.."</nowiki>") end
return _G[reserved_function](unpack(reserved_contents or {}))
end
end
return p
return p