[Top][All Lists]

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

Re: 15-file-contents-paragraph.patch

From: akim
Subject: Re: 15-file-contents-paragraph.patch
Date: Wed, 31 Jan 2001 20:06:09 +0100
User-agent: Mutt/1.3.12i

On Wed, Jan 31, 2001 at 11:19:37AM -0700, Tom Tromey wrote:
> >>>>> "Akim" == Akim Demaille <address@hidden> writes:
> Akim>         * (file_contents): Rewrite: instead of trying to 
> parse
> Akim>         it line by line, first swallow it completely into $CONTENTS,
> Akim>         *then*, parse it *paragraph* by paragraph.
> I see this went in.
> What is the rationale for this patch?

To make it easier to handle special paragraphs such as .PHONY.

My goal was to follow strictly the syntax of Make so that people don't
have several syntaxes to learn, and more than one way to shoot in their

I apologize if I've been too fast on this patch.  I was under pressure
for cleaning up the mess I had left with maek check, and had all this
in front of me.  Fell free to ask me to revert these.

Still, back to the point.  My gaol was primarily to catch paragraphes
such as the .PHONY ones.  At the beginning I was looping on result_rules,
but it quickly became exactly what I applied to the whole file_contents:
reading by paragraphs (to make it short, but in practice I first tried
some hairy elsif with the other, and them tried to parse line by line
$result_rules, and fell on situations where Perl'RE engine was going

It struck me that when you read in paragraph you no longer have the horrible
$saw_bk, $was_rule and $ignoring hacks.

> I'm very leery of changing file reading.  For &file_contents it isn't
> too worrisome, since we have complete control over the inputs.  For
> the other file reader it is scarier.

Hm, you saw me coming up :)

Frankly, the more I look at this loop, the more I think this is the right
way to do it.  But I can understand your fears.  I'm sure Jim will agree
to give a try to some experiments :)  I'm sure we can drastically shorten
and simplify the code using this technique.

> Also, the patch that went in has some unconditional prints to STDERR.
> This is wrong.

Well, I left some in comment, which is not clean, agreed.  I will remove
those comments tomorrow then, sorry.

reply via email to

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