lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GOP-PROP 3: C++ formatting (update)


From: Keith OHara
Subject: Re: GOP-PROP 3: C++ formatting (update)
Date: Wed, 29 Jun 2011 22:19:41 -0700
User-agent: Opera Mail/11.50 (Win32)

On Wed, 29 Jun 2011 21:05:51 -0700, Carl Sorensen <address@hidden> wrote:

On 6/29/11 6:01 PM, "Keith OHara" <address@hidden> wrote:

Graham Percival <graham <at> percival-music.ca> writes:

At the moment I'm leaning towards using astyle+postprocessing.

padding that can be helpful
-      && ((d == LEFT && !line_->get_bound (LEFT))
-          || (end && d == RIGHT && !line_->get_bound (RIGHT))))
+      && ( (d == LEFT && !line_->get_bound (LEFT))
+           || (end && d == RIGHT && !line_->get_bound (RIGHT))))

I am ambivalent about the padding above.

By the way, this is an example where post-processing can cause trouble.  s/( 
(/((/g  subtly misaligns the indentation
+      && ((d == LEFT && !line_->get_bound (LEFT))
+           || (end && d == RIGHT && !line_->get_bound (RIGHT))))
but if we fiddle with padding first and let Astyle indent without the padding 
options, then everything is copacetic.

or maybe annoying
-    if (Stem::get_beam ((*stems_)[i]))
+    if (Stem::get_beam ( (*stems_) [i]))


I very much dislike the padding above here.  Both the space before (*stems)
and the space before [i].


Do you have the ability to easily test a change that doesn't pad a
parenthesis if it's following the same character, ie. (( won't get an extra
space?

Maybe.  Astyle is open-source and clearly written, but I haven't looked at this 
area of the code.
It would be harder than testing a sed expression for pre-processing, but easier 
than figuring out fixcc.py.

And is there an option to avoid padding [?


No.  In the language of Astyle's options, the padding is associated with the ) 
before the [.  There is an open feature request for an option that pads only 
before the ( of a function call operator, which would fill our current need.
I assume the requested option would also pad the cast operator, (int) (n / d)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]