Lines Matching full:previous
42 const FormatToken *Previous = Tok.getPreviousNonComment();
43 return Previous && (Previous->getPrecedence() == prec::Assignment ||
44 Previous->isOneOf(tok::kw_return, TT_RequiresClause));
128 return Tok.isMemberAccess() && Tok.Previous && Tok.Previous->closesScope();
134 const FormatToken &Previous = *Current.Previous;
141 return Previous.is(tok::comma) && !Current.isTrailingComment() &&
142 ((Previous.isNot(TT_CtorInitializerComma) ||
145 (Previous.isNot(TT_InheritanceComma) ||
156 (LessTok.Previous && LessTok.Previous->is(tok::equal))));
292 const FormatToken &Previous = *Current.Previous;
294 assert(&Previous == Current.Previous);
301 if (!Current.MustBreakBefore && Previous.is(tok::l_brace) &&
302 Previous.isNot(TT_DictLiteral) && Previous.is(BK_BracedInit) &&
303 Previous.Previous &&
304 Previous.Previous->isOneOf(tok::l_brace, tok::l_paren, tok::comma)) {
312 if (Previous.opensScope() && Previous.isNot(tok::l_brace) &&
322 if (Previous.is(tok::l_brace) && State.Stack.size() > 1 &&
356 if (Previous.is(tok::l_square) && Previous.is(TT_ObjCMethodExpr))
359 if (Current.is(TT_ConditionalExpr) && Previous.is(tok::r_paren) &&
360 Previous.MatchingParen && Previous.MatchingParen->Previous &&
361 Previous.MatchingParen->Previous->MatchingParen &&
362 Previous.MatchingParen->Previous->MatchingParen->is(TT_LambdaLBrace)) {
364 assert(Previous.MatchingParen->Previous->is(tok::r_brace));
373 const FormatToken &Previous = *Current.Previous;
376 Current.is(TT_LambdaLBrace) && Previous.isNot(TT_LineComment)) {
404 Previous.isNot(TT_CSharpGenericTypeConstraintComma)) {
407 if ((startsNextParameter(Current, Style) || Previous.is(tok::semi) ||
408 (Previous.is(TT_TemplateCloser) && Current.is(TT_StartOfName) &&
414 (Previous.NestingLevel == 1 || Style.BinPackParameters)) ||
416 Previous.isNot(tok::question)) ||
418 Previous.is(TT_ConditionalExpr))) &&
426 (!Style.BreakBeforeTernaryOperators && Previous.is(TT_ConditionalExpr) &&
427 Previous.is(tok::colon)))) {
430 if (((Previous.is(TT_DictLiteral) && Previous.is(tok::l_brace)) ||
431 (Previous.is(TT_ArrayInitializerLSquare) &&
432 Previous.ParameterCount > 1) ||
433 opensProtoMessageField(Previous, Style)) &&
435 getLengthToMatchingParen(Previous, State.Stack) + State.Column - 1 >
442 ? Previous
445 (State.Column + State.Line->Last->TotalLength - Previous.TotalLength >
455 if (Current.is(TT_ObjCMethodExpr) && Previous.isNot(TT_SelectorName) &&
459 if (Current.is(TT_SelectorName) && Previous.isNot(tok::at) &&
483 !(Previous.closesScopeAfterBlock() && State.Column <= NewLineColumn)) {
489 if (Previous.ClosesTemplateDeclaration && CurrentState.BreakBeforeParameter &&
499 Previous.is(tok::comma) || Current.NestingLevel < 2) &&
500 !Previous.isOneOf(tok::kw_return, tok::lessless, tok::at,
502 !Previous.isOneOf(TT_InlineASMColon, TT_ConditionalExpr) &&
510 if (Previous.is(TT_BinaryOperator) && Current.CanBreakBefore) {
511 const auto PreviousPrecedence = Previous.getPrecedence();
515 Previous.Previous && Previous.Previous->EndsBinaryExpression;
531 Previous.Previous &&
532 Previous.Previous->isNot(TT_BinaryOperator); // For >>.
552 if (Previous.ClosesTemplateDeclaration) {
576 if (Previous.is(TT_FunctionAnnotationRParen) &&
580 if (Previous.is(TT_LeadingJavaAnnotation) && Current.isNot(tok::l_paren) &&
586 if (Style.isJavaScript() && Previous.is(tok::r_paren) &&
587 Previous.is(TT_JavaAnnotation)) {
603 !Style.isJavaScript() && Previous.isNot(tok::kw_template) &&
611 if (Style.ColumnLimit != 0 && Previous.is(BK_Block) &&
612 Previous.is(tok::l_brace) &&
618 ((Previous.is(tok::identifier) && Previous.TokenText == "endl") ||
619 (Previous.Tok.isLiteral() && (Previous.TokenText.ends_with("\\n\"") ||
620 Previous.TokenText == "\'\\n\'")))) {
624 if (Previous.is(TT_BlockComment) && Previous.IsMultiline)
637 assert(State.NextToken->Previous);
638 const FormatToken &Previous = *State.NextToken->Previous;
644 (!Previous.Tok.getIdentifierInfo() ||
645 Previous.Tok.getIdentifierInfo()->getPPKeywordID() ==
675 assert(State.NextToken->Previous);
676 const FormatToken &Previous = *State.NextToken->Previous;
687 const auto *Prev = Current.Previous;
723 (!Previous.Previous ||
724 Previous.Previous->isNot(TT_DesignatedInitializerPeriod))) {
727 const FormatToken *Tok = &Previous;
732 Tok = Tok->Previous;
734 if (Previous.PartOfMultiVariableDeclStmt)
743 Previous.is(tok::hash) && State.FirstIndent > 0 &&
744 &Previous == State.Line->First &&
770 Previous.is(TT_InheritanceColon)) {
799 if (!Tok.Previous)
801 if (Tok.Previous->isIf())
803 return !Tok.Previous->isOneOf(TT_CastRParen, tok::kw_for, tok::kw_while,
808 IsOpeningBracket(Previous) && State.Column > getNewLineColumn(State) &&
820 if (Previous.is(TT_TemplateString) && Previous.opensScope())
828 !CurrentState.IsCSharpGenericTypeConstraint && Previous.opensScope() &&
829 Previous.isNot(TT_ObjCMethodExpr) && Previous.isNot(TT_RequiresClause) &&
830 Previous.isNot(TT_TableGenDAGArgOpener) &&
831 Previous.isNot(TT_TableGenDAGArgOpenerToBreak) &&
832 !(Current.MacroParent && Previous.MacroParent) &&
834 Previous.isOneOf(BK_BracedInit, TT_VerilogMultiLineListLParen))) {
847 if (Current.isMemberAccess() && Previous.is(tok::r_paren) &&
848 (Previous.MatchingParen &&
849 (Previous.TotalLength - Previous.MatchingParen->TotalLength > 10))) {
890 if (Current.isNot(tok::comment) && Previous.is(tok::l_paren) &&
891 Previous.Previous &&
892 (Previous.Previous->is(tok::kw_for) || Previous.Previous->isIf())) {
898 ((Previous.is(tok::comma) &&
899 Previous.isNot(TT_OverloadedOperator)) ||
900 (Previous.is(tok::colon) && Previous.is(TT_ObjCMethodExpr)))) {
902 } else if (Previous.is(TT_CtorInitializerColon) &&
908 } else if (Previous.isOneOf(TT_ConditionalExpr, TT_CtorInitializerColon)) {
910 } else if (Previous.is(TT_BinaryOperator) &&
911 ((Previous.getPrecedence() != prec::Assignment &&
912 (Previous.isNot(tok::lessless) || Previous.OperatorIndex != 0 ||
913 Previous.NextOperator)) ||
919 } else if (Previous.is(TT_InheritanceColon)) {
924 } else if (Previous.opensScope()) {
930 if (Previous.MatchingParen) {
931 const FormatToken *Next = Previous.MatchingParen->getNextNonComment();
943 assert(State.NextToken->Previous);
944 const FormatToken &Previous = *State.NextToken->Previous;
952 const FormatToken *NextNonComment = Previous.getNextNonComment();
1049 Previous.is(TT_BinaryOperator)) {
1183 if (!(Previous.isOneOf(tok::l_paren, tok::l_brace, TT_BinaryOperator) ||
1191 Previous.is(TT_DictLiteral)) {
1208 if (!State.NextToken || !State.NextToken->Previous)
1219 const FormatToken &Previous = *Current.Previous;
1225 const FormatToken *NextNonComment = Previous.getNextNonComment();
1259 Previous.isOneOf(tok::kw_noexcept, tok::kw_mutable, tok::kw_constexpr,
1272 // Indent a closing parenthesis at the previous level if followed by a semi,
1336 Previous.is(TT_ConditionalExpr))) {
1340 (Previous.is(tok::colon) && !Current.FakeLParens.empty() &&
1356 if (Previous.is(tok::comma) && CurrentState.VariablePos != 0)
1440 Previous.isOneOf(tok::coloncolon, tok::equal, TT_JsTypeColon)) {
1457 if (Previous.is(tok::r_paren) &&
1458 Previous.isNot(TT_TableGenDAGArgOperatorToBreak) &&
1483 static bool hasNestedBlockInlined(const FormatToken *Previous,
1486 if (Previous->isNot(tok::l_paren))
1488 if (Previous->ParameterCount > 1)
1515 if (Current.is(TT_ConditionalExpr) && Current.Previous &&
1516 Current.Previous->isNot(TT_ConditionalExpr)) {
1538 const FormatToken *Previous = Current.Previous;
1539 while (Previous && Previous->isTrailingComment())
1540 Previous = Previous->Previous;
1541 if (Previous && Previous->is(tok::question))
1599 const FormatToken *Previous = Current.getPreviousNonComment();
1608 Previous && Previous->isOneOf(tok::l_brace, TT_ArrayInitializerLSquare) &&
1609 Previous->isNot(TT_DictLiteral) && State.Stack.size() > 1 &&
1616 if (Previous && (Previous->isOneOf(TT_BinaryOperator, TT_ConditionalExpr) ||
1617 (Previous->isOneOf(tok::l_paren, tok::comma, tok::colon) &&
1618 !Previous->isOneOf(TT_DictLiteral, TT_ObjCMethodExpr)))) {
1620 !Newline && hasNestedBlockInlined(Previous, Current, Style);
1664 // If the previous has a special role, let it consume tokens as appropriate.
1665 // It is necessary to start at the previous token for the only implemented
1669 if (Previous && Previous->Role)
1670 Penalty += Previous->Role->formatAfterToken(State, this, DryRun);
1681 const FormatToken *Previous = Current.getPreviousNonComment();
1687 Previous &&
1688 (Previous->opensScope() ||
1689 Previous->isOneOf(tok::semi, tok::kw_return, TT_RequiresClause) ||
1690 (Previous->getPrecedence() == prec::Assignment &&
1692 Previous->is(TT_ObjCMethodExpr));
1715 (!Previous || Previous->isNot(tok::kw_return) ||
1720 (Previous && Previous->isOneOf(TT_TableGenDAGArgListComma,
1729 if (Previous && Previous->endsSequence(tok::l_paren, tok::kw__Generic) &&
1736 (Previous &&
1738 Previous->is(tok::question) && Previous->is(TT_ConditionalExpr)))) &&
1768 if (PrecedenceLevel == prec::Conditional && Previous &&
1769 Previous->is(tok::colon) && Previous->is(TT_ConditionalExpr) &&
1779 if ((Previous && !Previous->opensScope()) || PrecedenceLevel != prec::Comma)
1843 Current.MatchingParen->Previous &&
1844 Current.MatchingParen->Previous->is(tok::comma);
1963 Current.Previous &&
1964 Current.Previous->is(tok::at);
1996 Current.MatchingParen->Previous) {
1997 const FormatToken &CurrentScopeOpener = *Current.MatchingParen->Previous;
2348 if (Style.isVerilog() && Current.Previous &&
2349 Current.Previous->isOneOf(tok::kw_export, Keywords.kw_import)) {
2409 Current, StartColumn, Current.OriginalColumn, !Current.Previous,
2412 (!Current.Previous ||
2413 Current.Previous->isNot(TT_ImplicitStringLiteral))) {
2465 // Store whether we inserted a new line break at the end of the previous
2470 // line that doesn't get reflown with the previous line is reached.
2494 // If we did reflow the previous line, we'll try reflowing again. Otherwise
2611 // the previous line, since in that case the previous line should still