PageRenderTime 21ms CodeModel.GetById 17ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/Tukui/modules/unitframes/core/oUF/private.lua

http://github.com/Asphyxia/Tukui
Lua | 22 lines | 19 code | 3 blank | 0 comment | 4 complexity | 1cea86a07da0112d3714bf30baa50701 MD5 | raw file
 1local parent, ns = ...
 2local Private = ns.oUF.Private
 3
 4function Private.argcheck(value, num, ...)
 5	assert(type(num) == 'number', "Bad argument #2 to 'argcheck' (number expected, got "..type(num)..")")
 6
 7	for i=1,select("#", ...) do
 8		if type(value) == select(i, ...) then return end
 9	end
10
11	local types = strjoin(", ", ...)
12	local name = string.match(debugstack(2,2,0), ": in function [`<](.-)['>]")
13	error(("Bad argument #%d to '%s' (%s expected, got %s"):format(num, name, types, type(value)), 3)
14end
15
16function Private.print(...)
17	print("|cff33ff99oUF:|r", ...)
18end
19
20function Private.error(...)
21	Private.print("|cffff0000Error:|r "..string.format(...))
22end