]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Mention m4sugar's internal quote strings.
authorEric Blake <ebb9@byu.net>
Thu, 24 Apr 2008 15:31:16 +0000 (09:31 -0600)
committerEric Blake <ebb9@byu.net>
Thu, 24 Apr 2008 15:31:16 +0000 (09:31 -0600)
* 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
doc/autoconf.texi
tests/m4sugar.at

index 5bb1e975595a68eefaa9758182343d8f8ad5b394..fad30e7505bc6eec74cb5b1f1961ce603bff9ef8 100644 (file)
--- 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.
index b6ae602b94b5512150a151caf9b04b529c6ccd1d..ff7ffc7dc77a8df8864f8e50026cd9357a020f9f 100644 (file)
@@ -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.
 
-@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{occurrences} of forbidden patterns
 
index 8dc127928f9de78a552fffe9f1c3cd154fded86e..69cb74b59706102411a7afe9cc7ac49e86902953 100644 (file)
@@ -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