<div dir="ltr"><div class="gmail_default" style>Thanks!</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jan 11, 2013 at 10:14 PM, Nico Weber <span dir="ltr"><<a href="mailto:nicolasweber@gmx.de" target="_blank">nicolasweber@gmx.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: nico<br>
Date: Fri Jan 11 15:14:08 2013<br>
New Revision: 172254<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=172254&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=172254&view=rev</a><br>
Log:<br>
Formatter: Format ObjC static and instance methods consistently, add a test for that.<br>
<br>
Modified:<br>
    cfe/trunk/lib/Format/Format.cpp<br>
    cfe/trunk/unittests/Format/FormatTest.cpp<br>
<br>
Modified: cfe/trunk/lib/Format/Format.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/Format.cpp?rev=172254&r1=172253&r2=172254&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/Format.cpp?rev=172254&r1=172253&r2=172254&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/Format/Format.cpp (original)<br>
+++ cfe/trunk/lib/Format/Format.cpp Fri Jan 11 15:14:08 2013<br>
@@ -1342,8 +1342,9 @@<br>
         Last->Tok.isNot(tok::kw_do) && Last->Tok.isNot(tok::r_brace) &&<br>
         Last->Tok.isNot(tok::kw_else) && Last->Tok.isNot(tok::kw_try) &&<br>
         Last->Tok.isNot(tok::kw_catch) && Last->Tok.isNot(tok::kw_for) &&<br>
-        // This gets rid of all ObjC @ keywords and - based definitions.<br>
-        Last->Tok.isNot(tok::at) && Last->Tok.isNot(tok::minus);<br>
+        // This gets rid of all ObjC @ keywords and methods.<br>
+        Last->Tok.isNot(tok::at) && Last->Tok.isNot(tok::minus) &&<br>
+        Last->Tok.isNot(tok::plus);<br>
     while (!Last->Children.empty())<br>
       Last = &Last->Children.back();<br>
     if (!Last->Tok.is(tok::l_brace))<br>
<br>
Modified: cfe/trunk/unittests/Format/FormatTest.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Format/FormatTest.cpp?rev=172254&r1=172253&r2=172254&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Format/FormatTest.cpp?rev=172254&r1=172253&r2=172254&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/unittests/Format/FormatTest.cpp (original)<br>
+++ cfe/trunk/unittests/Format/FormatTest.cpp Fri Jan 11 15:14:08 2013<br>
@@ -1388,6 +1388,9 @@<br>
                "- (int)answerWith:(int)i {\n"<br>
                "  return i;\n"<br>
                "}\n"<br>
+               "+ (int)answerWith:(int)i {\n"<br>
+               "  return i;\n"<br>
+               "}\n"<br>
                "@end");<br>
<br>
   verifyFormat("@implementation Foo\n"<br>
@@ -1397,6 +1400,7 @@<br>
<br>
   verifyFormat("@implementation Foo : Bar\n"<br>
                "+ (id)init {}\n"<br>
+               "- (void)foo {}\n"<br>
                "@end");<br>
<br>
   verifyFormat("@implementation Foo {\n"<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>