Lines Matching refs:First
23 const FormatToken *Next = Line.First->getNextNonComment(); in startsExternCBlock()
54 Offset = getIndentOffset(*Line.First); in nextLine()
69 if (Line.First->is(TT_CSharpGenericTypeConstraint)) in nextLine()
86 unsigned LevelIndent = Line.First->OriginalColumn; in adjustToUnmodifiedLine()
89 if ((!Line.First->is(tok::comment) || IndentForLevel[Line.Level] == -1) && in adjustToUnmodifiedLine()
155 return AnnotatedLines[StartLineIndex]->First->getNamespaceToken(); in getMatchingNamespaceToken()
159 const FormatToken *NamespaceToken = Line->First->getNamespaceToken(); in getNamespaceTokenText()
190 if (Next[i + 1]->First->NewlinesBefore > 0) in getNextMergedLine()
214 if (I[1]->Type == LT_Invalid || I[1]->First->MustBreakBefore) in tryFitMultipleLinesInOne()
217 (!I[1]->InPPDirective || I[1]->First->HasUnescapedNewline)) in tryFitMultipleLinesInOne()
232 TheLine->First == TheLine->Last && in tryFitMultipleLinesInOne()
234 I[1]->First->is(tok::r_brace)) in tryFitMultipleLinesInOne()
238 if (TheLine->Last->is(tok::l_brace) && TheLine->First == TheLine->Last && in tryFitMultipleLinesInOne()
240 bool EmptyBlock = I[1]->First->is(tok::r_brace); in tryFitMultipleLinesInOne()
242 const FormatToken *Tok = I[-1]->First; in tryFitMultipleLinesInOne()
270 I[1]->First->is(tok::r_brace)) || in tryFitMultipleLinesInOne()
275 if (auto nsToken = TheLine->First->getNamespaceToken()) { in tryFitMultipleLinesInOne()
300 I[i + 1]->First->SpacesRequiredBefore = !I[i]->Last->is(tok::r_brace); in tryFitMultipleLinesInOne()
311 TheLine->First != TheLine->Last) { in tryFitMultipleLinesInOne()
315 if (TheLine->Last->is(tok::l_brace) && TheLine->First != TheLine->Last && in tryFitMultipleLinesInOne()
316 TheLine->First->isOneOf(tok::kw_if, tok::kw_while, tok::kw_for)) { in tryFitMultipleLinesInOne()
322 if (I[1]->First->is(tok::l_brace) && in tryFitMultipleLinesInOne()
323 (TheLine->First->isOneOf(tok::kw_if, tok::kw_while, tok::kw_for, in tryFitMultipleLinesInOne()
326 (TheLine->First->is(tok::r_brace) && TheLine->First->Next && in tryFitMultipleLinesInOne()
327 TheLine->First->Next->isOneOf(tok::kw_else, tok::kw_catch))) && in tryFitMultipleLinesInOne()
337 } else if (I[1]->First->is(tok::l_brace) && in tryFitMultipleLinesInOne()
338 TheLine->First->isOneOf(tok::kw_if, tok::kw_while, in tryFitMultipleLinesInOne()
344 } else if (I[1]->First->is(tok::l_brace) && in tryFitMultipleLinesInOne()
345 TheLine->First->isOneOf(tok::kw_else, tok::kw_catch) && in tryFitMultipleLinesInOne()
359 if (TheLine->First->is(tok::l_brace) && I != AnnotatedLines.begin() && in tryFitMultipleLinesInOne()
360 I[-1]->First->is(tok::at) && I[-1]->First->Next) { in tryFitMultipleLinesInOne()
361 tok::ObjCKeywordKind kwId = I[-1]->First->Next->Tok.getObjCKeywordID(); in tryFitMultipleLinesInOne()
367 if (TheLine->First->is(tok::l_brace) && I != AnnotatedLines.begin() && in tryFitMultipleLinesInOne()
368 I[-1]->First->isOneOf(tok::kw_case, tok::kw_default)) in tryFitMultipleLinesInOne()
397 (I[1]->First->is(tok::r_brace) && in tryFitMultipleLinesInOne()
403 if (I[1]->First->is(TT_FunctionLBrace) && in tryFitMultipleLinesInOne()
416 I[1]->First == I[1]->Last && I + 2 != E && in tryFitMultipleLinesInOne()
417 I[2]->First->is(tok::r_brace))) { in tryFitMultipleLinesInOne()
427 const FormatToken *First = TheLine->First; in tryFitMultipleLinesInOne() local
428 if (First->is(tok::kw_else)) in tryFitMultipleLinesInOne()
431 return First->is(tok::r_brace) && First->Next && in tryFitMultipleLinesInOne()
432 First->Next->is(tok::kw_else); in tryFitMultipleLinesInOne()
434 if (TheLine->First->is(tok::kw_if) || in tryFitMultipleLinesInOne()
441 if (TheLine->First->isOneOf(tok::kw_for, tok::kw_while, tok::kw_do)) { in tryFitMultipleLinesInOne()
446 if (TheLine->First->isOneOf(tok::kw_case, tok::kw_default)) { in tryFitMultipleLinesInOne()
452 (TheLine->First->HasUnescapedNewline || TheLine->First->IsFirst)) { in tryFitMultipleLinesInOne()
464 if (I + 2 != E && I[2]->InPPDirective && !I[2]->First->HasUnescapedNewline) in tryMergeSimplePPDirective()
478 I[1]->First->is(tok::l_brace) && in tryMergeSimpleControlStatement()
482 (I[1]->InPPDirective && I[1]->First->HasUnescapedNewline)) in tryMergeSimpleControlStatement()
486 if (!Line.First->is(tok::kw_do) && !Line.First->is(tok::kw_else) && in tryMergeSimpleControlStatement()
490 if (Line.First->is(tok::kw_do) && !Line.Last->is(tok::kw_do)) in tryMergeSimpleControlStatement()
494 if (I[1]->First->isOneOf(tok::semi, tok::kw_if, tok::kw_for, tok::kw_while, in tryMergeSimpleControlStatement()
501 I[2]->First->is(tok::kw_else)) in tryMergeSimpleControlStatement()
512 I[1]->First->isOneOf(tok::kw_case, tok::kw_default)) in tryMergeShortCaseLabels()
514 if (I[0]->Last->is(tok::l_brace) || I[1]->First->is(tok::l_brace)) in tryMergeShortCaseLabels()
527 if (Line->First->isOneOf(tok::kw_case, tok::kw_default, tok::r_brace)) in tryMergeShortCaseLabels()
529 if (Line->First->isOneOf(tok::kw_if, tok::kw_for, tok::kw_switch, in tryMergeShortCaseLabels()
533 if (Line->First->is(tok::comment)) { in tryMergeShortCaseLabels()
541 if (Line->First->isOneOf(tok::kw_case, tok::kw_default, tok::r_brace)) in tryMergeShortCaseLabels()
543 if (Line->First->isNot(tok::comment) || Level != Line->Level) in tryMergeShortCaseLabels()
567 Line.First->isOneOf(tok::at, tok::minus, tok::plus)) in tryMergeSimpleBlock()
572 if (Line.First->isOneOf(tok::kw_else, tok::kw_case) || in tryMergeSimpleBlock()
573 (Line.First->Next && Line.First->Next->is(tok::kw_else))) in tryMergeSimpleBlock()
576 if (Line.First->is(tok::kw_default)) { in tryMergeSimpleBlock()
577 const FormatToken *Tok = Line.First->getNextNonComment(); in tryMergeSimpleBlock()
581 if (Line.First->isOneOf(tok::kw_if, tok::kw_while, tok::kw_do, tok::kw_try, in tryMergeSimpleBlock()
591 !I[1]->First->is(tok::r_brace)) in tryMergeSimpleBlock()
597 I + 2 != E && !I[2]->First->is(tok::r_brace)) in tryMergeSimpleBlock()
600 Line.First->isOneOf(tok::kw_while, tok::kw_do, tok::kw_for) && in tryMergeSimpleBlock()
602 !I[1]->First->is(tok::r_brace)) in tryMergeSimpleBlock()
605 Line.First->isOneOf(tok::kw_while, tok::kw_do, tok::kw_for) && in tryMergeSimpleBlock()
608 I + 2 != E && !I[2]->First->is(tok::r_brace)) in tryMergeSimpleBlock()
615 if (Line.First->isOneOf(tok::kw_try, tok::kw___try, tok::kw_catch, in tryMergeSimpleBlock()
621 FormatToken *Tok = I[1]->First; in tryMergeSimpleBlock()
632 FormatToken *RecordTok = Line.First; in tryMergeSimpleBlock()
664 Tok = I[2]->First; in tryMergeSimpleBlock()
678 if (Line.First == Line.Last && in tryMergeSimpleBlock()
685 } else if (I[1]->First->is(tok::l_brace)) { in tryMergeSimpleBlock()
695 (I[1]->First == I[1]->Last && I + 2 != E && in tryMergeSimpleBlock()
696 I[2]->First->is(tok::r_brace))) { in tryMergeSimpleBlock()
715 !I[1]->First->HasUnescapedNewline && !I[1]->First->is(tok::eof)) { in limitConsideringMacros()
723 if (I[1]->First->MustBreakBefore || I[2]->First->MustBreakBefore) in nextTwoLinesFitInto()
729 for (const FormatToken *Tok = Line->First; Tok; Tok = Tok->Next) { in containsMustBreak()
738 assert(!B.First->Previous); in join()
741 A.Last->Next = B.First; in join()
742 B.First->Previous = A.Last; in join()
743 B.First->CanBreakBefore = true; in join()
744 unsigned LengthA = A.Last->TotalLength + B.First->SpacesRequiredBefore; in join()
745 for (FormatToken *Tok = B.First; Tok; Tok = Tok->Next) { in join()
763 markFinalized(Child->First); in markFinalized()
847 if (Previous.Children[0]->First->MustBreakBefore) in formatChildren()
871 *Child->First, /*Newlines=*/0, /*Spaces=*/1, in formatChildren()
1163 Indent != TheLine.First->OriginalColumn; in format()
1170 SourceMgr.getSpellingLineNumber(TheLine.First->Tok.getLocation()); in format()
1175 bool LastLine = Line->First->is(tok::eof); in format()
1206 for (const FormatToken *Tok = TheLine.First; Tok; Tok = Tok->Next) in format()
1213 TheLine.First->NewlinesBefore > 0 || TheLine.First->IsFirst; in format()
1223 TheLine.First->OriginalColumn, in format()
1224 TheLine.First->OriginalColumn); in format()
1226 Whitespaces->addUntouchableToken(*TheLine.First, in format()
1230 for (FormatToken *Tok = TheLine.First->Next; Tok; Tok = Tok->Next) in format()
1237 markFinalized(TheLine.First); in format()
1250 FormatToken &RootToken = *Line.First; in formatFirstToken()
1297 if (PreviousLine->First->isAccessSpecifier()) in formatFirstToken()
1313 if (PreviousLine && PreviousLine->First->isAccessSpecifier() && in formatFirstToken()
1363 !NextLine->First->HasUnescapedNewline)); in getColumnLimit()