View source for Module:LuaCall
Jump to navigation
Jump to search
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page.
local p={}
function p.main(frame)
local parent=frame.getParent(frame) or {}
local reserved_value={}
local reserved_function,reserved_contents
for k,v in pairs(parent.args or {}) do
if tonumber(v)~=NaN then v=tonumber(v) end
_G[k]=v -- transfer every parameter directly to the global variable table
-- debuglog=debuglog..k.."="..v.."</nowiki><br /><nowiki>"
end
for k,v in pairs(frame.args or {}) do
if tonumber(v)~=NaN then v=tonumber(v) end
_G[k]=v -- transfer every parameter directly to the global variable table
end
--- Alas Scribunto does NOT implement coroutines, according to
--- http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#string.format
--- this will not stop us from trying to implement one single lousy function call
if _G[1] then
reserved_function,reserved_contents=mw.ustring.match(_G[1],"^%s*(%a[^%s%(]*)%(([^%)]*)%)%s*$")
end
000
1:0
Template used on this page:
Return to Module:LuaCall.