• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/contrib/llvm-project/clang/lib/Format/

Lines Matching defs:Line

22 bool startsExternCBlock(const AnnotatedLine &Line) {
23 const FormatToken *Next = Line.First->getNextNonComment();
25 return Line.startsWith(tok::kw_extern) && Next && Next->isStringLiteral() &&
51 /// Update the indent state given that \p Line is going to be formatted
53 void nextLine(const AnnotatedLine &Line) {
54 Offset = getIndentOffset(*Line.First);
57 while (IndentForLevel.size() <= Line.Level)
59 if (Line.InPPDirective) {
60 Indent = Line.Level * Style.IndentWidth + AdditionalIndent;
62 IndentForLevel.resize(Line.Level + 1);
63 Indent = getIndent(IndentForLevel, Line.Level);
67 if (Line.First->is(TT_CSharpGenericTypeConstraint))
68 Indent = Line.Level * Style.IndentWidth + Style.ContinuationIndentWidth;
71 /// Update the indent state given that \p Line indent should be
73 void skipLine(const AnnotatedLine &Line) {
74 while (IndentForLevel.size() <= Line.Level)
78 /// Update the level indent to adapt to the given \p Line.
83 void adjustToUnmodifiedLine(const AnnotatedLine &Line) {
84 unsigned LevelIndent = Line.First->OriginalColumn;
87 if ((!Line.First->is(tok::comment) || IndentForLevel[Line.Level] == -1) &&
88 !Line.InPPDirective)
89 IndentForLevel[Line.Level] = LevelIndent;
140 const AnnotatedLine *Line,
142 if (!Line->startsWith(tok::r_brace))
144 size_t StartLineIndex = Line->MatchingOpeningBlockLineIndex;
151 StringRef getNamespaceTokenText(const AnnotatedLine *Line) {
152 const FormatToken *NamespaceToken = Line->First->getNamespaceToken();
157 const AnnotatedLine *Line,
160 getMatchingNamespaceToken(Line, AnnotatedLines);
438 AnnotatedLine &Line = **I;
439 if (!Line.First->is(tok::kw_do) && Line.Last->isNot(tok::r_paren))
442 if (Line.First->is(tok::kw_do) && !Line.Last->is(tok::kw_do))
451 if (I + 2 != E && Line.startsWith(tok::kw_if) &&
475 const AnnotatedLine *Line = I[1 + NumStmts];
476 if (Line->InPPDirective != InPPDirective)
478 if (Line->First->isOneOf(tok::kw_case, tok::kw_default, tok::r_brace))
480 if (Line->First->isOneOf(tok::kw_if, tok::kw_for, tok::kw_switch,
484 if (Line->First->is(tok::comment)) {
485 if (Level != Line->Level)
489 Line = *J;
490 if (Line->InPPDirective != InPPDirective)
492 if (Line->First->isOneOf(tok::kw_case, tok::kw_default, tok::r_brace))
494 if (Line->First->isNot(tok::comment) || Level != Line->Level)
499 if (Line->Last->is(tok::comment))
512 AnnotatedLine &Line = **I;
518 Line.First->isOneOf(tok::at, tok::minus, tok::plus))
523 if (Line.First->isOneOf(tok::kw_else, tok::kw_case) ||
524 (Line.First->Next && Line.First->Next->is(tok::kw_else)))
527 if (Line.First->is(tok::kw_default)) {
528 const FormatToken *Tok = Line.First->getNextNonComment();
532 if (Line.First->isOneOf(tok::kw_if, tok::kw_while, tok::kw_do, tok::kw_try,
540 Line.startsWith(tok::kw_if) &&
545 Line.startsWith(tok::kw_if) &&
551 Line.First->isOneOf(tok::kw_while, tok::kw_do, tok::kw_for) &&
556 Line.First->isOneOf(tok::kw_while, tok::kw_do, tok::kw_for) &&
566 if (Line.First->isOneOf(tok::kw_try, tok::kw___try, tok::kw_catch,
571 if (Line.Last->is(tok::l_brace)) {
580 } else if (Limit != 0 && !Line.startsWithNamespace() &&
581 !startsExternCBlock(Line)) {
583 FormatToken *RecordTok = Line.First;
626 // { <-- current Line
629 if (Line.First == Line.Last &&
679 bool containsMustBreak(const AnnotatedLine *Line) {
680 for (const FormatToken *Tok = Line->First; Tok; Tok = Tok->Next) {
742 virtual unsigned formatLine(const AnnotatedLine &Line, unsigned FirstIndent,
812 State.Line->InPPDirective);
840 unsigned formatLine(const AnnotatedLine &Line, unsigned FirstIndent,
844 &Line, /*DryRun=*/false);
866 unsigned formatLine(const AnnotatedLine &Line, unsigned FirstIndent,
870 Indenter->getInitialState(FirstIndent, FirstStartColumn, &Line, DryRun);
891 unsigned formatLine(const AnnotatedLine &Line, unsigned FirstIndent,
894 Indenter->getInitialState(FirstIndent, FirstStartColumn, &Line, DryRun);
898 if (State.Line->Type == LT_ObjCMethodDecl)
1083 for (const AnnotatedLine *Line =
1085 Line; Line = NextLine, FirstLine = false) {
1086 const AnnotatedLine &TheLine = *Line;
1107 Status->Line =
1113 bool LastLine = Line->First->is(tok::eof);
1183 const AnnotatedLine &Line, const AnnotatedLine *PreviousLine,
1186 FormatToken &RootToken = *Line.First;
1201 !getNamespaceToken(&Line, Lines))
1204 if (PreviousLine == nullptr && Line.Level > 0)
1240 (Line.Type == LT_PreprocessorDirective ||
1241 Line.Type == LT_ImportStatement))
1246 Line.InPPDirective &&