This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
safe-ctype.h tweak
- To: gcc-patches at gcc dot gnu dot org
- Subject: safe-ctype.h tweak
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Date: Wed, 24 Oct 2001 18:53:56 +0100
- Cc: DJ Delorie <dj at redhat dot com>, Zack Weinberg <zack at codesourcery dot com>
This adds an extra category that I need for the cpplib lexer to do
locale-sensitive lexing (patch sometime in the next few days). The
category is what C99 calls the "basic charset".
OK to commit?
Neil.
* include/safe-ctype.h (_sch_isbasic, IS_BASIC): New.
Index: safe-ctype.h
===================================================================
RCS file: /cvs/gcc/gcc/include/safe-ctype.h,v
retrieving revision 1.3
diff -u -p -r1.3 safe-ctype.h
--- safe-ctype.h 2001/03/02 01:17:23 1.3
+++ safe-ctype.h 2001/10/24 17:51:23
@@ -63,7 +63,8 @@ enum {
_sch_isalnum = _sch_isalpha|_sch_isdigit, /* A-Za-z0-9 */
_sch_isidnum = _sch_isidst|_sch_isdigit, /* A-Za-z0-9_ */
_sch_isgraph = _sch_isalnum|_sch_ispunct, /* isprint and not space */
- _sch_iscppsp = _sch_isvsp|_sch_isnvsp /* isspace + \0 */
+ _sch_iscppsp = _sch_isvsp|_sch_isnvsp, /* isspace + \0 */
+ _sch_isbasic = _sch_isprint|_sch_iscppsp /* basic charset of ISO C */
};
/* Character classification. */
@@ -86,6 +87,7 @@ extern const unsigned short _sch_istable
#define ISIDNUM(c) _sch_test(c, _sch_isidnum)
#define ISIDST(c) _sch_test(c, _sch_isidst)
+#define IS_BASIC(c) _sch_test(c, _sch_isbasic)
#define IS_VSPACE(c) _sch_test(c, _sch_isvsp)
#define IS_NVSPACE(c) _sch_test(c, _sch_isnvsp)
#define IS_SPACE_OR_NUL(c) _sch_test(c, _sch_iscppsp)