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 <ebb9 byu.net>
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 &t _split): And test it.
Reported by Joel E. Denny.
Signed-off-by: Eric Blake <ebb9 byu.net>
---
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 <ebb9 byu.net>
+
+ 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 &t _split):
And test it.
+ Reported by Joel E. Denny.
+
2008-04-23 Eric Blake <ebb9 byu.net>
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
+and code) 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:
table samp
 -9661,9
+9667,18  The empty quadrigraph can be used:
Trailing spaces are smashed by command. This is
a feature.
- item to produce other quadrigraphs
+ item 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{ <: }.
+ example
+m4_define([a], [A])m4_define([b], [B])m4_define([c],
[C])dnl
+m4_split([a ) }>=- b -=< {( c])
+ result{}[a], [], [B], [], [c]
+m4_split([a ) } &t >=- b -=< &t  {( c])
+ result{}[a], [) }>=-], [b], [-=< {(], [c]
+ end
example
item to escape emph 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 -=< &t {( 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
|
On Thu, 24 Apr 2008, Eric Blake wrote:
> 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:
Thanks for doing all this.
|