@@ -158,7 +158,7 @@ static bool opensProtoMessageField(const FormatToken &LessTok,
158158 const FormatStyle &Style) {
159159 if (LessTok.isNot (tok::less))
160160 return false ;
161- return Style.Language == FormatStyle::LK_TextProto ||
161+ return Style.isTextProto () ||
162162 (Style.Language == FormatStyle::LK_Proto &&
163163 (LessTok.NestingLevel > 0 ||
164164 (LessTok.Previous && LessTok.Previous ->is (tok::equal))));
@@ -281,7 +281,7 @@ LineState ContinuationIndenter::getInitialState(unsigned FirstIndent,
281281 State.LowestLevelOnLine = 0 ;
282282 State.IgnoreStackForComparison = false ;
283283
284- if (Style.Language == FormatStyle::LK_TextProto ) {
284+ if (Style.isTextProto () ) {
285285 // We need this in order to deal with the bin packing of text fields at
286286 // global scope.
287287 auto &CurrentState = State.Stack .back ();
@@ -924,7 +924,7 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun,
924924 CurrentState.ContainsUnwrappedBuilder = true ;
925925 }
926926
927- if (Current.is (TT_LambdaArrow) && Style.Language == FormatStyle::LK_Java )
927+ if (Current.is (TT_LambdaArrow) && Style.isJava () )
928928 CurrentState.NoLineBreak = true ;
929929 if (Current.isMemberAccess () && Previous.is (tok::r_paren) &&
930930 (Previous.MatchingParen &&
@@ -1315,7 +1315,7 @@ unsigned ContinuationIndenter::getNewLineColumn(const LineState &State) {
13151315 NextNonComment = &Current;
13161316
13171317 // Java specific bits.
1318- if (Style.Language == FormatStyle::LK_Java &&
1318+ if (Style.isJava () &&
13191319 Current.isOneOf (Keywords.kw_implements , Keywords.kw_extends )) {
13201320 return std::max (CurrentState.LastSpace ,
13211321 CurrentState.Indent + Style.ContinuationIndentWidth );
@@ -1806,7 +1806,7 @@ void ContinuationIndenter::moveStatePastFakeLParens(LineState &State,
18061806 (Style.AlignOperands != FormatStyle::OAS_DontAlign ||
18071807 PrecedenceLevel < prec::Assignment) &&
18081808 (!Previous || Previous->isNot (tok::kw_return) ||
1809- (Style.Language != FormatStyle::LK_Java && PrecedenceLevel > 0 )) &&
1809+ (! Style.isJava () && PrecedenceLevel > 0 )) &&
18101810 (Style.AlignAfterOpenBracket != FormatStyle::BAS_DontAlign ||
18111811 PrecedenceLevel > prec::Comma || Current.NestingLevel == 0 ) &&
18121812 (!Style.isTableGen () ||
@@ -2453,8 +2453,8 @@ ContinuationIndenter::createBreakableToken(const FormatToken &Current,
24532453 ? 0
24542454 : Current.UnbreakableTailLength ;
24552455
2456- if (Style.isVerilog () || Style.Language == FormatStyle::LK_Java ||
2457- Style.isJavaScript () || Style. isCSharp ()) {
2456+ if (Style.isVerilog () || Style.isJava () || Style. isJavaScript () ||
2457+ Style.isCSharp ()) {
24582458 BreakableStringLiteralUsingOperators::QuoteStyleType QuoteStyle;
24592459 if (Style.isJavaScript () && Text.starts_with (" '" ) &&
24602460 Text.ends_with (" '" )) {
0 commit comments