diff options
author | Nico Weber <nicolasweber@gmx.de> | 2013-01-09 23:25:37 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2013-01-09 23:25:37 +0000 |
commit | 50767d8c8f2f667255bdb99692c0467ce992bc67 (patch) | |
tree | bcdb26efc63c5f9b5810aeebb34b66e545ca0ee3 /lib/Format | |
parent | d017e42af00c2e7c380d0f9b27c81734f4b2844e (diff) |
Formatter: Add support for @implementation.
Just reuse the @interface code for this. It accepts slightly more than
necessary (@implementation cannot have protocol lists), but that's ok.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172019 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format')
-rw-r--r-- | lib/Format/UnwrappedLineParser.cpp | 5 | ||||
-rw-r--r-- | lib/Format/UnwrappedLineParser.h | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/Format/UnwrappedLineParser.cpp b/lib/Format/UnwrappedLineParser.cpp index 1d0cb30af8..c049ac607d 100644 --- a/lib/Format/UnwrappedLineParser.cpp +++ b/lib/Format/UnwrappedLineParser.cpp @@ -209,7 +209,8 @@ void UnwrappedLineParser::parseStructuralElement() { case tok::objc_private: return parseAccessSpecifier(); case tok::objc_interface: - return parseObjCInterface(); + case tok::objc_implementation: + return parseObjCInterfaceOrImplementation(); case tok::objc_protocol: return parseObjCProtocol(); case tok::objc_end: @@ -519,7 +520,7 @@ void UnwrappedLineParser::parseObjCUntilAtEnd() { } while (!eof()); } -void UnwrappedLineParser::parseObjCInterface() { +void UnwrappedLineParser::parseObjCInterfaceOrImplementation() { nextToken(); nextToken(); // interface name diff --git a/lib/Format/UnwrappedLineParser.h b/lib/Format/UnwrappedLineParser.h index 303afc2d98..16ad37eec6 100644 --- a/lib/Format/UnwrappedLineParser.h +++ b/lib/Format/UnwrappedLineParser.h @@ -144,7 +144,7 @@ private: void parseStructOrClass(); void parseObjCProtocolList(); void parseObjCUntilAtEnd(); - void parseObjCInterface(); + void parseObjCInterfaceOrImplementation(); void parseObjCProtocol(); void addUnwrappedLine(); bool eof() const; |