Lines Matching refs:Previous

44   return Tok.isMemberAccess() && Tok.Previous && Tok.Previous->closesScope();  in startsSegmentOfBuilderTypeCall()
50 const FormatToken &Previous = *Current.Previous; in startsNextParameter() local
54 return Previous.is(tok::comma) && !Current.isTrailingComment() && in startsNextParameter()
55 (Previous.isNot(TT_CtorInitializerComma) || in startsNextParameter()
94 const FormatToken &Previous = *Current.Previous; in canBreak() local
95 assert(&Previous == Current.Previous); in canBreak()
102 if (!Current.MustBreakBefore && Previous.is(tok::l_brace) && in canBreak()
103 Previous.isNot(TT_DictLiteral) && Previous.BlockKind == BK_BracedInit && in canBreak()
104 Previous.Previous && in canBreak()
105 Previous.Previous->isOneOf(tok::l_brace, tok::l_paren, tok::comma)) in canBreak()
112 if (Previous.opensScope() && Previous.isNot(tok::l_brace) && in canBreak()
121 if (Previous.is(tok::l_brace) && State.Stack.size() > 1 && in canBreak()
137 const FormatToken &Previous = *Current.Previous; in mustBreak() local
143 if (Previous.is(tok::semi) && State.LineContainsContinuedForLoopSection) in mustBreak()
145 if ((startsNextParameter(Current, Style) || Previous.is(tok::semi) || in mustBreak()
148 (Current.is(TT_ConditionalExpr) && Previous.isNot(tok::question)))) || in mustBreak()
150 (Previous.is(tok::question) || Previous.is(TT_ConditionalExpr)))) && in mustBreak()
156 !Previous.isOneOf(tok::kw_return, tok::lessless, tok::at) && in mustBreak()
157 !Previous.isOneOf(TT_InlineASMColon, TT_ConditionalExpr) && in mustBreak()
160 if (((Previous.is(TT_DictLiteral) && Previous.is(tok::l_brace)) || in mustBreak()
161 Previous.is(TT_ArrayInitializerLSquare)) && in mustBreak()
163 getLengthToMatchingParen(Previous) + State.Column > getColumnLimit(State)) in mustBreak()
182 bool IsComparison = (Previous.getPrecedence() == prec::Relational || in mustBreak()
183 Previous.getPrecedence() == prec::Equality) && in mustBreak()
184 Previous.Previous && in mustBreak()
185 Previous.Previous->isNot(TT_BinaryOperator); // For >>. in mustBreak()
187 Previous.Previous && Previous.Previous->EndsBinaryExpression; in mustBreak()
188 if (Previous.is(TT_BinaryOperator) && (!IsComparison || LHSIsBinaryExpr) && in mustBreak()
190 !Current.isTrailingComment() && !Previous.is(tok::lessless) && in mustBreak()
191 Previous.getPrecedence() != prec::Assignment && in mustBreak()
195 if (Current.is(TT_BinaryOperator) && Previous.EndsBinaryExpression && in mustBreak()
210 if (Previous.ClosesTemplateDeclaration) in mustBreak()
212 if (Previous.is(TT_LeadingJavaAnnotation) && Current.isNot(tok::l_paren) && in mustBreak()
230 if (Style.ColumnLimit != 0 && Previous.BlockKind == BK_Block && in mustBreak()
231 Previous.is(tok::l_brace) && !Current.isOneOf(tok::r_brace, tok::comment)) in mustBreak()
234 if (Current.is(tok::lessless) && Previous.is(tok::identifier) && in mustBreak()
235 Previous.TokenText == "endl") in mustBreak()
248 (Current.Previous->Tok.getIdentifierInfo() == nullptr || in addTokenToState()
249 Current.Previous->Tok.getIdentifierInfo()->getPPKeywordID() == in addTokenToState()
279 const FormatToken &Previous = *State.NextToken->Previous; in addTokenOnCurrentLine() local
285 const FormatToken *Tok = &Previous; in addTokenOnCurrentLine()
290 Tok = Tok->Previous; in addTokenOnCurrentLine()
292 if (Previous.PartOfMultiVariableDeclStmt) in addTokenOnCurrentLine()
316 if (Style.AlignAfterOpenBracket && Previous.opensScope() && in addTokenOnCurrentLine()
317 Previous.isNot(TT_ObjCMethodExpr) && in addTokenOnCurrentLine()
318 (Current.isNot(TT_LineComment) || Previous.BlockKind == BK_BracedInit)) in addTokenOnCurrentLine()
327 if (Current.isMemberAccess() && Previous.is(tok::r_paren) && in addTokenOnCurrentLine()
328 (Previous.MatchingParen && in addTokenOnCurrentLine()
329 (Previous.TotalLength - Previous.MatchingParen->TotalLength > 10))) { in addTokenOnCurrentLine()
340 if (Current.isNot(tok::comment) && Previous.is(tok::l_paren) && in addTokenOnCurrentLine()
341 Previous.Previous && in addTokenOnCurrentLine()
342 Previous.Previous->isOneOf(tok::kw_if, tok::kw_for)) { in addTokenOnCurrentLine()
348 (Previous.is(tok::comma) || in addTokenOnCurrentLine()
349 (Previous.is(tok::colon) && Previous.is(TT_ObjCMethodExpr)))) { in addTokenOnCurrentLine()
351 } else if ((Previous.isOneOf(TT_BinaryOperator, TT_ConditionalExpr, in addTokenOnCurrentLine()
353 ((Previous.getPrecedence() != prec::Assignment && in addTokenOnCurrentLine()
354 (Previous.isNot(tok::lessless) || Previous.OperatorIndex != 0 || in addTokenOnCurrentLine()
355 !Previous.LastOperator)) || in addTokenOnCurrentLine()
361 } else if (Previous.is(TT_InheritanceColon)) { in addTokenOnCurrentLine()
364 } else if (Previous.opensScope()) { in addTokenOnCurrentLine()
371 if (Previous.MatchingParen) { in addTokenOnCurrentLine()
372 const FormatToken *Next = Previous.MatchingParen->getNextNonComment(); in addTokenOnCurrentLine()
384 const FormatToken &Previous = *State.NextToken->Previous; in addTokenOnNewLine() local
391 const FormatToken *NextNonComment = Previous.getNextNonComment(); in addTokenOnNewLine()
445 if ((Previous.isOneOf(tok::comma, tok::semi) && in addTokenOnNewLine()
447 Previous.is(TT_BinaryOperator)) in addTokenOnNewLine()
449 if (Previous.isOneOf(TT_TemplateCloser, TT_JavaAnnotation) && in addTokenOnNewLine()
499 if (!Previous.isOneOf(tok::l_paren, tok::l_brace, TT_BinaryOperator) || in addTokenOnNewLine()
502 Previous.is(TT_DictLiteral)) in addTokenOnNewLine()
510 if (!State.NextToken || !State.NextToken->Previous) in getNewLineColumn()
513 const FormatToken &Previous = *Current.Previous; in getNewLineColumn() local
519 const FormatToken *NextNonComment = Previous.getNextNonComment(); in getNewLineColumn()
556 Previous.is(TT_ConditionalExpr))) in getNewLineColumn()
558 if (Previous.is(tok::comma) && State.Stack.back().VariablePos != 0) in getNewLineColumn()
587 Previous.isOneOf(tok::coloncolon, tok::equal)) { in getNewLineColumn()
597 if (Previous.is(tok::r_paren) && !Current.isBinaryOperator() && in getNewLineColumn()
655 const FormatToken *Previous = Current.getPreviousNonComment(); in moveStateToNextToken() local
663 if (Current.isNot(tok::comment) && Previous && Previous->is(tok::l_brace) && in moveStateToNextToken()
672 if (Previous && (Previous->isOneOf(tok::l_paren, tok::comma, tok::colon) || in moveStateToNextToken()
673 Previous->isOneOf(TT_BinaryOperator, TT_ConditionalExpr)) && in moveStateToNextToken()
674 !Previous->isOneOf(TT_DictLiteral, TT_ObjCMethodExpr)) { in moveStateToNextToken()
677 (Previous->isNot(tok::l_paren) || Previous->ParameterCount > 1); in moveStateToNextToken()
707 if (Previous && Previous->Role) in moveStateToNextToken()
708 Penalty += Previous->Role->formatAfterToken(State, this, DryRun); in moveStateToNextToken()
716 const FormatToken *Previous = Current.getPreviousNonComment(); in moveStatePastFakeLParens() local
722 (Previous && (Previous->opensScope() || in moveStatePastFakeLParens()
723 Previous->isOneOf(tok::semi, tok::kw_return) || in moveStatePastFakeLParens()
724 (Previous->getPrecedence() == prec::Assignment && in moveStatePastFakeLParens()
726 Previous->is(TT_ObjCMethodExpr))); in moveStatePastFakeLParens()
739 (!Previous || Previous->isNot(tok::kw_return) || in moveStatePastFakeLParens()
751 if (Previous && Previous->getPrecedence() > prec::Assignment && in moveStatePastFakeLParens()
752 Previous->isOneOf(TT_BinaryOperator, TT_ConditionalExpr) && in moveStatePastFakeLParens()
753 Previous->getPrecedence() != prec::Relational) { in moveStatePastFakeLParens()
755 Previous->is(tok::lessless) || in moveStatePastFakeLParens()
756 (Previous->is(TT_BinaryOperator) && in moveStatePastFakeLParens()
758 (Previous->is(TT_ConditionalExpr) && in moveStatePastFakeLParens()
784 if ((Previous && !Previous->opensScope()) || *I > prec::Comma) in moveStatePastFakeLParens()
961 if (Text.startswith("\"") && Current.Previous && in breakProtrudingToken()
962 Current.Previous->is(tok::at)) { in breakProtrudingToken()
983 !Current.Previous, State.Line->InPPDirective, Encoding, Style)); in breakProtrudingToken()
985 (Current.Previous == nullptr || in breakProtrudingToken()
986 Current.Previous->isNot(TT_ImplicitStringLiteral))) { in breakProtrudingToken()