@@ -4413,31 +4413,29 @@ bool TokenAnnotator::spaceRequiredBetween(const AnnotatedLine &Line,
4413
4413
Right.MatchingParen == &Left && Line.Children .empty ()) {
4414
4414
return Style.SpaceInEmptyBlock ;
4415
4415
}
4416
- if ((Left.is (tok::l_paren) && Right.is (tok::r_paren)) ||
4417
- (Left.is (tok::l_brace) && Left.isNot (BK_Block) &&
4418
- Right.is (tok::r_brace) && Right.isNot (BK_Block))) {
4419
- return Style.SpacesInParensOptions .InEmptyParentheses ;
4420
- }
4421
- if (Style.SpacesInParens == FormatStyle::SIPO_Custom &&
4422
- Style.SpacesInParensOptions .ExceptDoubleParentheses &&
4423
- Left.is (tok::r_paren) && Right.is (tok::r_paren)) {
4424
- auto *InnerLParen = Left.MatchingParen ;
4425
- if (InnerLParen && InnerLParen->Previous == Right.MatchingParen ) {
4426
- InnerLParen->SpacesRequiredBefore = 0 ;
4427
- return false ;
4416
+ if (Style.SpacesInParens == FormatStyle::SIPO_Custom) {
4417
+ if ((Left.is (tok::l_paren) && Right.is (tok::r_paren)) ||
4418
+ (Left.is (tok::l_brace) && Left.isNot (BK_Block) &&
4419
+ Right.is (tok::r_brace) && Right.isNot (BK_Block))) {
4420
+ return Style.SpacesInParensOptions .InEmptyParentheses ;
4421
+ }
4422
+ if (Style.SpacesInParensOptions .ExceptDoubleParentheses &&
4423
+ Left.is (tok::r_paren) && Right.is (tok::r_paren)) {
4424
+ auto *InnerLParen = Left.MatchingParen ;
4425
+ if (InnerLParen && InnerLParen->Previous == Right.MatchingParen ) {
4426
+ InnerLParen->SpacesRequiredBefore = 0 ;
4427
+ return false ;
4428
+ }
4428
4429
}
4429
- }
4430
- if (Style.SpacesInParensOptions .InConditionalStatements ) {
4431
4430
const FormatToken *LeftParen = nullptr ;
4432
4431
if (Left.is (tok::l_paren))
4433
4432
LeftParen = &Left;
4434
4433
else if (Right.is (tok::r_paren) && Right.MatchingParen )
4435
4434
LeftParen = Right.MatchingParen ;
4436
- if (LeftParen) {
4437
- if (LeftParen->is (TT_ConditionLParen))
4438
- return true ;
4439
- if (LeftParen->Previous && isKeywordWithCondition (*LeftParen->Previous ))
4440
- return true ;
4435
+ if (LeftParen && (LeftParen->is (TT_ConditionLParen) ||
4436
+ (LeftParen->Previous &&
4437
+ isKeywordWithCondition (*LeftParen->Previous )))) {
4438
+ return Style.SpacesInParensOptions .InConditionalStatements ;
4441
4439
}
4442
4440
}
4443
4441
0 commit comments