[Bast-commits] r9706 - SQL-Abstract/1.x/trunk/lib/SQL/Abstract

frew at dev.catalyst.perl.org frew at dev.catalyst.perl.org
Thu Sep 9 02:51:23 GMT 2010


Author: frew
Date: 2010-09-09 03:51:23 +0100 (Thu, 09 Sep 2010)
New Revision: 9706

Modified:
   SQL-Abstract/1.x/trunk/lib/SQL/Abstract/Tree.pm
Log:
fix oddity in initial newlines

Modified: SQL-Abstract/1.x/trunk/lib/SQL/Abstract/Tree.pm
===================================================================
--- SQL-Abstract/1.x/trunk/lib/SQL/Abstract/Tree.pm	2010-09-09 02:50:57 UTC (rev 9705)
+++ SQL-Abstract/1.x/trunk/lib/SQL/Abstract/Tree.pm	2010-09-09 02:51:23 UTC (rev 9706)
@@ -278,6 +278,14 @@
   return $keyword
 }
 
+
+my %starters = (
+   select        => 1,
+   update        => 1,
+   'insert into' => 1,
+   'delete from' => 1,
+);
+
 sub whitespace {
    my ($self, $keyword, $depth) = @_;
 
@@ -285,7 +293,7 @@
    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';
+   $before = '' if $depth == 0 and defined $starters{lc $keyword};
    return [$before, ' '];
 }
 




More information about the Bast-commits mailing list