[sf-perl] which first: remove non-data lines or process line continuations?

Steve Fink sphink at gmail.com
Tue Dec 11 14:45:25 PST 2007

> I'm leaning toward removing the non-data lines first.  But I wanted to
> see if anyone had any strong opinions or otherwise interesting
> observations.

I was going to say that gmake removes non-data first, but then I tried
it, and discovered that gmake is insane.

This makefile:

X = a \
# b \
d : D

Seems to be processed as "Let's see... this X line is continued, so
add in the next line. Hmm... a comment! Let's start ignoring. The
comment ends with a backslashed newline, so let's ignore the next line
too. Okay, let's see. Now we have d : D. Great!" It forgets completely
about the X continuation. That should have been either "X=a c\nd : D"
or "X=a d : D". gmake does neither.

My initial vote would be for line continuations first, because I like
the global rule that any line can be continued by ending it with a
backslash, but on further reflection, I think I'd go for non-data
first. It is more useful in practice -- there are many times when I
have a long series of single words in a Makefile that I put on their
own line (followed by a backslash), and it's nice to be able to
comment them out individually.

More information about the SanFrancisco-pm mailing list