Lines Matching refs:First

23   const FormatToken *Next = Line.First->getNextNonComment();  in startsExternCBlock()
59 Offset = getIndentOffset(*Line.First); in nextLine()
72 if (Line.First->is(TT_CSharpGenericTypeConstraint)) in nextLine()
89 unsigned LevelIndent = Line.First->OriginalColumn; in adjustToUnmodifiedLine()
93 if ((!Line.First->is(tok::comment) || IndentForLevel[Line.Level] == -1) && in adjustToUnmodifiedLine()
182 return AnnotatedLines[StartLineIndex]->First->getNamespaceToken(); in getMatchingNamespaceToken()
186 const FormatToken *NamespaceToken = Line->First->getNamespaceToken(); in getNamespaceTokenText()
217 if (Next[i + 1]->First->NewlinesBefore > 0) in getNextMergedLine()
243 if (NextLine.Type == LT_Invalid || NextLine.First->MustBreakBefore) in tryFitMultipleLinesInOne()
246 (!NextLine.InPPDirective || NextLine.First->HasUnescapedNewline)) { in tryFitMultipleLinesInOne()
262 TheLine->First == TheLine->Last && in tryFitMultipleLinesInOne()
264 NextLine.First->is(tok::r_brace)) { in tryFitMultipleLinesInOne()
271 TheLine->First == TheLine->Last) { in tryFitMultipleLinesInOne()
272 bool EmptyBlock = NextLine.First->is(tok::r_brace); in tryFitMultipleLinesInOne()
274 const FormatToken *Tok = PreviousLine->First; in tryFitMultipleLinesInOne()
304 NextLine.First->is(tok::r_brace)) { in tryFitMultipleLinesInOne()
352 const FormatToken *FirstNonComment = TheLine->First; in tryFitMultipleLinesInOne()
362 if (auto nsToken = TheLine->First->getNamespaceToken()) { in tryFitMultipleLinesInOne()
387 I[i + 1]->First->SpacesRequiredBefore = !I[i]->Last->is(tok::r_brace); in tryFitMultipleLinesInOne()
397 if (TheLine->Last->is(TT_FunctionLBrace) && TheLine->First != TheLine->Last) in tryFitMultipleLinesInOne()
408 if (NextLine.First->is(tok::l_brace)) { in tryFitMultipleLinesInOne()
409 if ((TheLine->First->isOneOf(tok::kw_if, tok::kw_else, tok::kw_while, in tryFitMultipleLinesInOne()
412 (TheLine->First->is(tok::r_brace) && TheLine->First->Next && in tryFitMultipleLinesInOne()
413 TheLine->First->Next->isOneOf(tok::kw_else, tok::kw_catch))) && in tryFitMultipleLinesInOne()
425 if (TheLine->First->isOneOf(tok::kw_if, tok::kw_else, tok::kw_while, in tryFitMultipleLinesInOne()
432 if (TheLine->First->isOneOf(tok::kw_else, tok::kw_catch) && in tryFitMultipleLinesInOne()
446 if (PreviousLine && TheLine->First->is(tok::l_brace)) { in tryFitMultipleLinesInOne()
447 switch (PreviousLine->First->Tok.getKind()) { in tryFitMultipleLinesInOne()
450 if (PreviousLine->First->Next) { in tryFitMultipleLinesInOne()
452 PreviousLine->First->Next->Tok.getObjCKeywordID(); in tryFitMultipleLinesInOne()
503 (NextLine.First->is(tok::r_brace) && in tryFitMultipleLinesInOne()
509 !TheLine->First->isOneOf(tok::kw_class, tok::kw_enum, in tryFitMultipleLinesInOne()
512 (NextLine.First->is(tok::r_brace) && in tryFitMultipleLinesInOne()
519 if (NextLine.First->is(TT_FunctionLBrace) && in tryFitMultipleLinesInOne()
532 NextLine.First == NextLine.Last && I + 2 != E && in tryFitMultipleLinesInOne()
533 I[2]->First->is(tok::r_brace))) { in tryFitMultipleLinesInOne()
543 const FormatToken *First = TheLine->First; in tryFitMultipleLinesInOne() local
544 if (First->is(tok::kw_else)) in tryFitMultipleLinesInOne()
547 return First->is(tok::r_brace) && First->Next && in tryFitMultipleLinesInOne()
548 First->Next->is(tok::kw_else); in tryFitMultipleLinesInOne()
550 if (TheLine->First->is(tok::kw_if) || in tryFitMultipleLinesInOne()
557 if (TheLine->First->isOneOf(tok::kw_for, tok::kw_while, tok::kw_do, in tryFitMultipleLinesInOne()
563 if (TheLine->First->isOneOf(tok::kw_case, tok::kw_default)) { in tryFitMultipleLinesInOne()
569 (TheLine->First->HasUnescapedNewline || TheLine->First->IsFirst)) { in tryFitMultipleLinesInOne()
581 if (I + 2 != E && I[2]->InPPDirective && !I[2]->First->HasUnescapedNewline) in tryMergeSimplePPDirective()
595 I[1]->First->is(tok::l_brace) && in tryMergeSimpleControlStatement()
600 (I[1]->InPPDirective && I[1]->First->HasUnescapedNewline)) { in tryMergeSimpleControlStatement()
605 if (!Line.First->is(tok::kw_do) && !Line.First->is(tok::kw_else) && in tryMergeSimpleControlStatement()
610 if (Line.First->is(tok::kw_do) && !Line.Last->is(tok::kw_do)) in tryMergeSimpleControlStatement()
615 if (I[1]->First->isOneOf(tok::semi, tok::kw_if, tok::kw_for, tok::kw_while, in tryMergeSimpleControlStatement()
623 I[2]->First->is(tok::kw_else)) { in tryMergeSimpleControlStatement()
635 I[1]->First->isOneOf(tok::kw_case, tok::kw_default)) { in tryMergeShortCaseLabels()
638 if (I[0]->Last->is(tok::l_brace) || I[1]->First->is(tok::l_brace)) in tryMergeShortCaseLabels()
651 if (Line->First->isOneOf(tok::kw_case, tok::kw_default, tok::r_brace)) in tryMergeShortCaseLabels()
653 if (Line->First->isOneOf(tok::kw_if, tok::kw_for, tok::kw_switch, in tryMergeShortCaseLabels()
658 if (Line->First->is(tok::comment)) { in tryMergeShortCaseLabels()
666 if (Line->First->isOneOf(tok::kw_case, tok::kw_default, tok::r_brace)) in tryMergeShortCaseLabels()
668 if (Line->First->isNot(tok::comment) || Level != Line->Level) in tryMergeShortCaseLabels()
696 Line.First->isOneOf(tok::at, tok::minus, tok::plus)) { in tryMergeSimpleBlock()
702 if (Line.First->is(tok::kw_case) || in tryMergeSimpleBlock()
703 (Line.First->Next && Line.First->Next->is(tok::kw_else))) { in tryMergeSimpleBlock()
707 if (Line.First->is(tok::kw_default)) { in tryMergeSimpleBlock()
708 const FormatToken *Tok = Line.First->getNextNonComment(); in tryMergeSimpleBlock()
712 if (Line.First->isOneOf(tok::kw_if, tok::kw_else, tok::kw_while, tok::kw_do, in tryMergeSimpleBlock()
719 !I[1]->First->is(tok::r_brace)) { in tryMergeSimpleBlock()
725 Line.First->isOneOf(tok::kw_if, tok::kw_else) && in tryMergeSimpleBlock()
727 !I[1]->First->is(tok::r_brace)) { in tryMergeSimpleBlock()
731 Line.First->isOneOf(tok::kw_if, tok::kw_else) && in tryMergeSimpleBlock()
734 I + 2 != E && !I[2]->First->is(tok::r_brace)) { in tryMergeSimpleBlock()
738 Line.First->isOneOf(tok::kw_while, tok::kw_do, tok::kw_for, in tryMergeSimpleBlock()
741 !I[1]->First->is(tok::r_brace)) { in tryMergeSimpleBlock()
745 Line.First->isOneOf(tok::kw_while, tok::kw_do, tok::kw_for, in tryMergeSimpleBlock()
749 I + 2 != E && !I[2]->First->is(tok::r_brace)) { in tryMergeSimpleBlock()
757 if (Line.First->isOneOf(tok::kw_try, tok::kw___try, tok::kw_catch, in tryMergeSimpleBlock()
764 FormatToken *Tok = I[1]->First; in tryMergeSimpleBlock()
802 Tok = I[2]->First; in tryMergeSimpleBlock()
816 if (Line.First == Line.Last && Line.First->isNot(TT_FunctionLBrace) && in tryMergeSimpleBlock()
824 } else if (I[1]->First->is(tok::l_brace)) { in tryMergeSimpleBlock()
834 (I[1]->First == I[1]->Last && I + 2 != E && in tryMergeSimpleBlock()
835 I[2]->First->is(tok::r_brace))) { in tryMergeSimpleBlock()
854 !I[1]->First->HasUnescapedNewline && !I[1]->First->is(tok::eof)) { in limitConsideringMacros()
862 if (I[1]->First->MustBreakBefore || I[2]->First->MustBreakBefore) in nextTwoLinesFitInto()
868 for (const FormatToken *Tok = Line->First; Tok; Tok = Tok->Next) in containsMustBreak()
876 assert(!B.First->Previous); in join()
879 A.Last->Next = B.First; in join()
880 B.First->Previous = A.Last; in join()
881 B.First->CanBreakBefore = true; in join()
882 unsigned LengthA = A.Last->TotalLength + B.First->SpacesRequiredBefore; in join()
883 for (FormatToken *Tok = B.First; Tok; Tok = Tok->Next) { in join()
901 markFinalized(Child->First); in markFinalized()
986 if (Previous.Children[0]->First->MustBreakBefore) in formatChildren()
1011 *Child->First, /*Newlines=*/0, /*Spaces=*/1, in formatChildren()
1294 assert(Line->First); in format()
1310 Indent != TheLine.First->OriginalColumn; in format()
1317 SourceMgr.getSpellingLineNumber(TheLine.First->Tok.getLocation()); in format()
1322 bool LastLine = TheLine.First->is(tok::eof); in format()
1353 for (const FormatToken *Tok = TheLine.First; Tok; Tok = Tok->Next) in format()
1361 TheLine.First->NewlinesBefore > 0 || TheLine.First->IsFirst; in format()
1371 TheLine.First->OriginalColumn, in format()
1372 TheLine.First->OriginalColumn); in format()
1374 Whitespaces->addUntouchableToken(*TheLine.First, in format()
1379 for (FormatToken *Tok = TheLine.First->Next; Tok; Tok = Tok->Next) in format()
1386 markFinalized(TheLine.First); in format()
1397 FormatToken &RootToken = *Line.First; in formatFirstToken()
1446 if (PreviousLine->First->isAccessSpecifier()) in formatFirstToken()
1462 if (PreviousLine && PreviousLine->First->isAccessSpecifier() && in formatFirstToken()
1515 !NextLine->First->HasUnescapedNewline)); in getColumnLimit()