[cfe-commits] r173160 - in /cfe/trunk: lib/Format/Format.cpp unittests/Format/FormatTest.cpp

Daniel Jasper djasper at google.com
Tue Jan 22 07:45:50 PST 2013


>From what I have gathered, people usually try not to break around "." and
"->" unless it significantly enhanced readability, which it IMO doesn't in
this case. But better configuration options are one of the next things on
our list, so you will be able to get the old behavior back sometime soon.


On Tue, Jan 22, 2013 at 4:36 PM, Sebastian Redl <
sebastian.redl at getdesigned.at> wrote:

>
> On 22.01.2013, at 15:28, Daniel Jasper wrote:
>
> > Author: djasper
> > Date: Tue Jan 22 08:28:24 2013
> > New Revision: 173160
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=173160&view=rev
> > Log:
> > Let the formatter be more restrictive for breaking around . and ->
> >
> > Before:
> > aaaaaaaaaaaaaaa(aaaaaaaaa, aaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaa)
> >    .aaaaaaaaaaaaaaaaaa();
> >
> > After:
> > aaaaaaaaaaaaaaa(aaaaaaaaa, aaaaaaaaa,
> >                aaaaaaaaaaaaaaaaaaaaaaa).aaaaaaaaaaaaaaaaaa();
>
> Is that actually an improvement? I would prefer the former - the function
> call is one logical entity, so not breaking it up seems like a good idea.
> My company's in-house coding style rule about this is something like "break
> lines at the highest logical grouping possible". IOW, my logical
> understanding of the code here is
>
> member_access(
> .. call(aaaa, arguments(aaa, aaa, aaa)),
> .. call(aaaa)
> )
>
> which I realize is not equivalent to the parse tree, but I basically split
> this into the function call that returns an object and the member function
> call on that object. It makes sense to me to break between those two calls
> rather than in the middle of one.
>
> Sebastian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130122/5912e84a/attachment.html>


More information about the cfe-commits mailing list