local getArgs = require('Module:Arguments').getArgs
local forLoop = require('Module:For loop')._main
local p = {}

function p.main(frame)
	local moduleArgs = getArgs(frame, {frameOnly = true, trim = false, removeBlanks = false})
	local callerArgs = getArgs(frame, {parentOnly = true})
	local allArgs = {}
	
	-- Increase index of arguments of callerArgs by 1 and add to allArgs
	for i, v in ipairs(callerArgs) do
		allArgs[i + 1] = v
	end
	
	-- Add arguments of moduleArgs to allArgs
	for k, v in pairs(moduleArgs) do
		allArgs[k] = v
	end
	
	return forLoop(allArgs)
end

return p