Lines Matching defs:TheLine
252 const AnnotatedLine *TheLine = *I;
253 if (TheLine->Last->is(TT_LineComment))
258 if (TheLine->InPPDirective &&
270 Limit = TheLine->Last->TotalLength > Limit
272 : Limit - TheLine->Last->TotalLength;
274 if (TheLine->Last->is(TT_FunctionLBrace) &&
275 TheLine->First == TheLine->Last &&
283 if (PreviousLine && TheLine->Last->is(tok::l_brace) &&
284 TheLine->First == TheLine->Last) {
313 TheLine]() {
323 // Just checking TheLine->Level != 0 is not enough, because it
325 if (Style.isJavaScript() && TheLine->Last->is(TT_FunctionLBrace))
328 if (TheLine->Level != 0) {
338 (*J)->Level < TheLine->Level) {
361 const auto *FirstNonComment = TheLine->getFirstNonComment();
365 // instead of TheLine->First.
368 if (const auto *NSToken = TheLine->First->getNamespaceToken()) {
370 assert(TheLine->MatchingClosingBlockLineIndex > 0);
371 for (auto ClosingLineIndex = TheLine->MatchingClosingBlockLineIndex - 1;
381 const int OutdentBy = I[J]->Level - TheLine->Level;
394 if (auto nsToken = getMatchingNamespaceToken(TheLine, AnnotatedLines)) {
396 unsigned openingLine = TheLine->MatchingOpeningBlockLineIndex - 1;
413 const auto *LastNonComment = TheLine->getLastNonComment();
416 // instead of TheLine->Last.
420 TheLine->First != LastNonComment) {
424 if (TheLine->Last->is(tok::l_brace) && FirstNonComment != TheLine->Last &&
433 if ((TheLine->First->isOneOf(tok::kw_if, tok::kw_else, tok::kw_while,
436 (TheLine->First->is(tok::r_brace) && TheLine->First->Next &&
437 TheLine->First->Next->isOneOf(tok::kw_else, tok::kw_catch))) &&
443 return (Style.ColumnLimit == 0 || TheLine->Level * Style.IndentWidth +
444 TheLine->Last->TotalLength <=
449 if (TheLine->First->isOneOf(tok::kw_if, tok::kw_else, tok::kw_while,
456 if (TheLine->First->isOneOf(tok::kw_else, tok::kw_catch) &&
465 TheLine->Last->TotalLength <= Style.ColumnLimit)
470 if (PreviousLine && TheLine->First->is(tok::l_brace)) {
497 TheLine->Last->is(tok::l_brace) && PreviousLine->Last) {
517 if (TheLine->First->is(TT_SwitchExpressionLabel)) {
523 if (TheLine->Last->is(tok::l_brace)) {
526 if (TheLine->Last->is(TT_EnumLBrace)) {
528 } else if (TheLine->Last->is(TT_RequiresExpressionLBrace)) {
530 } else if (TheLine->Last->isOneOf(TT_ClassLBrace, TT_StructLBrace)) {
537 } else if (TheLine->InPPDirective ||
538 !TheLine->First->isOneOf(tok::kw_class, tok::kw_enum,
556 if (Limit <= 2 || (Style.ColumnLimit == 0 && containsMustBreak(TheLine)))
573 auto IsElseLine = [&TheLine]() -> bool {
574 const FormatToken *First = TheLine->First;
581 if (TheLine->First->is(tok::kw_if) ||
588 if (TheLine->First->isOneOf(tok::kw_for, tok::kw_while, tok::kw_do,
594 if (TheLine->First->isOneOf(tok::kw_case, tok::kw_default)) {
599 if (TheLine->InPPDirective &&
600 (TheLine->First->HasUnescapedNewline || TheLine->First->IsFirst)) {
1362 const AnnotatedLine &TheLine = *Line;
1372 TheLine.Level > RangeMinLevel ||
1373 (TheLine.Level == RangeMinLevel && !PreviousRBrace &&
1374 !TheLine.startsWith(tok::r_brace));
1377 Indent != TheLine.First->OriginalColumn;
1378 bool ShouldFormat = TheLine.Affected || FixIndentation;
1381 if (ShouldFormat && TheLine.Type == LT_Invalid && Status) {
1384 SourceMgr.getSpellingLineNumber(TheLine.First->Tok.getLocation());
1387 if (ShouldFormat && TheLine.Type != LT_Invalid) {
1389 bool LastLine = TheLine.First->is(tok::eof);
1390 formatFirstToken(TheLine, PreviousLine, PrevPrevLine, Lines, Indent,
1395 unsigned ColumnLimit = getColumnLimit(TheLine.InPPDirective, NextLine);
1397 !TheLine.ContainsMacroCall &&
1398 (TheLine.Last->TotalLength + Indent <= ColumnLimit ||
1399 (TheLine.Type == LT_ImportStatement &&
1402 TheLine.InPPDirective)); // don't split #regions in C#
1405 .formatLine(TheLine, NextStartColumn + Indent,
1409 .formatLine(TheLine, NextStartColumn + Indent,
1413 .formatLine(TheLine, NextStartColumn + Indent,
1416 RangeMinLevel = std::min(RangeMinLevel, TheLine.Level);
1420 if (TheLine.ChildrenAffected) {
1421 for (const FormatToken *Tok = TheLine.First; Tok; Tok = Tok->Next)
1429 TheLine.First->NewlinesBefore > 0 || TheLine.First->IsFirst;
1431 IndentTracker.adjustToUnmodifiedLine(TheLine);
1435 TheLine.LeadingEmptyLinesAffected);
1438 formatFirstToken(TheLine, PreviousLine, PrevPrevLine, Lines,
1439 TheLine.First->OriginalColumn,
1440 TheLine.First->OriginalColumn);
1442 Whitespaces->addUntouchableToken(*TheLine.First,
1443 TheLine.InPPDirective);
1447 for (FormatToken *Tok = TheLine.First->Next; Tok; Tok = Tok->Next)
1448 Whitespaces->addUntouchableToken(*Tok, TheLine.InPPDirective);
1454 markFinalized(TheLine.First);