fix placeholder quoting
[scpubgit/Q-Branch.git] / lib / SQL / Abstract / Tree.pm
index 4760672..ee8509c 100644 (file)
@@ -63,7 +63,7 @@ my @expression_start_keywords = (
   )',
   'ON',
   'WHERE',
-  'VALUES',
+  '(?: DEFAULT \s+ )? VALUES',
   'EXISTS',
   'GROUP \s+ BY',
   'HAVING',
@@ -167,7 +167,7 @@ my %profiles = (
         ? do {
           my $c = \&Term::ANSIColor::color;
           (
-            placeholder_surround => [$c->('black on_cyan'), $c->('reset')],
+            placeholder_surround => [q(') . $c->('black on_magenta'), $c->('reset') . q(')],
             colormap => {
               select        => [$c->('red'), $c->('reset')],
               'insert into' => [$c->('red'), $c->('reset')],
@@ -248,7 +248,7 @@ sub parse {
       defined $token
         and
       length $token
-        and 
+        and
       $token =~ /\S/
     );
   }
@@ -318,8 +318,8 @@ sub _recurse_parse {
     elsif ( $token =~ / ^ $expr_start_re $ /x ) {
       my $op = uc $token;
       my $right = $self->_recurse_parse($tokens, PARSE_IN_EXPR);
-      $left = $left ? [ $left,  [$op => [$right] ]]
-                   : [ $op => [$right] ];
+      $left = $left ? [ $left,  [$op => [$right||()] ]]
+                   : [ $op => [$right||()] ];
     }
     # NOT
     elsif ( $token =~ /^ NOT $/ix ) {