Lines Matching refs:First
24 const FormatToken *Next = Line.First->getNextNonComment();
101 if (Line.First->is(tok::comment) && IndentForLevel[Line.Level] != -1)
103 unsigned LevelIndent = Line.First->OriginalColumn;
141 if (IsAccessModifier(*Line.First)) {
195 return AnnotatedLines[StartLineIndex]->First->getNamespaceToken();
199 const FormatToken *NamespaceToken = Line->First->getNamespaceToken();
230 if (Next[i + 1]->First->NewlinesBefore > 0)
256 if (NextLine.Type == LT_Invalid || NextLine.First->MustBreakBefore)
259 (!NextLine.InPPDirective || NextLine.First->HasUnescapedNewline)) {
275 TheLine->First == TheLine->Last &&
277 NextLine.First->is(tok::r_brace)) {
284 TheLine->First == TheLine->Last) {
285 bool EmptyBlock = NextLine.First->is(tok::r_brace);
287 const FormatToken *Tok = PreviousLine->First;
317 NextLine.First->is(tok::r_brace)) {
366 // instead of TheLine->First.
369 TheLine->First->is(tok::kw_namespace) &&
377 if (const auto *NSToken = TheLine->First->getNamespaceToken()) {
412 I[i + 1]->First->SpacesRequiredBefore =
429 TheLine->First != LastNonComment) {
443 if (NextLine.First->is(tok::l_brace)) {
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))) &&
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) &&
481 if (PreviousLine && TheLine->First->is(tok::l_brace)) {
482 switch (PreviousLine->First->Tok.getKind()) {
485 if (PreviousLine->First->Next) {
487 PreviousLine->First->Next->Tok.getObjCKeywordID();
528 if (TheLine->First->is(TT_SwitchExpressionLabel)) {
546 (NextLine.First->is(tok::r_brace) &&
549 !TheLine->First->isOneOf(tok::kw_class, tok::kw_enum,
554 (NextLine.First->is(tok::r_brace) &&
561 if (NextLine.First->is(TT_FunctionLBrace) &&
574 NextLine.First == NextLine.Last && I + 2 != E &&
575 I[2]->First->is(tok::r_brace))) {
585 const FormatToken *First = TheLine->First;
586 if (First->is(tok::kw_else))
589 return First->is(tok::r_brace) && First->Next &&
590 First->Next->is(tok::kw_else);
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)) {
611 (TheLine->First->HasUnescapedNewline || TheLine->First->IsFirst)) {
623 if (I + 2 != E && I[2]->InPPDirective && !I[2]->First->HasUnescapedNewline)
639 (L1.InPPDirective && L1.First->HasUnescapedNewline)) {
658 if (L1.First->is(tok::kw_namespace)) {
673 if (I[N]->First->is(tok::r_brace) && !I[N]->First->MustBreakBefore &&
689 if (L2.First->isNot(tok::r_brace) || L2.First->MustBreakBefore)
704 I[1]->First->is(tok::l_brace) &&
709 (I[1]->InPPDirective && I[1]->First->HasUnescapedNewline)) {
714 if (Line.First->isNot(tok::kw_do) && Line.First->isNot(tok::kw_else) &&
719 if (Line.First->is(tok::kw_do) && Line.Last->isNot(tok::kw_do))
724 if (I[1]->First->isOneOf(tok::semi, tok::kw_if, tok::kw_for, tok::kw_while,
732 I[2]->First->is(tok::kw_else)) {
743 I[1]->First->isOneOf(tok::kw_case, tok::kw_default)) {
746 if (I[0]->Last->is(tok::l_brace) || I[1]->First->is(tok::l_brace))
762 if (Line->First->isOneOf(tok::kw_case, tok::kw_default, tok::r_brace))
764 if (Line->First->isOneOf(tok::kw_if, tok::kw_for, tok::kw_switch,
769 if (Line->First->is(tok::comment)) {
777 if (Line->First->isOneOf(tok::kw_case, tok::kw_default, tok::r_brace))
779 if (Line->First->isNot(tok::comment) || Level != Line->Level)
806 Line.First->isOneOf(tok::at, tok::minus, tok::plus)) {
812 if (Line.First->is(tok::kw_case) ||
813 (Line.First->Next && Line.First->Next->is(tok::kw_else))) {
817 if (Line.First->is(tok::kw_default)) {
818 const FormatToken *Tok = Line.First->getNextNonComment();
824 return Line.First->isOneOf(tok::kw_if, tok::kw_else, tok::kw_while,
831 I[1]->First->isNot(tok::r_brace));
834 Line.First->isOneOf(tok::kw_try, tok::kw___try, tok::kw_catch,
843 Line.First->isOneOf(tok::kw_if, tok::kw_else) &&
845 I[1]->First->isNot(tok::r_brace)) {
849 Line.First->isOneOf(tok::kw_if, tok::kw_else) &&
852 I + 2 != E && I[2]->First->isNot(tok::r_brace)) {
856 Line.First->isOneOf(tok::kw_while, tok::kw_do, tok::kw_for,
859 I[1]->First->isNot(tok::r_brace)) {
863 Line.First->isOneOf(tok::kw_while, tok::kw_do, tok::kw_for,
867 I + 2 != E && I[2]->First->isNot(tok::r_brace)) {
875 if (Line.First->isOneOf(tok::kw_try, tok::kw___try, tok::kw_catch,
883 Line.First->is(TT_BlockLBrace)) {
887 if (IsSplitBlock && Line.First == Line.Last &&
892 FormatToken *Tok = I[1]->First;
931 Tok = I[2]->First;
945 if (Line.First == Line.Last && Line.First->isNot(TT_FunctionLBrace) &&
953 } else if (I[1]->First->is(tok::l_brace)) {
963 (I[1]->First == I[1]->Last && I + 2 != E &&
964 I[2]->First->is(tok::r_brace))) {
982 !I[1]->First->HasUnescapedNewline && I[1]->First->isNot(tok::eof)) {
990 if (I[1]->First->MustBreakBefore || I[2]->First->MustBreakBefore)
1000 if ((*J)->First->MustBreakBefore)
1011 assert(Line->First);
1014 for (const FormatToken *Tok = Line->First->Next; Tok; Tok = Tok->Next)
1022 assert(!B.First->Previous);
1025 A.Last->Next = B.First;
1026 B.First->Previous = A.Last;
1027 B.First->CanBreakBefore = true;
1028 unsigned LengthA = A.Last->TotalLength + B.First->SpacesRequiredBefore;
1029 for (FormatToken *Tok = B.First; Tok; Tok = Tok->Next) {
1142 if (Previous.Children[0]->First->MustBreakBefore)
1167 *Child->First, /*Newlines=*/0, /*Spaces=*/1,
1174 markFinalized(Child->First);
1452 assert(Line->First);
1468 Indent != TheLine.First->OriginalColumn;
1475 SourceMgr.getSpellingLineNumber(TheLine.First->Tok.getLocation());
1480 bool LastLine = TheLine.First->is(tok::eof);
1512 for (const FormatToken *Tok = TheLine.First; Tok; Tok = Tok->Next)
1520 TheLine.First->NewlinesBefore > 0 || TheLine.First->IsFirst;
1530 TheLine.First->OriginalColumn,
1531 TheLine.First->OriginalColumn);
1533 Whitespaces->addUntouchableToken(*TheLine.First,
1538 for (FormatToken *Tok = TheLine.First->Next; Tok; Tok = Tok->Next)
1545 markFinalized(TheLine.First);
1556 const auto &RootToken = *Line.First;
1617 if (PreviousLine->First->isAccessSpecifier())
1635 if (PreviousLine && PreviousLine->First->isAccessSpecifier() &&
1665 FormatToken &RootToken = *Line.First;
1713 !NextLine->First->HasUnescapedNewline));