Formatter: Don't insert a space before unary operators after selector names.
Before: [color getRed: &r green: &g blue: &b alpha: &a]; Now: [color getRed:&r green:&g blue:&b alpha:&a]; llvm-svn: 172337
This commit is contained in:
parent
7e31c8f0ae
commit
2827a7ec6b
|
@ -1165,8 +1165,9 @@ private:
|
||||||
return false;
|
return false;
|
||||||
if (Tok.Type == TT_UnaryOperator)
|
if (Tok.Type == TT_UnaryOperator)
|
||||||
return Tok.Parent->isNot(tok::l_paren) &&
|
return Tok.Parent->isNot(tok::l_paren) &&
|
||||||
Tok.Parent->isNot(tok::l_square) &&
|
Tok.Parent->isNot(tok::l_square) && Tok.Parent->isNot(tok::at) &&
|
||||||
Tok.Parent->isNot(tok::at);
|
(Tok.Parent->isNot(tok::colon) ||
|
||||||
|
Tok.Parent->Type != TT_ObjCMethodExpr);
|
||||||
if (Tok.Parent->is(tok::greater) && Tok.is(tok::greater)) {
|
if (Tok.Parent->is(tok::greater) && Tok.is(tok::greater)) {
|
||||||
return Tok.Type == TT_TemplateCloser && Tok.Parent->Type ==
|
return Tok.Type == TT_TemplateCloser && Tok.Parent->Type ==
|
||||||
TT_TemplateCloser && Style.SplitTemplateClosingGreater;
|
TT_TemplateCloser && Style.SplitTemplateClosingGreater;
|
||||||
|
|
|
@ -1533,6 +1533,7 @@ TEST_F(FormatTest, FormatObjCMethodExpr) {
|
||||||
verifyFormat("[self stuffWithInt:a ? (e ? f : g) : c];");
|
verifyFormat("[self stuffWithInt:a ? (e ? f : g) : c];");
|
||||||
verifyFormat("[cond ? obj1 : obj2 methodWithParam:param]");
|
verifyFormat("[cond ? obj1 : obj2 methodWithParam:param]");
|
||||||
verifyFormat("[button setAction:@selector(zoomOut:)];");
|
verifyFormat("[button setAction:@selector(zoomOut:)];");
|
||||||
|
verifyFormat("[color getRed:&r green:&g blue:&b alpha:&a];");
|
||||||
|
|
||||||
verifyFormat("arr[[self indexForFoo:a]];");
|
verifyFormat("arr[[self indexForFoo:a]];");
|
||||||
verifyFormat("throw [self errorFor:a];");
|
verifyFormat("throw [self errorFor:a];");
|
||||||
|
|
Loading…
Reference in New Issue