the selctor patterns explained

This commit is contained in:
Wouter Scherphof 2013-03-24 23:30:34 +01:00
parent 591e7ebc8b
commit 77f24f93be

View File

@ -107,7 +107,11 @@ local function select(self, s)
end end
if part == "*" then goto nextpart end if part == "*" then goto nextpart end
local excludes, filter = Set:new() local excludes, filter = Set:new()
for t, w in string.gmatch(part, "([:%[#.]?)([^:%(%[#.%]%)]+)%]?%)?") do for t, w in string.gmatch(part,
"([:%[#.]?)" .. -- t = an optional :, [, #, or .
"([^:%(%[#.%]%)]+)" .. -- w = 1 or more of anything not :, (, [, #, ., ], or )
"%]?%)?" -- followed by an uncaptured optional ] and/or )
) do
if t == ":" then filter = w goto nextw end if t == ":" then filter = w goto nextw end
local match = sets[t][w] local match = sets[t][w]
if filter == "not" then if filter == "not" then