Re: argv_ref patch 24: allow NUL in macro names

Eric Blake <[email protected]>
Newsgroups gmane.comp.gnu.m4.patches
Message-ID <[email protected]>
Eric Blake <ebb9 <at> byu.net> writes:

> hardware.]  On the master branch, I split it into three patches -
> reworking m4_error to take a call_info * instead of a char * (so that the
> length can be passed in alongside the name), changing the symbol table to
> support NUL, and changing all macro name output (warnings, dumpdef, trace)
> to handle or quote difficult characters while avoiding extra munging of
> the global location variables.

And I'm not sure how I let the master branch testsuite failure in - I thought I 
properly ran 'make check' before committing.  A (desirable) side-effect of 
using quotearg in the locale style is that if the locale-specific close-quote 
element also occurs in the quoted string, the quoted occurrence is escaped with 
\.  Thus, error messages that refer to the literal string "`defn'" now look 
like ``defn\'' rather than ``defn''.  I'm committing this to rectify the 
situation, and expanding the test to show that the extra \ quoting only occurs 
when the string would otherwise be ambiguous.


From e8a049d48816579cd04d339724779f414077fec3 Mon Sep 17 00:00:00 2001
From: Eric Blake <[email protected]>
Date: Tue, 3 Jun 2008 14:16:14 -0600
Subject: [PATCH] Fix fallout from previous patch.

* doc/m4.texinfo (Builtin): Adjust expected output.

Signed-off-by: Eric Blake <[email protected]>
---
 ChangeLog      |    5 +++++
 doc/m4.texinfo |   17 +++++++++++++++--
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f06aee7..5b2f0cc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-06-03  Eric Blake  <[email protected]>
+
+	Fix fallout from previous patch.
+	* doc/m4.texinfo (Builtin): Adjust expected output.
+
 2008-06-02  Eric Blake  <[email protected]>
 
 	Stage 24c: Improve display of macro names with embedded NUL.
diff --git a/doc/m4.texinfo b/doc/m4.texinfo
index 3540710..1c7e4ef 100644
--- a/doc/m4.texinfo
+++ b/doc/m4.texinfo
@@ -2792,8 +2792,12 @@ builtin(`builtin')
 builtin(`builtin',)
 @error{}m4:stdin:4: Warning: builtin: undefined builtin `'
 @result{}
+builtin(`builtin', ``'
+')
+@error{}m4:stdin:5: Warning: builtin: undefined builtin ``\'\n'
+@result{}
 indir(`index')
-@error{}m4:stdin:5: Warning: index: too few arguments: 0 < 2
+@error{}m4:stdin:7: Warning: index: too few arguments: 0 < 2
 @result{}0
 @end example
 
@@ -2850,10 +2854,19 @@ traceoff
 changequote(`[', `]')
 @result{}
 defn1([foo])
-@error{}m4:stdin:11: Warning: builtin: undefined builtin ``defn''
+@error{}m4:stdin:11: Warning: builtin: undefined builtin ``defn\''
 @result{}
 defn2([foo])
 @result{}bar
+define([defn1], [builtin([defn], $@@)])
+@result{}
+defn1([foo])
+@result{}bar
+changequote
+@result{}
+defn1(`foo')
+@error{}m4:stdin:16: Warning: builtin: undefined builtin `[defn]'
+@result{}
 @end example
 
 @node M4symbols
-- 
1.5.5.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.