Jump to content

Module:AshLua

Unchecked
From Wikipedia

Documentation for this module may be created at Module:AshLua/doc

local p = {}

local wmfrInt = require('Module:AshLuaInternal')
local internal = wmfrInt.internal

function p.foo(frame)
	return internal(frame, 'Hello ')
end

function p.bar(frame)
	return internal(frame, 'Bye ')
end

function p.iter(frame)
	result = ''
	for index, value in ipairs(frame.args) do
		result = result .. '* ' .. tostring(index) .. ' → ' .. value .. '\n'
	end
	return result
end

function p.iter2(frame)
	result = ''
	for key, value in pairs(frame.args) do
		result = result .. '* ' .. key .. ' → ' .. value .. '\n'
	end
	return result
end

return p

-- {{#invoke:WMFRLua|foo|Wikipédia|baz=toi|bar=moi}}
-- {{#invoke:WMFRLua|bar|Wikipédia|baz=toi|bar=moi}}