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();
366 // instead of TheLine->First.
369 TheLine->First->is(tok::kw_namespace) &&
370 TheLine->Last->is(tok::l_brace)) {
377 if (const auto *NSToken = TheLine->First->getNamespaceToken()) {
379 assert(TheLine->MatchingClosingBlockLineIndex > 0);
380 for (auto ClosingLineIndex = TheLine->MatchingClosingBlockLineIndex - 1;
390 const int OutdentBy = I[J]->Level - TheLine->Level;
403 if (auto nsToken = getMatchingNamespaceToken(TheLine, AnnotatedLines)) {
405 unsigned openingLine = TheLine->MatchingOpeningBlockLineIndex - 1;
422 const auto *LastNonComment = TheLine->getLastNonComment();
425 // instead of TheLine->Last.
429 TheLine->First != LastNonComment) {
434 if (TheLine->Last->is(tok::l_brace) && FirstNonComment != TheLine->Last &&
437 TheLine->startsWithExportBlock())) {
444 if ((TheLine->First->isOneOf(tok::kw_if, tok::kw_else, tok::kw_while,
447 (TheLine->First->is(tok::r_brace) && TheLine->First->Next &&
448 TheLine->First->Next->isOneOf(tok::kw_else, tok::kw_catch))) &&
454 return (Style.ColumnLimit == 0 || TheLine->Level * Style.IndentWidth +
455 TheLine->Last->TotalLength <=
460 if (TheLine->First->isOneOf(tok::kw_if, tok::kw_else, tok::kw_while,
467 if (TheLine->First->isOneOf(tok::kw_else, tok::kw_catch) &&
476 TheLine->Last->TotalLength <= Style.ColumnLimit)
481 if (PreviousLine && TheLine->First->is(tok::l_brace)) {
508 TheLine->Last->is(tok::l_brace) && PreviousLine->Last) {
528 if (TheLine->First->is(TT_SwitchExpressionLabel)) {
534 if (TheLine->Last->is(tok::l_brace)) {
537 if (TheLine->Last->is(TT_EnumLBrace)) {
539 } else if (TheLine->Last->is(TT_CompoundRequirementLBrace)) {
541 } else if (TheLine->Last->isOneOf(TT_ClassLBrace, TT_StructLBrace)) {
548 } else if (TheLine->InPPDirective ||
549 !TheLine->First->isOneOf(tok::kw_class, tok::kw_enum,
567 if (Limit <= 2 || (Style.ColumnLimit == 0 && containsMustBreak(TheLine)))
584 auto IsElseLine = [&TheLine]() -> bool {
585 const FormatToken *First = TheLine->First;
592 if (TheLine->First->is(tok::kw_if) ||
599 if (TheLine->First->isOneOf(tok::kw_for, tok::kw_while, tok::kw_do,
605 if (TheLine->First->isOneOf(tok::kw_case, tok::kw_default)) {
610 if (TheLine->InPPDirective &&
611 (TheLine->First->HasUnescapedNewline || TheLine->First->IsFirst)) {
1453 const AnnotatedLine &TheLine = *Line;
1463 TheLine.Level > RangeMinLevel ||
1464 (TheLine.Level == RangeMinLevel && !PreviousRBrace &&
1465 !TheLine.startsWith(TT_NamespaceRBrace));
1468 Indent != TheLine.First->OriginalColumn;
1469 bool ShouldFormat = TheLine.Affected || FixIndentation;
1472 if (ShouldFormat && TheLine.Type == LT_Invalid && Status) {
1475 SourceMgr.getSpellingLineNumber(TheLine.First->Tok.getLocation());
1478 if (ShouldFormat && TheLine.Type != LT_Invalid) {
1480 bool LastLine = TheLine.First->is(tok::eof);
1481 formatFirstToken(TheLine, PreviousLine, PrevPrevLine, Lines, Indent,
1486 unsigned ColumnLimit = getColumnLimit(TheLine.InPPDirective, NextLine);
1488 !TheLine.ContainsMacroCall &&
1489 (TheLine.Last->TotalLength + Indent <= ColumnLimit ||
1490 (TheLine.Type == LT_ImportStatement &&
1493 TheLine.InPPDirective)); // don't split #regions in C#
1496 .formatLine(TheLine, NextStartColumn + Indent,
1500 .formatLine(TheLine, NextStartColumn + Indent,
1504 .formatLine(TheLine, NextStartColumn + Indent,
1507 RangeMinLevel = std::min(RangeMinLevel, TheLine.Level);
1511 if (TheLine.ChildrenAffected) {
1512 for (const FormatToken *Tok = TheLine.First; Tok; Tok = Tok->Next)
1520 TheLine.First->NewlinesBefore > 0 || TheLine.First->IsFirst;
1522 IndentTracker.adjustToUnmodifiedLine(TheLine);
1526 TheLine.LeadingEmptyLinesAffected);
1529 formatFirstToken(TheLine, PreviousLine, PrevPrevLine, Lines,
1530 TheLine.First->OriginalColumn,
1531 TheLine.First->OriginalColumn);
1533 Whitespaces->addUntouchableToken(*TheLine.First,
1534 TheLine.InPPDirective);
1538 for (FormatToken *Tok = TheLine.First->Next; Tok; Tok = Tok->Next)
1539 Whitespaces->addUntouchableToken(*Tok, TheLine.InPPDirective);
1545 markFinalized(TheLine.First);