From 77f24f93be6f9f36ed24c637246815ee75766aa1 Mon Sep 17 00:00:00 2001 From: Wouter Scherphof Date: Sun, 24 Mar 2013 23:30:34 +0100 Subject: [PATCH] the selctor patterns explained --- ElementNode.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ElementNode.lua b/ElementNode.lua index 73ebb56..650cd6a 100644 --- a/ElementNode.lua +++ b/ElementNode.lua @@ -107,7 +107,11 @@ local function select(self, s) end if part == "*" then goto nextpart end 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 local match = sets[t][w] if filter == "not" then