[PATCH] D30705: clang-format: [JS] allow breaking after non-null assertions.
Daniel Jasper via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 8 01:41:28 PST 2017
djasper accepted this revision.
djasper added inline comments.
This revision is now accepted and ready to land.
================
Comment at: lib/Format/TokenAnnotator.cpp:1056
+ } else if (Current.is(tok::exclaim)) {
+ if (Style.Language == FormatStyle::LK_JavaScript) {
+ if (Current.Previous &&
----------------
I wonder whether we should do this logic "inside out", i.e. have language-specific parts at the top (or in a separate function). We have started that in mustBreakBefore and I think that's helpful.
I can do this in a follow-up, though.
================
Comment at: lib/Format/TokenAnnotator.cpp:1063
+ return;
+ } else if (Current.Next &&
+ Current.Next->isOneOf(TT_BinaryOperator, Keywords.kw_as)) {
----------------
No "else" after "return": http://llvm.org/docs/CodingStandards.html#don-t-use-else-after-a-return
https://reviews.llvm.org/D30705
More information about the cfe-commits
mailing list