Merge pull request #78 from palmettos/master

Fixed #77 - Allow registering functions to signal patterns
This commit is contained in:
Matthias Richter 2017-03-16 20:18:34 +01:00 committed by GitHub
commit 22d0fb6960

View File

@ -64,6 +64,13 @@ function Registry:emitPattern(p, ...)
end end
end end
function Registry:registerPattern(p, f)
for s in pairs(self) do
if s:match(p) then self:register(s, f) end
end
return f
end
function Registry:removePattern(p, ...) function Registry:removePattern(p, ...)
for s in pairs(self) do for s in pairs(self) do
if s:match(p) then self:remove(s, ...) end if s:match(p) then self:remove(s, ...) end