Lines Matching defs:Style

46   LevelIndentTracker(const FormatStyle &Style,
49 : Style(Style), Keywords(Keywords), AdditionalIndent(AdditionalIndent) {
51 IndentForLevel.push_back(Style.IndentWidth * i + AdditionalIndent);
65 if (Style.IndentPPDirectives != FormatStyle::PPDIS_None &&
67 (Style.IndentPPDirectives == FormatStyle::PPDIS_BeforeHash &&
70 (Style.PPIndentWidth >= 0) ? Style.PPIndentWidth : Style.IndentWidth;
73 (Line.Level - Line.PPLevel) * Style.IndentWidth
89 Indent = Line.Level * Style.IndentWidth + Style.ContinuationIndentWidth;
115 if (Style.Language == FormatStyle::LK_Java || Style.isJavaScript() ||
116 Style.isCSharp()) {
145 return Style.IndentAccessModifiers ? -Style.IndentWidth
146 : Style.AccessModifierOffset;
163 return getIndent(Level - 1) + Style.IndentWidth;
166 const FormatStyle &Style;
213 LineJoiner(const FormatStyle &Style, const AdditionalKeywords &Keywords,
215 : Style(Style), Keywords(Keywords), End(Lines.end()), Next(Lines.begin()),
226 if (MergedLines > 0 && Style.ColumnLimit == 0) {
263 if (Style.ColumnLimit > 0 && Indent > Style.ColumnLimit)
267 Style.ColumnLimit == 0 ? UINT_MAX : Style.ColumnLimit - Indent;
276 !Style.BraceWrapping.SplitEmptyFunction &&
292 return !Style.BraceWrapping.SplitEmptyNamespace && EmptyBlock
301 return !Style.BraceWrapping.SplitEmptyRecord && EmptyBlock
307 Style.BraceWrapping.SplitEmptyRecord && EmptyBlock) {
314 if (Style.AllowShortFunctionsOnASingleLine == FormatStyle::SFS_All)
316 if (Style.AllowShortFunctionsOnASingleLine >= FormatStyle::SFS_Empty &&
321 if (Style.AllowShortFunctionsOnASingleLine &
325 if (Style.isJavaScript() && TheLine->Last->is(TT_FunctionLBrace))
367 if (Style.CompactNamespaces) {
427 return Style.AllowShortBlocksOnASingleLine != FormatStyle::SBS_Never
438 Style.BraceWrapping.AfterControlStatement ==
443 return (Style.ColumnLimit == 0 || TheLine->Level * Style.IndentWidth +
445 Style.ColumnLimit)
451 return (Style.BraceWrapping.AfterControlStatement ==
457 Style.BraceWrapping.AfterControlStatement ==
464 return (Style.ColumnLimit == 0 ||
465 TheLine->Last->TotalLength <= Style.ColumnLimit)
496 if (PreviousLine && Style.BraceWrapping.SplitEmptyRecord &&
518 return Style.AllowShortCaseExpressionOnASingleLine
527 ShouldMerge = Style.AllowShortEnumsOnASingleLine;
529 ShouldMerge = Style.AllowShortCompoundRequirementOnASingleLine;
534 ShouldMerge = !Style.BraceWrapping.AfterClass ||
536 !Style.BraceWrapping.SplitEmptyRecord);
542 ShouldMerge = !Style.BraceWrapping.AfterFunction ||
544 !Style.BraceWrapping.SplitEmptyFunction);
551 Style.BraceWrapping.AfterFunction) {
556 if (Limit <= 2 || (Style.ColumnLimit == 0 && containsMustBreak(TheLine)))
562 (Style.AllowShortFunctionsOnASingleLine >= FormatStyle::SFS_Empty &&
582 (IsElseLine() && (Style.AllowShortIfStatementsOnASingleLine ==
584 return Style.AllowShortIfStatementsOnASingleLine
590 return Style.AllowShortLoopsOnASingleLine
595 return Style.AllowShortCaseLabelsOnASingleLine
624 if (Style.BraceWrapping.AfterControlStatement ==
627 Style.AllowShortBlocksOnASingleLine == FormatStyle::SBS_Never) {
651 if (Style.AllowShortIfStatementsOnASingleLine ==
729 if (Style.Language != FormatStyle::LK_Java &&
753 Style.AllowShortBlocksOnASingleLine == FormatStyle::SBS_Never ||
754 (Style.AllowShortBlocksOnASingleLine == FormatStyle::SBS_Empty &&
765 if (!Style.AllowShortIfStatementsOnASingleLine &&
767 !Style.BraceWrapping.AfterControlStatement &&
771 if (!Style.AllowShortIfStatementsOnASingleLine &&
773 Style.BraceWrapping.AfterControlStatement ==
778 if (!Style.AllowShortLoopsOnASingleLine &&
781 !Style.BraceWrapping.AfterControlStatement &&
785 if (!Style.AllowShortLoopsOnASingleLine &&
788 Style.BraceWrapping.AfterControlStatement ==
805 if (Style.AllowShortBlocksOnASingleLine == FormatStyle::SBS_Never &&
826 (Style.SpaceInEmptyBlock || Line.Last->is(tok::comment)) ? 1 : 0;
869 Style.BraceWrapping.AfterControlStatement ==
881 if (Limit <= 2 || (Style.ColumnLimit == 0 && containsMustBreak(*I)))
885 if (Style.AllowShortBlocksOnASingleLine != FormatStyle::SBS_Never ||
944 const FormatStyle &Style;
996 const FormatStyle &Style,
998 : Indenter(Indenter), Whitespaces(Whitespaces), Style(Style),
1044 P.Indent - Previous.Children[0]->Level * Style.IndentWidth;
1069 if (Style.ColumnLimit > 0 &&
1070 Child->Last->TotalLength + State.Column + 2 > Style.ColumnLimit) {
1093 const FormatStyle &Style;
1102 const FormatStyle &Style,
1104 : LineFormatter(Indenter, Whitespaces, Style, BlockFormatter) {}
1129 WhitespaceManager *Whitespaces, const FormatStyle &Style,
1131 : LineFormatter(Indenter, Whitespaces, Style, BlockFormatter) {}
1153 const FormatStyle &Style,
1155 : LineFormatter(Indenter, Whitespaces, Style, BlockFormatter) {}
1336 LineJoiner Joiner(Style, Keywords, Lines);
1347 LevelIndentTracker IndentTracker(Style, Keywords, Lines[0]->Level,
1400 (!Style.isJavaScript() || !Style.JavaScriptWrapImports)) ||
1401 (Style.isCSharp() &&
1403 if (Style.ColumnLimit == 0) {
1404 NoColumnLimitLineFormatter(Indenter, Whitespaces, Style, this)
1408 Penalty += NoLineBreakFormatter(Indenter, Whitespaces, Style, this)
1412 Penalty += OptimizingLineFormatter(Indenter, Whitespaces, Style, this)
1464 const FormatStyle &Style) {
1467 std::min(RootToken.NewlinesBefore, Style.MaxEmptyLinesToKeep + 1);
1482 (!Style.KeepEmptyLines.AtStartOfFile || !RootToken.HasUnescapedNewline)) {
1487 if (!Style.KeepEmptyLines.AtStartOfBlock && PreviousLine &&
1498 switch (Style.EmptyLineBeforeAccessModifier) {
1532 switch (Style.EmptyLineAfterAccessModifier) {
1561 Style.KeepEmptyLines.AtEndOfFile ? Style.MaxEmptyLinesToKeep + 1 : 1);
1570 computeNewlines(Line, PreviousLine, PrevPrevLine, Lines, Style);
1579 if (!Style.isJavaScript() &&
1580 Style.IndentPPDirectives != FormatStyle::PPDIS_BeforeHash &&
1606 return Style.ColumnLimit - (ContinuesPPDirective ? 2 : 0);