From: Matt S Trout Date: Tue, 4 Sep 2018 02:46:19 +0000 (+0000) Subject: negation expansion X-Git-Tag: v2.000000~3^2~502 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=34dce7975186c0f19d30b54d2273a672a140791a;p=dbsrgits%2FSQL-Abstract.git negation expansion --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index ef70e57..51ec3a2 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -556,6 +556,9 @@ sub _expand_expr_hashpair { if ($k eq '-nest') { return $self->_expand_expr($v); } + if (my ($rest) = $k =~/^-not[_ ](.*)$/) { + return $self->_expand_expr({ -not => { "-${rest}", $v } }, $logic); + } } else { if (!ref($v)) { return +{ $k => { $self->{cmp} => $v } };