Formatter: Make parseObjCUntilAtEnd() actually work.

llvm-svn: 172003
This commit is contained in:
Nico Weber 2013-01-09 21:42:32 +00:00
parent 8696a8d9e3
commit d8ffe75ad1
2 changed files with 9 additions and 0 deletions

View File

@ -212,6 +212,8 @@ void UnwrappedLineParser::parseStructuralElement() {
return parseObjCInterface();
case tok::objc_protocol:
return parseObjCProtocol();
case tok::objc_end:
return; // Handled by the caller.
default:
break;
}

View File

@ -1189,6 +1189,8 @@ TEST_F(FormatTest, FormatObjCInterface) {
"@end");
verifyFormat("@interface Foo\n"
"@end\n"
"@interface Bar\n"
"@end");
verifyFormat("@interface Foo : Bar\n"
@ -1262,6 +1264,11 @@ TEST_F(FormatTest, FormatObjCProtocol) {
verifyFormat("@protocol Foo;\n"
"@protocol Bar;\n");
verifyFormat("@protocol Foo\n"
"@end\n"
"@protocol Bar\n"
"@end");
}
TEST_F(FormatTest, ObjCAt) {