Lines Matching refs:Style

245                             const FormatStyle &Style, unsigned &LineLevel)  in CompoundStatementIndenter()  argument
247 Style.BraceWrapping.AfterControlStatement, in CompoundStatementIndenter()
248 Style.BraceWrapping.IndentBraces) {} in CompoundStatementIndenter()
333 UnwrappedLineParser::UnwrappedLineParser(const FormatStyle &Style, in UnwrappedLineParser() argument
339 CurrentLines(&Lines), Style(Style), Keywords(Keywords), in UnwrappedLineParser()
340 CommentPragmasRegex(Style.CommentPragmas), Tokens(nullptr), in UnwrappedLineParser()
342 IncludeGuard(Style.IndentPPDirectives == FormatStyle::PPDIS_None in UnwrappedLineParser()
349 IncludeGuard = Style.IndentPPDirectives == FormatStyle::PPDIS_None in reset()
410 bool MustBeDeclaration = !Line->InPPDirective && !Style.isJavaScript(); in parseFile()
413 if (Style.Language == FormatStyle::LK_TextProto) in parseFile()
427 if (Style.Language == FormatStyle::LK_TextProto && in parseFile()
503 !Style.RemoveBracesLLVM || precededByCommentOrPPDirective(); in parseLevel()
559 if (!Style.RemoveBracesLLVM || Line->InPPDirective || in parseLevel()
596 if (Style.isProto() || Style.isVerilog() || in parseLevel()
597 (Style.isJavaScript() && Line->MustBeDeclaration)) { in parseLevel()
606 (Style.IndentCaseLabels || in parseLevel()
614 if (Style.isCSharp()) { in parseLevel()
653 if (Style.isJavaScript() && PrevTok) { in calculateBraceTypes()
679 if (Style.Language == FormatStyle::LK_Proto) { in calculateBraceTypes()
708 (Style.isJavaScript() && in calculateBraceTypes()
712 (Style.isCpp() && NextTok->is(tok::l_paren)); in calculateBraceTypes()
737 if (!Style.isCSharp() && NextTok->is(tok::l_square)) { in calculateBraceTypes()
805 const auto ColumnLimit = Style.ColumnLimit; in mightFitOnOneLine()
829 TokenAnnotator Annotator(Style, Keywords); in mightFitOnOneLine()
859 return Line.Level * Style.IndentWidth + Length <= ColumnLimit; in mightFitOnOneLine()
868 if (Style.isVerilog() && FormatTok->is(tok::colon)) { in parseBlock()
878 Style.isVerilog() && Keywords.isVerilogHierarchy(*FormatTok); in parseBlock()
880 (Style.isVerilog() && in parseBlock()
892 Style.BreakBeforeBraces == FormatStyle::BS_Whitesmiths) { in parseBlock()
929 if (AddLevels > 0u && Style.BreakBeforeBraces != FormatStyle::BS_Whitesmiths) in parseBlock()
992 if (Style.RemoveSemicolon && IsFunctionRBrace) { in parseBlock()
1069 static bool ShouldBreakBeforeBrace(const FormatStyle &Style, in ShouldBreakBeforeBrace() argument
1077 return Style.BraceWrapping.AfterNamespace; in ShouldBreakBeforeBrace()
1079 return Style.BraceWrapping.AfterClass; in ShouldBreakBeforeBrace()
1081 return Style.BraceWrapping.AfterUnion; in ShouldBreakBeforeBrace()
1083 return Style.BraceWrapping.AfterStruct; in ShouldBreakBeforeBrace()
1085 return Style.BraceWrapping.AfterEnum; in ShouldBreakBeforeBrace()
1098 bool SkipIndent = (Style.isJavaScript() && in parseChildBlock()
1253 Style.IndentPPDirectives != FormatStyle::PPDIS_None) { in parsePPEndIf()
1292 if (Style.IndentPPDirectives != FormatStyle::PPDIS_None) in parsePPDefine()
1318 if (Style.IndentPPDirectives != FormatStyle::PPDIS_None) in parsePPUnknown()
1530 if (Style.Language == FormatStyle::LK_TableGen && in parseStructuralElement()
1539 if (Style.isVerilog()) { in parseStructuralElement()
1579 if (Style.Language == FormatStyle::LK_Java || Style.isJavaScript() || in parseStructuralElement()
1580 Style.isCSharp()) { in parseStructuralElement()
1587 if (Style.isJavaScript() && Line->MustBeDeclaration) { in parseStructuralElement()
1598 if (Style.isJavaScript() && Line->MustBeDeclaration) { in parseStructuralElement()
1605 if (Style.isJavaScript() && Line->MustBeDeclaration) { in parseStructuralElement()
1614 if (Style.isJavaScript() && Line->MustBeDeclaration) { in parseStructuralElement()
1622 if (Style.isVerilog()) in parseStructuralElement()
1624 if (Style.isJavaScript() && Line->MustBeDeclaration) { in parseStructuralElement()
1637 if (Style.isProto()) { in parseStructuralElement()
1641 if (Style.isVerilog()) { in parseStructuralElement()
1646 if (Style.isJavaScript() && Line->MustBeDeclaration) { in parseStructuralElement()
1655 if (Style.isJavaScript() && Line->MustBeDeclaration) { in parseStructuralElement()
1663 if (Style.isVerilog()) { in parseStructuralElement()
1673 if (Style.BraceWrapping.AfterExternBlock) in parseStructuralElement()
1678 (Style.IndentExternBlock == FormatStyle::IEBS_Indent) || in parseStructuralElement()
1679 (Style.BraceWrapping.AfterExternBlock && in parseStructuralElement()
1680 Style.IndentExternBlock == in parseStructuralElement()
1691 if (Style.isJavaScript()) { in parseStructuralElement()
1695 if (Style.isCpp()) { in parseStructuralElement()
1723 if (Style.isJavaScript()) { in parseStructuralElement()
1727 if (Style.Language == FormatStyle::LK_Proto) { in parseStructuralElement()
1739 if (Style.isCpp() && parseModuleImport()) in parseStructuralElement()
1742 if (Style.isCpp() && in parseStructuralElement()
1752 if (Style.isCpp() && FormatTok->is(TT_StatementMacro)) { in parseStructuralElement()
1756 if (Style.isCpp() && FormatTok->is(TT_NamespaceMacro)) { in parseStructuralElement()
1774 } else if (Style.Language == FormatStyle::LK_Java && in parseStructuralElement()
1802 if (Style.BraceWrapping.AfterControlStatement == in parseStructuralElement()
1817 if (Style.BraceWrapping.AfterControlStatement == in parseStructuralElement()
1835 if (Style.isCpp()) { in parseStructuralElement()
1856 if (!Style.isCpp()) { in parseStructuralElement()
1871 if (Style.isVerilog()) { in parseStructuralElement()
1885 if (Style.Language == FormatStyle::LK_Java && FormatTok && in parseStructuralElement()
1889 if (Style.isJavaScript() && FormatTok && in parseStructuralElement()
1907 if (!IsTopLevel || !Style.isCpp() || !Previous || eof()) in parseStructuralElement()
1941 if (Style.Language == FormatStyle::LK_Java && in parseStructuralElement()
1945 if (Style.BraceWrapping.AfterControlStatement == in parseStructuralElement()
1949 } else if (Style.BraceWrapping.AfterFunction) { in parseStructuralElement()
1961 if (Style.isJavaScript() && Line->MustBeDeclaration) { in parseStructuralElement()
1967 if (Style.BraceWrapping.AfterFunction) in parseStructuralElement()
1972 if (Style.isCSharp() && FormatTok->is(Keywords.kw_where) && in parseStructuralElement()
1988 if (Style.isJavaScript() && FormatTok->is(Keywords.kw_function) && in parseStructuralElement()
1994 if ((Style.isJavaScript() || Style.Language == FormatStyle::LK_Java) && in parseStructuralElement()
1996 if (Style.isJavaScript()) { in parseStructuralElement()
2014 if (Style.isVerilog()) { in parseStructuralElement()
2033 if (Style.isCpp() && FormatTok->is(TT_StatementMacro)) { in parseStructuralElement()
2046 if (Style.isJavaScript()) in parseStructuralElement()
2053 while (I != E && Style.isVerilog() && I->Tok->is(tok::hash)) in parseStructuralElement()
2059 if (!Style.isVerilog() && FormatTok->is(tok::colon) && in parseStructuralElement()
2062 parseLabel(!Style.IndentGotoLabels); in parseStructuralElement()
2089 if ((Style.isJavaScript() || Style.isCSharp()) && in parseStructuralElement()
2100 if (Style.isCSharp()) in parseStructuralElement()
2104 } else if (Style.Language == FormatStyle::LK_Proto && in parseStructuralElement()
2119 if (Style.isProto()) { in parseStructuralElement()
2124 if (Style.isVerilog()) { in parseStructuralElement()
2129 if (Style.isJavaScript() && Line->MustBeDeclaration) { in parseStructuralElement()
2138 if (Style.isVerilog()) { in parseStructuralElement()
2155 if (Style.isVerilog()) { in parseStructuralElement()
2169 if (!Style.isCSharp()) in tryToParsePropertyAccessor()
2210 if (!IsTrivialPropertyAccessor && Style.BraceWrapping.AfterFunction) in tryToParsePropertyAccessor()
2260 if (!Style.isCpp()) { in tryToParseLambda()
2374 LeftSquare->isCppStructuredBinding(Style) || Previous->closesScope() || in tryToParseLambdaIntroducer()
2444 assert(Style.isJavaScript() || Style.isCSharp()); in tryToParseChildBlock()
2464 if (Style.isCSharp() && FormatTok->is(TT_FatArrow) && in parseBracedList()
2468 if (Style.isJavaScript()) { in parseBracedList()
2482 if (IsEnum && !Style.AllowShortEnumsOnASingleLine) in parseBracedList()
2489 if (Style.isCSharp()) in parseBracedList()
2498 if (Style.isJavaScript()) { in parseBracedList()
2512 if (Style.Language == FormatStyle::LK_Proto || in parseBracedList()
2526 if (Style.isJavaScript()) { in parseBracedList()
2537 if (IsEnum && !Style.AllowShortEnumsOnASingleLine) in parseBracedList()
2558 if (Style.Language == FormatStyle::LK_Java && FormatTok->is(tok::l_brace)) in parseParens()
2582 if (Style.isCSharp() && FormatTok->is(TT_FatArrow)) in parseParens()
2588 if (Style.isJavaScript()) in parseParens()
2594 if (Style.isJavaScript() && in parseParens()
2660 if (!Style.RemoveBracesLLVM) in keepAncestorBraces()
2681 if (Style.InsertBraces && !Line->InPPDirective && !Line->Tokens.empty() && in parseUnbracedBody()
2683 Tok = Style.BraceWrapping.AfterControlStatement == FormatStyle::BWACS_Never in parseUnbracedBody()
2759 return Style.isVerilog() ? Keywords.isVerilogBegin(Tok) in isBlockBegin()
2774 KeepIfBraces = !Style.RemoveBracesLLVM || KeepBraces; in parseIfThenElse()
2791 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseIfThenElse()
2794 if (Style.BraceWrapping.BeforeElse) in parseIfThenElse()
2802 if (Style.RemoveBracesLLVM) { in parseIfThenElse()
2815 if (Style.RemoveBracesLLVM) { in parseIfThenElse()
2825 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseIfThenElse()
2849 if (Style.RemoveBracesLLVM) { in parseIfThenElse()
2854 if (Style.RemoveBracesLLVM) in parseIfThenElse()
2867 if (!Style.RemoveBracesLLVM) in parseIfThenElse()
2929 if (Style.Language == FormatStyle::LK_Java && FormatTok->is(tok::l_paren)) in parseTryCatch()
2935 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseTryCatch()
2937 if (Style.BraceWrapping.BeforeCatch) in parseTryCatch()
2955 ((Style.Language == FormatStyle::LK_Java || Style.isJavaScript()) && in parseTryCatch()
2968 if (Style.RemoveBracesLLVM) in parseTryCatch()
2976 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseTryCatch()
2978 if (Style.BraceWrapping.BeforeCatch) in parseTryCatch()
2984 if (Style.RemoveBracesLLVM) in parseTryCatch()
3002 (Style.isCSharp() && FormatTok->is(tok::kw_union))) { in parseNamespace()
3012 if (ShouldBreakBeforeBrace(Style, InitialToken)) in parseNamespace()
3016 Style.NamespaceIndentation == FormatStyle::NI_All || in parseNamespace()
3017 (Style.NamespaceIndentation == FormatStyle::NI_Inner && in parseNamespace()
3023 Style.BreakBeforeBraces == FormatStyle::BS_Whitesmiths; in parseNamespace()
3051 if (Style.isCSharp()) { in parseNew()
3068 if (Style.Language != FormatStyle::LK_Java) in parseNew()
3097 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseLoopBody()
3118 const bool KeepBraces = !Style.RemoveBracesLLVM || in parseForOrWhileLoop()
3123 if (Style.isJavaScript() && FormatTok->is(Keywords.kw_await)) in parseForOrWhileLoop()
3125 if (Style.isCpp() && FormatTok->is(tok::kw_co_await)) in parseForOrWhileLoop()
3138 parseLoopBody(/*KeepBraces=*/true, Style.BraceWrapping.BeforeWhile); in parseDoWhile()
3148 if (Style.BreakBeforeBraces == FormatStyle::BS_Whitesmiths) in parseDoWhile()
3163 if (!Style.IndentCaseBlocks && CommentsBeforeNextToken.empty() && in parseLabel()
3167 Style.BraceWrapping.AfterCaseLabel, in parseLabel()
3168 Style.BraceWrapping.IndentBraces); in parseLabel()
3171 if (Style.BraceWrapping.AfterControlStatement == in parseLabel()
3174 if (!Style.IndentCaseBlocks && in parseLabel()
3175 Style.BreakBeforeBraces == FormatStyle::BS_Whitesmiths) { in parseLabel()
3213 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseSwitch()
3223 if (Style.RemoveBracesLLVM) in parseSwitch()
3650 if (Style.isJavaScript() && FormatTok->isOneOf(tok::colon, tok::question)) in parseEnum()
3654 if (Style.Language == FormatStyle::LK_Proto && FormatTok->is(tok::equal)) in parseEnum()
3679 if (Style.isCpp() && FormatTok->is(tok::identifier)) in parseEnum()
3690 if (Style.Language == FormatStyle::LK_Java) { in parseEnum()
3695 if (Style.Language == FormatStyle::LK_Proto) { in parseEnum()
3700 if (!Style.AllowShortEnumsOnASingleLine && in parseEnum()
3701 ShouldBreakBeforeBrace(Style, InitialToken)) { in parseEnum()
3706 if (!Style.AllowShortEnumsOnASingleLine) { in parseEnum()
3712 if (!Style.AllowShortEnumsOnASingleLine) in parseEnum()
3731 if (Style.Language == FormatStyle::LK_Java || Style.isJavaScript() || in parseStructLike()
3732 Style.isCSharp()) { in parseStructLike()
3860 ((Style.Language == FormatStyle::LK_Java || Style.isJavaScript()) && in parseRecord()
3862 if (Style.isJavaScript() && in parseRecord()
3916 if (Style.isCSharp() && FormatTok->is(Keywords.kw_where)) { in parseRecord()
3944 if (ShouldBreakBeforeBrace(Style, InitialToken)) in parseRecord()
3947 unsigned AddLevels = Style.IndentAccessModifiers ? 2u : 1u; in parseRecord()
3965 if (Style.BraceWrapping.AfterFunction) in parseObjCMethod()
4038 if (Style.BraceWrapping.AfterObjCDeclaration) in parseObjCInterfaceOrImplementation()
4213 if (Style.IndentCaseLabels) in parseVerilogHierarchyHeader()
4327 else if (!Style.IndentCaseBlocks && Keywords.isVerilogBegin(*FormatTok)) in parseVerilogCaseLabel()
4351 Style.BreakBeforeBraces == FormatStyle::BS_Whitesmiths; in addUnwrappedLine()
4513 if (!Style.isJavaScript()) in nextToken()
4518 if (Style.isVerilog()) { in nextToken()
4623 (!Style.isVerilog() || in readToken()
4639 if (Style.IndentPPDirectives == FormatStyle::PPDIS_BeforeHash && in readToken()