diff options
author | Dmitri Gribenko <gribozavr@gmail.com> | 2012-12-30 21:27:25 +0000 |
---|---|---|
committer | Dmitri Gribenko <gribozavr@gmail.com> | 2012-12-30 21:27:25 +0000 |
commit | 1f94f2b484dc74e09fe31dd5ea9d3f715be6c133 (patch) | |
tree | 90f522e9f33279111895488253cb01be8e2894fd /lib/Format/UnwrappedLineParser.cpp | |
parent | 2d382d149b442b928fd3fb8edcc8d82ea9325872 (diff) |
Formatter: parse and format inline namespaces like regular namespaces
This changes formatting from:
inline namespace X {
class A {
};
}
to:
inline namespace X {
class A {
};
}
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171266 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/UnwrappedLineParser.cpp')
-rw-r--r-- | lib/Format/UnwrappedLineParser.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Format/UnwrappedLineParser.cpp b/lib/Format/UnwrappedLineParser.cpp index 6c035b001c..78a1abdcf8 100644 --- a/lib/Format/UnwrappedLineParser.cpp +++ b/lib/Format/UnwrappedLineParser.cpp @@ -100,10 +100,19 @@ void UnwrappedLineParser::parseComments() { void UnwrappedLineParser::parseStatement() { parseComments(); + int TokenNumber = 0; switch (FormatTok.Tok.getKind()) { case tok::kw_namespace: parseNamespace(); return; + case tok::kw_inline: + nextToken(); + TokenNumber++; + if (FormatTok.Tok.is(tok::kw_namespace)) { + parseNamespace(); + return; + } + break; case tok::kw_public: case tok::kw_protected: case tok::kw_private: @@ -132,7 +141,6 @@ void UnwrappedLineParser::parseStatement() { default: break; } - int TokenNumber = 0; do { ++TokenNumber; switch (FormatTok.Tok.getKind()) { |