Modul:Rptchars

Version vom 16. Januar 2023, 18:57 Uhr von Xineohp1506 (Diskussion | Beiträge) (1 Version von wikinewsen:Module:Rptchars importiert)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)

Die Dokumentation für dieses Modul kann unter Modul:Rptchars/doc erstellt werden

local p = {}

function p.bound( )
	return 16
end

function p.leftBraces( frame )
	local x = frame.args[1]
	if (x == nil) then return "{" end
	x = tonumber( x )
	if (x == nil) then return "{" end
	if (x < 1) then return "" end
	return string.rep("{",math.min(math.floor(x),p.bound()))
end

function p.rightBraces( frame )
	local x = frame.args[1]
	if (x == nil) then return "}" end
	x = tonumber( x )
	if (x == nil) then return "}" end
	if (x < 1) then return "" end
	return string.rep("}",math.min(math.floor(x),p.bound()))
end

function p.leftSquareBrackets( frame )
	local x = frame.args[1]
	if (x == nil) then return "[" end
	x = tonumber( x )
	if (x == nil) then return "[" end
	if (x < 1) then return "" end
	return string.rep("[",math.min(math.floor(x),p.bound()))
end

function p.rightSquareBrackets( frame )
	local x = frame.args[1]
	if (x == nil) then return "]" end
	x = tonumber( x )
	if (x == nil) then return "]" end
	if (x < 1) then return "" end
	return string.rep("]",math.min(math.floor(x),p.bound()))
end

function p.leftAngleBrackets( frame )
	local x = frame.args[1]
	if (x == nil) then return "<" end
	x = tonumber( x )
	if (x == nil) then return "<" end
	if (x < 1) then return "" end
	return string.rep("<",math.min(math.floor(x),p.bound()))
end

function p.rightAngleBrackets( frame )
	local x = frame.args[1]
	if (x == nil) then return ">" end
	x = tonumber( x )
	if (x == nil) then return ">" end
	if (x < 1) then return "" end
	return string.rep(">",math.min(math.floor(x),p.bound()))
end

function p.equalSigns( frame )
	local x = frame.args[1]
	if (x == nil) then return "=" end
	x = tonumber( x )
	if (x == nil) then return "=" end
	if (x < 1) then return "" end
	return string.rep("=",math.min(math.floor(x),p.bound()))
end

return p