Lines Matching refs:Line

22 bool startsExternCBlock(const AnnotatedLine &Line) {  in startsExternCBlock()  argument
23 const FormatToken *Next = Line.First->getNextNonComment(); in startsExternCBlock()
25 return Line.startsWith(tok::kw_extern) && Next && Next->isStringLiteral() && in startsExternCBlock()
58 void nextLine(const AnnotatedLine &Line) { in nextLine() argument
59 Offset = getIndentOffset(*Line.First); in nextLine()
62 skipLine(Line, /*UnknownIndent=*/true); in nextLine()
63 if (Line.InPPDirective) { in nextLine()
66 Indent = Line.Level * IndentWidth + AdditionalIndent; in nextLine()
68 Indent = getIndent(Line.Level); in nextLine()
72 if (Line.First->is(TT_CSharpGenericTypeConstraint)) in nextLine()
73 Indent = Line.Level * Style.IndentWidth + Style.ContinuationIndentWidth; in nextLine()
78 void skipLine(const AnnotatedLine &Line, bool UnknownIndent = false) { in skipLine() argument
79 if (Line.Level >= IndentForLevel.size()) in skipLine()
80 IndentForLevel.resize(Line.Level + 1, UnknownIndent ? -1 : Indent); in skipLine()
88 void adjustToUnmodifiedLine(const AnnotatedLine &Line) { in adjustToUnmodifiedLine() argument
89 unsigned LevelIndent = Line.First->OriginalColumn; in adjustToUnmodifiedLine()
92 assert(Line.Level < IndentForLevel.size()); in adjustToUnmodifiedLine()
93 if ((!Line.First->is(tok::comment) || IndentForLevel[Line.Level] == -1) && in adjustToUnmodifiedLine()
94 !Line.InPPDirective) { in adjustToUnmodifiedLine()
95 IndentForLevel[Line.Level] = LevelIndent; in adjustToUnmodifiedLine()
174 const AnnotatedLine *Line, in getMatchingNamespaceToken() argument
176 if (!Line->startsWith(tok::r_brace)) in getMatchingNamespaceToken()
178 size_t StartLineIndex = Line->MatchingOpeningBlockLineIndex; in getMatchingNamespaceToken()
185 StringRef getNamespaceTokenText(const AnnotatedLine *Line) { in getNamespaceTokenText() argument
186 const FormatToken *NamespaceToken = Line->First->getNamespaceToken(); in getNamespaceTokenText()
191 const AnnotatedLine *Line, in getMatchingNamespaceTokenText() argument
194 getMatchingNamespaceToken(Line, AnnotatedLines); in getMatchingNamespaceTokenText()
321 const AnnotatedLine *Line = nullptr; in tryFitMultipleLinesInOne() local
326 Line = *J; in tryFitMultipleLinesInOne()
331 if (!Line) in tryFitMultipleLinesInOne()
335 const FormatToken *LastNonComment = Line->Last; in tryFitMultipleLinesInOne()
604 AnnotatedLine &Line = **I; in tryMergeSimpleControlStatement() local
605 if (!Line.First->is(tok::kw_do) && !Line.First->is(tok::kw_else) && in tryMergeSimpleControlStatement()
606 !Line.Last->is(tok::kw_else) && Line.Last->isNot(tok::r_paren)) { in tryMergeSimpleControlStatement()
610 if (Line.First->is(tok::kw_do) && !Line.Last->is(tok::kw_do)) in tryMergeSimpleControlStatement()
622 if (I + 2 != E && Line.startsWith(tok::kw_if) && in tryMergeSimpleControlStatement()
648 const AnnotatedLine *Line = I[1 + NumStmts]; in tryMergeShortCaseLabels() local
649 if (Line->InPPDirective != InPPDirective) 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()
659 if (Level != Line->Level) in tryMergeShortCaseLabels()
663 Line = *J; in tryMergeShortCaseLabels()
664 if (Line->InPPDirective != InPPDirective) 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()
673 if (Line->Last->is(tok::comment)) in tryMergeShortCaseLabels()
690 AnnotatedLine &Line = **I; in tryMergeSimpleBlock() local
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()
725 Line.First->isOneOf(tok::kw_if, tok::kw_else) && in tryMergeSimpleBlock()
731 Line.First->isOneOf(tok::kw_if, tok::kw_else) && in tryMergeSimpleBlock()
738 Line.First->isOneOf(tok::kw_while, tok::kw_do, tok::kw_for, in tryMergeSimpleBlock()
745 Line.First->isOneOf(tok::kw_while, tok::kw_do, tok::kw_for, in tryMergeSimpleBlock()
757 if (Line.First->isOneOf(tok::kw_try, tok::kw___try, tok::kw_catch, in tryMergeSimpleBlock()
763 if (Line.Last->is(tok::l_brace)) { in tryMergeSimpleBlock()
777 } else if (Limit != 0 && !Line.startsWithNamespace() && in tryMergeSimpleBlock()
778 !startsExternCBlock(Line)) { in tryMergeSimpleBlock()
780 if (isRecordLBrace(*Line.Last)) in tryMergeSimpleBlock()
816 if (Line.First == Line.Last && Line.First->isNot(TT_FunctionLBrace) && in tryMergeSimpleBlock()
867 bool containsMustBreak(const AnnotatedLine *Line) { in containsMustBreak() argument
868 for (const FormatToken *Tok = Line->First; Tok; Tok = Tok->Next) in containsMustBreak()
929 virtual unsigned formatLine(const AnnotatedLine &Line, unsigned FirstIndent,
1013 State.Line->InPPDirective); in formatChildren()
1041 unsigned formatLine(const AnnotatedLine &Line, unsigned FirstIndent, in formatLine() argument
1045 &Line, /*DryRun=*/false); in formatLine()
1067 unsigned formatLine(const AnnotatedLine &Line, unsigned FirstIndent, in formatLine() argument
1071 Indenter->getInitialState(FirstIndent, FirstStartColumn, &Line, DryRun); in formatLine()
1092 unsigned formatLine(const AnnotatedLine &Line, unsigned FirstIndent, in formatLine() argument
1095 Indenter->getInitialState(FirstIndent, FirstStartColumn, &Line, DryRun); in formatLine()
1099 if (State.Line->Type == LT_ObjCMethodDecl) in formatLine()
1290 for (const AnnotatedLine *Line = in format() local
1292 Line; PrevPrevLine = PreviousLine, PreviousLine = Line, Line = NextLine, in format()
1294 assert(Line->First); in format()
1295 const AnnotatedLine &TheLine = *Line; in format()
1316 Status->Line = in format()
1393 const AnnotatedLine &Line, const AnnotatedLine *PreviousLine, in formatFirstToken() argument
1397 FormatToken &RootToken = *Line.First; in formatFirstToken()
1412 !getNamespaceToken(&Line, Lines)) { in formatFirstToken()
1416 if (PreviousLine == nullptr && Line.Level > 0) in formatFirstToken()
1491 (Line.Type == LT_PreprocessorDirective || in formatFirstToken()
1492 Line.Type == LT_ImportStatement)) { in formatFirstToken()
1498 Line.InPPDirective && in formatFirstToken()