lilypond-devel
[Top][All Lists]
Advanced

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

Re: Style: don't break compiling freetype-errors.cc (issue2144047)


From: perpeduumimmobile
Subject: Re: Style: don't break compiling freetype-errors.cc (issue2144047)
Date: Sat, 11 Sep 2010 07:02:55 +0000

On 2010/09/10 19:46:57, Graham Percival wrote:
a python guru / regex person [...]
That's not me...

(from the issue description)
- Given a "define blah {" line, we *don't* want to move the { to
   the next line.

- given a:
     =
    include "foo.h"
     ;
   don't move the include onto the = line, or the ; onto the
   include line.

Wouldn't it be easier to just say
- if a line belongs to a preprocessor statement
  (i.e. it either starts with "#" or
        each of the lines before end with "\", and the first line
        of those starts with "#")
then leave it alone (dont merge another line on this, don't take some
characters out to the next)?  This would solve all those preprocessor
related issues, and seems easier.

If there's a "positive list" of changes, say,
- "# include\t\t<foobar>" => "#include <foobar>",
then those could of course be included as separate cases.

Typically only the three groups #include, #define / #undef and #if /
#ifdef / #endif make out nearly all of the preprocessor directives
(unless there are a lot of special optimizations like OpenMP use or
compiler/platform-dependent performance tweaks).  Do we really want to
care about the others at the risk of running into compiling issues?

http://codereview.appspot.com/2144047/



reply via email to

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