Lines Matching refs:Style
45 LevelIndentTracker(const FormatStyle &Style, in LevelIndentTracker() argument
48 : Style(Style), Keywords(Keywords), AdditionalIndent(AdditionalIndent) { in LevelIndentTracker()
50 IndentForLevel.push_back(Style.IndentWidth * i + AdditionalIndent); in LevelIndentTracker()
63 if (Style.IndentPPDirectives != FormatStyle::PPDIS_None && in nextLine()
65 (Style.IndentPPDirectives == FormatStyle::PPDIS_BeforeHash && in nextLine()
68 (Style.PPIndentWidth >= 0) ? Style.PPIndentWidth : Style.IndentWidth; in nextLine()
71 (Line.Level - Line.PPLevel) * Style.IndentWidth in nextLine()
80 Indent = Line.Level * Style.IndentWidth + Style.ContinuationIndentWidth; in nextLine()
112 if (Style.Language == FormatStyle::LK_Java || Style.isJavaScript() || in getIndentOffset()
113 Style.isCSharp()) { in getIndentOffset()
118 if (RootToken.isAccessSpecifier(Style.isCpp())) { in getIndentOffset()
144 return Style.IndentAccessModifiers ? -Style.IndentWidth in getIndentOffset()
145 : Style.AccessModifierOffset; in getIndentOffset()
160 return getIndent(Level - 1) + Style.IndentWidth; in getIndent()
163 const FormatStyle &Style; member in clang::format::__anon5560ac9b0111::LevelIndentTracker
207 LineJoiner(const FormatStyle &Style, const AdditionalKeywords &Keywords, in LineJoiner() argument
209 : Style(Style), Keywords(Keywords), End(Lines.end()), Next(Lines.begin()), in LineJoiner()
220 if (MergedLines > 0 && Style.ColumnLimit == 0) { in getNextMergedLine()
257 if (Style.ColumnLimit > 0 && Indent > Style.ColumnLimit) in tryFitMultipleLinesInOne()
261 Style.ColumnLimit == 0 ? UINT_MAX : Style.ColumnLimit - Indent; in tryFitMultipleLinesInOne()
270 !Style.BraceWrapping.SplitEmptyFunction && in tryFitMultipleLinesInOne()
286 return !Style.BraceWrapping.SplitEmptyNamespace && EmptyBlock in tryFitMultipleLinesInOne()
295 return !Style.BraceWrapping.SplitEmptyRecord && EmptyBlock in tryFitMultipleLinesInOne()
301 Style.BraceWrapping.SplitEmptyRecord && EmptyBlock) { in tryFitMultipleLinesInOne()
308 if (Style.AllowShortFunctionsOnASingleLine == FormatStyle::SFS_All) in tryFitMultipleLinesInOne()
310 if (Style.AllowShortFunctionsOnASingleLine >= FormatStyle::SFS_Empty && in tryFitMultipleLinesInOne()
315 if (Style.AllowShortFunctionsOnASingleLine & in tryFitMultipleLinesInOne()
319 if (Style.isJavaScript() && TheLine->Last->is(TT_FunctionLBrace)) in tryFitMultipleLinesInOne()
368 if (Style.CompactNamespaces) { in tryFitMultipleLinesInOne()
410 return Style.AllowShortBlocksOnASingleLine != FormatStyle::SBS_Never in tryFitMultipleLinesInOne()
421 Style.BraceWrapping.AfterControlStatement == in tryFitMultipleLinesInOne()
426 return (Style.ColumnLimit == 0 || TheLine->Level * Style.IndentWidth + in tryFitMultipleLinesInOne()
428 Style.ColumnLimit) in tryFitMultipleLinesInOne()
434 return (Style.BraceWrapping.AfterControlStatement == in tryFitMultipleLinesInOne()
440 Style.BraceWrapping.AfterControlStatement == in tryFitMultipleLinesInOne()
447 return (Style.ColumnLimit == 0 || in tryFitMultipleLinesInOne()
448 TheLine->Last->TotalLength <= Style.ColumnLimit) in tryFitMultipleLinesInOne()
479 if (PreviousLine && Style.BraceWrapping.SplitEmptyRecord && in tryFitMultipleLinesInOne()
504 ShouldMerge = Style.AllowShortEnumsOnASingleLine; in tryFitMultipleLinesInOne()
509 ShouldMerge = !Style.BraceWrapping.AfterClass || in tryFitMultipleLinesInOne()
511 !Style.BraceWrapping.SplitEmptyRecord); in tryFitMultipleLinesInOne()
518 ShouldMerge = !Style.BraceWrapping.AfterFunction || in tryFitMultipleLinesInOne()
520 !Style.BraceWrapping.SplitEmptyFunction); in tryFitMultipleLinesInOne()
527 Style.BraceWrapping.AfterFunction) { in tryFitMultipleLinesInOne()
532 if (Limit <= 2 || (Style.ColumnLimit == 0 && containsMustBreak(TheLine))) in tryFitMultipleLinesInOne()
538 (Style.AllowShortFunctionsOnASingleLine >= FormatStyle::SFS_Empty && in tryFitMultipleLinesInOne()
558 (IsElseLine() && (Style.AllowShortIfStatementsOnASingleLine == in tryFitMultipleLinesInOne()
560 return Style.AllowShortIfStatementsOnASingleLine in tryFitMultipleLinesInOne()
566 return Style.AllowShortLoopsOnASingleLine in tryFitMultipleLinesInOne()
571 return Style.AllowShortCaseLabelsOnASingleLine in tryFitMultipleLinesInOne()
600 if (Style.BraceWrapping.AfterControlStatement == in tryMergeSimpleControlStatement()
603 Style.AllowShortBlocksOnASingleLine == FormatStyle::SBS_Never) { in tryMergeSimpleControlStatement()
627 if (Style.AllowShortIfStatementsOnASingleLine == in tryMergeSimpleControlStatement()
705 if (Style.Language != FormatStyle::LK_Java && in tryMergeSimpleBlock()
729 Style.AllowShortBlocksOnASingleLine == FormatStyle::SBS_Never || in tryMergeSimpleBlock()
730 (Style.AllowShortBlocksOnASingleLine == FormatStyle::SBS_Empty && in tryMergeSimpleBlock()
741 if (!Style.AllowShortIfStatementsOnASingleLine && in tryMergeSimpleBlock()
743 !Style.BraceWrapping.AfterControlStatement && in tryMergeSimpleBlock()
747 if (!Style.AllowShortIfStatementsOnASingleLine && in tryMergeSimpleBlock()
749 Style.BraceWrapping.AfterControlStatement == in tryMergeSimpleBlock()
754 if (!Style.AllowShortLoopsOnASingleLine && in tryMergeSimpleBlock()
757 !Style.BraceWrapping.AfterControlStatement && in tryMergeSimpleBlock()
761 if (!Style.AllowShortLoopsOnASingleLine && in tryMergeSimpleBlock()
764 Style.BraceWrapping.AfterControlStatement == in tryMergeSimpleBlock()
796 Tok->SpacesRequiredBefore = Style.SpaceInEmptyBlock ? 1 : 0; in tryMergeSimpleBlock()
839 Style.BraceWrapping.AfterControlStatement == in tryMergeSimpleBlock()
851 if (Limit <= 2 || (Style.ColumnLimit == 0 && containsMustBreak(*I))) in tryMergeSimpleBlock()
855 if (Style.AllowShortBlocksOnASingleLine != FormatStyle::SBS_Never || in tryMergeSimpleBlock()
911 const FormatStyle &Style; member in clang::format::__anon5560ac9b0111::LineJoiner
942 const FormatStyle &Style, in LineFormatter() argument
944 : Indenter(Indenter), Whitespaces(Whitespaces), Style(Style), in LineFormatter()
990 P.Indent - Previous.Children[0]->Level * Style.IndentWidth; in formatChildren()
992 if (Style.LambdaBodyIndentation == FormatStyle::LBI_OuterScope && in formatChildren()
1026 if (Style.ColumnLimit > 0 && in formatChildren()
1027 Child->Last->TotalLength + State.Column + 2 > Style.ColumnLimit) { in formatChildren()
1048 const FormatStyle &Style; member in clang::format::__anon5560ac9b0111::LineFormatter
1057 const FormatStyle &Style, in NoColumnLimitLineFormatter() argument
1059 : LineFormatter(Indenter, Whitespaces, Style, BlockFormatter) {} in NoColumnLimitLineFormatter()
1084 WhitespaceManager *Whitespaces, const FormatStyle &Style, in NoLineBreakFormatter() argument
1086 : LineFormatter(Indenter, Whitespaces, Style, BlockFormatter) {} in NoLineBreakFormatter()
1108 const FormatStyle &Style, in OptimizingLineFormatter() argument
1110 : LineFormatter(Indenter, Whitespaces, Style, BlockFormatter) {} in OptimizingLineFormatter()
1291 LineJoiner Joiner(Style, Keywords, Lines); in format()
1302 LevelIndentTracker IndentTracker(Style, Keywords, Lines[0]->Level, in format()
1354 (!Style.isJavaScript() || !Style.JavaScriptWrapImports)) || in format()
1355 (Style.isCSharp() && in format()
1357 if (Style.ColumnLimit == 0) { in format()
1358 NoColumnLimitLineFormatter(Indenter, Whitespaces, Style, this) in format()
1362 Penalty += NoLineBreakFormatter(Indenter, Whitespaces, Style, this) in format()
1366 Penalty += OptimizingLineFormatter(Indenter, Whitespaces, Style, this) in format()
1428 std::min(RootToken.NewlinesBefore, Style.MaxEmptyLinesToKeep + 1); in formatFirstToken()
1446 if (!Style.KeepEmptyLinesAtTheStartOfBlocks && PreviousLine && in formatFirstToken()
1457 switch (Style.EmptyLineBeforeAccessModifier) { in formatFirstToken()
1489 switch (Style.EmptyLineAfterAccessModifier) { in formatFirstToken()
1511 if (!Style.isJavaScript() && in formatFirstToken()
1512 Style.IndentPPDirectives != FormatStyle::PPDIS_BeforeHash && in formatFirstToken()
1538 return Style.ColumnLimit - (ContinuesPPDirective ? 2 : 0); in getColumnLimit()