Last->Tok.isNot(tok::kw_do) && Last->Tok.isNot(tok::r_brace) &&
Last->Tok.isNot(tok::kw_else) && Last->Tok.isNot(tok::kw_try) &&
Last->Tok.isNot(tok::kw_catch) && Last->Tok.isNot(tok::kw_for) &&
- // This gets rid of all ObjC @ keywords and - based definitions.
- Last->Tok.isNot(tok::at) && Last->Tok.isNot(tok::minus);
+ // This gets rid of all ObjC @ keywords and methods.
+ Last->Tok.isNot(tok::at) && Last->Tok.isNot(tok::minus) &&
+ Last->Tok.isNot(tok::plus);
while (!Last->Children.empty())
Last = &Last->Children.back();
if (!Last->Tok.is(tok::l_brace))
"- (int)answerWith:(int)i {\n"
" return i;\n"
"}\n"
+ "+ (int)answerWith:(int)i {\n"
+ " return i;\n"
+ "}\n"
"@end");
verifyFormat("@implementation Foo\n"
verifyFormat("@implementation Foo : Bar\n"
"+ (id)init {}\n"
+ "- (void)foo {}\n"
"@end");
verifyFormat("@implementation Foo {\n"