From: Matt S Trout Date: Mon, 18 Mar 2019 04:34:37 +0000 (+0000) Subject: move -not to an expander X-Git-Tag: v2.000000~3^2~391 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=adf8f6bcb0ef530dd762f8ae9f7babe023105e5b;p=dbsrgits%2FSQL-Abstract.git move -not to an expander --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index a8cb5fc..6e14594 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -194,6 +194,7 @@ sub new { $opt{expand} = { -ident => '_expand_ident', -value => sub { +{ -bind => [ our $Cur_Col_Meta, $_[2] ] } }, + -not => sub { +{ -op => [ 'not', $_[0]->_expand_expr($_[2]) ] } }, }; return bless \%opt, $class; @@ -634,9 +635,6 @@ sub _expand_expr_hashpair { puke "-bool => undef not supported" unless defined($v); return $self->_expand_ident(-ident => $v); } - if ($k eq '-not') { - return { -op => [ 'not', $self->_expand_expr($v) ] }; - } if (my ($rest) = $k =~/^-not[_ ](.*)$/) { return +{ -op => [ 'not',