[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Comments on changesyntax et al.
From: |
Eric Blake |
Subject: |
Re: Comments on changesyntax et al. |
Date: |
Sat, 24 Feb 2007 07:03:39 -0700 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061207 Thunderbird/1.5.0.9 Mnenhy/0.7.4.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Eric Blake on 2/10/2007 4:22 PM:
>
> Paul convinced me that for purposes
> of a transition period, only ${<digit> should be recognized as
> the start of an extended argument. On the other hand, that was
> before we came up with the idea for multi-character extended
> argument delimiters, so maybe I should just reserve ALL ${
> sequences in the default warning of M4 1.4.9's --warn-macro-sequence.
I decided with the flexibility of the regex in --warn-macro-sequence in
1.4.9, and the promised flexibility of changeextarg (yet to be
implemented) in 2.0, that we might as well make the default regex warn
about all uses of ${. Like so:
2007-02-24 Eric Blake <address@hidden>
Reserve all uses of raw ${} in macro definitions, not just
${<digit>}.
* src/builtin.c (set_macro_sequence): Change default macro
sequence.
* doc/m4.texinfo (Operation modes): Update to match.
* src/m4.c (usage): Likewise.
* NEWS: Likewise.
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFF4EW784KuGfSFAYARAqM5AKDIbrOMe/7vpINb2VIgZhgoOxbtcQCgkolL
Zvl7z8Y4RLi3Qnx7iQHQZ10=
=S8Iy
-----END PGP SIGNATURE-----
Index: NEWS
===================================================================
RCS file: /sources/m4/m4/NEWS,v
retrieving revision 1.1.1.1.2.93
diff -u -p -r1.1.1.1.2.93 NEWS
--- NEWS 8 Feb 2007 14:52:29 -0000 1.1.1.1.2.93
+++ NEWS 24 Feb 2007 14:01:22 -0000
@@ -23,9 +23,9 @@ Version 1.4.9 - ?? ??? 2007, by ???? (C
* A new `--warn-macro-sequence' command-line option allows detection of
sequences in `define' and `pushdef' definitions that match an optional
regular expression. The default regular expression is
- `\$\({[0-9][^}]*}\|[0-9][0-9]+\)', corresponding to the sequences that
- might not behave correctly when upgrading to the eventual M4 2.0. By
- default, M4 2.0 will follow the POSIX requirement that a macro definition
+ `\$\({[^}]*}\|[0-9][0-9]+\)', corresponding to the sequences that might
+ not behave correctly when upgrading to the eventual M4 2.0. By default,
+ M4 2.0 will follow the POSIX requirement that a macro definition
containing `$11' must expand to the first argument concatenated with 1,
rather than the eleventh argument; and will take advantage of the POSIX
wording that allows implementations to treat `${11}' as the eleventh
Index: doc/m4.texinfo
===================================================================
RCS file: /sources/m4/m4/doc/m4.texinfo,v
retrieving revision 1.1.1.1.2.114
diff -u -p -r1.1.1.1.2.114 m4.texinfo
--- doc/m4.texinfo 8 Feb 2007 14:52:29 -0000 1.1.1.1.2.114
+++ doc/m4.texinfo 24 Feb 2007 14:01:24 -0000
@@ -590,13 +590,13 @@ match in any macro definition (either by
@code{pushdef}). Empty matches are ignored; therefore, supplying the
empty string as @var{REGEXP} disables any warning. If the optional
@var{REGEXP} is not supplied, then the default regular expression is
address@hidden(@address@hidden@}\|[0-9][0-9]+\)} (a literal @samp{$} followed
-by multiple digits or by an open brace and a digit), since these
-sequences will change semantics in the default operation of
address@hidden M4 2.0 (due to a change in how more than 9 arguments in a
-macro definition will be handled, @pxref{Arguments}). Providing an
-alternate regular expression can provide a useful reverse lookup feature
-of finding where a macro is defined to have a given definition.
address@hidden(@address@hidden@}\|[0-9][0-9]+\)} (a literal @samp{$} followed by
+multiple digits or by an open brace), since these sequences will
+change semantics in the default operation of @acronym{GNU} M4 2.0 (due
+to a change in how more than 9 arguments in a macro definition will be
+handled, @pxref{Arguments}). Providing an alternate regular
+expression can provide a useful reverse lookup feature of finding
+where a macro is defined to have a given definition.
@item -W @var{REGEXP}
@itemx address@hidden
@@ -6388,7 +6388,7 @@ the first time.
@bye
@c Local Variables:
address@hidden coding: ISO-8859-1
address@hidden coding: iso-8859-1
@c fill-column: 72
@c ispell-local-dictionary: "american"
@c indent-tabs-mode: nil
Index: src/builtin.c
===================================================================
RCS file: /sources/m4/m4/src/Attic/builtin.c,v
retrieving revision 1.1.1.1.2.57
diff -u -p -r1.1.1.1.2.57 builtin.c
--- src/builtin.c 8 Feb 2007 14:52:29 -0000 1.1.1.1.2.57
+++ src/builtin.c 24 Feb 2007 14:01:24 -0000
@@ -253,7 +253,7 @@ set_macro_sequence (const char *regexp)
const char *msg;
if (! regexp)
- regexp = "\\$\\({[0-9][^}]*}\\|[0-9][0-9]+\\)";
+ regexp = "\\$\\({[^}]*}\\|[0-9][0-9]+\\)";
else if (regexp[0] == '\0')
{
macro_sequence_inuse = false;
Index: src/m4.c
===================================================================
RCS file: /sources/m4/m4/src/Attic/m4.c,v
retrieving revision 1.1.1.1.2.44
diff -u -p -r1.1.1.1.2.44 m4.c
--- src/m4.c 8 Feb 2007 14:52:29 -0000 1.1.1.1.2.44
+++ src/m4.c 24 Feb 2007 14:01:24 -0000
@@ -162,7 +162,7 @@ Operation modes:\n\
-Q, --quiet, --silent suppress some warnings for builtins\n\
--warn-macro-sequence[=REGEXP]\n\
warn if macro definition matches REGEXP,\n\
- default \\$\\({[0-9][^}]*}\\|[0-9]+\\)\n\
+ default \\$\\({[^}]*}\\|[0-9][0-9]+\\)\n\
", stdout);
#ifdef ENABLE_CHANGEWORD
fputs ("\
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: Comments on changesyntax et al.,
Eric Blake <=