From: Ryan P. Kelly Date: Wed, 29 Jun 2011 04:21:20 +0000 (-0400) Subject: Split comma separated clauses onto multiple lines X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fpeople%2Ff0rk%2Fformat-sql;p=dbsrgits%2FSQL-Abstract.git Split comma separated clauses onto multiple lines --- diff --git a/lib/SQL/Abstract/Tree.pm b/lib/SQL/Abstract/Tree.pm index 86d206c..ed1b038 100644 --- a/lib/SQL/Abstract/Tree.pm +++ b/lib/SQL/Abstract/Tree.pm @@ -606,7 +606,8 @@ sub _unparse { return join (" $op ", map $self->_unparse($_, $bindargs, $depth), @{$args}); } elsif ($op eq '-LIST' ) { - return join (', ', map $self->_unparse($_, $bindargs, $depth), @{$args}); + return ($self->newline||'') . join (', ' . ($self->newline||''), + map $self->indent($depth + 1) . $self->_unparse($_, $bindargs, $depth), @{$args}); } elsif ($op eq '-MISC' ) { return join (' ', map $self->_unparse($_, $bindargs, $depth), @{$args});