From: Eric Blake Date: Thu, 24 Apr 2008 15:31:16 +0000 (-0600) Subject: Mention m4sugar's internal quote strings. X-Git-Tag: v2.63~91 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c11e71ae5663c64cac637031563d4b4de1cc3390;p=thirdparty%2Fautoconf.git 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 --- diff --git a/ChangeLog b/ChangeLog index 5bb1e9755..fad30e750 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-04-24 Eric Blake + + 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 Allow unbalanced () in m4_expand. diff --git a/doc/autoconf.texi b/doc/autoconf.texi index b6ae602b9..ff7ffc7dc 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. -@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 diff --git a/tests/m4sugar.at b/tests/m4sugar.at index 8dc127928..69cb74b59 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