From: Matt S Trout Date: Mon, 1 Apr 2019 01:30:54 +0000 (+0000) Subject: teach between to work as a unop X-Git-Tag: v2.000000~3^2~302 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1e0dbb8d4fe8f7cc9b14204aa8f356e86fa722aa;p=dbsrgits%2FSQL-Abstract.git teach between to work as a unop --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 285039b..0f524ff 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -210,6 +210,11 @@ sub new { }, -between => '_expand_between', -not_between => '_expand_between', + -op => sub { + my ($self, $node, $args) = @_; + my ($op, @opargs) = @$args; + +{ $node => [ $op, map $self->expand_expr($_), @opargs ] }; + }, }; $opt{expand_op} = { @@ -997,7 +1002,7 @@ sub _expand_between { } return +{ -op => [ $op, - $self->expand_expr($k, -ident), + $self->expand_expr(ref($k) ? $k : { -ident => $k }), @rhs ] } }