[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 2.62 AT_SETUP limitations
From: |
Eric Blake |
Subject: |
Re: 2.62 AT_SETUP limitations |
Date: |
Thu, 24 Apr 2008 15:41:05 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
Eric Blake <ebb9 <at> byu.net> writes:
> > I find it rarely pays to play the guessing game of "surely the user will
> > never do *this*". Moreover, I'm betting that the user will never guess
> > that this bizarre string is actually special to autotest.
>
> Magic line-noise strings don't just affect autotest, but all m4sugar-based
> languages, including autoconf itself.
>
> > At the very
> > least, can this new limitation be mentioned in the manual? Or did I miss
> > it?
>
> So yes, it would probably be worth adding a blurb in the m4sugar
documentation
Like so:
>From c11e71ae5663c64cac637031563d4b4de1cc3390 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Thu, 24 Apr 2008 09:31:16 -0600
Subject: [PATCH] Mention m4sugar's internal quote strings.
* doc/autoconf.texi (Quadrigraphs): Mention alternate quote used
in m4sugar, and how to still output it literally.
* tests/m4sugar.at (m4@&address@hidden): And test it.
Reported by Joel E. Denny.
Signed-off-by: Eric Blake <address@hidden>
---
ChangeLog | 8 ++++++++
doc/autoconf.texi | 21 ++++++++++++++++++---
tests/m4sugar.at | 7 +++++++
3 files changed, 33 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 5bb1e97..fad30e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-04-24 Eric Blake <address@hidden>
+
+ Mention m4sugar's internal quote strings.
+ * doc/autoconf.texi (Quadrigraphs): Mention alternate quote used
+ in m4sugar, and how to still output it literally.
+ * tests/m4sugar.at (m4@&address@hidden): And test it.
+ Reported by Joel E. Denny.
+
2008-04-23 Eric Blake <address@hidden>
Allow unbalanced () in m4_expand.
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index b6ae602..ff7ffc7 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -9629,7 +9629,13 @@ expression @samp{[^[]}, which matches any character
other than @samp{[}.
This expression contains unbalanced brackets so it cannot be put easily
into an M4 macro.
-You can work around this problem by using one of the following
+Additionally, there are a few m4sugar macros (such as @code{m4_split}
+and @code{m4_expand}) which internally use special markers in addition
+to the regular quoting characters. If the arguments to these macros
+contain the literal strings @samp{-=<@{(} or @samp{)@}>=-}, the macros
+might behave incorrectly.
+
+You can work around these problems by using one of the following
@dfn{quadrigraphs}:
@table @samp
@@ -9661,9 +9667,18 @@ The empty quadrigraph can be used:
Trailing spaces are smashed by @command{autom4te}. This is a feature.
address@hidden to produce other quadrigraphs
address@hidden to produce quadrigraphs and other strings reserved by m4sugar
+
+For instance @samp{@@<@@&t@@:@@} produces @samp{@@<:@@}. For a more
+contrived example:
-For instance @samp{@@<@@&t@@:@@} produces @samp{@@<:@@}.
address@hidden
+m4_define([a], [A])m4_define([b], [B])m4_define([c], [C])dnl
+m4_split([a )@}>=- b -=<@{( c])
address@hidden, [], [B], [], [c]
+m4_split([a )@}@@&t@@>=- b -=<@@&t@@@{( c])
address@hidden, [)@}>=-], [b], [-=<@{(], [c]
address@hidden example
@item to escape @emph{occurrences} of forbidden patterns
diff --git a/tests/m4sugar.at b/tests/m4sugar.at
index 8dc1279..69cb74b 100644
--- a/tests/m4sugar.at
+++ b/tests/m4sugar.at
@@ -170,6 +170,11 @@ m4_split([abcde], [bd])
m4_split([abcde], [[bd]])
m4_split([foo=`` bar=''])
m4_split([foo='' bar=``])
+dnl these next two are from the manual; keep this in sync if the internal
+dnl quoting strings in m4_split are changed
+m4_define([a], [A])m4_define([b], [B])m4_define([c], [C])dnl
+m4_split([a )}>=- b -=<{( c])
+m4_split([a )}@&t@>=- b -=<@&address@hidden( c])
]],
[[
@@ -184,6 +189,8 @@ m4_split([foo='' bar=``])
[a], [c], [e]
[foo=``], [bar='']
[foo=''], [bar=``]
+[a], [], [B], [], [c]
+[a], [)}>=-], [b], [-=<{(], [c]
]])
AT_CLEANUP
--
1.5.5.1
- Re: 2.62 AT_SETUP limitations, (continued)
Re: 2.62 AT_SETUP limitations, Noah Misch, 2008/04/22
- Re: 2.62 AT_SETUP limitations, Eric Blake, 2008/04/23
- Re: 2.62 AT_SETUP limitations, Eric Blake, 2008/04/23
- Re: 2.62 AT_SETUP limitations, Joel E. Denny, 2008/04/23
- Re: 2.62 AT_SETUP limitations, Eric Blake, 2008/04/23
- Re: 2.62 AT_SETUP limitations, Ralf Wildenhues, 2008/04/24
- Re: 2.62 AT_SETUP limitations,
Eric Blake <=
- Re: 2.62 AT_SETUP limitations, Joel E. Denny, 2008/04/24
Re: 2.62 AT_SETUP limitations, Akim Demaille, 2008/04/24
tracing output [was: 2.62 AT_SETUP limitations], Eric Blake, 2008/04/24
Re: tracing output [was: 2.62 AT_SETUP limitations], Eric Blake, 2008/04/24
Re: tracing output, Akim Demaille, 2008/04/25
Re: 2.62 AT_SETUP limitations, Akim Demaille, 2008/04/24
Re: 2.62 AT_SETUP limitations, Joel E. Denny, 2008/04/24