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: v1.90_01~281 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8d8f6cc8c8edc9caa6a2c672dc046a1162ebf996;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 aa034b1..bc7f7e5 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 ] } }