Lines Matching full: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)) {
365 // instead of TheLine->First.
368 if (const auto *NSToken = TheLine->First->getNamespaceToken()) {
379 // but only if their content was indented in the first place.
403 I[i + 1]->First->SpacesRequiredBefore =
420 TheLine->First != LastNonComment) {
432 if (NextLine.First->is(tok::l_brace)) {
433 if ((TheLine->First->isOneOf(tok::kw_if, tok::kw_else, tok::kw_while,
436 (TheLine->First->is(tok::r_brace) && TheLine->First->Next &&
437 TheLine->First->Next->isOneOf(tok::kw_else, tok::kw_catch))) &&
449 if (TheLine->First->isOneOf(tok::kw_if, tok::kw_else, tok::kw_while,
456 if (TheLine->First->isOneOf(tok::kw_else, tok::kw_catch) &&
470 if (PreviousLine && TheLine->First->is(tok::l_brace)) {
471 switch (PreviousLine->First->Tok.getKind()) {
474 if (PreviousLine->First->Next) {
476 PreviousLine->First->Next->Tok.getObjCKeywordID();
517 if (TheLine->First->is(TT_SwitchExpressionLabel)) {
535 (NextLine.First->is(tok::r_brace) &&
538 !TheLine->First->isOneOf(tok::kw_class, tok::kw_enum,
543 (NextLine.First->is(tok::r_brace) &&
550 if (NextLine.First->is(TT_FunctionLBrace) &&
563 NextLine.First == NextLine.Last && I + 2 != E &&
564 I[2]->First->is(tok::r_brace))) {
574 const FormatToken *First = TheLine->First;
575 if (First->is(tok::kw_else))
578 return First->is(tok::r_brace) && First->Next &&
579 First->Next->is(tok::kw_else);
581 if (TheLine->First->is(tok::kw_if) ||
588 if (TheLine->First->isOneOf(tok::kw_for, tok::kw_while, tok::kw_do,
594 if (TheLine->First->isOneOf(tok::kw_case, tok::kw_default)) {
600 (TheLine->First->HasUnescapedNewline || TheLine->First->IsFirst)) {
612 if (I + 2 != E && I[2]->InPPDirective && !I[2]->First->HasUnescapedNewline)
626 I[1]->First->is(tok::l_brace) &&
631 (I[1]->InPPDirective && I[1]->First->HasUnescapedNewline)) {
636 if (Line.First->isNot(tok::kw_do) && Line.First->isNot(tok::kw_else) &&
641 if (Line.First->is(tok::kw_do) && Line.Last->isNot(tok::kw_do))
646 if (I[1]->First->isOneOf(tok::semi, tok::kw_if, tok::kw_for, tok::kw_while,
654 I[2]->First->is(tok::kw_else)) {
666 I[1]->First->isOneOf(tok::kw_case, tok::kw_default)) {
669 if (I[0]->Last->is(tok::l_brace) || I[1]->First->is(tok::l_brace))
685 if (Line->First->isOneOf(tok::kw_case, tok::kw_default, tok::r_brace))
687 if (Line->First->isOneOf(tok::kw_if, tok::kw_for, tok::kw_switch,
692 if (Line->First->is(tok::comment)) {
700 if (Line->First->isOneOf(tok::kw_case, tok::kw_default, tok::r_brace))
702 if (Line->First->isNot(tok::comment) || Level != Line->Level)
730 Line.First->isOneOf(tok::at, tok::minus, tok::plus)) {
736 if (Line.First->is(tok::kw_case) ||
737 (Line.First->Next && Line.First->Next->is(tok::kw_else))) {
741 if (Line.First->is(tok::kw_default)) {
742 const FormatToken *Tok = Line.First->getNextNonComment();
748 return Line.First->isOneOf(tok::kw_if, tok::kw_else, tok::kw_while,
755 I[1]->First->isNot(tok::r_brace));
758 Line.First->isOneOf(tok::kw_try, tok::kw___try, tok::kw_catch,
766 Line.First->isOneOf(tok::kw_if, tok::kw_else) &&
768 I[1]->First->isNot(tok::r_brace)) {
772 Line.First->isOneOf(tok::kw_if, tok::kw_else) &&
775 I + 2 != E && I[2]->First->isNot(tok::r_brace)) {
779 Line.First->isOneOf(tok::kw_while, tok::kw_do, tok::kw_for,
782 I[1]->First->isNot(tok::r_brace)) {
786 Line.First->isOneOf(tok::kw_while, tok::kw_do, tok::kw_for,
790 I + 2 != E && I[2]->First->isNot(tok::r_brace)) {
796 // FIXME: For catch, __except, __finally the first token on the line
798 if (Line.First->isOneOf(tok::kw_try, tok::kw___try, tok::kw_catch,
806 Line.First->is(TT_BlockLBrace)) {
810 if (IsSplitBlock && Line.First == Line.Last &&
815 FormatToken *Tok = I[1]->First;
854 Tok = I[2]->First;
868 if (Line.First == Line.Last && Line.First->isNot(TT_FunctionLBrace) &&
876 } else if (I[1]->First->is(tok::l_brace)) {
886 (I[1]->First == I[1]->Last && I + 2 != E &&
887 I[2]->First->is(tok::r_brace))) {
906 !I[1]->First->HasUnescapedNewline && I[1]->First->isNot(tok::eof)) {
914 if (I[1]->First->MustBreakBefore || I[2]->First->MustBreakBefore)
920 assert(Line->First);
921 // Ignore the first token, because in this situation, it applies more to the
923 for (const FormatToken *Tok = Line->First->Next; Tok; Tok = Tok->Next)
931 assert(!B.First->Previous);
934 A.Last->Next = B.First;
935 B.First->Previous = A.Last;
936 B.First->CanBreakBefore = true;
937 unsigned LengthA = A.Last->TotalLength + B.First->SpacesRequiredBefore;
938 for (FormatToken *Tok = B.First; Tok; Tok = Tok->Next) {
961 // In the first pass we format all macro arguments in the expanded token
1051 if (Previous.Children[0]->First->MustBreakBefore)
1076 *Child->First, /*Newlines=*/0, /*Spaces=*/1,
1083 markFinalized(Child->First);
1183 /// first. During state generation we make sure that we insert states first
1230 // While not empty, take first element and follow edges.
1236 Penalty = Queue.top().first.first;
1361 assert(Line->First);
1377 Indent != TheLine.First->OriginalColumn;
1384 SourceMgr.getSpellingLineNumber(TheLine.First->Tok.getLocation());
1389 bool LastLine = TheLine.First->is(tok::eof);
1421 for (const FormatToken *Tok = TheLine.First; Tok; Tok = Tok->Next)
1429 TheLine.First->NewlinesBefore > 0 || TheLine.First->IsFirst;
1436 // Format the first token.
1439 TheLine.First->OriginalColumn,
1440 TheLine.First->OriginalColumn);
1442 Whitespaces->addUntouchableToken(*TheLine.First,
1447 for (FormatToken *Tok = TheLine.First->Next; Tok; Tok = Tok->Next)
1454 markFinalized(TheLine.First);
1465 const auto &RootToken = *Line.First;
1509 if (PreviousLine->First->isAccessSpecifier())
1527 if (PreviousLine && PreviousLine->First->isAccessSpecifier() &&
1557 FormatToken &RootToken = *Line.First;
1605 !NextLine->First->HasUnescapedNewline));