Lines Matching refs:First

24   const FormatToken *Next = Line.First->getNextNonComment();  in startsExternCBlock()
101 if (Line.First->is(tok::comment) && IndentForLevel[Line.Level] != -1) in adjustToUnmodifiedLine()
103 unsigned LevelIndent = Line.First->OriginalColumn; in adjustToUnmodifiedLine()
141 if (IsAccessModifier(*Line.First)) { in getIndentOffset()
195 return AnnotatedLines[StartLineIndex]->First->getNamespaceToken(); in getMatchingNamespaceToken()
199 const FormatToken *NamespaceToken = Line->First->getNamespaceToken(); in getNamespaceTokenText()
230 if (Next[i + 1]->First->NewlinesBefore > 0) in getNextMergedLine()
256 if (NextLine.Type == LT_Invalid || NextLine.First->MustBreakBefore) in tryFitMultipleLinesInOne()
259 (!NextLine.InPPDirective || NextLine.First->HasUnescapedNewline)) { in tryFitMultipleLinesInOne()
275 TheLine->First == TheLine->Last && in tryFitMultipleLinesInOne()
277 NextLine.First->is(tok::r_brace)) { in tryFitMultipleLinesInOne()
284 TheLine->First == TheLine->Last) { in tryFitMultipleLinesInOne()
285 bool EmptyBlock = NextLine.First->is(tok::r_brace); in tryFitMultipleLinesInOne()
287 const FormatToken *Tok = PreviousLine->First; in tryFitMultipleLinesInOne()
317 NextLine.First->is(tok::r_brace)) { in tryFitMultipleLinesInOne()
368 if (const auto *NSToken = TheLine->First->getNamespaceToken()) { in tryFitMultipleLinesInOne()
403 I[i + 1]->First->SpacesRequiredBefore = in tryFitMultipleLinesInOne()
420 TheLine->First != LastNonComment) { in tryFitMultipleLinesInOne()
432 if (NextLine.First->is(tok::l_brace)) { in tryFitMultipleLinesInOne()
433 if ((TheLine->First->isOneOf(tok::kw_if, tok::kw_else, tok::kw_while, in tryFitMultipleLinesInOne()
436 (TheLine->First->is(tok::r_brace) && TheLine->First->Next && in tryFitMultipleLinesInOne()
437 TheLine->First->Next->isOneOf(tok::kw_else, tok::kw_catch))) && in tryFitMultipleLinesInOne()
449 if (TheLine->First->isOneOf(tok::kw_if, tok::kw_else, tok::kw_while, in tryFitMultipleLinesInOne()
456 if (TheLine->First->isOneOf(tok::kw_else, tok::kw_catch) && in tryFitMultipleLinesInOne()
470 if (PreviousLine && TheLine->First->is(tok::l_brace)) { in tryFitMultipleLinesInOne()
471 switch (PreviousLine->First->Tok.getKind()) { in tryFitMultipleLinesInOne()
474 if (PreviousLine->First->Next) { in tryFitMultipleLinesInOne()
476 PreviousLine->First->Next->Tok.getObjCKeywordID(); in tryFitMultipleLinesInOne()
517 if (TheLine->First->is(TT_SwitchExpressionLabel)) { in tryFitMultipleLinesInOne()
535 (NextLine.First->is(tok::r_brace) && in tryFitMultipleLinesInOne()
538 !TheLine->First->isOneOf(tok::kw_class, tok::kw_enum, in tryFitMultipleLinesInOne()
543 (NextLine.First->is(tok::r_brace) && in tryFitMultipleLinesInOne()
550 if (NextLine.First->is(TT_FunctionLBrace) && in tryFitMultipleLinesInOne()
563 NextLine.First == NextLine.Last && I + 2 != E && in tryFitMultipleLinesInOne()
564 I[2]->First->is(tok::r_brace))) { in tryFitMultipleLinesInOne()
574 const FormatToken *First = TheLine->First; in tryFitMultipleLinesInOne() local
575 if (First->is(tok::kw_else)) in tryFitMultipleLinesInOne()
578 return First->is(tok::r_brace) && First->Next && in tryFitMultipleLinesInOne()
579 First->Next->is(tok::kw_else); in tryFitMultipleLinesInOne()
581 if (TheLine->First->is(tok::kw_if) || in tryFitMultipleLinesInOne()
588 if (TheLine->First->isOneOf(tok::kw_for, tok::kw_while, tok::kw_do, in tryFitMultipleLinesInOne()
594 if (TheLine->First->isOneOf(tok::kw_case, tok::kw_default)) { in tryFitMultipleLinesInOne()
600 (TheLine->First->HasUnescapedNewline || TheLine->First->IsFirst)) { in tryFitMultipleLinesInOne()
612 if (I + 2 != E && I[2]->InPPDirective && !I[2]->First->HasUnescapedNewline) in tryMergeSimplePPDirective()
626 I[1]->First->is(tok::l_brace) && in tryMergeSimpleControlStatement()
631 (I[1]->InPPDirective && I[1]->First->HasUnescapedNewline)) { in tryMergeSimpleControlStatement()
636 if (Line.First->isNot(tok::kw_do) && Line.First->isNot(tok::kw_else) && in tryMergeSimpleControlStatement()
641 if (Line.First->is(tok::kw_do) && Line.Last->isNot(tok::kw_do)) in tryMergeSimpleControlStatement()
646 if (I[1]->First->isOneOf(tok::semi, tok::kw_if, tok::kw_for, tok::kw_while, in tryMergeSimpleControlStatement()
654 I[2]->First->is(tok::kw_else)) { in tryMergeSimpleControlStatement()
666 I[1]->First->isOneOf(tok::kw_case, tok::kw_default)) { in tryMergeShortCaseLabels()
669 if (I[0]->Last->is(tok::l_brace) || I[1]->First->is(tok::l_brace)) in tryMergeShortCaseLabels()
685 if (Line->First->isOneOf(tok::kw_case, tok::kw_default, tok::r_brace)) in tryMergeShortCaseLabels()
687 if (Line->First->isOneOf(tok::kw_if, tok::kw_for, tok::kw_switch, in tryMergeShortCaseLabels()
692 if (Line->First->is(tok::comment)) { in tryMergeShortCaseLabels()
700 if (Line->First->isOneOf(tok::kw_case, tok::kw_default, tok::r_brace)) in tryMergeShortCaseLabels()
702 if (Line->First->isNot(tok::comment) || Level != Line->Level) in tryMergeShortCaseLabels()
730 Line.First->isOneOf(tok::at, tok::minus, tok::plus)) { in tryMergeSimpleBlock()
736 if (Line.First->is(tok::kw_case) || in tryMergeSimpleBlock()
737 (Line.First->Next && Line.First->Next->is(tok::kw_else))) { in tryMergeSimpleBlock()
741 if (Line.First->is(tok::kw_default)) { in tryMergeSimpleBlock()
742 const FormatToken *Tok = Line.First->getNextNonComment(); in tryMergeSimpleBlock()
748 return Line.First->isOneOf(tok::kw_if, tok::kw_else, tok::kw_while, in tryMergeSimpleBlock()
755 I[1]->First->isNot(tok::r_brace)); in tryMergeSimpleBlock()
758 Line.First->isOneOf(tok::kw_try, tok::kw___try, tok::kw_catch, in tryMergeSimpleBlock()
766 Line.First->isOneOf(tok::kw_if, tok::kw_else) && in tryMergeSimpleBlock()
768 I[1]->First->isNot(tok::r_brace)) { in tryMergeSimpleBlock()
772 Line.First->isOneOf(tok::kw_if, tok::kw_else) && in tryMergeSimpleBlock()
775 I + 2 != E && I[2]->First->isNot(tok::r_brace)) { in tryMergeSimpleBlock()
779 Line.First->isOneOf(tok::kw_while, tok::kw_do, tok::kw_for, in tryMergeSimpleBlock()
782 I[1]->First->isNot(tok::r_brace)) { in tryMergeSimpleBlock()
786 Line.First->isOneOf(tok::kw_while, tok::kw_do, tok::kw_for, in tryMergeSimpleBlock()
790 I + 2 != E && I[2]->First->isNot(tok::r_brace)) { in tryMergeSimpleBlock()
798 if (Line.First->isOneOf(tok::kw_try, tok::kw___try, tok::kw_catch, in tryMergeSimpleBlock()
806 Line.First->is(TT_BlockLBrace)) { in tryMergeSimpleBlock()
810 if (IsSplitBlock && Line.First == Line.Last && in tryMergeSimpleBlock()
815 FormatToken *Tok = I[1]->First; in tryMergeSimpleBlock()
854 Tok = I[2]->First; in tryMergeSimpleBlock()
868 if (Line.First == Line.Last && Line.First->isNot(TT_FunctionLBrace) && in tryMergeSimpleBlock()
876 } else if (I[1]->First->is(tok::l_brace)) { in tryMergeSimpleBlock()
886 (I[1]->First == I[1]->Last && I + 2 != E && in tryMergeSimpleBlock()
887 I[2]->First->is(tok::r_brace))) { in tryMergeSimpleBlock()
906 !I[1]->First->HasUnescapedNewline && I[1]->First->isNot(tok::eof)) { in limitConsideringMacros()
914 if (I[1]->First->MustBreakBefore || I[2]->First->MustBreakBefore) in nextTwoLinesFitInto()
920 assert(Line->First); in containsMustBreak()
923 for (const FormatToken *Tok = Line->First->Next; Tok; Tok = Tok->Next) in containsMustBreak()
931 assert(!B.First->Previous); in join()
934 A.Last->Next = B.First; in join()
935 B.First->Previous = A.Last; in join()
936 B.First->CanBreakBefore = true; in join()
937 unsigned LengthA = A.Last->TotalLength + B.First->SpacesRequiredBefore; in join()
938 for (FormatToken *Tok = B.First; Tok; Tok = Tok->Next) { in join()
1051 if (Previous.Children[0]->First->MustBreakBefore) in formatChildren()
1076 *Child->First, /*Newlines=*/0, /*Spaces=*/1, in formatChildren()
1083 markFinalized(Child->First); in formatChildren()
1361 assert(Line->First); in format()
1377 Indent != TheLine.First->OriginalColumn; in format()
1384 SourceMgr.getSpellingLineNumber(TheLine.First->Tok.getLocation()); in format()
1389 bool LastLine = TheLine.First->is(tok::eof); in format()
1421 for (const FormatToken *Tok = TheLine.First; Tok; Tok = Tok->Next) in format()
1429 TheLine.First->NewlinesBefore > 0 || TheLine.First->IsFirst; in format()
1439 TheLine.First->OriginalColumn, in format()
1440 TheLine.First->OriginalColumn); in format()
1442 Whitespaces->addUntouchableToken(*TheLine.First, in format()
1447 for (FormatToken *Tok = TheLine.First->Next; Tok; Tok = Tok->Next) in format()
1454 markFinalized(TheLine.First); in format()
1465 const auto &RootToken = *Line.First; in computeNewlines()
1509 if (PreviousLine->First->isAccessSpecifier()) in computeNewlines()
1527 if (PreviousLine && PreviousLine->First->isAccessSpecifier() && in computeNewlines()
1557 FormatToken &RootToken = *Line.First; in formatFirstToken()
1605 !NextLine->First->HasUnescapedNewline)); in getColumnLimit()