Subject: Re: make and comments
To: None <tech-userlevel@netbsd.org>
From: Andrew Brown <atatat@atatdot.net>
List: tech-userlevel
Date: 07/29/2002 16:41:01
>> Just discovered on the automake list that our make doesn't honour escaped
>> comment lines, eg
>> 
>> 
>> # hello \
>>   there
>> 
>> which one might guess would be possible according to the man page. (Though
>> it does say "In general", so maybe we could add "(not in comment lines)")
>> 
>> Thoughts?

depends on how you parse a line.  libwrap defines a line as that which
is read in after all trailing backslashes (and subsequent newlines)
have been stripped.  a "line" is then checked to see if it is a comment.

>What about continuation lines that look like comments:
>
>	command args \
># more text \
>		even more text
>
>How should that be parsed?

it's tricky.  one could argue that a \ should continue a comment.
otoh, one could also legitimately argue that everything after the
comment character should be tossed before parsing the (rest of the)
line.

personally, i'd be happier if i could comment out arbitrary lines from
things like:

	foo:
		this \
		that \
		the other thing \
		the end

so that i wouldn't have to muck about too much.  i doubt that'll
happen any time soon.

>Or try putting a multi-megabyte file that has no NL characters in
>it through (IIRC) solaris 'grep'.  I think it keeps on expanding
>the input buffer until it has a line to process, unfortunately
>coded to be O(n^2) in the length of the line :-(

similar problem.  similar absence of a solution.

-- 
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org             * "ah!  i see you have the internet
twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
andrew@crossbar.com       * "information is power -- share the wealth."