[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: M4 syntax $11 vs. ${11}
From: |
Paul Eggert |
Subject: |
Re: M4 syntax $11 vs. ${11} |
Date: |
Thu, 08 Feb 2007 11:20:43 -0800 |
User-agent: |
Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux) |
Eric Blake <address@hidden> writes:
> +fatal "need GNU m4 1.4.5 or later: $m4"
> + unless system "echo 'ifdef(mac,bug)dnl' | $m4 --trace=mac 2>&1 | grep bug
> >/dev/null";
> +
> +# Detect if we can use feature added in M4 1.4.9 to warn user about $10.
> +# Override the user's choice of --warn-macro-sequence, since the default
> +# macro sequence rejects ${1} even though we guarantee it is safe.
> +$m4 .= " --warn-macro-sequence='\\\$\\([0-9][0-9]+\\|{{\\)'"
> + if ! system "$m4 --help | grep warn-macro-sequence >/dev/null";
Can you please rewrite this so that it invokes m4 once instead of
twice, and doesn't use grep at all? You can use Perl's pattern
matching instead of grep. And I think you can test for both features
by a single call to 'm4'. This will help autom4te start up a bit
faster.
Perhaps it would be even better to test for these things at
configure-time: that way, we won't have to invoke 'm4' at all, at
run-time.
A nit: the "+" isn't needed. Once you see two digits, you don't need
to look for more.