diff options
author | Daniel Jasper <djasper@google.com> | 2012-12-05 14:57:28 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2012-12-05 14:57:28 +0000 |
commit | 33182dd0f7d5b5e913b1957c2cb6dc04942efd46 (patch) | |
tree | a8d086c525d12251e359b04347c001c91b2007d3 /lib/Format/UnwrappedLineParser.cpp | |
parent | 720ffb644400661b927c6359aac5677dab036ed4 (diff) |
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169384 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/UnwrappedLineParser.cpp')
-rw-r--r-- | lib/Format/UnwrappedLineParser.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Format/UnwrappedLineParser.cpp b/lib/Format/UnwrappedLineParser.cpp index bdea42a2eb..c2cb5b8027 100644 --- a/lib/Format/UnwrappedLineParser.cpp +++ b/lib/Format/UnwrappedLineParser.cpp @@ -106,6 +106,12 @@ void UnwrappedLineParser::parseComment() { } 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: |