]> granicus.if.org Git - clang/commit
Improve formatting of conditional expressions.
authorDaniel Jasper <djasper@google.com>
Mon, 28 Jan 2013 12:45:14 +0000 (12:45 +0000)
committerDaniel Jasper <djasper@google.com>
Mon, 28 Jan 2013 12:45:14 +0000 (12:45 +0000)
commitbfe6fd4f00257b113ea3bcb4efef8d9f9f245882
treec53f97d7d3dd18e57cad1ad4cb021bac172feb62
parentae8699bde649e2ed1f66414b4283b862f11056dd
Improve formatting of conditional expressions.

Before we did not really systematically format those. Now, we format the
different cases as:

- 1 Line:  a ? b : c;
- 2 Lines: short ? loooooooooong
                 : loooooooooong
- 2 Lines: loooooooooooooooong
               ? short : short
- 3 Lines: loooooooooooooooong
               ? loooooooooooooong
               : loooooooooooooong

Not sure whether "?" and ":" should go on the new line, but it seems to
be the most consistent approach.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173683 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Format/Format.cpp
unittests/Format/FormatTest.cpp