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()
65 (Style.PPIndentWidth >= 0) ? Style.PPIndentWidth : Style.IndentWidth; in nextLine()
73 Indent = Line.Level * Style.IndentWidth + Style.ContinuationIndentWidth; in nextLine()
105 if (Style.Language == FormatStyle::LK_Java || Style.isJavaScript() || in getIndentOffset()
106 Style.isCSharp()) { in getIndentOffset()
111 if (RootToken.isAccessSpecifier(Style.isCpp())) { in getIndentOffset()
137 return Style.IndentAccessModifiers ? -Style.IndentWidth in getIndentOffset()
138 : Style.AccessModifierOffset; in getIndentOffset()
153 return getIndent(Level - 1) + Style.IndentWidth; in getIndent()
156 const FormatStyle &Style; member in clang::format::__anon8a591c740111::LevelIndentTracker
200 LineJoiner(const FormatStyle &Style, const AdditionalKeywords &Keywords, in LineJoiner() argument
202 : Style(Style), Keywords(Keywords), End(Lines.end()), Next(Lines.begin()), in LineJoiner()
213 if (MergedLines > 0 && Style.ColumnLimit == 0) { in getNextMergedLine()
250 if (Style.ColumnLimit > 0 && Indent > Style.ColumnLimit) in tryFitMultipleLinesInOne()
254 Style.ColumnLimit == 0 ? UINT_MAX : Style.ColumnLimit - Indent; in tryFitMultipleLinesInOne()
263 !Style.BraceWrapping.SplitEmptyFunction && in tryFitMultipleLinesInOne()
279 return !Style.BraceWrapping.SplitEmptyNamespace && EmptyBlock in tryFitMultipleLinesInOne()
288 return !Style.BraceWrapping.SplitEmptyRecord && EmptyBlock in tryFitMultipleLinesInOne()
294 Style.BraceWrapping.SplitEmptyRecord && EmptyBlock) { in tryFitMultipleLinesInOne()
301 if (Style.AllowShortFunctionsOnASingleLine == FormatStyle::SFS_All) in tryFitMultipleLinesInOne()
303 if (Style.AllowShortFunctionsOnASingleLine >= FormatStyle::SFS_Empty && in tryFitMultipleLinesInOne()
308 if (Style.AllowShortFunctionsOnASingleLine & in tryFitMultipleLinesInOne()
312 if (Style.isJavaScript() && TheLine->Last->is(TT_FunctionLBrace)) in tryFitMultipleLinesInOne()
361 if (Style.CompactNamespaces) { in tryFitMultipleLinesInOne()
403 return Style.AllowShortBlocksOnASingleLine != FormatStyle::SBS_Never in tryFitMultipleLinesInOne()
414 Style.BraceWrapping.AfterControlStatement == in tryFitMultipleLinesInOne()
419 return (Style.ColumnLimit == 0 || TheLine->Level * Style.IndentWidth + in tryFitMultipleLinesInOne()
421 Style.ColumnLimit) in tryFitMultipleLinesInOne()
427 return (Style.BraceWrapping.AfterControlStatement == in tryFitMultipleLinesInOne()
433 Style.BraceWrapping.AfterControlStatement == in tryFitMultipleLinesInOne()
440 return (Style.ColumnLimit == 0 || in tryFitMultipleLinesInOne()
441 TheLine->Last->TotalLength <= Style.ColumnLimit) in tryFitMultipleLinesInOne()
472 if (PreviousLine && Style.BraceWrapping.SplitEmptyRecord && in tryFitMultipleLinesInOne()
497 ShouldMerge = Style.AllowShortEnumsOnASingleLine; in tryFitMultipleLinesInOne()
502 ShouldMerge = !Style.BraceWrapping.AfterClass || in tryFitMultipleLinesInOne()
504 !Style.BraceWrapping.SplitEmptyRecord); in tryFitMultipleLinesInOne()
511 ShouldMerge = !Style.BraceWrapping.AfterFunction || in tryFitMultipleLinesInOne()
513 !Style.BraceWrapping.SplitEmptyFunction); in tryFitMultipleLinesInOne()
520 Style.BraceWrapping.AfterFunction) { in tryFitMultipleLinesInOne()
525 if (Limit <= 2 || (Style.ColumnLimit == 0 && containsMustBreak(TheLine))) in tryFitMultipleLinesInOne()
531 (Style.AllowShortFunctionsOnASingleLine >= FormatStyle::SFS_Empty && in tryFitMultipleLinesInOne()
551 (IsElseLine() && (Style.AllowShortIfStatementsOnASingleLine == in tryFitMultipleLinesInOne()
553 return Style.AllowShortIfStatementsOnASingleLine in tryFitMultipleLinesInOne()
559 return Style.AllowShortLoopsOnASingleLine in tryFitMultipleLinesInOne()
564 return Style.AllowShortCaseLabelsOnASingleLine in tryFitMultipleLinesInOne()
593 if (Style.BraceWrapping.AfterControlStatement == in tryMergeSimpleControlStatement()
596 Style.AllowShortBlocksOnASingleLine == FormatStyle::SBS_Never) { in tryMergeSimpleControlStatement()
620 if (Style.AllowShortIfStatementsOnASingleLine == in tryMergeSimpleControlStatement()
695 if (Style.Language != FormatStyle::LK_Java && in tryMergeSimpleBlock()
716 if (Style.AllowShortBlocksOnASingleLine == FormatStyle::SBS_Never) in tryMergeSimpleBlock()
718 if (Style.AllowShortBlocksOnASingleLine == FormatStyle::SBS_Empty && in tryMergeSimpleBlock()
724 if (!Style.AllowShortIfStatementsOnASingleLine && in tryMergeSimpleBlock()
726 !Style.BraceWrapping.AfterControlStatement && in tryMergeSimpleBlock()
730 if (!Style.AllowShortIfStatementsOnASingleLine && in tryMergeSimpleBlock()
732 Style.BraceWrapping.AfterControlStatement == in tryMergeSimpleBlock()
737 if (!Style.AllowShortLoopsOnASingleLine && in tryMergeSimpleBlock()
740 !Style.BraceWrapping.AfterControlStatement && in tryMergeSimpleBlock()
744 if (!Style.AllowShortLoopsOnASingleLine && in tryMergeSimpleBlock()
747 Style.BraceWrapping.AfterControlStatement == in tryMergeSimpleBlock()
774 Tok->SpacesRequiredBefore = Style.SpaceInEmptyBlock ? 1 : 0; in tryMergeSimpleBlock()
817 Style.BraceWrapping.AfterControlStatement == in tryMergeSimpleBlock()
829 if (Limit <= 2 || (Style.ColumnLimit == 0 && containsMustBreak(*I))) in tryMergeSimpleBlock()
833 if (Style.AllowShortBlocksOnASingleLine != FormatStyle::SBS_Never || in tryMergeSimpleBlock()
889 const FormatStyle &Style; member in clang::format::__anon8a591c740111::LineJoiner
920 const FormatStyle &Style, in LineFormatter() argument
922 : Indenter(Indenter), Whitespaces(Whitespaces), Style(Style), in LineFormatter()
968 P.Indent - Previous.Children[0]->Level * Style.IndentWidth; in formatChildren()
970 if (Style.LambdaBodyIndentation == FormatStyle::LBI_OuterScope && in formatChildren()
1004 if (Style.ColumnLimit > 0 && in formatChildren()
1005 Child->Last->TotalLength + State.Column + 2 > Style.ColumnLimit) { in formatChildren()
1026 const FormatStyle &Style; member in clang::format::__anon8a591c740111::LineFormatter
1035 const FormatStyle &Style, in NoColumnLimitLineFormatter() argument
1037 : LineFormatter(Indenter, Whitespaces, Style, BlockFormatter) {} in NoColumnLimitLineFormatter()
1062 WhitespaceManager *Whitespaces, const FormatStyle &Style, in NoLineBreakFormatter() argument
1064 : LineFormatter(Indenter, Whitespaces, Style, BlockFormatter) {} in NoLineBreakFormatter()
1086 const FormatStyle &Style, in OptimizingLineFormatter() argument
1088 : LineFormatter(Indenter, Whitespaces, Style, BlockFormatter) {} in OptimizingLineFormatter()
1269 LineJoiner Joiner(Style, Keywords, Lines); in format()
1280 LevelIndentTracker IndentTracker(Style, Keywords, Lines[0]->Level, in format()
1332 (!Style.isJavaScript() || !Style.JavaScriptWrapImports)) || in format()
1333 (Style.isCSharp() && in format()
1335 if (Style.ColumnLimit == 0) { in format()
1336 NoColumnLimitLineFormatter(Indenter, Whitespaces, Style, this) in format()
1340 Penalty += NoLineBreakFormatter(Indenter, Whitespaces, Style, this) in format()
1344 Penalty += OptimizingLineFormatter(Indenter, Whitespaces, Style, this) in format()
1406 std::min(RootToken.NewlinesBefore, Style.MaxEmptyLinesToKeep + 1); in formatFirstToken()
1424 if (!Style.KeepEmptyLinesAtTheStartOfBlocks && PreviousLine && in formatFirstToken()
1435 switch (Style.EmptyLineBeforeAccessModifier) { in formatFirstToken()
1467 switch (Style.EmptyLineAfterAccessModifier) { in formatFirstToken()
1489 if (!Style.isJavaScript() && in formatFirstToken()
1490 Style.IndentPPDirectives != FormatStyle::PPDIS_BeforeHash && in formatFirstToken()
1516 return Style.ColumnLimit - (ContinuesPPDirective ? 2 : 0); in getColumnLimit()