summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/TokenAnnotator.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-11-26 12:31:19 +0000
committerDaniel Jasper <djasper@google.com>2014-11-26 12:31:19 +0000
commit375815d24b8b84e78781634c747125c3d3f5a9e0 (patch)
treea8187457276bf0b4a4a19fcd9fb5101af54371ef /clang/lib/Format/TokenAnnotator.cpp
parent2a783392d475a440d9282c31730e011057b13f18 (diff)
downloadbcm5719-llvm-375815d24b8b84e78781634c747125c3d3f5a9e0.tar.gz
bcm5719-llvm-375815d24b8b84e78781634c747125c3d3f5a9e0.zip
clang-format: [Java] Improve formatting of throws declarations.
Before: public void doSoooooooooo() throws LoooooooooongException, LooooooooooongException {} After: public void doSoooooooooo() throws LoooooooooongException, LooooooooooongException {} llvm-svn: 222829
Diffstat (limited to 'clang/lib/Format/TokenAnnotator.cpp')
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index 2e3e2dd6124..ccaac1bb284 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -1200,7 +1200,8 @@ private:
else if (Current->isOneOf(tok::period, tok::arrow))
return PrecedenceArrowAndPeriod;
else if (Style.Language == FormatStyle::LK_Java &&
- Current->isOneOf(Keywords.kw_extends, Keywords.kw_implements))
+ Current->isOneOf(Keywords.kw_extends, Keywords.kw_implements,
+ Keywords.kw_throws))
return 0;
}
return -1;
@@ -1470,7 +1471,7 @@ unsigned TokenAnnotator::splitPenalty(const AnnotatedLine &Line,
if (Style.Language == FormatStyle::LK_Java) {
if (Left.is(TT_LeadingJavaAnnotation))
return 1;
- if (Right.is(Keywords.kw_extends))
+ if (Right.isOneOf(Keywords.kw_extends, Keywords.kw_throws))
return 1;
if (Right.is(Keywords.kw_implements))
return 2;
OpenPOWER on IntegriCloud