[Python-checkins] CVS: python/dist/src/Modules _sre.c,2.56,2.57 sre_constants.h,2.12,2.13

Fredrik Lundh effbot@users.sourceforge.net
Mon, 02 Jul 2001 09:58:40 -0700


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv555/Modules

Modified Files:
	_sre.c sre_constants.h 
Log Message:


added martin's BIGCHARSET patch to SRE 2.1.1.  martin reports 2x
speedups for certain unicode character ranges.


Index: _sre.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_sre.c,v
retrieving revision 2.56
retrieving revision 2.57
diff -C2 -r2.56 -r2.57
*** _sre.c	2001/07/02 16:42:49	2.56
--- _sre.c	2001/07/02 16:58:38	2.57
***************
*** 507,510 ****
--- 507,523 ----
              break;
  
+ 	case SRE_OP_BIGCHARSET:
+ 	    /* <BIGCHARSET> <blockcount> <256 blockindices> <blocks> */
+ 	{
+ 	    int count, block;
+ 	    count = *(set++);
+ 	    block = ((unsigned char*)set)[ch >> 8];
+ 	    set += 128;
+ 	    if (set[block*16 + ((ch & 255)>>4)] & (1 << (ch & 15)))
+ 		return ok;
+ 	    set += count*16;
+ 	    break;
+ 	}
+ 
          case SRE_OP_CATEGORY:
              /* <CATEGORY> <code> */

Index: sre_constants.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/sre_constants.h,v
retrieving revision 2.12
retrieving revision 2.13
diff -C2 -r2.12 -r2.13
*** sre_constants.h	2001/03/22 15:50:09	2.12
--- sre_constants.h	2001/07/02 16:58:38	2.13
***************
*** 12,16 ****
   */
  
! #define SRE_MAGIC 20010320
  #define SRE_OP_FAILURE 0
  #define SRE_OP_SUCCESS 1
--- 12,16 ----
   */
  
! #define SRE_MAGIC 20010701
  #define SRE_OP_FAILURE 0
  #define SRE_OP_SUCCESS 1
***************
*** 24,45 ****
  #define SRE_OP_CATEGORY 9
  #define SRE_OP_CHARSET 10
! #define SRE_OP_GROUPREF 11
! #define SRE_OP_GROUPREF_IGNORE 12
! #define SRE_OP_IN 13
! #define SRE_OP_IN_IGNORE 14
! #define SRE_OP_INFO 15
! #define SRE_OP_JUMP 16
! #define SRE_OP_LITERAL 17
! #define SRE_OP_LITERAL_IGNORE 18
! #define SRE_OP_MARK 19
! #define SRE_OP_MAX_UNTIL 20
! #define SRE_OP_MIN_UNTIL 21
! #define SRE_OP_NOT_LITERAL 22
! #define SRE_OP_NOT_LITERAL_IGNORE 23
! #define SRE_OP_NEGATE 24
! #define SRE_OP_RANGE 25
! #define SRE_OP_REPEAT 26
! #define SRE_OP_REPEAT_ONE 27
! #define SRE_OP_SUBPATTERN 28
  #define SRE_AT_BEGINNING 0
  #define SRE_AT_BEGINNING_LINE 1
--- 24,46 ----
  #define SRE_OP_CATEGORY 9
  #define SRE_OP_CHARSET 10
! #define SRE_OP_BIGCHARSET 11
! #define SRE_OP_GROUPREF 12
! #define SRE_OP_GROUPREF_IGNORE 13
! #define SRE_OP_IN 14
! #define SRE_OP_IN_IGNORE 15
! #define SRE_OP_INFO 16
! #define SRE_OP_JUMP 17
! #define SRE_OP_LITERAL 18
! #define SRE_OP_LITERAL_IGNORE 19
! #define SRE_OP_MARK 20
! #define SRE_OP_MAX_UNTIL 21
! #define SRE_OP_MIN_UNTIL 22
! #define SRE_OP_NOT_LITERAL 23
! #define SRE_OP_NOT_LITERAL_IGNORE 24
! #define SRE_OP_NEGATE 25
! #define SRE_OP_RANGE 26
! #define SRE_OP_REPEAT 27
! #define SRE_OP_REPEAT_ONE 28
! #define SRE_OP_SUBPATTERN 29
  #define SRE_AT_BEGINNING 0
  #define SRE_AT_BEGINNING_LINE 1