[cfe-commits] r172003 - in /cfe/trunk: lib/Format/UnwrappedLineParser.cpp unittests/Format/FormatTest.cpp
Nico Weber
nicolasweber at gmx.de
Wed Jan 9 13:42:32 PST 2013
Author: nico
Date: Wed Jan 9 15:42:32 2013
New Revision: 172003
URL: http://llvm.org/viewvc/llvm-project?rev=172003&view=rev
Log:
Formatter: Make parseObjCUntilAtEnd() actually work.
Modified:
cfe/trunk/lib/Format/UnwrappedLineParser.cpp
cfe/trunk/unittests/Format/FormatTest.cpp
Modified: cfe/trunk/lib/Format/UnwrappedLineParser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/UnwrappedLineParser.cpp?rev=172003&r1=172002&r2=172003&view=diff
==============================================================================
--- cfe/trunk/lib/Format/UnwrappedLineParser.cpp (original)
+++ cfe/trunk/lib/Format/UnwrappedLineParser.cpp Wed Jan 9 15:42:32 2013
@@ -212,6 +212,8 @@
return parseObjCInterface();
case tok::objc_protocol:
return parseObjCProtocol();
+ case tok::objc_end:
+ return; // Handled by the caller.
default:
break;
}
Modified: cfe/trunk/unittests/Format/FormatTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Format/FormatTest.cpp?rev=172003&r1=172002&r2=172003&view=diff
==============================================================================
--- cfe/trunk/unittests/Format/FormatTest.cpp (original)
+++ cfe/trunk/unittests/Format/FormatTest.cpp Wed Jan 9 15:42:32 2013
@@ -1189,6 +1189,8 @@
"@end");
verifyFormat("@interface Foo\n"
+ "@end\n"
+ "@interface Bar\n"
"@end");
verifyFormat("@interface Foo : Bar\n"
@@ -1262,6 +1264,11 @@
verifyFormat("@protocol Foo;\n"
"@protocol Bar;\n");
+
+ verifyFormat("@protocol Foo\n"
+ "@end\n"
+ "@protocol Bar\n"
+ "@end");
}
TEST_F(FormatTest, ObjCAt) {
More information about the cfe-commits
mailing list