モジュール:サンドボックス/Query Kuma/Test

モジュールの解説[作成]
local p = {}
local result = {}

function p.main(frame)
	result = {}
	local parent = frame:getParent()
	local args = frame.args
	local pargs = parent and parent.args
	table.insert(result, '(')
	for k, v in pairs(args) do
		table.insert(result, 'args[' .. tostring(k) .. '] = ' .. mw.ustring.gsub(tostring(v), '%[', '[?'))
	end
	if pargs then
		for k, v in pairs(pargs) do
			table.insert(result, 'pargs[' .. tostring(k) .. '] = ' .. mw.ustring.gsub(tostring(v), '%[', '[?'))
		end
	end
	table.insert(result, ')')
	return table.concat(result, ', ')
end

return p