aboutsummaryrefslogtreecommitdiff
path: root/lib/Format/TokenAnnotator.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-02-26 13:59:14 +0000
committerDaniel Jasper <djasper@google.com>2013-02-26 13:59:14 +0000
commit518ee34467c0722e253a58efea20456e96aa5802 (patch)
tree1d7ee2ec9d3370e219d3217a141e4e846cbf5955 /lib/Format/TokenAnnotator.cpp
parentd79f1f37b04703addb631ee11d266d3bfc3dd451 (diff)
Fix bad line break decision.
Before: if (Intervals[i].getRange().getFirst() < Intervals[i - 1] .getRange().getLast()) {} After: if (Intervals[i].getRange().getFirst() < Intervals[i - 1].getRange().getLast()) {} git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176092 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/TokenAnnotator.cpp')
-rw-r--r--lib/Format/TokenAnnotator.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Format/TokenAnnotator.cpp b/lib/Format/TokenAnnotator.cpp
index 83e1facb21..67ad08a389 100644
--- a/lib/Format/TokenAnnotator.cpp
+++ b/lib/Format/TokenAnnotator.cpp
@@ -890,10 +890,10 @@ unsigned TokenAnnotator::splitPenalty(const AnnotatedLine &Line,
if (Right.is(tok::arrow) || Right.is(tok::period)) {
if (Line.Type == LT_BuilderTypeCall)
- return 5; // Should be smaller than breaking at a nested comma.
+ return 5;
if ((Left.is(tok::r_paren) || Left.is(tok::r_square)) &&
Left.MatchingParen && Left.MatchingParen->ParameterCount > 0)
- return 10;
+ return 20; // Should be smaller than breaking at a nested comma.
return 150;
}
@@ -928,7 +928,7 @@ unsigned TokenAnnotator::splitPenalty(const AnnotatedLine &Line,
return prec::Shift;
}
if (Left.Type == TT_ConditionalExpr)
- return prec::Assignment;
+ return prec::Conditional;
prec::Level Level = getPrecedence(Left);
if (Level != prec::Unknown)