} else if (Previous.is(tok::comma) && State.Stack.back().VariablePos != 0) {
State.Column = State.Stack.back().VariablePos;
} else if ((PreviousNonComment &&
- PreviousNonComment->ClosesTemplateDeclaration) ||
+ (PreviousNonComment->ClosesTemplateDeclaration ||
+ PreviousNonComment->Type == TT_AttributeParen)) ||
((Current.Type == TT_StartOfName ||
Current.is(tok::kw_operator)) &&
State.ParenLevel == 0 &&
} else if (AfterCaret) {
// This is the parameter list of an ObjC block.
Contexts.back().IsExpression = false;
+ } else if (Left->Previous && Left->Previous->is(tok::kw___attribute)) {
+ Left->Type = TT_AttributeParen;
}
if (StartsObjCMethodExpr) {
}
}
+ if (Left->Type == TT_AttributeParen)
+ CurrentToken->Type = TT_AttributeParen;
+
if (!HasMultipleLines)
Left->PackingKind = PPK_Inconclusive;
else if (HasMultipleParametersOnALine)
if (Left.is(tok::colon))
return Left.Type != TT_ObjCMethodExpr;
if (Right.is(tok::l_paren)) {
- if (Left.is(tok::r_paren) && Left.MatchingParen &&
- Left.MatchingParen->Previous &&
- Left.MatchingParen->Previous->is(tok::kw___attribute))
+ if (Left.is(tok::r_paren) && Left.Type == TT_AttributeParen)
return true;
return Line.Type == LT_ObjCDecl ||
Left.isOneOf(tok::kw_return, tok::kw_new, tok::kw_delete,
return false;
if (Left.is(tok::equal) && Line.Type == LT_VirtualFunctionDecl)
return false;
- if (Left.Previous) {
- if (Left.is(tok::l_paren) && Right.is(tok::l_paren) &&
- Left.Previous->is(tok::kw___attribute))
- return false;
- if (Left.is(tok::l_paren) && (Left.Previous->Type == TT_BinaryOperator ||
- Left.Previous->Type == TT_CastRParen))
- return false;
- }
+ if (Left.is(tok::l_paren) && Left.Type == TT_AttributeParen)
+ return false;
+ if (Left.is(tok::l_paren) && Left.Previous &&
+ (Left.Previous->Type == TT_BinaryOperator ||
+ Left.Previous->Type == TT_CastRParen))
+ return false;
if (Right.Type == TT_ImplicitStringLiteral)
return false;
Right.isOneOf(tok::lessless, tok::arrow, tok::period, tok::colon,
tok::l_square, tok::at) ||
(Left.is(tok::r_paren) &&
- Right.isOneOf(tok::identifier, tok::kw_const, tok::kw___attribute)) ||
+ Right.isOneOf(tok::identifier, tok::kw_const)) ||
(Left.is(tok::l_paren) && !Right.is(tok::r_paren));
}