[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: m4_pattern_forbid matches itself
From: |
Raja R Harinath |
Subject: |
Re: m4_pattern_forbid matches itself |
Date: |
Thu, 24 Jul 2003 15:03:36 -0500 |
User-agent: |
Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux) |
Hi,
Phil Edwards <address@hidden> writes:
> On Thu, Jul 24, 2003 at 02:44:12PM -0500, Raja R Harinath wrote:
>>
>> That's strange. It is implemented by a grep.
>>
>> foreach (split (/\W+/))
>> {
>> $prohibited{$_} = $.
>> if /$forbidden/o && !/$allowed/o && ! exists $prohibited{$_};
>> }
>
> Where is this code? On my system, /usr/bin/m4 is a binary, not a perl
> script. :-) I've been trying to dig to learn more, but haven't yet
> retrieved the m4 source.
In $bindir/autom4te. Somewhat misleadingly, 'm4_pattern_forbid'
isn't part of 'm4', but from the 'm4sugar' library that's part of
'autoconf'.
>> > Any other ideas? The few examples of m4_pattern_forbid I've seen all
>> > seem to be matching isolated words, e.g., m4_pattern_forbid([^FOO$]),
>> > which clearly won't help for trying to match part of a variable name.
>>
>> Given the splitting above on \W, that shouldn't be a problem.
>
> I've been trying variations on
>
> m4_pattern_forbid([\${?target_alias\>],
> [target alias is not what you think it is])
I don't know if that'll work, since the \W split will probably
swallow the ${.
- Hari
--
Raja R Harinath ------------------------------ address@hidden