krasimir added inline comments.

================
Comment at: clang/lib/Format/BreakableToken.cpp:109
+    // after '\'.
+    if (Style.isCpp()) {
+      StringRef::size_type LastNonBlank =
----------------
sammccall wrote:
> Do we really want to predicate this on isCpp()? `//` comments are allowed by 
> C99.
> Even if the warning only applies to C++ for some reason, the reasons for 
> confusion do not.
I think in Java and other non-C++-y languages, an `\` at the end of a 
line-comment line does not have any special meaning, hence I didn't want it to 
trigger in those cases.


================
Comment at: clang/lib/Format/BreakableToken.cpp:125
     else
       break;
   }
----------------
sammccall wrote:
> doesn't this mean that we won't loop? if Text ends with "blah \ \" then 
> you'll split between "blah" and the first "\"?
> 
> I guess this could be structured:
> 
> ```
> while () {
>   if (special case 1) {
>     // adjust pos
>     continue;
>   }
>   if (special case 2) {
>     // adjust pos
>     continue;
>   }
>   break;
> }
> ```
> 
> (This is equivalent to the old if/elseif/break which is too hard to add 
> complex conditions to)
Thank you! Updated this block and added a test case for this.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90949/new/

https://reviews.llvm.org/D90949

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to