[Top][All Lists]

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

Re: improve AS_ESCAPE

From: Eric Blake
Subject: Re: improve AS_ESCAPE
Date: Tue, 03 Mar 2009 06:05:59 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20081209 Thunderbird/ Mnenhy/

Hash: SHA1

According to Paolo Bonzini on 3/3/2009 2:21 AM:
>> I currently don't see the need for it.  But you can also just add those
>> two lines of example to the @comment if you prefer that to nuking.
> I'm thinking of an alternate implementation.  Sorry for coming up late
> with this.  What if instead you leave AS_ESCAPE as it was, and instead
> add _AS_ESCAPE1/2/3/4 for Autoconf's private usage?  That would be
> implemented like this:

Looks like it has merit:

> m4_define([AS_ESCAPE],
> [m4_if([$2], [],
>        [m4_if(m4_len([$1], m4_len(m4_translit([[$1]], [$2])),
>               [$1], [_AS_ESCAPE($@)])],
>        [_AS_ESCAPE4([$1], [`], ['], [""], [$])])

Thus, short strings benefit from our filtering for strings that need no
escapes, avoiding regex when possible, while long strings are still
handled (except you still have an issue with escaping -, [, and ], that
has always been present even before I started touching this).

I'll play with it, and see what I can come up with.  Meanwhile, I've
noticed that AC_LITERAL_IF is a bit beefy for what is really necessary.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at
Comment: Using GnuPG with Mozilla -


reply via email to

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