Indentation fixes for clang-format.
- Fix behavior of memoization together with optimization
- Correctly attribute the PenaltyIndentLevel (breaking directly after "(" did
not count towards the inner level)
- Recognize more tokens as assignments
Review: http://llvm-reviews.chandlerc.com/D172
llvm-svn: 169384
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp
index bdea42a..c2cb5b8 100644
--- a/clang/lib/Format/UnwrappedLineParser.cpp
+++ b/clang/lib/Format/UnwrappedLineParser.cpp
@@ -106,6 +106,12 @@
}
void UnwrappedLineParser::parseStatement() {
+ // Consume leading line comments, e.g. for branches without compounds.
+ while (FormatTok.Tok.is(tok::comment)) {
+ nextToken();
+ addUnwrappedLine();
+ }
+
switch (FormatTok.Tok.getKind()) {
case tok::kw_public:
case tok::kw_protected: