Clang-format: IndentCaseLabels option, proper namespace handling
Summary: + tests arranged in groups, as their number is already quite large.
Reviewers: djasper, klimek
Reviewed By: djasper
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D185
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169520 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Format/UnwrappedLineParser.h b/lib/Format/UnwrappedLineParser.h
index 3fbc73f..03dda99 100644
--- a/lib/Format/UnwrappedLineParser.h
+++ b/lib/Format/UnwrappedLineParser.h
@@ -21,6 +21,7 @@
#include "clang/Basic/IdentifierTable.h"
#include "clang/Basic/SourceManager.h"
+#include "clang/Format/Format.h"
#include "clang/Lex/Lexer.h"
namespace clang {
@@ -78,7 +79,8 @@
class UnwrappedLineParser {
public:
- UnwrappedLineParser(Lexer &Lex, SourceManager &SourceMgr,
+ UnwrappedLineParser(const FormatStyle &Style, Lexer &Lex,
+ SourceManager &SourceMgr,
UnwrappedLineConsumer &Callback);
/// Returns true in case of a structural error.
@@ -86,7 +88,7 @@
private:
bool parseLevel();
- bool parseBlock();
+ bool parseBlock(unsigned AddLevels = 1);
void parsePPDirective();
void parseComment();
void parseStatement();
@@ -97,6 +99,7 @@
void parseLabel();
void parseCaseLabel();
void parseSwitch();
+ void parseNamespace();
void parseAccessSpecifier();
void parseEnum();
void addUnwrappedLine();
@@ -111,6 +114,7 @@
FormatToken FormatTok;
bool GreaterStashed;
+ const FormatStyle &Style;
Lexer &Lex;
SourceManager &SourceMgr;
IdentifierTable IdentTable;