[PATCH] D28462: clang-format: Add new style option AlignConsecutiveMacros

Daniel Jasper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 23 16:40:21 PDT 2017


djasper added inline comments.


================
Comment at: lib/Format/WhitespaceManager.cpp:431
+
+              // Special case for AlignTokens: for all other alignment cases,
+              // the current sequence is ended when a comma or a scope change
----------------
enyquist wrote:
> djasper wrote:
> > I am not yet sure I understand this. How is this different from:
> > 
> >   $ clang-format test.cc -style="{AlignConsecutiveDeclarations: true}"
> >   map<int, int> m;
> >   map<int>      m;
> >   int           a;
> I'm not sure exactly what you mean. Do you mean, why do I need this special case to ignore scope changes and commas? This was the only way I could get it to work, AlignTokens was bailing out as soon as a paren or a comma inside parens was seen.
Yes, that's what I mean. The example I am writing above works correctly and structurally, the two should be the same, right? Maybe this is easier now that you can skip over the parameter list because of the correct MatchingParen?


Repository:
  rL LLVM

https://reviews.llvm.org/D28462





More information about the cfe-commits mailing list