Lines Matching refs:Style
130 const FormatStyle &Style, unsigned &LineLevel) in CompoundStatementIndenter() argument
132 Style.BraceWrapping.AfterControlStatement, in CompoundStatementIndenter()
133 Style.BraceWrapping.IndentBraces) {} in CompoundStatementIndenter()
150 SourceManager &SourceMgr, const FormatStyle &Style, in UnwrappedLineParser() argument
156 CurrentLines(&Lines), Style(Style), Keywords(Keywords), in UnwrappedLineParser()
157 CommentPragmasRegex(Style.CommentPragmas), Tokens(nullptr), in UnwrappedLineParser()
159 IncludeGuard(Style.IndentPPDirectives == FormatStyle::PPDIS_None in UnwrappedLineParser()
163 Macros(Style.Macros, SourceMgr, Style, Allocator, IdentTable) {} in UnwrappedLineParser()
167 IncludeGuard = Style.IndentPPDirectives == FormatStyle::PPDIS_None in reset()
263 bool MustBeDeclaration = !Line->InPPDirective && !Style.isJavaScript(); in parseFile()
266 if (Style.Language == FormatStyle::LK_TextProto) in parseFile()
280 if (Style.Language == FormatStyle::LK_TextProto && in parseFile()
350 !Style.RemoveBracesLLVM || precededByCommentOrPPDirective(); in parseLevel()
403 if (!Style.RemoveBracesLLVM || Line->InPPDirective || in parseLevel()
440 if (Style.Language == FormatStyle::LK_Proto || Style.isVerilog() || in parseLevel()
441 (Style.isJavaScript() && Line->MustBeDeclaration)) { in parseLevel()
450 (Style.IndentCaseLabels || in parseLevel()
458 if (Style.isCSharp()) { in parseLevel()
513 if (Style.isJavaScript() && PrevTok) { in calculateBraceTypes()
539 if (Style.Language == FormatStyle::LK_Proto) { in calculateBraceTypes()
558 (Style.isJavaScript() && in calculateBraceTypes()
562 (Style.isCpp() && NextTok->is(tok::l_paren)); in calculateBraceTypes()
594 if (!Style.isCSharp() && NextTok->is(tok::l_square)) { in calculateBraceTypes()
602 if (Style.isCpp() && Line->InMacroBody && PrevTok != FormatTok && in calculateBraceTypes()
681 const auto ColumnLimit = Style.ColumnLimit; in mightFitOnOneLine()
705 TokenAnnotator Annotator(Style, Keywords); in mightFitOnOneLine()
735 return Line.Level * Style.IndentWidth + Length <= ColumnLimit; in mightFitOnOneLine()
745 if (Style.isVerilog() && FormatTok->is(tok::colon)) { in parseBlock()
755 Style.isVerilog() && Keywords.isVerilogHierarchy(*FormatTok); in parseBlock()
757 (Style.isVerilog() && in parseBlock()
769 Style.BreakBeforeBraces == FormatStyle::BS_Whitesmiths) { in parseBlock()
806 if (AddLevels > 0u && Style.BreakBeforeBraces != FormatStyle::BS_Whitesmiths) in parseBlock()
871 if (Style.RemoveSemicolon && IsFunctionRBrace) { in parseBlock()
948 static bool ShouldBreakBeforeBrace(const FormatStyle &Style, in ShouldBreakBeforeBrace() argument
956 return Style.BraceWrapping.AfterNamespace; in ShouldBreakBeforeBrace()
958 return Style.BraceWrapping.AfterClass; in ShouldBreakBeforeBrace()
960 return Style.BraceWrapping.AfterUnion; in ShouldBreakBeforeBrace()
962 return Style.BraceWrapping.AfterStruct; in ShouldBreakBeforeBrace()
964 return Style.BraceWrapping.AfterEnum; in ShouldBreakBeforeBrace()
976 bool SkipIndent = (Style.isJavaScript() && in parseChildBlock()
1131 Style.IndentPPDirectives != FormatStyle::PPDIS_None) { in parsePPEndIf()
1170 if (Style.IndentPPDirectives != FormatStyle::PPDIS_None) in parsePPDefine()
1179 if (Style.SkipMacroDefinitionBody) { in parsePPDefine()
1211 if (Style.IndentPPDirectives != FormatStyle::PPDIS_None) in parsePPUnknown()
1419 if (Style.Language == FormatStyle::LK_TableGen && in parseStructuralElement()
1428 if (Style.isCpp()) { in parseStructuralElement()
1431 } else if (Style.isVerilog()) { in parseStructuralElement()
1485 if (Style.Language == FormatStyle::LK_Java || Style.isJavaScript() || in parseStructuralElement()
1486 Style.isCSharp()) { in parseStructuralElement()
1493 if (Style.isJavaScript() && Line->MustBeDeclaration) { in parseStructuralElement()
1504 if (Style.isJavaScript() && Line->MustBeDeclaration) { in parseStructuralElement()
1511 if (Style.isJavaScript() && Line->MustBeDeclaration) { in parseStructuralElement()
1520 if (Style.isJavaScript() && Line->MustBeDeclaration) { in parseStructuralElement()
1528 if (Style.isVerilog()) in parseStructuralElement()
1530 if (Style.isJavaScript() && Line->MustBeDeclaration) { in parseStructuralElement()
1544 if (Style.Language == FormatStyle::LK_Proto) { in parseStructuralElement()
1548 if (Style.isVerilog()) { in parseStructuralElement()
1553 if (Style.isJavaScript() && Line->MustBeDeclaration) { in parseStructuralElement()
1562 if (Style.isJavaScript() && Line->MustBeDeclaration) { in parseStructuralElement()
1570 if (Style.isVerilog()) { in parseStructuralElement()
1580 if (Style.BraceWrapping.AfterExternBlock) in parseStructuralElement()
1585 (Style.IndentExternBlock == FormatStyle::IEBS_Indent) || in parseStructuralElement()
1586 (Style.BraceWrapping.AfterExternBlock && in parseStructuralElement()
1587 Style.IndentExternBlock == in parseStructuralElement()
1598 if (Style.isJavaScript()) { in parseStructuralElement()
1602 if (Style.isCpp()) { in parseStructuralElement()
1630 if (Style.isJavaScript()) { in parseStructuralElement()
1634 if (Style.Language == FormatStyle::LK_Proto) { in parseStructuralElement()
1646 if (Style.isCpp() && parseModuleImport()) in parseStructuralElement()
1649 if (Style.isCpp() && in parseStructuralElement()
1659 if (Style.isCpp() && FormatTok->is(TT_StatementMacro)) { in parseStructuralElement()
1663 if (Style.isCpp() && FormatTok->is(TT_NamespaceMacro)) { in parseStructuralElement()
1671 if (!Style.isJavaScript() && !Style.isVerilog() && !Style.isTableGen() && in parseStructuralElement()
1676 parseLabel(!Style.IndentGotoLabels); in parseStructuralElement()
1698 } else if (Style.Language == FormatStyle::LK_Java && in parseStructuralElement()
1726 if (Style.BraceWrapping.AfterControlStatement == in parseStructuralElement()
1741 if (Style.BraceWrapping.AfterControlStatement == in parseStructuralElement()
1759 if (Style.isCpp()) { in parseStructuralElement()
1780 if (!Style.isCpp() && !Style.isVerilog()) { in parseStructuralElement()
1795 if (Style.isVerilog()) { in parseStructuralElement()
1800 if (Style.isTableGen()) { in parseStructuralElement()
1826 if (Style.Language == FormatStyle::LK_Java && FormatTok && in parseStructuralElement()
1830 if (Style.isJavaScript() && FormatTok && in parseStructuralElement()
1848 if (OpeningBrace || !Style.isCpp() || !Previous || eof()) in parseStructuralElement()
1889 if (Style.Language == FormatStyle::LK_Java && in parseStructuralElement()
1893 if (Style.BraceWrapping.AfterControlStatement == in parseStructuralElement()
1897 } else if (Style.BraceWrapping.AfterFunction) { in parseStructuralElement()
1910 if (Style.isJavaScript() && Line->MustBeDeclaration) { in parseStructuralElement()
1916 if (Style.BraceWrapping.AfterFunction) in parseStructuralElement()
1921 if (Style.isCSharp() && FormatTok->is(Keywords.kw_where) && in parseStructuralElement()
1937 if (Style.isJavaScript() && FormatTok->is(Keywords.kw_function) && in parseStructuralElement()
1944 if ((Style.isJavaScript() || Style.Language == FormatStyle::LK_Java) && in parseStructuralElement()
1946 if (Style.isJavaScript()) { in parseStructuralElement()
1964 if (Style.isVerilog()) { in parseStructuralElement()
1977 if (!Style.isCpp() && FormatTok->is(Keywords.kw_interface)) { in parseStructuralElement()
1983 if (Style.isCpp() && FormatTok->is(TT_StatementMacro)) { in parseStructuralElement()
1996 if (Style.isJavaScript()) in parseStructuralElement()
2003 if (Style.isVerilog()) in parseStructuralElement()
2031 if ((Style.isJavaScript() || Style.isCSharp()) && in parseStructuralElement()
2042 if (Style.isCSharp()) in parseStructuralElement()
2046 if (Style.isTableGen() && in parseStructuralElement()
2056 } else if (Style.Language == FormatStyle::LK_Proto && in parseStructuralElement()
2070 if (Style.Language == FormatStyle::LK_Proto) { in parseStructuralElement()
2075 if (Style.isVerilog()) { in parseStructuralElement()
2080 if (Style.isJavaScript() && Line->MustBeDeclaration) { in parseStructuralElement()
2089 if (Style.isVerilog()) { in parseStructuralElement()
2106 if (Style.isVerilog()) { in parseStructuralElement()
2120 if (!Style.isCSharp()) in tryToParsePropertyAccessor()
2161 if (!IsTrivialPropertyAccessor && Style.BraceWrapping.AfterFunction) in tryToParsePropertyAccessor()
2211 if (!Style.isCpp()) { in tryToParseLambda()
2340 LeftSquare->isCppStructuredBinding(Style)) { in tryToParseLambdaIntroducer()
2408 assert(Style.isJavaScript() || Style.isCSharp()); in tryToParseChildBlock()
2426 if (Style.isCSharp() && FormatTok->is(TT_FatArrow) && in parseBracedList()
2430 if (Style.isJavaScript()) { in parseBracedList()
2443 if (IsEnum && !Style.AllowShortEnumsOnASingleLine) in parseBracedList()
2450 if (Style.isCSharp()) in parseBracedList()
2459 if (Style.isJavaScript()) { in parseBracedList()
2482 if (Style.isJavaScript()) { in parseBracedList()
2493 if (IsEnum && !Style.AllowShortEnumsOnASingleLine) in parseBracedList()
2521 if (Style.Language == FormatStyle::LK_Java && FormatTok->is(tok::l_brace)) in parseParens()
2526 Style.RemoveParentheses > FormatStyle::RPS_Leave) { in parseParens()
2539 Style.RemoveParentheses == FormatStyle::RPS_ReturnStatement && in parseParens()
2574 if (Style.isCSharp() && FormatTok->is(TT_FatArrow)) in parseParens()
2580 if (Style.isJavaScript()) in parseParens()
2586 if (Style.isJavaScript() && (FormatTok->is(Keywords.kw_function))) in parseParens()
2649 if (!Style.RemoveBracesLLVM) in keepAncestorBraces()
2670 if (Style.InsertBraces && !Line->InPPDirective && !Line->Tokens.empty() && in parseUnbracedBody()
2672 Tok = Style.BraceWrapping.AfterControlStatement == FormatStyle::BWACS_Never in parseUnbracedBody()
2748 return Style.isVerilog() ? Keywords.isVerilogBegin(Tok) in isBlockBegin()
2756 (Style.isVerilog() && in parseIfThenElse()
2775 if (Style.isTableGen()) { in parseIfThenElse()
2790 KeepIfBraces = !Style.RemoveBracesLLVM || KeepBraces; in parseIfThenElse()
2815 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseIfThenElse()
2819 if (Style.BraceWrapping.BeforeElse) in parseIfThenElse()
2829 if (Style.RemoveBracesLLVM) { in parseIfThenElse()
2842 if (Style.RemoveBracesLLVM) { in parseIfThenElse()
2852 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseIfThenElse()
2877 if (Style.RemoveBracesLLVM) { in parseIfThenElse()
2882 if (Style.RemoveBracesLLVM) in parseIfThenElse()
2895 if (!Style.RemoveBracesLLVM) in parseIfThenElse()
2957 if (Style.Language == FormatStyle::LK_Java && FormatTok->is(tok::l_paren)) in parseTryCatch()
2963 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseTryCatch()
2965 if (Style.BraceWrapping.BeforeCatch) in parseTryCatch()
2983 ((Style.Language == FormatStyle::LK_Java || Style.isJavaScript()) && in parseTryCatch()
2996 if (Style.RemoveBracesLLVM) in parseTryCatch()
3004 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseTryCatch()
3006 if (Style.BraceWrapping.BeforeCatch) in parseTryCatch()
3012 if (Style.RemoveBracesLLVM) in parseTryCatch()
3030 (Style.isCSharp() && FormatTok->is(tok::kw_union))) { in parseNamespace()
3042 if (ShouldBreakBeforeBrace(Style, InitialToken)) in parseNamespace()
3046 Style.NamespaceIndentation == FormatStyle::NI_All || in parseNamespace()
3047 (Style.NamespaceIndentation == FormatStyle::NI_Inner && in parseNamespace()
3053 Style.BreakBeforeBraces == FormatStyle::BS_Whitesmiths; in parseNamespace()
3078 if (Style.isCSharp()) { in parseNew()
3095 if (Style.Language != FormatStyle::LK_Java) in parseNew()
3123 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseLoopBody()
3144 (Style.isVerilog() && in parseForOrWhileLoop()
3151 const bool KeepBraces = !Style.RemoveBracesLLVM || in parseForOrWhileLoop()
3156 if (Style.isJavaScript() && FormatTok->is(Keywords.kw_await)) in parseForOrWhileLoop()
3158 if (Style.isCpp() && FormatTok->is(tok::kw_co_await)) in parseForOrWhileLoop()
3164 if (Style.isVerilog()) in parseForOrWhileLoop()
3169 if (Style.isVerilog()) { in parseForOrWhileLoop()
3172 } else if (Style.AllowShortLoopsOnASingleLine && FormatTok->is(tok::semi) && in parseForOrWhileLoop()
3187 parseLoopBody(/*KeepBraces=*/true, Style.BraceWrapping.BeforeWhile); in parseDoWhile()
3199 if (Style.BreakBeforeBraces == FormatStyle::BS_Whitesmiths) in parseDoWhile()
3214 if (!Style.IndentCaseBlocks && CommentsBeforeNextToken.empty() && in parseLabel()
3218 Style.BraceWrapping.AfterCaseLabel, in parseLabel()
3219 Style.BraceWrapping.IndentBraces); in parseLabel()
3222 if (Style.BraceWrapping.AfterControlStatement == in parseLabel()
3225 if (!Style.IndentCaseBlocks && in parseLabel()
3226 Style.BreakBeforeBraces == FormatStyle::BS_Whitesmiths) { in parseLabel()
3268 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseSwitch()
3280 if (Style.RemoveBracesLLVM) in parseSwitch()
3714 if (Style.isJavaScript() && FormatTok->isOneOf(tok::colon, tok::question)) in parseEnum()
3718 if (Style.Language == FormatStyle::LK_Proto && FormatTok->is(tok::equal)) in parseEnum()
3729 if (Style.isVerilog()) { in parseEnum()
3746 if (Style.isCpp() && FormatTok->is(tok::identifier)) in parseEnum()
3757 if (Style.Language == FormatStyle::LK_Java) { in parseEnum()
3762 if (Style.Language == FormatStyle::LK_Proto) { in parseEnum()
3767 if (!Style.AllowShortEnumsOnASingleLine && in parseEnum()
3768 ShouldBreakBeforeBrace(Style, InitialToken)) { in parseEnum()
3773 if (!Style.AllowShortEnumsOnASingleLine) { in parseEnum()
3778 if (!Style.AllowShortEnumsOnASingleLine) in parseEnum()
3798 if (Style.Language == FormatStyle::LK_Java || Style.isJavaScript() || in parseStructLike()
3799 Style.isCSharp()) { in parseStructLike()
3930 ((Style.Language == FormatStyle::LK_Java || Style.isJavaScript()) && in parseRecord()
3932 if (Style.isJavaScript() && in parseRecord()
3985 if (Style.isCSharp() && FormatTok->is(Keywords.kw_where)) { in parseRecord()
4015 if (ShouldBreakBeforeBrace(Style, InitialToken)) in parseRecord()
4018 unsigned AddLevels = Style.IndentAccessModifiers ? 2u : 1u; in parseRecord()
4037 if (Style.BraceWrapping.AfterFunction) in parseObjCMethod()
4110 if (Style.BraceWrapping.AfterObjCDeclaration) in parseObjCInterfaceOrImplementation()
4287 if (Style.IndentCaseLabels) in parseVerilogHierarchyHeader()
4404 else if (!Style.IndentCaseBlocks && Keywords.isVerilogBegin(*FormatTok)) in parseVerilogCaseLabel()
4441 Style.BreakBeforeBraces == FormatStyle::BS_Whitesmiths; in addUnwrappedLine()
4636 if (!Style.isJavaScript()) in nextToken()
4641 if (Style.isVerilog()) { in nextToken()
4747 (!Style.isVerilog() || in readToken()
4763 if (Style.IndentPPDirectives == FormatStyle::PPDIS_BeforeHash && in readToken()