From: Matt S Trout Date: Wed, 27 Mar 2019 01:25:39 +0000 (+0000) Subject: normalise ops to foo, foo_bar etc. X-Git-Tag: v1.90_01~296 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e57d8650c757f2cf939ab03d2e2f584c6f6ce7f2;p=dbsrgits%2FSQL-Abstract.git normalise ops to foo, foo_bar etc. --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 6043a43..6996a7d 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -702,12 +702,12 @@ sub _expand_expr_hashpair_scalar { sub _expand_expr_hashpair_op { my ($self, $k, $v) = @_; - (my $op = $k) =~ s/^-(?=\w)//; + s/^-(?=\w)//, s/ +/_/g for my $op = lc $k; $self->_assert_pass_injection_guard($op); # Ops prefixed with -not_ get converted - if (my ($rest) = $op =~/^not[_ ](.*)$/) { + if (my ($rest) = $op =~/^not_(.*)$/) { return +{ -op => [ 'not', $self->_expand_expr({ "-${rest}", $v }) @@ -717,6 +717,8 @@ sub _expand_expr_hashpair_op { { # Old SQLA compat + my $op = join(' ', split '_', $op); + # the old special op system requires illegality for top-level use if (