Lines Matching refs:Current

132 static bool startsNextParameter(const FormatToken &Current,  in startsNextParameter()  argument
134 const FormatToken &Previous = *Current.Previous; in startsNextParameter()
135 if (Current.is(TT_CtorInitializerComma) && in startsNextParameter()
139 if (Style.Language == FormatStyle::LK_Proto && Current.is(TT_SelectorName)) in startsNextParameter()
141 return Previous.is(tok::comma) && !Current.isTrailingComment() && in startsNextParameter()
291 const FormatToken &Current = *State.NextToken; in canBreak() local
292 const FormatToken &Previous = *Current.Previous; in canBreak()
294 assert(&Previous == Current.Previous); in canBreak()
295 if (!Current.CanBreakBefore && !(CurrentState.BreakBeforeClosingBrace && in canBreak()
296 Current.closesBlockOrBlockTypeList(Style))) { in canBreak()
301 if (!Current.MustBreakBefore && Previous.is(tok::l_brace) && in canBreak()
314 State.LowestLevelOnLine < Current.NestingLevel) { in canBreak()
317 if (Current.isMemberAccess() && CurrentState.ContainsUnwrappedBuilder) in canBreak()
331 if (Current.is(TT_FunctionDeclarationName)) { in canBreak()
346 if (!Current.isOneOf(TT_BinaryOperator, tok::comma) && in canBreak()
351 Current.isNot(TT_LambdaLBrace)) && in canBreak()
359 if (Current.is(TT_ConditionalExpr) && Previous.is(tok::r_paren) && in canBreak()
372 const FormatToken &Current = *State.NextToken; in mustBreak() local
373 const FormatToken &Previous = *Current.Previous; in mustBreak()
375 if (Style.BraceWrapping.BeforeLambdaBody && Current.CanBreakBefore && in mustBreak()
376 Current.is(TT_LambdaLBrace) && Previous.isNot(TT_LineComment)) { in mustBreak()
377 auto LambdaBodyLength = getLengthToMatchingParen(Current, State.Stack); in mustBreak()
380 if (Current.MustBreakBefore || in mustBreak()
381 (Current.is(TT_InlineASMColon) && in mustBreak()
388 (Current.closesBlockOrBlockTypeList(Style) || in mustBreak()
389 (Current.is(tok::r_brace) && in mustBreak()
390 Current.isBlockIndentedInitRBrace(Style)))) { in mustBreak()
393 if (CurrentState.BreakBeforeClosingParen && Current.is(tok::r_paren)) in mustBreak()
397 Current.ObjCSelectorNameParts > 1 && in mustBreak()
398 Current.startsSequence(TT_SelectorName, tok::colon, tok::caret)) { in mustBreak()
407 if ((startsNextParameter(Current, Style) || Previous.is(tok::semi) || in mustBreak()
408 (Previous.is(TT_TemplateCloser) && Current.is(TT_StartOfName) && in mustBreak()
415 (Style.BreakBeforeTernaryOperators && Current.is(TT_ConditionalExpr) && in mustBreak()
419 CurrentState.BreakBeforeParameter && !Current.isTrailingComment() && in mustBreak()
420 !Current.isOneOf(tok::r_paren, tok::r_brace)) { in mustBreak()
424 ((Style.BreakBeforeTernaryOperators && Current.is(TT_ConditionalExpr) && in mustBreak()
425 Current.is(tok::colon)) || in mustBreak()
443 : Current; in mustBreak()
448 (!Current.isTrailingComment() || Current.NewlinesBefore > 0) && in mustBreak()
455 if (Current.is(TT_ObjCMethodExpr) && Previous.isNot(TT_SelectorName) && in mustBreak()
459 if (Current.is(TT_SelectorName) && Previous.isNot(tok::at) && in mustBreak()
462 !Current.startsSequence(TT_SelectorName, tok::colon, tok::caret))) { in mustBreak()
467 if (Current.isMemberAccess() && Style.ColumnLimit != 0 && in mustBreak()
468 State.Column + getLengthToNextOperator(Current) > Style.ColumnLimit && in mustBreak()
470 Current.NestingLevel < State.StartOfLineLevel)) { in mustBreak()
474 if (startsSegmentOfBuilderTypeCall(Current) && in mustBreak()
490 Current.CanBreakBefore) { in mustBreak()
499 Previous.is(tok::comma) || Current.NestingLevel < 2) && in mustBreak()
510 if (Previous.is(TT_BinaryOperator) && Current.CanBreakBefore) { in mustBreak()
513 CurrentState.BreakBeforeParameter && !Current.isTrailingComment()) { in mustBreak()
536 } else if (Current.is(TT_BinaryOperator) && Current.CanBreakBefore && in mustBreak()
542 if (Current.is(tok::lessless) && Current.isNot(TT_OverloadedOperator) && in mustBreak()
547 if (Current.NestingLevel == 0 && !Current.isTrailingComment()) { in mustBreak()
553 if (Current.is(tok::kw_concept)) { in mustBreak()
563 if (Current.is(TT_RequiresClause)) { in mustBreak()
574 Current.NewlinesBefore > 0); in mustBreak()
580 if (Previous.is(TT_LeadingJavaAnnotation) && Current.isNot(tok::l_paren) && in mustBreak()
581 Current.isNot(TT_LeadingJavaAnnotation)) { in mustBreak()
592 if (BreakBeforeDecoratedTokens.contains(Current.TokenText)) in mustBreak()
596 if (Current.is(TT_FunctionDeclarationName) && in mustBreak()
613 !Current.isOneOf(tok::r_brace, tok::comment)) { in mustBreak()
617 if (Current.is(tok::lessless) && in mustBreak()
636 const FormatToken &Current = *State.NextToken; in addTokenToState() local
643 if (Current.is(TT_ImplicitStringLiteral) && in addTokenToState()
648 SourceMgr.getSpellingColumnNumber(Current.WhitespaceRange.getEnd()); in addTokenToState()
649 if (Current.LastNewlineOffset != 0) { in addTokenToState()
655 SourceMgr.getSpellingColumnNumber(Current.WhitespaceRange.getBegin()); in addTokenToState()
674 FormatToken &Current = *State.NextToken; in addTokenOnCurrentLine() local
681 Style.isCpp() && [&Current] { in addTokenOnCurrentLine()
687 const auto *Prev = Current.Previous; in addTokenOnCurrentLine()
691 if (Prev->is(TT_BlockComment) && Current.SpacesRequiredBefore == 0) in addTokenOnCurrentLine()
693 const auto *PrevNonComment = Current.getPreviousNonComment(); in addTokenOnCurrentLine()
696 if (Current.isOneOf(tok::comment, tok::l_paren, TT_LambdaLSquare)) in addTokenOnCurrentLine()
720 if (Current.is(tok::equal) && in addTokenOnCurrentLine()
721 (State.Line->First->is(tok::kw_for) || Current.NestingLevel == 0) && in addTokenOnCurrentLine()
738 unsigned Spaces = Current.SpacesRequiredBefore + ExtraSpaces; in addTokenOnCurrentLine()
758 Whitespaces.replaceWhitespace(Current, /*Newlines=*/0, Spaces, in addTokenOnCurrentLine()
766 Current.is(TT_InheritanceColon)) { in addTokenOnCurrentLine()
774 if (Current.is(TT_SelectorName) && !CurrentState.ObjCSelectorNameFound) { in addTokenOnCurrentLine()
777 unsigned FirstColonPos = State.Column + Spaces + Current.ColumnWidth; in addTokenOnCurrentLine()
778 if (Current.LongestObjCSelectorName == 0) in addTokenOnCurrentLine()
780 else if (MinIndent + Current.LongestObjCSelectorName > FirstColonPos) in addTokenOnCurrentLine()
781 CurrentState.ColonPos = MinIndent + Current.LongestObjCSelectorName; in addTokenOnCurrentLine()
816 Current.FakeLParens.size() > 0 && in addTokenOnCurrentLine()
817 Current.FakeLParens.back() > prec::Unknown) { in addTokenOnCurrentLine()
832 !(Current.MacroParent && Previous.MacroParent) && in addTokenOnCurrentLine()
833 (Current.isNot(TT_LineComment) || in addTokenOnCurrentLine()
838 if (CurrentState.AvoidBinPacking && startsNextParameter(Current, Style)) in addTokenOnCurrentLine()
840 if (startsSegmentOfBuilderTypeCall(Current) && in addTokenOnCurrentLine()
845 if (Current.is(TT_LambdaArrow) && Style.Language == FormatStyle::LK_Java) in addTokenOnCurrentLine()
847 if (Current.isMemberAccess() && Previous.is(tok::r_paren) && in addTokenOnCurrentLine()
863 const FormatToken *P = Current.getPreviousNonComment(); in addTokenOnCurrentLine()
864 if (Current.isNot(tok::comment) && P && in addTokenOnCurrentLine()
890 if (Current.isNot(tok::comment) && Previous.is(tok::l_paren) && in addTokenOnCurrentLine()
897 } else if (!Current.isOneOf(tok::comment, tok::caret) && in addTokenOnCurrentLine()
903 (!Current.isTrailingComment() || Current.NewlinesBefore > 0) && in addTokenOnCurrentLine()
914 Current.StartsBinaryExpression)) { in addTokenOnCurrentLine()
922 } else if (Current.is(TT_CSharpGenericTypeConstraintColon)) { in addTokenOnCurrentLine()
942 FormatToken &Current = *State.NextToken; in addTokenOnNewLine() local
951 const FormatToken *PreviousNonComment = Current.getPreviousNonComment(); in addTokenOnNewLine()
954 NextNonComment = &Current; in addTokenOnNewLine()
1001 if (Current.isNot(TT_LambdaArrow) && in addTokenOnNewLine()
1002 (!Style.isJavaScript() || Current.NestingLevel != 0 || in addTokenOnNewLine()
1004 !Current.isOneOf(Keywords.kw_async, Keywords.kw_function))) { in addTokenOnNewLine()
1055 Current.NestingLevel == 0) { in addTokenOnNewLine()
1062 if (Current.is(TT_BinaryOperator) && Current.CanBreakBefore) in addTokenOnNewLine()
1067 if (Current.is(tok::r_brace) && Current.MatchingParen && in addTokenOnNewLine()
1070 !Current.MatchingParen->Children.empty()) { in addTokenOnNewLine()
1077 std::max(1u, std::min(Current.NewlinesBefore, MaxEmptyLinesToKeep)); in addTokenOnNewLine()
1080 Whitespaces.replaceWhitespace(Current, Newlines, State.Column, State.Column, in addTokenOnNewLine()
1084 if (!Current.isTrailingComment()) in addTokenOnNewLine()
1086 if (Current.is(tok::lessless)) { in addTokenOnNewLine()
1093 State.StartOfLineLevel = Current.NestingLevel; in addTokenOnNewLine()
1094 State.LowestLevelOnLine = Current.NestingLevel; in addTokenOnNewLine()
1099 (!Style.isCpp() && Current.is(tok::r_brace) && State.Stack.size() > 1 && in addTokenOnNewLine()
1101 (Style.Language == FormatStyle::LK_ObjC && Current.is(tok::r_brace) && in addTokenOnNewLine()
1106 (Current.MatchingParen && in addTokenOnNewLine()
1107 Current.MatchingParen->is(TT_RequiresExpressionLBrace)); in addTokenOnNewLine()
1111 Current.MatchingParen && Current.MatchingParen->is(TT_LambdaLBrace)) { in addTokenOnNewLine()
1147 Current.NestingLevel != 0) && in addTokenOnNewLine()
1151 Current.isNot(TT_BinaryOperator) && !PreviousNonComment->opensScope() && in addTokenOnNewLine()
1155 Current.isNot(TT_LambdaLBrace))) { in addTokenOnNewLine()
1211 FormatToken &Current = *State.NextToken; in getNewLineColumn() local
1215 Current.isNot(TT_CSharpGenericTypeConstraint)) { in getNewLineColumn()
1219 const FormatToken &Previous = *Current.Previous; in getNewLineColumn()
1224 const FormatToken *PreviousNonComment = Current.getPreviousNonComment(); in getNewLineColumn()
1227 NextNonComment = &Current; in getNewLineColumn()
1231 Current.isOneOf(Keywords.kw_implements, Keywords.kw_extends)) { in getNewLineColumn()
1251 if (Current.NestingLevel == 0 || in getNewLineColumn()
1258 if (Current.is(TT_LambdaArrow) && in getNewLineColumn()
1263 if ((Current.isOneOf(tok::r_brace, tok::r_square) || in getNewLineColumn()
1264 (Current.is(tok::greater) && (Style.isProto() || Style.isTableGen()))) && in getNewLineColumn()
1266 if (Current.closesBlockOrBlockTypeList(Style)) in getNewLineColumn()
1268 if (Current.MatchingParen && Current.MatchingParen->is(BK_BracedInit)) in getNewLineColumn()
1287 if (Current.is(tok::r_paren) && State.Stack.size() > 1 && in getNewLineColumn()
1288 (!Current.Next || in getNewLineColumn()
1289 Current.Next->isOneOf(tok::semi, tok::kw_const, tok::l_brace))) { in getNewLineColumn()
1294 if (Style.isTableGen() && Current.is(TT_TableGenDAGArgCloser) && in getNewLineColumn()
1299 (Current.is(tok::r_paren) || in getNewLineColumn()
1300 (Current.is(tok::r_brace) && Current.MatchingParen && in getNewLineColumn()
1301 Current.MatchingParen->is(BK_BracedInit))) && in getNewLineColumn()
1314 if (Current.is(tok::identifier) && Current.Next && in getNewLineColumn()
1315 (!Style.isVerilog() || Current.Next->is(tok::colon)) && in getNewLineColumn()
1316 (Current.Next->is(TT_DictLiteral) || in getNewLineColumn()
1317 (Style.isProto() && Current.Next->isOneOf(tok::less, tok::l_brace)))) { in getNewLineColumn()
1340 (Previous.is(tok::colon) && !Current.FakeLParens.empty() && in getNewLineColumn()
1341 Current.FakeLParens.back() == prec::Conditional)) && in getNewLineColumn()
1358 if (Current.is(TT_RequiresClause)) { in getNewLineColumn()
1377 Current.isNot(tok::l_paren)) || in getNewLineColumn()
1459 !Current.isBinaryOperator() && in getNewLineColumn()
1460 !Current.isOneOf(tok::colon, tok::comment)) { in getNewLineColumn()
1463 if (Current.is(TT_ProtoExtensionLSquare)) in getNewLineColumn()
1465 if (Current.isBinaryOperator() && CurrentState.UnindentOperator) { in getNewLineColumn()
1466 return CurrentState.Indent - Current.Tok.getLength() - in getNewLineColumn()
1467 Current.SpacesRequiredBefore; in getNewLineColumn()
1469 if (Current.is(tok::comment) && NextNonComment->isBinaryOperator() && in getNewLineColumn()
1484 const FormatToken &Current, in hasNestedBlockInlined() argument
1492 return Style.BraceWrapping.BeforeLambdaBody && Current.is(TT_LambdaLSquare); in hasNestedBlockInlined()
1498 const FormatToken &Current = *State.NextToken; in moveStateToNextToken() local
1501 if (Current.is(TT_CSharpGenericTypeConstraint)) in moveStateToNextToken()
1503 if (Current.isOneOf(tok::comma, TT_BinaryOperator)) in moveStateToNextToken()
1505 if (Current.isOneOf(TT_InheritanceColon, TT_CSharpGenericTypeConstraintColon)) in moveStateToNextToken()
1507 if (Current.is(tok::lessless) && Current.isNot(TT_OverloadedOperator)) { in moveStateToNextToken()
1513 if (Current.is(TT_BinaryOperator) && Current.isNot(tok::lessless)) in moveStateToNextToken()
1515 if (Current.is(TT_ConditionalExpr) && Current.Previous && in moveStateToNextToken()
1516 Current.Previous->isNot(TT_ConditionalExpr)) { in moveStateToNextToken()
1519 if (Current.is(TT_ArraySubscriptLSquare) && in moveStateToNextToken()
1533 if (IsWrappedConditional(Current)) in moveStateToNextToken()
1535 if (Style.BreakBeforeTernaryOperators && Current.is(tok::question)) in moveStateToNextToken()
1537 if (!Style.BreakBeforeTernaryOperators && Current.isNot(tok::colon)) { in moveStateToNextToken()
1538 const FormatToken *Previous = Current.Previous; in moveStateToNextToken()
1544 if (!Current.opensScope() && !Current.closesScope() && in moveStateToNextToken()
1545 Current.isNot(TT_PointerOrReference)) { in moveStateToNextToken()
1547 std::min(State.LowestLevelOnLine, Current.NestingLevel); in moveStateToNextToken()
1549 if (Current.isMemberAccess()) in moveStateToNextToken()
1550 CurrentState.StartOfFunctionCall = !Current.NextOperator ? 0 : State.Column; in moveStateToNextToken()
1551 if (Current.is(TT_SelectorName)) in moveStateToNextToken()
1553 if (Current.is(TT_CtorInitializerColon) && in moveStateToNextToken()
1575 if (Current.is(TT_CtorInitializerColon) && in moveStateToNextToken()
1585 if (Current.is(TT_InheritanceColon)) { in moveStateToNextToken()
1589 if (Current.isOneOf(TT_BinaryOperator, TT_ConditionalExpr) && Newline) in moveStateToNextToken()
1590 CurrentState.NestedBlockIndent = State.Column + Current.ColumnWidth + 1; in moveStateToNextToken()
1591 if (Current.isOneOf(TT_LambdaLSquare, TT_LambdaArrow)) in moveStateToNextToken()
1593 if (Current.is(TT_RequiresExpression) && in moveStateToNextToken()
1599 const FormatToken *Previous = Current.getPreviousNonComment(); in moveStateToNextToken()
1607 if (Current.isNot(tok::comment) && !Current.ClosesRequiresClause && in moveStateToNextToken()
1620 !Newline && hasNestedBlockInlined(Previous, Current, Style); in moveStateToNextToken()
1632 if (Current.is(TT_ObjCStringLiteral) && State.StartOfStringLiteral == 0) in moveStateToNextToken()
1634 if (Current.is(TT_CSharpStringLiteral) && State.StartOfStringLiteral == 0) { in moveStateToNextToken()
1636 } else if (Current.is(TT_TableGenMultiLineString) && in moveStateToNextToken()
1639 } else if (Current.isStringLiteral() && State.StartOfStringLiteral == 0) { in moveStateToNextToken()
1641 } else if (!Current.isOneOf(tok::comment, tok::identifier, tok::hash) && in moveStateToNextToken()
1642 !Current.isStringLiteral()) { in moveStateToNextToken()
1646 State.Column += Current.ColumnWidth; in moveStateToNextToken()
1654 Keywords.isVerilogEndOfLabel(Current)) { in moveStateToNextToken()
1660 handleEndOfLine(Current, State, DryRun, AllowBreak, Newline); in moveStateToNextToken()
1662 if (Current.Role) in moveStateToNextToken()
1663 Current.Role->formatFromToken(State, this, DryRun); in moveStateToNextToken()
1677 const FormatToken &Current = *State.NextToken; in moveStatePastFakeLParens() local
1678 if (Current.FakeLParens.empty()) in moveStatePastFakeLParens()
1681 const FormatToken *Previous = Current.getPreviousNonComment(); in moveStatePastFakeLParens()
1693 for (const auto &PrecedenceLevel : llvm::reverse(Current.FakeLParens)) { in moveStatePastFakeLParens()
1712 if (!Current.isTrailingComment() && in moveStatePastFakeLParens()
1718 PrecedenceLevel > prec::Comma || Current.NestingLevel == 0) && in moveStatePastFakeLParens()
1735 if ((shouldUnindentNextOperator(Current) || in moveStatePastFakeLParens()
1758 Current.isNot(TT_UnaryOperator) && in moveStatePastFakeLParens()
1770 &PrecedenceLevel == &Current.FakeLParens.back() && in moveStatePastFakeLParens()
1776 !Current.isTrailingComment())) { in moveStatePastFakeLParens()
1806 const FormatToken &Current = *State.NextToken; in moveStatePastScopeOpener() local
1807 if (!Current.opensScope()) in moveStatePastScopeOpener()
1813 if (Current.isOneOf(tok::less, tok::l_paren) && in moveStatePastScopeOpener()
1818 if (Current.MatchingParen && Current.is(BK_Block)) { in moveStatePastScopeOpener()
1829 if (Current.isOneOf(tok::l_brace, TT_ArrayInitializerLSquare) || in moveStatePastScopeOpener()
1830 opensProtoMessageField(Current, Style)) { in moveStatePastScopeOpener()
1831 if (Current.opensBlockOrBlockTypeList(Style)) { in moveStatePastScopeOpener()
1834 } else if (Current.is(tok::l_brace)) { in moveStatePastScopeOpener()
1841 const FormatToken *NextNonComment = Current.getNextNonComment(); in moveStatePastScopeOpener()
1842 bool EndsInComma = Current.MatchingParen && in moveStatePastScopeOpener()
1843 Current.MatchingParen->Previous && in moveStatePastScopeOpener()
1844 Current.MatchingParen->Previous->is(tok::comma); in moveStatePastScopeOpener()
1845 AvoidBinPacking = EndsInComma || Current.is(TT_DictLiteral) || in moveStatePastScopeOpener()
1851 if (Current.ParameterCount > 1) in moveStatePastScopeOpener()
1858 if (Style.isTableGen() && Current.is(TT_TableGenDAGArgOpenerToBreak) && in moveStatePastScopeOpener()
1864 const FormatToken *Next = Current.Next; in moveStatePastScopeOpener()
1873 if (Current.is(tok::less) && Current.ParentBracket == tok::l_paren) { in moveStatePastScopeOpener()
1879 Current.MatchingParen && in moveStatePastScopeOpener()
1880 Current.MatchingParen->getPreviousNonComment() && in moveStatePastScopeOpener()
1881 Current.MatchingParen->getPreviousNonComment()->is(tok::comma); in moveStatePastScopeOpener()
1895 Current.getPreviousNonComment() && in moveStatePastScopeOpener()
1896 Current.getPreviousNonComment()->is(tok::kw__Generic); in moveStatePastScopeOpener()
1904 (Current.is(PPK_OnePerLine) || in moveStatePastScopeOpener()
1905 (!BinPackInconclusiveFunctions && Current.is(PPK_Inconclusive)))); in moveStatePastScopeOpener()
1907 if (Current.is(TT_ObjCMethodExpr) && Current.MatchingParen && in moveStatePastScopeOpener()
1912 if (getLengthToMatchingParen(Current, State.Stack) + State.Column > in moveStatePastScopeOpener()
1919 for (const FormatToken *Tok = &Current; in moveStatePastScopeOpener()
1920 Tok && Tok != Current.MatchingParen; Tok = Tok->Next) { in moveStatePastScopeOpener()
1937 Current.Children.empty() && in moveStatePastScopeOpener()
1938 !Current.isOneOf(TT_DictLiteral, TT_ArrayInitializerLSquare) && in moveStatePastScopeOpener()
1940 (Current.is(TT_TemplateOpener) && in moveStatePastScopeOpener()
1943 ParenState(&Current, NewIndent, LastSpace, AvoidBinPacking, NoLineBreak)); in moveStatePastScopeOpener()
1947 NewState.HasMultipleNestedBlocks = (Current.BlockParameterCount > 1); in moveStatePastScopeOpener()
1949 if (Style.BraceWrapping.BeforeLambdaBody && Current.Next && in moveStatePastScopeOpener()
1950 Current.is(tok::l_paren)) { in moveStatePastScopeOpener()
1952 FormatToken const *next = Current.Next; in moveStatePastScopeOpener()
1962 NewState.IsInsideObjCArrayLiteral = Current.is(TT_ArrayInitializerLSquare) && in moveStatePastScopeOpener()
1963 Current.Previous && in moveStatePastScopeOpener()
1964 Current.Previous->is(tok::at); in moveStatePastScopeOpener()
1968 const FormatToken &Current = *State.NextToken; in moveStatePastScopeCloser() local
1969 if (!Current.closesScope()) in moveStatePastScopeCloser()
1975 (Current.isOneOf(tok::r_paren, tok::r_square, TT_TemplateString) || in moveStatePastScopeCloser()
1976 (Current.is(tok::r_brace) && State.NextToken != State.Line->First) || in moveStatePastScopeCloser()
1979 (Current.is(tok::greater) && Current.is(TT_DictLiteral)))) { in moveStatePastScopeCloser()
1995 if (CurrentState.BreakBeforeParameter && Current.MatchingParen && in moveStatePastScopeCloser()
1996 Current.MatchingParen->Previous) { in moveStatePastScopeCloser()
1997 const FormatToken &CurrentScopeOpener = *Current.MatchingParen->Previous; in moveStatePastScopeCloser()
2002 CurrentScopeOpener.TotalLength - Current.TotalLength - 1; in moveStatePastScopeCloser()
2003 if (State.Column + Current.ColumnWidth + NecessarySpaceInLine <= in moveStatePastScopeCloser()
2010 if (Current.is(tok::r_square)) { in moveStatePastScopeCloser()
2012 const FormatToken *NextNonComment = Current.getNextNonComment(); in moveStatePastScopeCloser()
2060 const FormatToken &Current, LineState &State, in reformatRawStringLiteral() argument
2062 unsigned StartColumn = State.Column - Current.ColumnWidth; in reformatRawStringLiteral()
2063 StringRef OldDelimiter = *getRawStringDelimiter(Current.TokenText); in reformatRawStringLiteral()
2075 Current.TokenText.substr(OldPrefixSize).drop_back(OldSuffixSize)); in reformatRawStringLiteral()
2099 bool ContentStartsOnNewline = Current.TokenText[OldPrefixSize] == '\n'; in reformatRawStringLiteral()
2122 (!Newline && Current.Next && Current.Next->is(tok::r_paren)) in reformatRawStringLiteral()
2138 Current.NewlinesBefore ? FirstStartColumn - NewPrefixSize : CurrentIndent; in reformatRawStringLiteral()
2148 return addMultilineToken(Current, State); in reformatRawStringLiteral()
2154 Current.Tok.getLocation().getLocWithOffset(2); in reformatRawStringLiteral()
2165 Current.Tok.getLocation().getLocWithOffset(Current.TokenText.size() - in reformatRawStringLiteral()
2176 Current.Tok.getLocation().getLocWithOffset(OldPrefixSize); in reformatRawStringLiteral()
2207 unsigned ContinuationIndenter::addMultilineToken(const FormatToken &Current, in addMultilineToken() argument
2216 State.Column = Current.LastLineColumnWidth; in addMultilineToken()
2223 unsigned ContinuationIndenter::handleEndOfLine(const FormatToken &Current, in handleEndOfLine() argument
2229 auto RawStringStyle = getRawStringStyle(Current, State); in handleEndOfLine()
2230 if (RawStringStyle && !Current.Finalized) { in handleEndOfLine()
2231 Penalty = reformatRawStringLiteral(Current, State, *RawStringStyle, DryRun, in handleEndOfLine()
2233 } else if (Current.IsMultiline && Current.isNot(TT_BlockComment)) { in handleEndOfLine()
2236 Penalty = addMultilineToken(Current, State); in handleEndOfLine()
2248 Current, State, AllowBreak, /*DryRun=*/true, Strict); in handleEndOfLine()
2254 breakProtrudingToken(Current, StrictState, AllowBreak, in handleEndOfLine()
2266 breakProtrudingToken(Current, OriginalState, AllowBreak, /*DryRun=*/false, in handleEndOfLine()
2279 static StringRef getEnclosingFunctionName(const FormatToken &Current) { in getEnclosingFunctionName() argument
2281 auto Tok = Current.getPreviousNonComment(); in getEnclosingFunctionName()
2298 ContinuationIndenter::getRawStringStyle(const FormatToken &Current, in getRawStringStyle() argument
2300 if (!Current.isStringLiteral()) in getRawStringStyle()
2302 auto Delimiter = getRawStringDelimiter(Current.TokenText); in getRawStringStyle()
2308 getEnclosingFunctionName(Current)); in getRawStringStyle()
2317 ContinuationIndenter::createBreakableToken(const FormatToken &Current, in createBreakableToken() argument
2319 unsigned StartColumn = State.Column - Current.ColumnWidth; in createBreakableToken()
2320 if (Current.isStringLiteral()) { in createBreakableToken()
2337 if (Current.IsUnterminatedLiteral) in createBreakableToken()
2348 if (Style.isVerilog() && Current.Previous && in createBreakableToken()
2349 Current.Previous->isOneOf(tok::kw_export, Keywords.kw_import)) { in createBreakableToken()
2352 StringRef Text = Current.TokenText; in createBreakableToken()
2360 : Current.UnbreakableTailLength; in createBreakableToken()
2377 Current, QuoteStyle, in createBreakableToken()
2378 /*UnindentPlus=*/shouldUnindentNextOperator(Current), StartColumn, in createBreakableToken()
2397 Current, StartColumn, Prefix, Postfix, UnbreakableTailLength, in createBreakableToken()
2400 } else if (Current.is(TT_BlockComment)) { in createBreakableToken()
2405 switchesFormatting(Current)) { in createBreakableToken()
2409 Current, StartColumn, Current.OriginalColumn, !Current.Previous, in createBreakableToken()
2411 } else if (Current.is(TT_LineComment) && in createBreakableToken()
2412 (!Current.Previous || in createBreakableToken()
2413 Current.Previous->isNot(TT_ImplicitStringLiteral))) { in createBreakableToken()
2415 for (const FormatToken *T = &Current; T && T->is(TT_LineComment); in createBreakableToken()
2423 CommentPragmasRegex.match(Current.TokenText.substr(2)) || in createBreakableToken()
2424 switchesFormatting(Current) || !RegularComments) { in createBreakableToken()
2428 Current, StartColumn, /*InPPDirective=*/false, Encoding, Style); in createBreakableToken()
2434 ContinuationIndenter::breakProtrudingToken(const FormatToken &Current, in breakProtrudingToken() argument
2438 createBreakableToken(Current, State, AllowBreak); in breakProtrudingToken()
2443 if (Current.is(TT_LineComment)) { in breakProtrudingToken()
2452 if (Current.UnbreakableTailLength >= ColumnLimit) in breakProtrudingToken()
2456 unsigned StartColumn = State.Column - Current.ColumnWidth; in breakProtrudingToken()
2457 unsigned NewBreakPenalty = Current.isStringLiteral() in breakProtrudingToken()
2793 Current.UnbreakableTailLength; in breakProtrudingToken()
2802 if (Current.isNot(TT_LineComment)) in breakProtrudingToken()
2806 if (Current.is(TT_BlockComment)) in breakProtrudingToken()
2823 const FormatToken &Current = *State.NextToken; in nextIsMultilineString() local
2824 if (!Current.isStringLiteral() || Current.is(TT_ImplicitStringLiteral)) in nextIsMultilineString()
2829 if (Current.TokenText.starts_with("R\"")) in nextIsMultilineString()
2831 if (Current.IsMultiline) in nextIsMultilineString()
2833 if (Current.getNextNonComment() && in nextIsMultilineString()
2834 Current.getNextNonComment()->isStringLiteral()) { in nextIsMultilineString()
2838 State.Column + Current.ColumnWidth + Current.UnbreakableTailLength > in nextIsMultilineString()