[Python-checkins] CVS: python/dist/src/Modules _sre.c,2.17,2.18

Fredrik Lundh python-dev@python.org
Sat, 1 Jul 2000 10:51:06 -0700


Update of /cvsroot/python/python/dist/src/Modules
In directory slayer.i.sourceforge.net:/tmp/cvs-serv25808/Modules

Modified Files:
	_sre.c 
Log Message:


today's SRE update:

-- changed 1.6 to 2.0 in the file headers

-- fixed ISALNUM macro for the unicode locale.  this
   solution isn't perfect, but the best I can do with
   Python's current unicode database.

Index: _sre.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_sre.c,v
retrieving revision 2.17
retrieving revision 2.18
diff -C2 -r2.17 -r2.18
*** _sre.c	2000/06/30 21:40:20	2.17
--- _sre.c	2000/07/01 17:50:59	2.18
***************
*** 26,30 ****
   *
   * Portions of this engine have been developed in cooperation with
!  * CNRI.  Hewlett-Packard provided funding for 1.6 integration and
   * other compatibility work.
   */
--- 26,30 ----
   *
   * Portions of this engine have been developed in cooperation with
!  * CNRI.  Hewlett-Packard provided funding for 2.0 integration and
   * other compatibility work.
   */
***************
*** 53,57 ****
  
  #if PY_VERSION_HEX >= 0x01060000
! /* defining this enables unicode support (default under 1.6) */
  #define HAVE_UNICODE
  #endif
--- 53,57 ----
  
  #if PY_VERSION_HEX >= 0x01060000
! /* defining this enables unicode support (default under 1.6a1 and later) */
  #define HAVE_UNICODE
  #endif
***************
*** 144,152 ****
      return (unsigned int) Py_UNICODE_TOLOWER((Py_UNICODE)(ch));
  }
! #define SRE_UNI_TO_LOWER(ch) Py_UNICODE_TOLOWER((Py_UNICODE)(ch))
  #define SRE_UNI_IS_DIGIT(ch) Py_UNICODE_ISDIGIT((Py_UNICODE)(ch))
  #define SRE_UNI_IS_SPACE(ch) Py_UNICODE_ISSPACE((Py_UNICODE)(ch))
  #define SRE_UNI_IS_LINEBREAK(ch) Py_UNICODE_ISLINEBREAK((Py_UNICODE)(ch))
! #define SRE_UNI_IS_ALNUM(ch) ((ch) < 256 ? isalnum((ch)) : 0)
  #define SRE_UNI_IS_WORD(ch) (SRE_IS_ALNUM((ch)) || (ch) == '_')
  #endif
--- 144,159 ----
      return (unsigned int) Py_UNICODE_TOLOWER((Py_UNICODE)(ch));
  }
! 
! #if !defined(Py_UNICODE_ISALNUM)
! /* FIXME: workaround.  should be fixed in unicodectype.c */
! #define Py_UNICODE_ISALNUM(ch)\
!     (Py_UNICODE_ISLOWER(ch) || Py_UNICODE_ISUPPER(ch) ||\
!      Py_UNICODE_ISTITLE(ch) || Py_UNICODE_ISDIGIT(ch))
! #endif
! 
  #define SRE_UNI_IS_DIGIT(ch) Py_UNICODE_ISDIGIT((Py_UNICODE)(ch))
  #define SRE_UNI_IS_SPACE(ch) Py_UNICODE_ISSPACE((Py_UNICODE)(ch))
  #define SRE_UNI_IS_LINEBREAK(ch) Py_UNICODE_ISLINEBREAK((Py_UNICODE)(ch))
! #define SRE_UNI_IS_ALNUM(ch) Py_UNICODE_ISALNUM((Py_UNICODE)(ch))
  #define SRE_UNI_IS_WORD(ch) (SRE_IS_ALNUM((ch)) || (ch) == '_')
  #endif