Lines Matching refs:First

23   const FormatToken *Next = Line.First->getNextNonComment();  in startsExternCBlock()
59 Offset = getIndentOffset(*Line.First); in nextLine()
96 unsigned LevelIndent = Line.First->OriginalColumn; in adjustToUnmodifiedLine()
100 if ((!Line.First->is(tok::comment) || IndentForLevel[Line.Level] == -1) && in adjustToUnmodifiedLine()
189 return AnnotatedLines[StartLineIndex]->First->getNamespaceToken(); in getMatchingNamespaceToken()
193 const FormatToken *NamespaceToken = Line->First->getNamespaceToken(); in getNamespaceTokenText()
224 if (Next[i + 1]->First->NewlinesBefore > 0) in getNextMergedLine()
250 if (NextLine.Type == LT_Invalid || NextLine.First->MustBreakBefore) in tryFitMultipleLinesInOne()
253 (!NextLine.InPPDirective || NextLine.First->HasUnescapedNewline)) { in tryFitMultipleLinesInOne()
269 TheLine->First == TheLine->Last && in tryFitMultipleLinesInOne()
271 NextLine.First->is(tok::r_brace)) { in tryFitMultipleLinesInOne()
278 TheLine->First == TheLine->Last) { in tryFitMultipleLinesInOne()
279 bool EmptyBlock = NextLine.First->is(tok::r_brace); in tryFitMultipleLinesInOne()
281 const FormatToken *Tok = PreviousLine->First; in tryFitMultipleLinesInOne()
311 NextLine.First->is(tok::r_brace)) { in tryFitMultipleLinesInOne()
359 const FormatToken *FirstNonComment = TheLine->First; in tryFitMultipleLinesInOne()
369 if (auto nsToken = TheLine->First->getNamespaceToken()) { in tryFitMultipleLinesInOne()
394 I[i + 1]->First->SpacesRequiredBefore = !I[i]->Last->is(tok::r_brace); in tryFitMultipleLinesInOne()
404 if (TheLine->Last->is(TT_FunctionLBrace) && TheLine->First != TheLine->Last) in tryFitMultipleLinesInOne()
415 if (NextLine.First->is(tok::l_brace)) { in tryFitMultipleLinesInOne()
416 if ((TheLine->First->isOneOf(tok::kw_if, tok::kw_else, tok::kw_while, in tryFitMultipleLinesInOne()
419 (TheLine->First->is(tok::r_brace) && TheLine->First->Next && in tryFitMultipleLinesInOne()
420 TheLine->First->Next->isOneOf(tok::kw_else, tok::kw_catch))) && in tryFitMultipleLinesInOne()
432 if (TheLine->First->isOneOf(tok::kw_if, tok::kw_else, tok::kw_while, in tryFitMultipleLinesInOne()
439 if (TheLine->First->isOneOf(tok::kw_else, tok::kw_catch) && in tryFitMultipleLinesInOne()
453 if (PreviousLine && TheLine->First->is(tok::l_brace)) { in tryFitMultipleLinesInOne()
454 switch (PreviousLine->First->Tok.getKind()) { in tryFitMultipleLinesInOne()
457 if (PreviousLine->First->Next) { in tryFitMultipleLinesInOne()
459 PreviousLine->First->Next->Tok.getObjCKeywordID(); in tryFitMultipleLinesInOne()
510 (NextLine.First->is(tok::r_brace) && in tryFitMultipleLinesInOne()
516 !TheLine->First->isOneOf(tok::kw_class, tok::kw_enum, in tryFitMultipleLinesInOne()
519 (NextLine.First->is(tok::r_brace) && in tryFitMultipleLinesInOne()
526 if (NextLine.First->is(TT_FunctionLBrace) && in tryFitMultipleLinesInOne()
539 NextLine.First == NextLine.Last && I + 2 != E && in tryFitMultipleLinesInOne()
540 I[2]->First->is(tok::r_brace))) { in tryFitMultipleLinesInOne()
550 const FormatToken *First = TheLine->First; in tryFitMultipleLinesInOne() local
551 if (First->is(tok::kw_else)) in tryFitMultipleLinesInOne()
554 return First->is(tok::r_brace) && First->Next && in tryFitMultipleLinesInOne()
555 First->Next->is(tok::kw_else); in tryFitMultipleLinesInOne()
557 if (TheLine->First->is(tok::kw_if) || in tryFitMultipleLinesInOne()
564 if (TheLine->First->isOneOf(tok::kw_for, tok::kw_while, tok::kw_do, in tryFitMultipleLinesInOne()
570 if (TheLine->First->isOneOf(tok::kw_case, tok::kw_default)) { in tryFitMultipleLinesInOne()
576 (TheLine->First->HasUnescapedNewline || TheLine->First->IsFirst)) { in tryFitMultipleLinesInOne()
588 if (I + 2 != E && I[2]->InPPDirective && !I[2]->First->HasUnescapedNewline) in tryMergeSimplePPDirective()
602 I[1]->First->is(tok::l_brace) && in tryMergeSimpleControlStatement()
607 (I[1]->InPPDirective && I[1]->First->HasUnescapedNewline)) { in tryMergeSimpleControlStatement()
612 if (!Line.First->is(tok::kw_do) && !Line.First->is(tok::kw_else) && in tryMergeSimpleControlStatement()
617 if (Line.First->is(tok::kw_do) && !Line.Last->is(tok::kw_do)) in tryMergeSimpleControlStatement()
622 if (I[1]->First->isOneOf(tok::semi, tok::kw_if, tok::kw_for, tok::kw_while, in tryMergeSimpleControlStatement()
630 I[2]->First->is(tok::kw_else)) { in tryMergeSimpleControlStatement()
642 I[1]->First->isOneOf(tok::kw_case, tok::kw_default)) { in tryMergeShortCaseLabels()
645 if (I[0]->Last->is(tok::l_brace) || I[1]->First->is(tok::l_brace)) in tryMergeShortCaseLabels()
661 if (Line->First->isOneOf(tok::kw_case, tok::kw_default, tok::r_brace)) in tryMergeShortCaseLabels()
663 if (Line->First->isOneOf(tok::kw_if, tok::kw_for, tok::kw_switch, in tryMergeShortCaseLabels()
668 if (Line->First->is(tok::comment)) { in tryMergeShortCaseLabels()
676 if (Line->First->isOneOf(tok::kw_case, tok::kw_default, tok::r_brace)) in tryMergeShortCaseLabels()
678 if (Line->First->isNot(tok::comment) || Level != Line->Level) in tryMergeShortCaseLabels()
706 Line.First->isOneOf(tok::at, tok::minus, tok::plus)) { in tryMergeSimpleBlock()
712 if (Line.First->is(tok::kw_case) || in tryMergeSimpleBlock()
713 (Line.First->Next && Line.First->Next->is(tok::kw_else))) { in tryMergeSimpleBlock()
717 if (Line.First->is(tok::kw_default)) { in tryMergeSimpleBlock()
718 const FormatToken *Tok = Line.First->getNextNonComment(); in tryMergeSimpleBlock()
724 return Line.First->isOneOf(tok::kw_if, tok::kw_else, tok::kw_while, in tryMergeSimpleBlock()
731 I[1]->First->isNot(tok::r_brace)); in tryMergeSimpleBlock()
734 Line.First->isOneOf(tok::kw_try, tok::kw___try, tok::kw_catch, in tryMergeSimpleBlock()
742 Line.First->isOneOf(tok::kw_if, tok::kw_else) && in tryMergeSimpleBlock()
744 !I[1]->First->is(tok::r_brace)) { in tryMergeSimpleBlock()
748 Line.First->isOneOf(tok::kw_if, tok::kw_else) && in tryMergeSimpleBlock()
751 I + 2 != E && !I[2]->First->is(tok::r_brace)) { in tryMergeSimpleBlock()
755 Line.First->isOneOf(tok::kw_while, tok::kw_do, tok::kw_for, in tryMergeSimpleBlock()
758 !I[1]->First->is(tok::r_brace)) { in tryMergeSimpleBlock()
762 Line.First->isOneOf(tok::kw_while, tok::kw_do, tok::kw_for, in tryMergeSimpleBlock()
766 I + 2 != E && !I[2]->First->is(tok::r_brace)) { in tryMergeSimpleBlock()
774 if (Line.First->isOneOf(tok::kw_try, tok::kw___try, tok::kw_catch, in tryMergeSimpleBlock()
781 if (IsSplitBlock && Line.First == Line.Last && in tryMergeSimpleBlock()
786 FormatToken *Tok = I[1]->First; in tryMergeSimpleBlock()
824 Tok = I[2]->First; in tryMergeSimpleBlock()
838 if (Line.First == Line.Last && Line.First->isNot(TT_FunctionLBrace) && in tryMergeSimpleBlock()
846 } else if (I[1]->First->is(tok::l_brace)) { in tryMergeSimpleBlock()
856 (I[1]->First == I[1]->Last && I + 2 != E && in tryMergeSimpleBlock()
857 I[2]->First->is(tok::r_brace))) { in tryMergeSimpleBlock()
876 !I[1]->First->HasUnescapedNewline && !I[1]->First->is(tok::eof)) { in limitConsideringMacros()
884 if (I[1]->First->MustBreakBefore || I[2]->First->MustBreakBefore) in nextTwoLinesFitInto()
890 for (const FormatToken *Tok = Line->First; Tok; Tok = Tok->Next) in containsMustBreak()
898 assert(!B.First->Previous); in join()
901 A.Last->Next = B.First; in join()
902 B.First->Previous = A.Last; in join()
903 B.First->CanBreakBefore = true; in join()
904 unsigned LengthA = A.Last->TotalLength + B.First->SpacesRequiredBefore; in join()
905 for (FormatToken *Tok = B.First; Tok; Tok = Tok->Next) { in join()
923 markFinalized(Child->First); in markFinalized()
1008 if (Previous.Children[0]->First->MustBreakBefore) in formatChildren()
1033 *Child->First, /*Newlines=*/0, /*Spaces=*/1, in formatChildren()
1316 assert(Line->First); in format()
1332 Indent != TheLine.First->OriginalColumn; in format()
1339 SourceMgr.getSpellingLineNumber(TheLine.First->Tok.getLocation()); in format()
1344 bool LastLine = TheLine.First->is(tok::eof); in format()
1375 for (const FormatToken *Tok = TheLine.First; Tok; Tok = Tok->Next) in format()
1383 TheLine.First->NewlinesBefore > 0 || TheLine.First->IsFirst; in format()
1393 TheLine.First->OriginalColumn, in format()
1394 TheLine.First->OriginalColumn); in format()
1396 Whitespaces->addUntouchableToken(*TheLine.First, in format()
1401 for (FormatToken *Tok = TheLine.First->Next; Tok; Tok = Tok->Next) in format()
1408 markFinalized(TheLine.First); in format()
1419 FormatToken &RootToken = *Line.First; in formatFirstToken()
1468 if (PreviousLine->First->isAccessSpecifier()) in formatFirstToken()
1484 if (PreviousLine && PreviousLine->First->isAccessSpecifier() && in formatFirstToken()
1537 !NextLine->First->HasUnescapedNewline)); in getColumnLimit()