跳转到内容

模組:Vgname/testcases

维基百科,自由的百科全书

这是本页的一个历史版本,由風中的刀劍留言 | 贡献2015年1月24日 (六) 07:12编辑。这可能和当前版本存在着巨大的差异。

local yesno = require('Module:Yesno')
local getArgs = require('Module:Arguments').getArgs

local function makeInvokeFunc(funcName)
	return function (frame)
		local args = getArgs(frame, {
		parentOnly = true;
		valueFunc = function (key, value)
			if value == nil then
				return ''
			else
				return value
			end
		end;
		})
		return p[funcName](args)
	end
end

local p = {}
 
local function func1(args)
	return args[1]
	-- Code for the first function goes here.
end

local function func2(args)
	-- Code for the second function goes here.
end

p.main = makeInvokeFunc('_main')

function p._main(args)

	return func1()
end

return p