llvm-project/clang/lib/Format
Daniel Jasper cd8599e8c9 Better formatting of conditional expressions.
In conditional expressions, if the condition is split over multiple
lines, also break before both operands.

This prevents formattings like:

  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ==
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ? b : c;

Which are bad, because they suggestion incorrect operator precedence:

  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ==
      (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ? b : c);

This lead to the discovery that the expression parser incorrectly
handled conditional operators and that it could also handle semicolons
(which in turn reduced the amount of special casing for for-loops). As a
side-effect, we can now apply the bin-packing configuration to the
sections of for-loops.

llvm-svn: 175973
2013-02-23 21:01:55 +00:00
..
CMakeLists.txt Move the token annotator into separate files. 2013-01-29 21:01:14 +00:00
Format.cpp Better formatting of conditional expressions. 2013-02-23 21:01:55 +00:00
Makefile
TokenAnnotator.cpp Better formatting of conditional expressions. 2013-02-23 21:01:55 +00:00
TokenAnnotator.h Fix counting of parameters so that r175162 works as expected. 2013-02-14 15:01:34 +00:00
UnwrappedLineParser.cpp Fix crash for incomplete labels in macros. 2013-02-12 20:17:17 +00:00
UnwrappedLineParser.h Move the token annotator into separate files. 2013-01-29 21:01:14 +00:00