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 23:53:34 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Graham Percival <graham <at> percival-music.ca> writes:
> 
> At the moment I'm leaning towards using astyle+postprocessing.
> The script in question is here:

Don't post-process, or you mis-align the indentation that astyle did.

Pre-filtering works well, assuming we drop the corresponding astyle options:

 # add space before (, except in macro definitions
 sed -i -e '/#\s*define/!s/\([)_[:alnum:]]\)(/\1 (/g' $*

 astyle --style=gnu --indent-cases --indent=spaces=2 \
  --max-instatement-indent=60 \
  --align-pointer=name --pad-oper \
  --keep-one-line-blocks --quiet  $*
 # no need for --pad-paren-out

This passes a `make check` but it needs a facility to skip over comments and 
strings (such as the facility already written for fixcc).







reply via email to

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