diff options
author | Daniel Jasper <djasper@google.com> | 2014-11-14 08:22:46 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2014-11-14 08:22:46 +0000 |
commit | 61d81973c16131e3b9298c4931eb59bbe73dbed2 (patch) | |
tree | a8cca91f0e06412b46362bfa5824cd84a4e6b20e /clang/lib/Format/TokenAnnotator.cpp | |
parent | f69b0585c1aa802a496737fa93443d4a215ae641 (diff) | |
download | bcm5719-llvm-61d81973c16131e3b9298c4931eb59bbe73dbed2.tar.gz bcm5719-llvm-61d81973c16131e3b9298c4931eb59bbe73dbed2.zip |
clang-format: [Java] Improve formatting of generics.
Before:
Function < F, ? extends T > function;
After:
Function<F, ? extends T> function;
llvm-svn: 221976
Diffstat (limited to 'clang/lib/Format/TokenAnnotator.cpp')
-rw-r--r-- | clang/lib/Format/TokenAnnotator.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index 8ec8f58d147..f926beb1066 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -63,11 +63,13 @@ private: next(); return true; } - if (CurrentToken->isOneOf(tok::r_paren, tok::r_square, tok::r_brace, - tok::colon)) - return false; if (CurrentToken->is(tok::question) && - Style.Language != FormatStyle::LK_Java) + Style.Language == FormatStyle::LK_Java) { + next(); + continue; + } + if (CurrentToken->isOneOf(tok::r_paren, tok::r_square, tok::r_brace, + tok::colon, tok::question)) return false; // If a && or || is found and interpreted as a binary operator, this set // of angles is likely part of something like "a < b && c > d". If the @@ -367,10 +369,6 @@ private: } bool parseConditional() { - if (Style.Language == FormatStyle::LK_Java && - CurrentToken->isOneOf(tok::comma, tok::greater)) - return true; // This is a generic "?". - while (CurrentToken) { if (CurrentToken->is(tok::colon)) { CurrentToken->Type = TT_ConditionalExpr; |