Lines Matching refs:First
24 const FormatToken *Next = Line.First->getNextNonComment(); in startsExternCBlock()
55 Offset = getIndentOffset(*Line.First); in nextLine()
83 unsigned LevelIndent = Line.First->OriginalColumn; in adjustToUnmodifiedLine()
86 if ((!Line.First->is(tok::comment) || IndentForLevel[Line.Level] == -1) && in adjustToUnmodifiedLine()
139 const FormatToken *NamespaceTok = Line->First; in isNamespaceDeclaration()
173 if (Next[i + 1]->First->NewlinesBefore > 0) in getNextMergedLine()
197 if (I[1]->Type == LT_Invalid || I[1]->First->MustBreakBefore) in tryFitMultipleLinesInOne()
200 (!I[1]->InPPDirective || I[1]->First->HasUnescapedNewline)) in tryFitMultipleLinesInOne()
215 TheLine->First == TheLine->Last && in tryFitMultipleLinesInOne()
217 I[1]->First->is(tok::r_brace)) in tryFitMultipleLinesInOne()
221 if (TheLine->Last->is(tok::l_brace) && TheLine->First == TheLine->Last && in tryFitMultipleLinesInOne()
223 bool EmptyBlock = I[1]->First->is(tok::r_brace); in tryFitMultipleLinesInOne()
225 const FormatToken *Tok = I[-1]->First; in tryFitMultipleLinesInOne()
248 I[1]->First->is(tok::r_brace)) || in tryFitMultipleLinesInOne()
275 I[i + 1]->First->SpacesRequiredBefore = !I[i]->Last->is(tok::r_brace); in tryFitMultipleLinesInOne()
286 TheLine->First != TheLine->Last) { in tryFitMultipleLinesInOne()
290 if (TheLine->Last->is(tok::l_brace) && TheLine->First != TheLine->Last && in tryFitMultipleLinesInOne()
291 TheLine->First->isOneOf(tok::kw_if, tok::kw_while, tok::kw_for)) { in tryFitMultipleLinesInOne()
297 if (I[1]->First->is(tok::l_brace) && in tryFitMultipleLinesInOne()
298 TheLine->First->isOneOf(tok::kw_if, tok::kw_while, tok::kw_for)) { in tryFitMultipleLinesInOne()
305 if (TheLine->First->is(tok::l_brace) && TheLine->First == TheLine->Last && in tryFitMultipleLinesInOne()
307 I[-1]->First->isOneOf(tok::kw_if, tok::kw_while, tok::kw_for)) { in tryFitMultipleLinesInOne()
319 if (TheLine->First->is(tok::l_brace) && I != AnnotatedLines.begin() && in tryFitMultipleLinesInOne()
320 I[-1]->First->is(tok::at) && I[-1]->First->Next) { in tryFitMultipleLinesInOne()
321 tok::ObjCKeywordKind kwId = I[-1]->First->Next->Tok.getObjCKeywordID(); in tryFitMultipleLinesInOne()
327 if (TheLine->First->is(tok::l_brace) && I != AnnotatedLines.begin() && in tryFitMultipleLinesInOne()
328 I[-1]->First->isOneOf(tok::kw_case, tok::kw_default)) in tryFitMultipleLinesInOne()
333 (I[1]->First->is(tok::r_brace) && in tryFitMultipleLinesInOne()
339 if (I[1]->First->is(TT_FunctionLBrace) && in tryFitMultipleLinesInOne()
352 I[1]->First == I[1]->Last && I + 2 != E && in tryFitMultipleLinesInOne()
353 I[2]->First->is(tok::r_brace))) { in tryFitMultipleLinesInOne()
362 if (TheLine->First->is(tok::kw_if)) { in tryFitMultipleLinesInOne()
367 if (TheLine->First->isOneOf(tok::kw_for, tok::kw_while)) { in tryFitMultipleLinesInOne()
372 if (TheLine->First->isOneOf(tok::kw_case, tok::kw_default)) { in tryFitMultipleLinesInOne()
378 (TheLine->First->HasUnescapedNewline || TheLine->First->IsFirst)) { in tryFitMultipleLinesInOne()
390 if (I + 2 != E && I[2]->InPPDirective && !I[2]->First->HasUnescapedNewline) in tryMergeSimplePPDirective()
403 (I[1]->First->is(tok::l_brace) && !Style.AllowShortBlocksOnASingleLine)) in tryMergeSimpleControlStatement()
406 (I[1]->InPPDirective && I[1]->First->HasUnescapedNewline)) in tryMergeSimpleControlStatement()
414 if (I[1]->First->isOneOf(tok::semi, tok::kw_if, tok::kw_for, tok::kw_while, in tryMergeSimpleControlStatement()
419 I[2]->First->is(tok::kw_else)) in tryMergeSimpleControlStatement()
429 I[1]->First->isOneOf(tok::kw_case, tok::kw_default)) in tryMergeShortCaseLabels()
431 if (I[0]->Last->is(tok::l_brace) || I[1]->First->is(tok::l_brace)) in tryMergeShortCaseLabels()
444 if (Line->First->isOneOf(tok::kw_case, tok::kw_default, tok::r_brace)) in tryMergeShortCaseLabels()
446 if (Line->First->isOneOf(tok::kw_if, tok::kw_for, tok::kw_switch, in tryMergeShortCaseLabels()
450 if (Line->First->is(tok::comment)) { in tryMergeShortCaseLabels()
458 if (Line->First->isOneOf(tok::kw_case, tok::kw_default, tok::r_brace)) in tryMergeShortCaseLabels()
460 if (Line->First->isNot(tok::comment) || Level != Line->Level) in tryMergeShortCaseLabels()
484 Line.First->isOneOf(tok::at, tok::minus, tok::plus)) in tryMergeSimpleBlock()
489 if (Line.First->isOneOf(tok::kw_else, tok::kw_case) || in tryMergeSimpleBlock()
490 (Line.First->Next && Line.First->Next->is(tok::kw_else))) in tryMergeSimpleBlock()
493 if (Line.First->is(tok::kw_default)) { in tryMergeSimpleBlock()
494 const FormatToken *Tok = Line.First->getNextNonComment(); in tryMergeSimpleBlock()
498 if (Line.First->isOneOf(tok::kw_if, tok::kw_while, tok::kw_do, tok::kw_try, in tryMergeSimpleBlock()
508 !I[1]->First->is(tok::r_brace)) in tryMergeSimpleBlock()
513 !I[2]->First->is(tok::r_brace)) in tryMergeSimpleBlock()
516 Line.First->isOneOf(tok::kw_while, tok::kw_do, tok::kw_for) && in tryMergeSimpleBlock()
518 !I[1]->First->is(tok::r_brace)) in tryMergeSimpleBlock()
521 Line.First->isOneOf(tok::kw_while, tok::kw_do, tok::kw_for) && in tryMergeSimpleBlock()
523 !I[2]->First->is(tok::r_brace)) in tryMergeSimpleBlock()
530 if (Line.First->isOneOf(tok::kw_try, tok::kw___try, tok::kw_catch, in tryMergeSimpleBlock()
536 FormatToken *Tok = I[1]->First; in tryMergeSimpleBlock()
547 FormatToken *RecordTok = Line.First; in tryMergeSimpleBlock()
578 Tok = I[2]->First; in tryMergeSimpleBlock()
588 } else if (I[1]->First->is(tok::l_brace)) { in tryMergeSimpleBlock()
598 (I[1]->First == I[1]->Last && I + 2 != E && in tryMergeSimpleBlock()
599 I[2]->First->is(tok::r_brace))) { in tryMergeSimpleBlock()
618 !I[1]->First->HasUnescapedNewline && !I[1]->First->is(tok::eof)) { in limitConsideringMacros()
626 if (I[1]->First->MustBreakBefore || I[2]->First->MustBreakBefore) in nextTwoLinesFitInto()
632 for (const FormatToken *Tok = Line->First; Tok; Tok = Tok->Next) { in containsMustBreak()
641 assert(!B.First->Previous); in join()
644 A.Last->Next = B.First; in join()
645 B.First->Previous = A.Last; in join()
646 B.First->CanBreakBefore = true; in join()
647 unsigned LengthA = A.Last->TotalLength + B.First->SpacesRequiredBefore; in join()
648 for (FormatToken *Tok = B.First; Tok; Tok = Tok->Next) { in join()
666 markFinalized(Child->First); in markFinalized()
740 if (Previous.Children[0]->First->MustBreakBefore) in formatChildren()
764 *Child->First, /*Newlines=*/0, /*Spaces=*/1, in formatChildren()
1057 Indent != TheLine.First->OriginalColumn; in format()
1064 SourceMgr.getSpellingLineNumber(TheLine.First->Tok.getLocation()); in format()
1069 bool LastLine = Line->First->is(tok::eof); in format()
1098 for (const FormatToken *Tok = TheLine.First; Tok; Tok = Tok->Next) in format()
1105 TheLine.First->NewlinesBefore > 0 || TheLine.First->IsFirst; in format()
1115 TheLine.First->OriginalColumn, in format()
1116 TheLine.First->OriginalColumn); in format()
1118 Whitespaces->addUntouchableToken(*TheLine.First, in format()
1122 for (FormatToken *Tok = TheLine.First->Next; Tok; Tok = Tok->Next) in format()
1129 markFinalized(TheLine.First); in format()
1140 FormatToken &RootToken = *Line.First; in formatFirstToken()
1178 if (PreviousLine && PreviousLine->First->isAccessSpecifier() && in formatFirstToken()
1207 !NextLine->First->HasUnescapedNewline)); in getColumnLimit()