From: Ryan P. Kelly Date: Wed, 29 Jun 2011 04:20:30 +0000 (-0400) Subject: Split AND'ed or OR'ed clauses onto separate lines X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=39a95e35495f3a0dec44bcdf5256c3b21093f593;p=dbsrgits%2FSQL-Abstract.git Split AND'ed or OR'ed clauses onto separate lines --- diff --git a/lib/SQL/Abstract/Tree.pm b/lib/SQL/Abstract/Tree.pm index 519cae4..86d206c 100644 --- a/lib/SQL/Abstract/Tree.pm +++ b/lib/SQL/Abstract/Tree.pm @@ -598,7 +598,11 @@ sub _unparse { ) ); } - elsif ($op eq 'AND' or $op eq 'OR' or $op =~ $binary_op_re ) { + elsif ($op eq 'AND' or $op eq 'OR') { + return ($self->newline||'') . join (" $op ". ($self->newline||''), + map $self->indent($depth + 1) . $self->_unparse($_, $bindargs, $depth), @{$args}); + } + elsif ($op =~ / ^ $binary_op_re $ /x ) { return join (" $op ", map $self->_unparse($_, $bindargs, $depth), @{$args}); } elsif ($op eq '-LIST' ) {