================
@@ -5685,11 +5685,9 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine 
&Line,
     if (Right.is(tok::r_brace) && Left.is(tok::l_brace) &&
         !Left.Children.empty()) {
       // Support AllowShortFunctionsOnASingleLine for JavaScript.
-      return Style.AllowShortFunctionsOnASingleLine == FormatStyle::SFS_None ||
-             Style.AllowShortFunctionsOnASingleLine == FormatStyle::SFS_Empty 
||
-             (Left.NestingLevel == 0 && Line.Level == 0 &&
-              Style.AllowShortFunctionsOnASingleLine &
-                  FormatStyle::SFS_InlineOnly);
+      return !(Left.NestingLevel == 0 && Line.Level == 0
+                   ? Style.AllowShortFunctionsOnASingleLine.isAll()
----------------
irymarchyk wrote:

Thanks, I tried to add code to correctly handle this case. Also I added unit 
test (per my understanding). Please let me know if you want to add more cases 
(or if I made some mistake). Thanks.

https://github.com/llvm/llvm-project/pull/134337
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to