From: Matt S Trout Date: Mon, 18 Mar 2019 04:37:53 +0000 (+0000) Subject: expandify -bool X-Git-Tag: v2.000000~3^2~390 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=974be3fd094d4bc5292c95f8215e55d4e6961aa3;p=dbsrgits%2FSQL-Abstract.git expandify -bool --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 6e14594..6e090c4 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',