Lines Matching refs:Style

40   LevelIndentTracker(const FormatStyle &Style,  in LevelIndentTracker()  argument
43 : Style(Style), Keywords(Keywords), AdditionalIndent(AdditionalIndent) { in LevelIndentTracker()
45 IndentForLevel.push_back(Style.IndentWidth * i + AdditionalIndent); in LevelIndentTracker()
60 Indent = Line.Level * Style.IndentWidth + AdditionalIndent; in nextLine()
68 Indent = Line.Level * Style.IndentWidth + Style.ContinuationIndentWidth; in nextLine()
98 if (Style.Language == FormatStyle::LK_Java || in getIndentOffset()
99 Style.Language == FormatStyle::LK_JavaScript || Style.isCSharp()) in getIndentOffset()
108 return Style.IndentAccessModifiers ? -Style.IndentWidth in getIndentOffset()
109 : Style.AccessModifierOffset; in getIndentOffset()
124 return getIndent(IndentForLevel, Level - 1) + Style.IndentWidth; in getIndent()
127 const FormatStyle &Style; member in clang::format::__anon5304a6e50111::LevelIndentTracker
171 LineJoiner(const FormatStyle &Style, const AdditionalKeywords &Keywords, in LineJoiner() argument
173 : Style(Style), Keywords(Keywords), End(Lines.end()), Next(Lines.begin()), in LineJoiner()
184 if (MergedLines > 0 && Style.ColumnLimit == 0) in getNextMergedLine()
218 if (Style.ColumnLimit > 0 && Indent > Style.ColumnLimit) in tryFitMultipleLinesInOne()
222 Style.ColumnLimit == 0 ? UINT_MAX : Style.ColumnLimit - Indent; in tryFitMultipleLinesInOne()
231 !Style.BraceWrapping.SplitEmptyFunction && in tryFitMultipleLinesInOne()
245 return !Style.BraceWrapping.SplitEmptyNamespace && EmptyBlock in tryFitMultipleLinesInOne()
253 return !Style.BraceWrapping.SplitEmptyRecord && EmptyBlock in tryFitMultipleLinesInOne()
258 Style.BraceWrapping.SplitEmptyRecord && EmptyBlock) { in tryFitMultipleLinesInOne()
266 Style.AllowShortFunctionsOnASingleLine == FormatStyle::SFS_All || in tryFitMultipleLinesInOne()
267 (Style.AllowShortFunctionsOnASingleLine >= FormatStyle::SFS_Empty && in tryFitMultipleLinesInOne()
269 (Style.AllowShortFunctionsOnASingleLine & FormatStyle::SFS_InlineOnly && in tryFitMultipleLinesInOne()
272 if (Style.CompactNamespaces) { in tryFitMultipleLinesInOne()
315 return Style.AllowShortBlocksOnASingleLine != FormatStyle::SBS_Never in tryFitMultipleLinesInOne()
326 Style.BraceWrapping.AfterControlStatement == in tryFitMultipleLinesInOne()
331 return (Style.ColumnLimit == 0 || in tryFitMultipleLinesInOne()
332 TheLine->Last->TotalLength <= Style.ColumnLimit) in tryFitMultipleLinesInOne()
338 return (Style.BraceWrapping.AfterControlStatement == in tryFitMultipleLinesInOne()
344 Style.BraceWrapping.AfterControlStatement == in tryFitMultipleLinesInOne()
351 return (Style.ColumnLimit == 0 || in tryFitMultipleLinesInOne()
352 TheLine->Last->TotalLength <= Style.ColumnLimit) in tryFitMultipleLinesInOne()
371 if (Style.BraceWrapping.SplitEmptyRecord && in tryFitMultipleLinesInOne()
394 return !Style.BraceWrapping.AfterFunction || in tryFitMultipleLinesInOne()
396 !Style.BraceWrapping.SplitEmptyRecord) in tryFitMultipleLinesInOne()
402 Style.BraceWrapping.AfterFunction) { in tryFitMultipleLinesInOne()
407 if (Limit <= 2 || (Style.ColumnLimit == 0 && containsMustBreak(TheLine))) in tryFitMultipleLinesInOne()
413 (Style.AllowShortFunctionsOnASingleLine >= FormatStyle::SFS_Empty && in tryFitMultipleLinesInOne()
433 (IsElseLine() && (Style.AllowShortIfStatementsOnASingleLine == in tryFitMultipleLinesInOne()
435 return Style.AllowShortIfStatementsOnASingleLine in tryFitMultipleLinesInOne()
440 return Style.AllowShortLoopsOnASingleLine in tryFitMultipleLinesInOne()
445 return Style.AllowShortCaseLabelsOnASingleLine in tryFitMultipleLinesInOne()
474 if (Style.BraceWrapping.AfterControlStatement == in tryMergeSimpleControlStatement()
477 Style.AllowShortBlocksOnASingleLine == FormatStyle::SBS_Never) in tryMergeSimpleControlStatement()
496 if (Style.AllowShortIfStatementsOnASingleLine == in tryMergeSimpleControlStatement()
564 if (Style.Language != FormatStyle::LK_Java && in tryMergeSimpleBlock()
582 if (Style.AllowShortBlocksOnASingleLine == FormatStyle::SBS_Never) in tryMergeSimpleBlock()
586 if (!Style.AllowShortIfStatementsOnASingleLine && in tryMergeSimpleBlock()
588 !Style.BraceWrapping.AfterControlStatement && in tryMergeSimpleBlock()
591 if (!Style.AllowShortIfStatementsOnASingleLine && in tryMergeSimpleBlock()
593 Style.BraceWrapping.AfterControlStatement == in tryMergeSimpleBlock()
597 if (!Style.AllowShortLoopsOnASingleLine && in tryMergeSimpleBlock()
599 !Style.BraceWrapping.AfterControlStatement && in tryMergeSimpleBlock()
602 if (!Style.AllowShortLoopsOnASingleLine && in tryMergeSimpleBlock()
604 Style.BraceWrapping.AfterControlStatement == in tryMergeSimpleBlock()
624 Tok->SpacesRequiredBefore = Style.SpaceInEmptyBlock ? 1 : 0; in tryMergeSimpleBlock()
677 Style.BraceWrapping.AfterControlStatement == in tryMergeSimpleBlock()
688 if (Limit <= 2 || (Style.ColumnLimit == 0 && containsMustBreak(*I))) in tryMergeSimpleBlock()
692 if (Style.AllowShortBlocksOnASingleLine != FormatStyle::SBS_Never || in tryMergeSimpleBlock()
749 const FormatStyle &Style; member in clang::format::__anon5304a6e50111::LineJoiner
780 const FormatStyle &Style, in LineFormatter() argument
782 : Indenter(Indenter), Whitespaces(Whitespaces), Style(Style), in LineFormatter()
825 Previous.Children[0]->Level * Style.IndentWidth; in formatChildren()
851 if (Style.ColumnLimit > 0 && in formatChildren()
852 Child->Last->TotalLength + State.Column + 2 > Style.ColumnLimit) in formatChildren()
872 const FormatStyle &Style; member in clang::format::__anon5304a6e50111::LineFormatter
881 const FormatStyle &Style, in NoColumnLimitLineFormatter() argument
883 : LineFormatter(Indenter, Whitespaces, Style, BlockFormatter) {} in NoColumnLimitLineFormatter()
908 WhitespaceManager *Whitespaces, const FormatStyle &Style, in NoLineBreakFormatter() argument
910 : LineFormatter(Indenter, Whitespaces, Style, BlockFormatter) {} in NoLineBreakFormatter()
932 const FormatStyle &Style, in OptimizingLineFormatter() argument
934 : LineFormatter(Indenter, Whitespaces, Style, BlockFormatter) {} in OptimizingLineFormatter()
1110 LineJoiner Joiner(Style, Keywords, Lines); in format()
1121 LevelIndentTracker IndentTracker(Style, Keywords, Lines[0]->Level, in format()
1170 (Style.Language != FormatStyle::LK_JavaScript || in format()
1171 !Style.JavaScriptWrapImports)) || in format()
1172 (Style.isCSharp() && in format()
1174 if (Style.ColumnLimit == 0) in format()
1175 NoColumnLimitLineFormatter(Indenter, Whitespaces, Style, this) in format()
1179 Penalty += NoLineBreakFormatter(Indenter, Whitespaces, Style, this) in format()
1183 Penalty += OptimizingLineFormatter(Indenter, Whitespaces, Style, this) in format()
1242 std::min(RootToken.NewlinesBefore, Style.MaxEmptyLinesToKeep + 1); in formatFirstToken()
1259 if (!Style.KeepEmptyLinesAtTheStartOfBlocks && PreviousLine && in formatFirstToken()
1267 switch (Style.EmptyLineBeforeAccessModifier) { in formatFirstToken()
1299 switch (Style.EmptyLineAfterAccessModifier) { in formatFirstToken()
1320 if (Style.IndentPPDirectives != FormatStyle::PPDIS_BeforeHash && in formatFirstToken()
1345 return Style.ColumnLimit - (ContinuesPPDirective ? 2 : 0); in getColumnLimit()