clang-format: Improve alignment after 'return'.
Previously, comments, could totally confuse it.
Before:
return
// true if code is one of a or b.
code == a ||
code == b;
After:
return
// true if code is one of a or b.
code == a || code == b;
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191654 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Format/TokenAnnotator.cpp b/lib/Format/TokenAnnotator.cpp
index 6772c89..220da70 100644
--- a/lib/Format/TokenAnnotator.cpp
+++ b/lib/Format/TokenAnnotator.cpp
@@ -853,6 +853,10 @@
/// \brief Parse expressions with the given operatore precedence.
void parse(int Precedence = 0) {
+ // Skip 'return' as it is not part of a binary expression.
+ while (Current && Current->is(tok::kw_return))
+ next();
+
if (Current == NULL || Precedence > PrecedenceArrowAndPeriod)
return;