Lines Matching refs:Style

46   LevelIndentTracker(const FormatStyle &Style,  in LevelIndentTracker()  argument
49 : Style(Style), Keywords(Keywords), AdditionalIndent(AdditionalIndent) { in LevelIndentTracker()
51 IndentForLevel.push_back(Style.IndentWidth * i + AdditionalIndent); in LevelIndentTracker()
65 if (Style.IndentPPDirectives != FormatStyle::PPDIS_None && in nextLine()
67 (Style.IndentPPDirectives == FormatStyle::PPDIS_BeforeHash && in nextLine()
70 (Style.PPIndentWidth >= 0) ? Style.PPIndentWidth : Style.IndentWidth; in nextLine()
73 (Line.Level - Line.PPLevel) * Style.IndentWidth in nextLine()
89 Indent = Line.Level * Style.IndentWidth + Style.ContinuationIndentWidth; in nextLine()
115 if (Style.Language == FormatStyle::LK_Java || Style.isJavaScript() || in getIndentOffset()
116 Style.isCSharp()) { in getIndentOffset()
121 if (RootToken.isAccessSpecifier(Style.isCpp())) { in getIndentOffset()
147 return Style.IndentAccessModifiers ? -Style.IndentWidth in getIndentOffset()
148 : Style.AccessModifierOffset; in getIndentOffset()
164 return getIndent(Level - 1) + Style.IndentWidth; in getIndent()
167 const FormatStyle &Style; member in clang::format::__anon985fe27a0111::LevelIndentTracker
214 LineJoiner(const FormatStyle &Style, const AdditionalKeywords &Keywords, in LineJoiner() argument
216 : Style(Style), Keywords(Keywords), End(Lines.end()), Next(Lines.begin()), in LineJoiner()
227 if (MergedLines > 0 && Style.ColumnLimit == 0) { in getNextMergedLine()
264 if (Style.ColumnLimit > 0 && Indent > Style.ColumnLimit) in tryFitMultipleLinesInOne()
268 Style.ColumnLimit == 0 ? UINT_MAX : Style.ColumnLimit - Indent; in tryFitMultipleLinesInOne()
277 !Style.BraceWrapping.SplitEmptyFunction && in tryFitMultipleLinesInOne()
293 return !Style.BraceWrapping.SplitEmptyNamespace && EmptyBlock in tryFitMultipleLinesInOne()
302 return !Style.BraceWrapping.SplitEmptyRecord && EmptyBlock in tryFitMultipleLinesInOne()
308 Style.BraceWrapping.SplitEmptyRecord && EmptyBlock) { in tryFitMultipleLinesInOne()
315 if (Style.AllowShortFunctionsOnASingleLine == FormatStyle::SFS_All) in tryFitMultipleLinesInOne()
317 if (Style.AllowShortFunctionsOnASingleLine >= FormatStyle::SFS_Empty && in tryFitMultipleLinesInOne()
322 if (Style.AllowShortFunctionsOnASingleLine & in tryFitMultipleLinesInOne()
326 if (Style.isJavaScript() && TheLine->Last->is(TT_FunctionLBrace)) in tryFitMultipleLinesInOne()
368 if (Style.CompactNamespaces) { in tryFitMultipleLinesInOne()
428 return Style.AllowShortBlocksOnASingleLine != FormatStyle::SBS_Never in tryFitMultipleLinesInOne()
439 Style.BraceWrapping.AfterControlStatement == in tryFitMultipleLinesInOne()
444 return (Style.ColumnLimit == 0 || TheLine->Level * Style.IndentWidth + in tryFitMultipleLinesInOne()
446 Style.ColumnLimit) in tryFitMultipleLinesInOne()
452 return (Style.BraceWrapping.AfterControlStatement == in tryFitMultipleLinesInOne()
458 Style.BraceWrapping.AfterControlStatement == in tryFitMultipleLinesInOne()
465 return (Style.ColumnLimit == 0 || in tryFitMultipleLinesInOne()
466 TheLine->Last->TotalLength <= Style.ColumnLimit) in tryFitMultipleLinesInOne()
497 if (PreviousLine && Style.BraceWrapping.SplitEmptyRecord && in tryFitMultipleLinesInOne()
522 ShouldMerge = Style.AllowShortEnumsOnASingleLine; in tryFitMultipleLinesInOne()
524 ShouldMerge = Style.AllowShortCompoundRequirementOnASingleLine; in tryFitMultipleLinesInOne()
529 ShouldMerge = !Style.BraceWrapping.AfterClass || in tryFitMultipleLinesInOne()
531 !Style.BraceWrapping.SplitEmptyRecord); in tryFitMultipleLinesInOne()
537 ShouldMerge = !Style.BraceWrapping.AfterFunction || in tryFitMultipleLinesInOne()
539 !Style.BraceWrapping.SplitEmptyFunction); in tryFitMultipleLinesInOne()
546 Style.BraceWrapping.AfterFunction) { in tryFitMultipleLinesInOne()
551 if (Limit <= 2 || (Style.ColumnLimit == 0 && containsMustBreak(TheLine))) in tryFitMultipleLinesInOne()
557 (Style.AllowShortFunctionsOnASingleLine >= FormatStyle::SFS_Empty && in tryFitMultipleLinesInOne()
577 (IsElseLine() && (Style.AllowShortIfStatementsOnASingleLine == in tryFitMultipleLinesInOne()
579 return Style.AllowShortIfStatementsOnASingleLine in tryFitMultipleLinesInOne()
585 return Style.AllowShortLoopsOnASingleLine in tryFitMultipleLinesInOne()
590 return Style.AllowShortCaseLabelsOnASingleLine in tryFitMultipleLinesInOne()
619 if (Style.BraceWrapping.AfterControlStatement == in tryMergeSimpleControlStatement()
622 Style.AllowShortBlocksOnASingleLine == FormatStyle::SBS_Never) { in tryMergeSimpleControlStatement()
646 if (Style.AllowShortIfStatementsOnASingleLine == in tryMergeSimpleControlStatement()
724 if (Style.Language != FormatStyle::LK_Java && in tryMergeSimpleBlock()
748 Style.AllowShortBlocksOnASingleLine == FormatStyle::SBS_Never || in tryMergeSimpleBlock()
749 (Style.AllowShortBlocksOnASingleLine == FormatStyle::SBS_Empty && in tryMergeSimpleBlock()
760 if (!Style.AllowShortIfStatementsOnASingleLine && in tryMergeSimpleBlock()
762 !Style.BraceWrapping.AfterControlStatement && in tryMergeSimpleBlock()
766 if (!Style.AllowShortIfStatementsOnASingleLine && in tryMergeSimpleBlock()
768 Style.BraceWrapping.AfterControlStatement == in tryMergeSimpleBlock()
773 if (!Style.AllowShortLoopsOnASingleLine && in tryMergeSimpleBlock()
776 !Style.BraceWrapping.AfterControlStatement && in tryMergeSimpleBlock()
780 if (!Style.AllowShortLoopsOnASingleLine && in tryMergeSimpleBlock()
783 Style.BraceWrapping.AfterControlStatement == in tryMergeSimpleBlock()
817 (Style.SpaceInEmptyBlock || Line.Last->is(tok::comment)) ? 1 : 0; in tryMergeSimpleBlock()
860 Style.BraceWrapping.AfterControlStatement == in tryMergeSimpleBlock()
872 if (Limit <= 2 || (Style.ColumnLimit == 0 && containsMustBreak(*I))) in tryMergeSimpleBlock()
876 if (Style.AllowShortBlocksOnASingleLine != FormatStyle::SBS_Never || in tryMergeSimpleBlock()
935 const FormatStyle &Style; member in clang::format::__anon985fe27a0111::LineJoiner
987 const FormatStyle &Style, in LineFormatter() argument
989 : Indenter(Indenter), Whitespaces(Whitespaces), Style(Style), in LineFormatter()
1035 P.Indent - Previous.Children[0]->Level * Style.IndentWidth; in formatChildren()
1060 if (Style.ColumnLimit > 0 && in formatChildren()
1061 Child->Last->TotalLength + State.Column + 2 > Style.ColumnLimit) { in formatChildren()
1084 const FormatStyle &Style; member in clang::format::__anon985fe27a0111::LineFormatter
1093 const FormatStyle &Style, in NoColumnLimitLineFormatter() argument
1095 : LineFormatter(Indenter, Whitespaces, Style, BlockFormatter) {} in NoColumnLimitLineFormatter()
1120 WhitespaceManager *Whitespaces, const FormatStyle &Style, in NoLineBreakFormatter() argument
1122 : LineFormatter(Indenter, Whitespaces, Style, BlockFormatter) {} in NoLineBreakFormatter()
1144 const FormatStyle &Style, in OptimizingLineFormatter() argument
1146 : LineFormatter(Indenter, Whitespaces, Style, BlockFormatter) {} in OptimizingLineFormatter()
1327 LineJoiner Joiner(Style, Keywords, Lines); in format()
1338 LevelIndentTracker IndentTracker(Style, Keywords, Lines[0]->Level, in format()
1391 (!Style.isJavaScript() || !Style.JavaScriptWrapImports)) || in format()
1392 (Style.isCSharp() && in format()
1394 if (Style.ColumnLimit == 0) { in format()
1395 NoColumnLimitLineFormatter(Indenter, Whitespaces, Style, this) in format()
1399 Penalty += NoLineBreakFormatter(Indenter, Whitespaces, Style, this) in format()
1403 Penalty += OptimizingLineFormatter(Indenter, Whitespaces, Style, this) in format()
1455 const FormatStyle &Style) { in computeNewlines() argument
1458 std::min(RootToken.NewlinesBefore, Style.MaxEmptyLinesToKeep + 1); in computeNewlines()
1476 if (!Style.KeepEmptyLinesAtTheStartOfBlocks && PreviousLine && in computeNewlines()
1487 switch (Style.EmptyLineBeforeAccessModifier) { in computeNewlines()
1521 switch (Style.EmptyLineAfterAccessModifier) { in computeNewlines()
1550 Style.KeepEmptyLinesAtEOF ? Style.MaxEmptyLinesToKeep + 1 : 1); in formatFirstToken()
1559 computeNewlines(Line, PreviousLine, PrevPrevLine, Lines, Style); in formatFirstToken()
1568 if (!Style.isJavaScript() && in formatFirstToken()
1569 Style.IndentPPDirectives != FormatStyle::PPDIS_BeforeHash && in formatFirstToken()
1595 return Style.ColumnLimit - (ContinuesPPDirective ? 2 : 0); in getColumnLimit()