diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2024-09-04 14:31:28 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2024-10-23 18:27:14 +0000 |
commit | 6c4b055cfb6bf549e9145dde6454cc6b178c35e4 (patch) | |
tree | e58933367edeae1dece89149dda0609027b1b8d7 /contrib/llvm-project/clang/lib/Format/ContinuationIndenter.cpp | |
parent | 62987288060ff68c817b7056815aa9fb8ba8ecd7 (diff) | |
parent | 7432c96084d72c631f1e5ddf1cc2e24fd9c92482 (diff) |
Diffstat (limited to 'contrib/llvm-project/clang/lib/Format/ContinuationIndenter.cpp')
-rw-r--r-- | contrib/llvm-project/clang/lib/Format/ContinuationIndenter.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/contrib/llvm-project/clang/lib/Format/ContinuationIndenter.cpp b/contrib/llvm-project/clang/lib/Format/ContinuationIndenter.cpp index b07360425ca6..7d89f0e63dd2 100644 --- a/contrib/llvm-project/clang/lib/Format/ContinuationIndenter.cpp +++ b/contrib/llvm-project/clang/lib/Format/ContinuationIndenter.cpp @@ -842,10 +842,8 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun, CurrentState.ContainsUnwrappedBuilder = true; } - if (Current.is(TT_TrailingReturnArrow) && - Style.Language == FormatStyle::LK_Java) { + if (Current.is(TT_LambdaArrow) && Style.Language == FormatStyle::LK_Java) CurrentState.NoLineBreak = true; - } if (Current.isMemberAccess() && Previous.is(tok::r_paren) && (Previous.MatchingParen && (Previous.TotalLength - Previous.MatchingParen->TotalLength > 10))) { @@ -1000,7 +998,7 @@ unsigned ContinuationIndenter::addTokenOnNewLine(LineState &State, // // is common and should be formatted like a free-standing function. The same // goes for wrapping before the lambda return type arrow. - if (Current.isNot(TT_TrailingReturnArrow) && + if (Current.isNot(TT_LambdaArrow) && (!Style.isJavaScript() || Current.NestingLevel != 0 || !PreviousNonComment || PreviousNonComment->isNot(tok::equal) || !Current.isOneOf(Keywords.kw_async, Keywords.kw_function))) { @@ -1257,7 +1255,7 @@ unsigned ContinuationIndenter::getNewLineColumn(const LineState &State) { } return CurrentState.Indent; } - if (Current.is(TT_TrailingReturnArrow) && + if (Current.is(TT_LambdaArrow) && Previous.isOneOf(tok::kw_noexcept, tok::kw_mutable, tok::kw_constexpr, tok::kw_consteval, tok::kw_static, TT_AttributeSquare)) { return ContinuationIndent; @@ -1590,7 +1588,7 @@ unsigned ContinuationIndenter::moveStateToNextToken(LineState &State, } if (Current.isOneOf(TT_BinaryOperator, TT_ConditionalExpr) && Newline) CurrentState.NestedBlockIndent = State.Column + Current.ColumnWidth + 1; - if (Current.isOneOf(TT_LambdaLSquare, TT_TrailingReturnArrow)) + if (Current.isOneOf(TT_LambdaLSquare, TT_LambdaArrow)) CurrentState.LastSpace = State.Column; if (Current.is(TT_RequiresExpression) && Style.RequiresExpressionIndentation == FormatStyle::REI_Keyword) { |