op dwim should require *only* non-word chars
[dbsrgits/SQL-Abstract.git] / lib / SQL / Abstract.pm
index b681900..74f359b 100644 (file)
@@ -28,7 +28,7 @@ BEGIN {
 # GLOBALS
 #======================================================================
 
-our $VERSION  = '1.90_01';
+our $VERSION  = '1.90_02';
 
 # This would confuse some packagers
 $VERSION = eval $VERSION if $VERSION =~ /_/; # numify for warning-free dev releases
@@ -301,11 +301,11 @@ sub new {
         s/\A\s+//, s/\s+\Z// for $sql;
         return [ $sql, @bind ];
       };
-      $opt{expand_op}{ident} = sub {
+      $opt{expand_op}{ident} = __PACKAGE__->make_unop_expander(sub {
         my ($self, undef, $body) = @_;
         $body = $body->from if Scalar::Util::blessed($body);
         $self->_expand_ident(ident => $body);
-      };
+      });
     }
   }
 
@@ -963,7 +963,7 @@ sub _expand_hashpair {
   }
   if ($k =~ /^-./) {
     return $self->_expand_hashpair_op($k, $v);
-  } elsif ($k =~ /^[^\w]/i) {
+  } elsif ($k =~ /^\W+$/) {
     my ($lhs, @rhs) = ref($v) eq 'ARRAY' ? @$v : $v;
     return $self->_expand_op(
       -op, [ $k, $self->expand_expr($lhs, -ident), @rhs ]
@@ -1284,7 +1284,7 @@ sub _expand_bool {
 sub _expand_list {
   my ($self, undef, $expr) = @_;
   return { -op => [
-    ',', map $self->expand_expr($_), 
+    ',', map $self->expand_expr($_),
           @{$expr->{-op}}[1..$#{$expr->{-op}}]
   ] } if ref($expr) eq 'HASH' and ($expr->{-op}||[''])->[0] eq ',';
   return +{ -op => [ ',',