diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2016-10-04 11:40:27 +0900 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2016-10-04 11:40:27 +0900 |
commit | b3471ebcbedda83782396420fa2737bf784aab93 (patch) | |
tree | 4549a0a70204380c2770733dbf1fb945d2e0ce47 /lib | |
parent | a354644df7c3c49d2961c2fd4084078d2b68135a (diff) | |
download | gitano-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.lua | 11 |
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 "" |