NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: PR/39002 CVS commit: src/dist/nawk

The following reply was made to PR bin/39002; it has been noted by GNATS.

From: "Greg A. Woods; Planix, Inc." <>
To: David Holland <>
Subject: Re: PR/39002 CVS commit: src/dist/nawk
Date: Sun, 13 Jul 2008 17:34:26 -0400

 On 13-Jul-08, at 5:13 PM, David Holland wrote:
 > On Sun, Jul 13, 2008 at 04:46:23PM -0400, Greg A. Woods; Planix,  
 > Inc. wrote:
 >> Page 191:
 >> for strings and REs:
 >>     \c      any other character 'c' literally, e.g., \" for " and \\ for \
 >> The implication is of course that all 'x' are valid in '\x' and  
 >> thus no
 >> warning should ever be given.  (except inside a character class in  
 >> an RE
 >> where only '\', '^' at the beginning, and '-' between two  
 >> characters have
 >> any special meaning)
 > That implication does not follow. (And if it did, lint would be  
 > illegal.)
 The implication that all 'x' are valid in '\x' MUST follow.  It is  
 guaranteed by the language definition and exhaustively supported by  
 all relevant discussions of the issue in the text of the book.  You  
 want GAWK, use GAWK.  You want MAWK, use MAWK.  AWK is the AWK defined  
 by the book.
 It is also not uncommon in my experience to see "unnecessary" escaping  
 of characters both in string constants and especially in regular  
 expressions in AWK (and e-lisp and perl and other RE-rich languages)  
 -- perhaps it is not as elegant as one might like, but sometimes it is  
 just "easier", especially with generated code.
                                        Greg A. Woods; Planix, Inc.

Home | Main Index | Thread Index | Old Index