Lines Matching defs:Previous
44 return Tok.isMemberAccess() && Tok.Previous && Tok.Previous->closesScope();
50 const FormatToken &Previous = *Current.Previous;
54 return Previous.is(tok::comma) && !Current.isTrailingComment() &&
55 (Previous.Type != TT_CtorInitializerComma ||
93 const FormatToken &Previous = *Current.Previous;
94 assert(&Previous == Current.Previous);
100 if (!Current.MustBreakBefore && Previous.is(tok::l_brace) &&
101 Previous.Type != TT_DictLiteral && Previous.BlockKind == BK_BracedInit &&
102 Previous.Previous &&
103 Previous.Previous->isOneOf(tok::l_brace, tok::l_paren, tok::comma))
110 if (Previous.opensScope() && Previous.isNot(tok::l_brace) &&
119 Previous.is(tok::l_brace) && State.Stack.size() > 1 &&
129 const FormatToken &Previous = *Current.Previous;
135 if (Previous.is(tok::semi) && State.LineContainsContinuedForLoopSection)
137 if ((startsNextParameter(Current, Style) || Previous.is(tok::semi) ||
140 Previous.isNot(tok::question)))) ||
142 (Previous.is(tok::question) || Previous.Type == TT_ConditionalExpr))) &&
148 !Previous.isOneOf(tok::kw_return, tok::lessless, tok::at) &&
149 Previous.Type != TT_InlineASMColon &&
150 Previous.Type != TT_ConditionalExpr && nextIsMultilineString(State))
152 if (((Previous.Type == TT_DictLiteral && Previous.is(tok::l_brace)) ||
153 Previous.Type == TT_ArrayInitializerLSquare) &&
155 getLengthToMatchingParen(Previous) + State.Column > getColumnLimit(State))
177 bool IsComparison = (Previous.getPrecedence() == prec::Relational ||
178 Previous.getPrecedence() == prec::Equality) &&
179 Previous.Previous &&
180 Previous.Previous->Type != TT_BinaryOperator; // For >>.
182 Previous.Previous && Previous.Previous->EndsBinaryExpression;
183 if (Previous.Type == TT_BinaryOperator &&
186 !Current.isTrailingComment() && !Previous.is(tok::lessless) &&
187 Previous.getPrecedence() != prec::Assignment &&
202 if (Previous.ClosesTemplateDeclaration && Current.NestingLevel == 0 &&
221 if (Style.ColumnLimit != 0 && Previous.BlockKind == BK_Block &&
222 Previous.is(tok::l_brace) && !Current.isOneOf(tok::r_brace, tok::comment))
235 (Current.Previous->Tok.getIdentifierInfo() == nullptr ||
236 Current.Previous->Tok.getIdentifierInfo()->getPPKeywordID() ==
260 const FormatToken &Previous = *State.NextToken->Previous;
266 const FormatToken *Tok = &Previous;
271 Tok = Tok->Previous;
273 if (Previous.PartOfMultiVariableDeclStmt)
295 if (Previous.opensScope() && Previous.Type != TT_ObjCMethodExpr &&
296 (Current.Type != TT_LineComment || Previous.BlockKind == BK_BracedInit))
304 if (Current.isNot(tok::comment) && Previous.is(tok::l_paren) &&
305 Previous.Previous && Previous.Previous->isOneOf(tok::kw_if, tok::kw_for))
310 (Previous.is(tok::comma) ||
311 (Previous.is(tok::colon) && Previous.Type == TT_ObjCMethodExpr)))
313 else if ((Previous.Type == TT_BinaryOperator ||
314 Previous.Type == TT_ConditionalExpr ||
315 Previous.Type == TT_CtorInitializerColon) &&
316 ((Previous.getPrecedence() != prec::Assignment &&
317 (Previous.isNot(tok::lessless) || Previous.OperatorIndex != 0 ||
318 !Previous.LastOperator)) ||
324 else if (Previous.Type == TT_InheritanceColon) {
327 } else if (Previous.opensScope()) {
334 if (Previous.MatchingParen) {
335 const FormatToken *Next = Previous.MatchingParen->getNextNonComment();
347 const FormatToken &Previous = *State.NextToken->Previous;
354 const FormatToken *NextNonComment = Previous.getNextNonComment();
408 if ((Previous.isOneOf(tok::comma, tok::semi) &&
410 Previous.Type == TT_BinaryOperator)
412 if (Previous.Type == TT_TemplateCloser && Current.NestingLevel == 0)
461 if (!(Previous.isOneOf(tok::l_paren, tok::l_brace) ||
462 Previous.Type == TT_BinaryOperator) ||
465 Previous.Type == TT_DictLiteral)
473 if (!State.NextToken || !State.NextToken->Previous)
476 const FormatToken &Previous = *State.NextToken->Previous;
482 const FormatToken *NextNonComment = Previous.getNextNonComment();
517 Previous.Type == TT_ConditionalExpr))
519 if (Previous.is(tok::comma) && State.Stack.back().VariablePos != 0)
551 Previous.isOneOf(tok::coloncolon, tok::equal)) {
622 const FormatToken *Previous = Current.getPreviousNonComment();
631 if (Current.isNot(tok::comment) && Previous && Previous->is(tok::l_brace) &&
666 // If the previous has a special role, let it consume tokens as appropriate.
667 // It is necessary to start at the previous token for the only implemented
671 if (Previous && Previous->Role)
672 Penalty += Previous->Role->formatAfterToken(State, this, DryRun);
680 const FormatToken *Previous = Current.getPreviousNonComment();
686 (Previous && (Previous->opensScope() || Previous->is(tok::kw_return) ||
687 Previous->getPrecedence() == prec::Assignment ||
688 Previous->Type == TT_ObjCMethodExpr));
699 if (!Previous || Previous->isNot(tok::kw_return) || *I > 0)
708 if (Previous && Previous->getPrecedence() > prec::Assignment &&
709 (Previous->Type == TT_BinaryOperator ||
710 Previous->Type == TT_ConditionalExpr) &&
711 Previous->getPrecedence() != prec::Relational) {
712 bool BreakBeforeOperator = Previous->is(tok::lessless) ||
713 (Previous->Type == TT_BinaryOperator &&
715 (Previous->Type == TT_ConditionalExpr &&
740 if ((Previous && !Previous->opensScope()) || *I > prec::Comma)
975 if (Text.startswith("\"") && Current.Previous &&
976 Current.Previous->is(tok::at)) {
998 !Current.Previous, State.Line->InPPDirective, Encoding, Style));
1000 (Current.Previous == nullptr ||
1001 Current.Previous->Type != TT_ImplicitStringLiteral)) {