summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2016-10-04 11:40:27 +0900
committerDaniel Silverstone <dsilvers@digital-scurf.org>2016-10-04 11:40:27 +0900
commitb3471ebcbedda83782396420fa2737bf784aab93 (patch)
tree4549a0a70204380c2770733dbf1fb945d2e0ce47 /lib
parenta354644df7c3c49d2961c2fd4084078d2b68135a (diff)
downloadgitano-b3471ebcbedda83782396420fa2737bf784aab93.tar.gz
Provide is, {start,end}s{,with}, with auto-inversion; and 'not' without; as lace match typesv0.1
Diffstat (limited to 'lib')
-rw-r--r--lib/gitano/lace.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/gitano/lace.lua b/lib/gitano/lace.lua
index 48b2626..033d6be 100644
--- a/lib/gitano/lace.lua
+++ b/lib/gitano/lace.lua
@@ -77,6 +77,14 @@ local match_types = {
end
}
+-- Match aliases (auto-inverted)
+match_types.is = match_types.exact
+match_types.starts = match_types.prefix
+match_types.ends = match_types.suffix
+match_types.startswith = match_types.prefix
+match_types.endswith = match_types.suffix
+
+-- Inverted matches
do
local inverted_matches = {}
for k, v in pairs(match_types) do
@@ -87,6 +95,9 @@ do
end
end
+-- Match aliases (not auto-inverted)
+match_types["not"] = match_types["!is"]
+
local function _do_simple_match(ctx, key, matchtype, value)
value = util.process_expansion(ctx, value)
local kk = ctx[key] or ""