[Top][All Lists]

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

Re: [PATCH] Honor multi-line m4_pattern_forbid comment

From: Eric Blake
Subject: Re: [PATCH] Honor multi-line m4_pattern_forbid comment
Date: Mon, 16 Jun 2008 21:52:23 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Hans Ulrich Niedermann <hun <at> n-dimensional.de> writes:

> Let m4 create $tmp/patterns with comments spread over
> multiple lines as before, but have autom4te reassemble
> multi-line comments.

Thanks for the report, and even more for the patch idea.  However, you don't 
appear to have copyright on file, so we will need to get that taken care of 
before your patch can be incorporated.

For that matter, the manual doesn't even document that m4_pattern_forbid takes 
a second argument - this is a more fundamental bug that needs fixing, in part 
because we are free to change the semantics of the second parameter as long as 
is not documented (for that matter, it is technically possible, although not 
very nice, to simply document that the second argument exists but must be a 
single line).

> An alternative solution would be to let autom4te have
> m4 convert multi-line comments to an escaped one-line
> form and let autom4te later unescape them.

autom4te is capturing the m4_pattern_forbid via m4's trace mechanism.  m4 1.4.x 
outputs trace lines with embedded newlines, with no way around it (trace lines 
are sent to the trace file without any further processing by m4).  I'm working 
on making the eventual m4 1.6 output escape sequences instead, but don't know 
how it will interact with autom4te (at any rate, trace style would have to be 
run-time configurable in m4, and autom4te will still have to support the older 
1.4.x output if the newer 1.6 trace output is not present).

I haven't looked closely at your patch (intentionally, so that I still have the 
freedom to implement something independently, if copyright assignment becomes 
an issue), but did spot some immediate nits:

> +# autoconf: forbidden tokens, no comment
> +# -------------------------------------------------
> +AT_SETUP([autoconf: forbidden tokens,[] no comment])

The [] after , should be extraneous, as of autoconf 2.62.  For that matter, it 
seems like this would not be adding anything (except testsuite execution time) 
to what the existing tests for forbidden tokens already did.

> +
> +# autoconf: forbidden tokens, with one-line comment
> +# -------------------------------------------------
> +AT_SETUP([autoconf: forbidden tokens,[] one-line comment])

Again, the ,[] seems extra; plain , should work.  But you did the right thing 
in adding test cases!

>  # autoconf: forbidden tokens, exceptions
>  # --------------------------------------
>  AT_SETUP([autoconf: forbidden tokens,[] exceptions])

Ah, I see.  You were copying existing usage, and that usage pre-dated my fix in 
2.62 that made the [] unnecessary.

Eric Blake

reply via email to

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