Module:languages: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 836: Line 836:


--[==[Given a list of types as strings, returns true if the language has all of them.]==]
--[==[Given a list of types as strings, returns true if the language has all of them.]==]
function Language:hasType(...)
function Language:hasType(self, ...)
local args, types = {...}, self:getTypes()
local n = select("#", ...)
for i = 1, #args do
if n == 0 then
error("Must specify at least one type.")
end
local types = self:getTypes()
if not types[...] then
return false
elseif n == 1 then
return true
end
local args = {...}
for i = 2, n do
if not types[args[i]] then
if not types[args[i]] then
return false
return false

Navigation menu