CVSROOT:        /sources/m4
Module name:    m4
Branch:         branch-1_4
Changes by:     Eric Blake <ericb>      06/09/04 13:35:10

Index: doc/m4.texinfo
===================================================================
RCS file: /sources/m4/m4/doc/m4.texinfo,v
retrieving revision 1.1.1.1.2.70
retrieving revision 1.1.1.1.2.71
diff -u -b -r1.1.1.1.2.70 -r1.1.1.1.2.71
--- doc/m4.texinfo      24 Aug 2006 14:27:33 -0000      1.1.1.1.2.70
+++ doc/m4.texinfo      4 Sep 2006 13:35:09 -0000       1.1.1.1.2.71
@@ -360,7 +360,7 @@
 Then in 2005 Gary V. Vaughan collected together the many
 patches to @acronym{GNU} @code{m4} 1.4 that were floating around the net and
 released 1.4.3 and 1.4.4.  And in 2006, Eric Blake joined the team and
-prepared patches for the release of 1.4.5 and 1.4.6.
+prepared patches for the release of 1.4.5, 1.4.6, and 1.4.7.
 
 Meanwhile, development has continued on new features for @code{m4}, such
 as dynamic module loading and additional builtins.  When complete,
@@ -2724,6 +2724,41 @@
 @code{changeword}.  This is that if your regular expression accepts
 @samp{foo}, it must also accept @samp{f} and @samp{fo}.
 
[EMAIL PROTECTED]
+ifdef(`changeword', `', `errprint(` skipping: no changeword support
+')m4exit(`77')')dnl
+define(`foo
+', `bar
+')
[EMAIL PROTECTED]
+dnl This example wants to recognize changeword, dnl, and `foo\n'.
+dnl First, we check that our regexp will match.
+regexp(`changeword', `[cd][a-z]*\|foo[
+]')
[EMAIL PROTECTED]
+regexp(`foo
+', `[cd][a-z]*\|foo[
+]')
[EMAIL PROTECTED]
+regexp(`f', `[cd][a-z]*\|foo[
+]')
[EMAIL PROTECTED]
+foo
[EMAIL PROTECTED]
+changeword(`[cd][a-z]*\|foo[
+]')
[EMAIL PROTECTED]
+dnl Even though `foo\n' matches, we forgot to allow `f'.
+foo
[EMAIL PROTECTED]
+changeword(`[cd][a-z]*\|fo*[
+]?')
[EMAIL PROTECTED]
+dnl Now we can call `foo\n'.
+foo
[EMAIL PROTECTED]
[EMAIL PROTECTED] example
+
 @code{changeword} has another function.  If the regular expression
 supplied contains any grouped subexpressions, then text outside
 the first of these is discarded before symbol lookup.  So:


Reply via email to