From: Matt S Trout Date: Mon, 18 Mar 2019 04:37:53 +0000 (+0000) Subject: expandify -bool X-Git-Tag: v1.90_01~369 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=883e036241e3f4f339c5021730aa4f1280d2130c;p=dbsrgits%2FSQL-Abstract.git expandify -bool --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 1a8705d..5aaeee0 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -195,6 +195,14 @@ sub new { -ident => '_expand_ident', -value => sub { +{ -bind => [ our $Cur_Col_Meta, $_[2] ] } }, -not => sub { +{ -op => [ 'not', $_[0]->_expand_expr($_[2]) ] } }, + -bool => sub { + my ($self, undef, $v) = @_; + if (ref($v)) { + return $self->_expand_expr($v); + } + puke "-bool => undef not supported" unless defined($v); + return $self->_expand_ident(-ident => $v); + }, }; return bless \%opt, $class; @@ -628,13 +636,6 @@ sub _expand_expr_hashpair { } return $self->_expand_expr($v); } - if ($k eq '-bool') { - if (ref($v)) { - return $self->_expand_expr($v); - } - puke "-bool => undef not supported" unless defined($v); - return $self->_expand_ident(-ident => $v); - } if (my ($rest) = $k =~/^-not[_ ](.*)$/) { return +{ -op => [ 'not',