[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: m4_unquote
From: |
Akim Demaille |
Subject: |
Re: m4_unquote |
Date: |
19 Feb 2001 11:47:28 +0100 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Cuyahoga Valley) |
Pavel Roskin <address@hidden> writes:
> Hello!
>
> I tried to put some sanity checks to AT_DATA, but finally decided that
> they are not worth the trouble.
>
> However, this macro (m4_unquote) appeared in process and can be useful for
> somebody. It was hard for me to write it (but it was a great exercize in
> m4!). I'm not suggesting its inclusion to Autoconf, but maybe it could
> become a part of an unofficial macro library.
I think that byy definition, if you need that macro something dead
wrong is happening...
> Optionally I can add support for multiline strings. The idea is: add @eol@
> at the end of lines (regexp), convert newlines to "@" (translit),
> unquote, convert @eol@@ to newlines.
>
> _________________________
> # m4_unquote(STRING)
> # ------------------
> # Remove one pair of the quotes if they exist, but don't expand any
> # macros even if they don't. Useful for checking validity of the
> # arguments. This macro doesn't work properly with multiline arguments.
> m4_define([m4_unquote],
> [m4_patsubst([[$1]], [^\[\[\(.*\)\]\]$], [[\1]])])
m4_define([m4_unquote], address@hidden)
or am I missing something?