@@ -819,20 +819,20 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun,
819
819
return false ;
820
820
};
821
821
// Identifies simple (no expression) one-argument function calls.
822
- const auto IsNotSimpleFunction = [&](const FormatToken &Tok) {
822
+ const auto IsSimpleFunction = [&](const FormatToken &Tok) {
823
823
const auto *Previous = Tok.Previous ;
824
- const auto *Next = Tok.Next ;
825
- if (Tok.FakeLParens .size () > 0 && Tok.FakeLParens .back () > prec::Unknown)
824
+ if (!Tok.FakeLParens .empty () && Tok.FakeLParens .back () > prec::Unknown)
825
+ return false ;
826
+ if (!Previous || (!Previous->isOneOf (TT_FunctionDeclarationLParen,
827
+ TT_LambdaDefinitionLParen) &&
828
+ !IsFunctionCallParen (*Previous))) {
826
829
return true ;
827
- if (Previous && (Previous->is (TT_FunctionDeclarationLParen) ||
828
- IsFunctionCallParen (*Previous) ||
829
- Previous->is (TT_LambdaDefinitionLParen))) {
830
- return !IsOpeningBracket (Tok) && Next && !Next->isMemberAccess () &&
831
- !IsInTemplateString (Tok) &&
832
- !Next->is (TT_FunctionDeclarationLParen) &&
833
- !IsFunctionCallParen (*Next);
834
830
}
835
- return false ;
831
+ if (IsOpeningBracket (Tok) || IsInTemplateString (Tok))
832
+ return true ;
833
+ const auto *Next = Tok.Next ;
834
+ return !Next || Next->isMemberAccess () ||
835
+ Next->is (TT_FunctionDeclarationLParen) || IsFunctionCallParen (*Next);
836
836
};
837
837
if ((Style .AlignAfterOpenBracket == FormatStyle::BAS_AlwaysBreak ||
838
838
Style .AlignAfterOpenBracket == FormatStyle::BAS_BlockIndent) &&
@@ -844,7 +844,7 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun,
844
844
// caaaaaaaaaaaall(
845
845
// caaaaaaaaaaaall(
846
846
// caaaaaaaaaaaaaaaaaaaaaaall(aaaaaaaaaaaaaa, aaaaaaaaa))));
847
- IsNotSimpleFunction (Current)) {
847
+ ! IsSimpleFunction (Current)) {
848
848
CurrentState.NoLineBreak = true ;
849
849
}
850
850
0 commit comments