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()
53 void nextLine(const AnnotatedLine &Line) { in nextLine() argument
54 Offset = getIndentOffset(*Line.First); in nextLine()
57 while (IndentForLevel.size() <= Line.Level) in nextLine()
59 if (Line.InPPDirective) { in nextLine()
62 Indent = Line.Level * IndentWidth + AdditionalIndent; in nextLine()
64 IndentForLevel.resize(Line.Level + 1); in nextLine()
65 Indent = getIndent(IndentForLevel, Line.Level); in nextLine()
69 if (Line.First->is(TT_CSharpGenericTypeConstraint)) in nextLine()
70 Indent = Line.Level * Style.IndentWidth + Style.ContinuationIndentWidth; in nextLine()
75 void skipLine(const AnnotatedLine &Line) { in skipLine() argument
76 while (IndentForLevel.size() <= Line.Level) in skipLine()
85 void adjustToUnmodifiedLine(const AnnotatedLine &Line) { in adjustToUnmodifiedLine() argument
86 unsigned LevelIndent = Line.First->OriginalColumn; in adjustToUnmodifiedLine()
89 if ((!Line.First->is(tok::comment) || IndentForLevel[Line.Level] == -1) && in adjustToUnmodifiedLine()
90 !Line.InPPDirective) in adjustToUnmodifiedLine()
91 IndentForLevel[Line.Level] = LevelIndent; in adjustToUnmodifiedLine()
147 const AnnotatedLine *Line, in getMatchingNamespaceToken() argument
149 if (!Line->startsWith(tok::r_brace)) in getMatchingNamespaceToken()
151 size_t StartLineIndex = Line->MatchingOpeningBlockLineIndex; in getMatchingNamespaceToken()
158 StringRef getNamespaceTokenText(const AnnotatedLine *Line) { in getNamespaceTokenText() argument
159 const FormatToken *NamespaceToken = Line->First->getNamespaceToken(); in getNamespaceTokenText()
164 const AnnotatedLine *Line, in getMatchingNamespaceTokenText() argument
167 getMatchingNamespaceToken(Line, AnnotatedLines); in getMatchingNamespaceTokenText()
485 AnnotatedLine &Line = **I; in tryMergeSimpleControlStatement() local
486 if (!Line.First->is(tok::kw_do) && !Line.First->is(tok::kw_else) && in tryMergeSimpleControlStatement()
487 !Line.Last->is(tok::kw_else) && Line.Last->isNot(tok::r_paren)) in tryMergeSimpleControlStatement()
490 if (Line.First->is(tok::kw_do) && !Line.Last->is(tok::kw_do)) in tryMergeSimpleControlStatement()
500 if (I + 2 != E && Line.startsWith(tok::kw_if) && in tryMergeSimpleControlStatement()
524 const AnnotatedLine *Line = I[1 + NumStmts]; in tryMergeShortCaseLabels() local
525 if (Line->InPPDirective != InPPDirective) 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()
534 if (Level != Line->Level) in tryMergeShortCaseLabels()
538 Line = *J; in tryMergeShortCaseLabels()
539 if (Line->InPPDirective != InPPDirective) 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()
548 if (Line->Last->is(tok::comment)) in tryMergeShortCaseLabels()
561 AnnotatedLine &Line = **I; in tryMergeSimpleBlock() local
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()
589 Line.startsWith(tok::kw_if) && in tryMergeSimpleBlock()
594 Line.startsWith(tok::kw_if) && in tryMergeSimpleBlock()
600 Line.First->isOneOf(tok::kw_while, tok::kw_do, tok::kw_for) && in tryMergeSimpleBlock()
605 Line.First->isOneOf(tok::kw_while, tok::kw_do, tok::kw_for) && in tryMergeSimpleBlock()
615 if (Line.First->isOneOf(tok::kw_try, tok::kw___try, tok::kw_catch, in tryMergeSimpleBlock()
620 if (Line.Last->is(tok::l_brace)) { in tryMergeSimpleBlock()
629 } else if (Limit != 0 && !Line.startsWithNamespace() && in tryMergeSimpleBlock()
630 !startsExternCBlock(Line)) { in tryMergeSimpleBlock()
632 FormatToken *RecordTok = Line.First; in tryMergeSimpleBlock()
678 if (Line.First == Line.Last && in tryMergeSimpleBlock()
728 bool containsMustBreak(const AnnotatedLine *Line) { in containsMustBreak() argument
729 for (const FormatToken *Tok = Line->First; Tok; Tok = Tok->Next) { in containsMustBreak()
791 virtual unsigned formatLine(const AnnotatedLine &Line, unsigned FirstIndent,
873 State.Line->InPPDirective); in formatChildren()
901 unsigned formatLine(const AnnotatedLine &Line, unsigned FirstIndent, in formatLine() argument
905 &Line, /*DryRun=*/false); in formatLine()
927 unsigned formatLine(const AnnotatedLine &Line, unsigned FirstIndent, in formatLine() argument
931 Indenter->getInitialState(FirstIndent, FirstStartColumn, &Line, DryRun); in formatLine()
952 unsigned formatLine(const AnnotatedLine &Line, unsigned FirstIndent, in formatLine() argument
955 Indenter->getInitialState(FirstIndent, FirstStartColumn, &Line, DryRun); in formatLine()
959 if (State.Line->Type == LT_ObjCMethodDecl) in formatLine()
1145 for (const AnnotatedLine *Line = in format() local
1147 Line; Line = NextLine, FirstLine = false) { in format()
1148 const AnnotatedLine &TheLine = *Line; in format()
1169 Status->Line = in format()
1175 bool LastLine = Line->First->is(tok::eof); in format()
1246 const AnnotatedLine &Line, const AnnotatedLine *PreviousLine, in formatFirstToken() argument
1250 FormatToken &RootToken = *Line.First; in formatFirstToken()
1265 !getNamespaceToken(&Line, Lines)) in formatFirstToken()
1268 if (PreviousLine == nullptr && Line.Level > 0) in formatFirstToken()
1340 (Line.Type == LT_PreprocessorDirective || in formatFirstToken()
1341 Line.Type == LT_ImportStatement)) in formatFirstToken()
1346 Line.InPPDirective && in formatFirstToken()