This revision was automatically updated to reflect the committed changes.
Closed by commit rL303556: clang-format: do not reflow bullet lists (authored
by Typz).
Changed prior to commit:
https://reviews.llvm.org/D33285?vs=99436=99764#toc
Repository:
rL LLVM
https://reviews.llvm.org/D33285
krasimir accepted this revision.
krasimir added a comment.
This revision is now accepted and ready to land.
Looks great!
https://reviews.llvm.org/D33285
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
Typz updated this revision to Diff 99436.
Typz marked an inline comment as done.
Typz added a comment.
Limit to 2 digits and not break before a matching numbered list sequence
followed by a fullstop, to avoid interpreting numbers at the end of sentence as
numbered bullets (and thus preventing
Typz marked 3 inline comments as done.
Typz added inline comments.
Comment at: lib/Format/BreakableToken.cpp:313
+ // Numbered lists may also start with a number followed by '.'
+ static const char *kNumberedListPattern = "^[0-9]+\\. ";
+ hasSpecialMeaningPrefix =
krasimir added inline comments.
Comment at: lib/Format/BreakableToken.cpp:313
+ // Numbered lists may also start with a number followed by '.'
+ static const char *kNumberedListPattern = "^[0-9]+\\. ";
+ hasSpecialMeaningPrefix = hasSpecialMeaningPrefix ||
Typz updated this revision to Diff 99427.
Typz added a comment.
- Use static regex to avoid recreating it each time
- Add more tests
https://reviews.llvm.org/D33285
Files:
lib/Format/BreakableToken.cpp
unittests/Format/FormatTestComments.cpp
Index: unittests/Format/FormatTestComments.cpp
Typz marked an inline comment as done.
Typz added inline comments.
Comment at: lib/Format/BreakableToken.cpp:313
+ // Numbered lists may also start with a number followed by '.'
+ static const char *kNumberedListPattern = "^[0-9]+\\. ";
+ hasSpecialMeaningPrefix =
krasimir added inline comments.
Comment at: lib/Format/BreakableToken.cpp:313
+ // Numbered lists may also start with a number followed by '.'
+ static const char *kNumberedListPattern = "^[0-9]+\\. ";
+ hasSpecialMeaningPrefix = hasSpecialMeaningPrefix ||
A
Typz created this revision.
Herald added a subscriber: klimek.
This patch prevents reflowing bullet lists in block comments.
It handles all lists supported by doxygen and markdown, e.g. bullet
lists starting with '-', '*', '+', as well as numbered lists starting
with -# or a number followed by a