Lines Matching refs:Style
50 AnnotatingParser(const FormatStyle &Style, AnnotatedLine &Line, in AnnotatingParser() argument
52 : Style(Style), Line(Line), CurrentToken(Line.First), AutoFound(false), in AnnotatingParser()
89 if (Style.Language == FormatStyle::LK_Java && in parseAngle()
102 if (Style.Language == FormatStyle::LK_TextProto || in parseAngle()
103 (Style.Language == FormatStyle::LK_Proto && Left->Previous && in parseAngle()
112 Style.Language == FormatStyle::LK_Java) { in parseAngle()
118 Style.Language != FormatStyle::LK_Proto && in parseAngle()
119 Style.Language != FormatStyle::LK_TextProto)) in parseAngle()
133 if (Style.Language == FormatStyle::LK_Proto) { in parseAngle()
169 } else if (Style.Language == FormatStyle::LK_JavaScript && in parseParens()
184 } else if (Style.Language == FormatStyle::LK_JavaScript && Left->Previous && in parseParens()
190 } else if (Style.Language == FormatStyle::LK_JavaScript && Left->Previous && in parseParens()
353 if (!Style.isCpp() || !Tok.startsSequence(tok::l_square, tok::l_square)) in isCpp11AttributeSpecifier()
395 Style.isCpp() && Parent && Parent->is(TT_TemplateCloser) && in parseSquare()
404 !InsideInlineASM && !CppArrayTemplates && Style.isCpp() && in parseSquare()
418 if (Left->isCppStructuredBinding(Style)) { in parseSquare()
425 } else if (Style.Language == FormatStyle::LK_JavaScript && Parent && in parseSquare()
429 } else if (Style.isCpp() && Contexts.back().ContextKind == tok::l_brace && in parseSquare()
435 } else if (Style.Language == FormatStyle::LK_Proto || in parseSquare()
436 Style.Language == FormatStyle::LK_TextProto) { in parseSquare()
487 if (Style.Language == FormatStyle::LK_JavaScript && Parent && in parseSquare()
588 if (Style.Language == FormatStyle::LK_JavaScript && Left->Previous && in parseBrace()
607 (!Contexts.back().ColonIsDictLiteral || !Style.isCpp())) || in parseBrace()
608 Style.Language == FormatStyle::LK_Proto || in parseBrace()
609 Style.Language == FormatStyle::LK_TextProto) { in parseBrace()
616 Style.Language == FormatStyle::LK_JavaScript) in parseBrace()
620 Style.Language == FormatStyle::LK_JavaScript) in parseBrace()
638 Left->Role.reset(new CommaSeparatedList(Style)); in updateParameterCount()
684 if (Style.Language == FormatStyle::LK_JavaScript) { in consumeToken()
700 Style.Language == FormatStyle::LK_Proto || in consumeToken()
701 Style.Language == FormatStyle::LK_TextProto) { in consumeToken()
703 if (Style.Language == FormatStyle::LK_TextProto) { in consumeToken()
761 if (Style.Language == FormatStyle::LK_JavaScript && in consumeToken()
777 if (Style.Language == FormatStyle::LK_JavaScript) { in consumeToken()
818 if (Style.Language == FormatStyle::LK_TextProto) { in consumeToken()
834 if (Style.Language == FormatStyle::LK_TextProto || in consumeToken()
835 (Style.Language == FormatStyle::LK_Proto && Tok->Previous && in consumeToken()
858 if (Style.Language != FormatStyle::LK_TextProto) in consumeToken()
862 if (Style.Language == FormatStyle::LK_TextProto || in consumeToken()
863 Style.Language == FormatStyle::LK_Proto) in consumeToken()
882 if (Style.Language == FormatStyle::LK_JavaScript && Tok->Next && in consumeToken()
895 Style.Language == FormatStyle::LK_JavaScript) in consumeToken()
982 if (Style.Language == FormatStyle::LK_JavaScript && IsFirstToken) { in parsePreprocessorDirective()
1047 if ((Style.Language == FormatStyle::LK_Java && in parseLine()
1067 if (Style.Language == FormatStyle::LK_Proto && Line.Level == 0 && in parseLine()
1078 if (Style.Language == FormatStyle::LK_JavaScript && in parseLine()
1085 if (Style.Language == FormatStyle::LK_JavaScript) { in parseLine()
1208 !(Style.Language == FormatStyle::LK_JavaScript && in modifyContext()
1240 Contexts.back().IsExpression = Style.Language == FormatStyle::LK_Java; in modifyContext()
1267 if (Style.Language == FormatStyle::LK_JavaScript) { in determineTokenType()
1302 Style.Language == FormatStyle::LK_Java) { in determineTokenType()
1321 if (Style.Language == FormatStyle::LK_JavaScript && in determineTokenType()
1332 Style.Language != FormatStyle::LK_TextProto)) { in determineTokenType()
1365 Style.Language != FormatStyle::LK_JavaScript && in determineTokenType()
1366 Style.Language != FormatStyle::LK_Java) { in determineTokenType()
1386 else if (Style.Language == FormatStyle::LK_Java && Current.Previous && in determineTokenType()
1409 } else if ((Style.Language == FormatStyle::LK_Java || in determineTokenType()
1410 Style.Language == FormatStyle::LK_JavaScript) && in determineTokenType()
1440 if (Style.Language == FormatStyle::LK_JavaScript && in isStartOfName()
1476 if (!Style.isCpp() && Style.Language != FormatStyle::LK_Java) in rParenEndsCast()
1513 if (Style.Language == FormatStyle::LK_Java && Tok.Next->is(tok::l_paren)) in rParenEndsCast()
1573 if (Style.Language == FormatStyle::LK_JavaScript) in determineStarAmpUsage()
1678 const FormatStyle &Style; member in clang::format::__anon963563180111::AnnotatingParser
1698 ExpressionParser(const FormatStyle &Style, const AdditionalKeywords &Keywords, in ExpressionParser() argument
1700 : Style(Style), Keywords(Keywords), Current(Line.First) {} in ExpressionParser()
1798 ((Style.Language == FormatStyle::LK_Proto || in getCurrentPrecedence()
1799 Style.Language == FormatStyle::LK_TextProto) && in getCurrentPrecedence()
1814 if ((Style.Language == FormatStyle::LK_Java || in getCurrentPrecedence()
1815 Style.Language == FormatStyle::LK_JavaScript) && in getCurrentPrecedence()
1818 if (Style.Language == FormatStyle::LK_JavaScript && in getCurrentPrecedence()
1825 if ((Style.Language == FormatStyle::LK_Java || in getCurrentPrecedence()
1826 Style.Language == FormatStyle::LK_JavaScript) && in getCurrentPrecedence()
1888 const FormatStyle &Style; member in clang::format::__anon963563180111::ExpressionParser
1942 AnnotatingParser Parser(Style, Line, Keywords); in annotate()
1955 ExpressionParser ExprParser(Style, Keywords, Line); in annotate()
2053 if ((Style.AlwaysBreakAfterReturnType == FormatStyle::RTBS_TopLevel || in mustBreakForReturnType()
2054 Style.AlwaysBreakAfterReturnType == in mustBreakForReturnType()
2059 switch (Style.AlwaysBreakAfterReturnType) { in mustBreakForReturnType()
2081 Line.First->IsMultiline ? Style.ColumnLimit in calculateFormattingInformation()
2091 Current->SpacesRequiredBefore = Style.Cpp11BracedListStyle ? 0 : 1; in calculateFormattingInformation()
2093 Current->SpacesRequiredBefore = Style.SpacesBeforeTrailingComments; in calculateFormattingInformation()
2132 ChildSize = LastOfChild.isTrailingComment() ? Style.ColumnLimit in calculateFormattingInformation()
2140 Current->TotalLength = Prev->TotalLength + Style.ColumnLimit; in calculateFormattingInformation()
2158 if (Style.Language == FormatStyle::LK_ObjC && in calculateFormattingInformation()
2175 Current->MatchingParen->opensBlockOrBlockTypeList(Style)) { in calculateFormattingInformation()
2180 if (Current->opensBlockOrBlockTypeList(Style)) in calculateFormattingInformation()
2212 if (Style.Language == FormatStyle::LK_Java) { in splitPenalty()
2219 } else if (Style.Language == FormatStyle::LK_JavaScript) { in splitPenalty()
2235 if (Style.Language == FormatStyle::LK_Proto) in splitPenalty()
2255 return Style.PenaltyReturnTypeOnItsOwnLine; in splitPenalty()
2267 (Right.is(tok::period) && Style.Language == FormatStyle::LK_Proto)) in splitPenalty()
2337 Style.AlignAfterOpenBracket != FormatStyle::BAS_DontAlign) in splitPenalty()
2350 if (Style.AlignAfterOpenBracket == FormatStyle::BAS_DontAlign) in splitPenalty()
2352 if (Left.is(tok::l_brace) && !Style.Cpp11BracedListStyle) in splitPenalty()
2354 return Left.ParameterCount > 1 ? Style.PenaltyBreakBeforeFirstCallParameter in splitPenalty()
2380 return Style.PenaltyBreakTemplateDeclaration; in splitPenalty()
2387 return Style.PenaltyBreakAssignment; in splitPenalty()
2399 if (Left.is(Keywords.kw_assert) && Style.Language == FormatStyle::LK_Java) in spaceRequiredBetween()
2401 if (Style.ObjCSpaceAfterProperty && Line.Type == LT_ObjCProperty && in spaceRequiredBetween()
2409 return Style.SpaceInEmptyParentheses; in spaceRequiredBetween()
2413 ? Style.SpacesInCStyleCastParentheses in spaceRequiredBetween()
2414 : Style.SpacesInParentheses; in spaceRequiredBetween()
2421 return !IsLightweightGeneric && Style.ObjCSpaceBeforeProtocolList; in spaceRequiredBetween()
2424 return Style.SpaceAfterTemplateKeyword; in spaceRequiredBetween()
2437 if (Style.Language == FormatStyle::LK_TextProto || in spaceRequiredBetween()
2438 (Style.Language == FormatStyle::LK_Proto && in spaceRequiredBetween()
2443 return !Style.Cpp11BracedListStyle; in spaceRequiredBetween()
2464 (Style.PointerAlignment != FormatStyle::PAS_Left || in spaceRequiredBetween()
2471 (Style.PointerAlignment != FormatStyle::PAS_Right && in spaceRequiredBetween()
2481 (Style.PointerAlignment != FormatStyle::PAS_Right && in spaceRequiredBetween()
2488 [](const FormatToken &LSquareTok, const FormatStyle &Style) { in spaceRequiredBetween() argument
2489 return Style.SpacesInContainerLiterals || in spaceRequiredBetween()
2490 ((Style.Language == FormatStyle::LK_Proto || in spaceRequiredBetween()
2491 Style.Language == FormatStyle::LK_TextProto) && in spaceRequiredBetween()
2492 !Style.Cpp11BracedListStyle && in spaceRequiredBetween()
2498 SpaceRequiredForArrayInitializerLSquare(Left, Style)) || in spaceRequiredBetween()
2501 Style.SpacesInSquareBrackets && Right.isNot(tok::r_square)); in spaceRequiredBetween()
2506 Style)) || in spaceRequiredBetween()
2507 (Style.SpacesInSquareBrackets && in spaceRequiredBetween()
2522 return !Style.Cpp11BracedListStyle; in spaceRequiredBetween()
2525 return Style.Language == FormatStyle::LK_JavaScript || in spaceRequiredBetween()
2532 (Style.SpaceBeforeParens != FormatStyle::SBPO_Never && in spaceRequiredBetween()
2540 (Style.SpaceBeforeParens == FormatStyle::SBPO_Always && in spaceRequiredBetween()
2585 if (Style.isCpp()) { in spaceRequiredBefore()
2589 !Left.opensScope() && Style.SpaceBeforeCpp11BracedList) in spaceRequiredBefore()
2591 } else if (Style.Language == FormatStyle::LK_Proto || in spaceRequiredBefore()
2592 Style.Language == FormatStyle::LK_TextProto) { in spaceRequiredBefore()
2607 return !Style.Cpp11BracedListStyle; in spaceRequiredBefore()
2615 } else if (Style.Language == FormatStyle::LK_JavaScript) { in spaceRequiredBefore()
2702 } else if (Style.Language == FormatStyle::LK_Java) { in spaceRequiredBefore()
2706 return Style.SpaceBeforeParens != FormatStyle::SBPO_Never; in spaceRequiredBefore()
2733 return Style.SpaceBeforeParens == FormatStyle::SBPO_Always; in spaceRequiredBefore()
2741 return Style.SpaceBeforeCtorInitializerColon; in spaceRequiredBefore()
2742 if (Right.is(TT_InheritanceColon) && !Style.SpaceBeforeInheritanceColon) in spaceRequiredBefore()
2745 !Style.SpaceBeforeRangeBasedForLoopColon) in spaceRequiredBefore()
2758 return Style.SpacesInContainerLiterals; in spaceRequiredBefore()
2769 return Style.SpaceAfterCStyleCast || in spaceRequiredBefore()
2773 if (Style.Language == FormatStyle::LK_TextProto || in spaceRequiredBefore()
2774 (Style.Language == FormatStyle::LK_Proto && Left.is(TT_DictLiteral))) in spaceRequiredBefore()
2775 return !Style.Cpp11BracedListStyle; in spaceRequiredBefore()
2777 (Style.Standard != FormatStyle::LS_Cpp11 || Style.SpacesInAngles); in spaceRequiredBefore()
2783 if (!Style.SpaceBeforeAssignmentOperators && in spaceRequiredBefore()
2786 if (Style.Language == FormatStyle::LK_Java && Right.is(tok::coloncolon) && in spaceRequiredBefore()
2796 Style.Standard == FormatStyle::LS_Cpp03) || in spaceRequiredBefore()
2800 (Left.is(tok ::l_paren) && Style.SpacesInParentheses); in spaceRequiredBefore()
2802 return Style.SpacesInAngles; in spaceRequiredBefore()
2806 Style.PointerAlignment != FormatStyle::PAS_Right; in spaceRequiredBefore()
2810 return Style.PointerAlignment != FormatStyle::PAS_Left; in spaceRequiredBefore()
2817 return Style.SpaceBeforeParens == FormatStyle::SBPO_Always; in spaceRequiredBefore()
2840 if (Right.NewlinesBefore > 1 && Style.MaxEmptyLinesToKeep > 0) in mustBreakBefore()
2843 if (Style.Language == FormatStyle::LK_JavaScript) { in mustBreakBefore()
2869 return Style.AllowShortFunctionsOnASingleLine == FormatStyle::SFS_None || in mustBreakBefore()
2870 Style.AllowShortFunctionsOnASingleLine == FormatStyle::SFS_Empty || in mustBreakBefore()
2872 Style.AllowShortFunctionsOnASingleLine & in mustBreakBefore()
2874 } else if (Style.Language == FormatStyle::LK_Java) { in mustBreakBefore()
2878 } else if (Style.Language == FormatStyle::LK_Cpp || in mustBreakBefore()
2879 Style.Language == FormatStyle::LK_ObjC || in mustBreakBefore()
2880 Style.Language == FormatStyle::LK_Proto || in mustBreakBefore()
2881 Style.Language == FormatStyle::LK_TableGen || in mustBreakBefore()
2882 Style.Language == FormatStyle::LK_TextProto) { in mustBreakBefore()
2891 if (Style.JavaScriptWrapImports || Line.Type != LT_ImportStatement) { in mustBreakBefore()
2894 (Style.Language == FormatStyle::LK_JavaScript && in mustBreakBefore()
2901 (Style.Language == FormatStyle::LK_JavaScript && in mustBreakBefore()
2924 Style.AlwaysBreakTemplateDeclarations == FormatStyle::BTDS_Yes) in mustBreakBefore()
2927 Style.BreakConstructorInitializers == FormatStyle::BCIS_BeforeComma && in mustBreakBefore()
2928 !Style.ConstructorInitializerAllOnOneLineOrOnePerLine) in mustBreakBefore()
2931 Style.BreakConstructorInitializers == FormatStyle::BCIS_BeforeComma && in mustBreakBefore()
2932 !Style.ConstructorInitializerAllOnOneLineOrOnePerLine) in mustBreakBefore()
2935 if (Style.BreakInheritanceList == FormatStyle::BILS_BeforeComma && in mustBreakBefore()
2946 Right.NestingLevel == 1 && Style.Language == FormatStyle::LK_Proto) { in mustBreakBefore()
2954 return (Line.startsWith(tok::kw_enum) && Style.BraceWrapping.AfterEnum) || in mustBreakBefore()
2956 Style.BraceWrapping.AfterEnum) || in mustBreakBefore()
2957 (Line.startsWith(tok::kw_class) && Style.BraceWrapping.AfterClass) || in mustBreakBefore()
2958 (Line.startsWith(tok::kw_struct) && Style.BraceWrapping.AfterStruct); in mustBreakBefore()
2959 if (Left.is(TT_ObjCBlockLBrace) && !Style.AllowShortBlocksOnASingleLine) in mustBreakBefore()
2962 if ((Style.Language == FormatStyle::LK_Java || in mustBreakBefore()
2963 Style.Language == FormatStyle::LK_JavaScript) && in mustBreakBefore()
2966 (Line.Last->is(tok::l_brace) || Style.BreakAfterJavaFieldAnnotations)) in mustBreakBefore()
2999 if ((Style.Language == FormatStyle::LK_Proto || in mustBreakBefore()
3000 Style.Language == FormatStyle::LK_TextProto) && in mustBreakBefore()
3060 if ((Style.Language == FormatStyle::LK_Cpp || in mustBreakBefore()
3061 Style.Language == FormatStyle::LK_ObjC) && in mustBreakBefore()
3089 if (Style.Language == FormatStyle::LK_Java) { in canBreakBefore()
3096 } else if (Style.Language == FormatStyle::LK_JavaScript) { in canBreakBefore()
3134 return Style.BreakBeforeBinaryOperators == FormatStyle::BOS_None; in canBreakBefore()
3136 return Style.BreakBeforeBinaryOperators != FormatStyle::BOS_None; in canBreakBefore()
3174 (Style.PointerAlignment == FormatStyle::PAS_Right && in canBreakBefore()
3189 Style.BreakConstructorInitializers == FormatStyle::BCIS_AfterColon); in canBreakBefore()
3193 return Style.BreakBeforeTernaryOperators; in canBreakBefore()
3195 return !Style.BreakBeforeTernaryOperators; in canBreakBefore()
3197 return Style.BreakInheritanceList == FormatStyle::BILS_AfterColon; in canBreakBefore()
3199 return Style.BreakInheritanceList != FormatStyle::BILS_AfterColon; in canBreakBefore()
3208 if (Style.Language == FormatStyle::LK_Proto || in canBreakBefore()
3209 Style.Language == FormatStyle::LK_TextProto) { in canBreakBefore()
3210 if (!Style.AlwaysBreakBeforeMultilineStrings && Right.isStringLiteral()) in canBreakBefore()
3269 !Style.Cpp11BracedListStyle) in canBreakBefore()
3307 return Style.BreakConstructorInitializers == FormatStyle::BCIS_AfterColon; in canBreakBefore()
3309 return Style.BreakConstructorInitializers != FormatStyle::BCIS_AfterColon; in canBreakBefore()
3311 Style.BreakConstructorInitializers == FormatStyle::BCIS_BeforeComma) in canBreakBefore()
3314 Style.BreakConstructorInitializers == FormatStyle::BCIS_BeforeComma) in canBreakBefore()
3317 Style.BreakInheritanceList == FormatStyle::BILS_BeforeComma) in canBreakBefore()
3320 Style.BreakInheritanceList == FormatStyle::BILS_BeforeComma) in canBreakBefore()
3326 Style.BreakBeforeBinaryOperators != FormatStyle::BOS_None && in canBreakBefore()
3327 (Style.BreakBeforeBinaryOperators == FormatStyle::BOS_All || in canBreakBefore()
3336 Style.BreakBeforeBinaryOperators != FormatStyle::BOS_All && in canBreakBefore()
3337 (Style.BreakBeforeBinaryOperators == FormatStyle::BOS_None || in canBreakBefore()