whitespace tests
[dbsrgits/SQL-Abstract.git] / lib / SQL / Abstract / Tree.pm
index 18cc184..0110fc5 100644 (file)
@@ -252,12 +252,11 @@ sub whitespace {
    my ($self, $keyword, $depth) = @_;
 
    my $before = '';
-   my $after  = ' ';
    if (defined $self->indentmap->{lc $keyword}) {
       $before = $self->newline . $self->indent($depth + $self->indentmap->{lc $keyword});
    }
    $before = '' if $depth == 0 and lc $keyword eq 'select';
-   return [$before, $after];
+   return [$before, ' '];
 }
 
 sub indent { ($_[0]->indent_string||'') x ( ( $_[0]->indent_amount || 0 ) * $_[1] ) }
@@ -291,7 +290,7 @@ sub unparse {
     return '(' .
       join(' ',
         map $self->unparse($_, $depth + 2), @{$cdr}) .
-    (_is_select($cdr)?( $self->newline||'' ).$self->indent($depth + 1):'') . ')';
+    (_is_select($cdr)?( $self->newline||'' ).$self->indent($depth + 1):'') . ') ';
   }
   elsif ($car eq 'OR' or $car eq 'AND' or (grep { $car =~ /^ $_ $/xi } @binary_op_keywords ) ) {
     return join (" $car ", map $self->unparse($_, $depth), @{$cdr});