[Python-checkins] CVS: python/dist/src/Modules _sre.c,2.27,2.28 sre.h,2.14,2.15

Fredrik Lundh python-dev@python.org
2000年7月23日 14:46:21 -0700


Update of /cvsroot/python/python/dist/src/Modules
In directory slayer.i.sourceforge.net:/tmp/cvs-serv6140/Modules
Modified Files:
	_sre.c sre.h 
Log Message:
-- SRE 0.9.6 sync. this includes:
 + added "regs" attribute
 + fixed "pos" and "endpos" attributes
 + reset "lastindex" and "lastgroup" in scanner methods
 + removed (?P#id) syntax; the "lastindex" and "lastgroup"
 attributes are now always set
 + removed string module dependencies in sre_parse
 + better debugging support in sre_parse
 + various tweaks to build under 1.5.2
Index: _sre.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_sre.c,v
retrieving revision 2.27
retrieving revision 2.28
diff -C2 -r2.27 -r2.28
*** _sre.c	2000年07月21日 06:00:07	2.27
--- _sre.c	2000年07月23日 21:46:17	2.28
***************
*** 1,4 ****
! /* -*- Mode: C; tab-width: 4 -*-
! *
 * Secret Labs' Regular Expression Engine
 *
--- 1,3 ----
! /*
 * Secret Labs' Regular Expression Engine
 *
***************
*** 6,27 ****
[...3493 lines suppressed...]
*** 2100,2108 ****
 init_sre(void)
 {
! 	/* Patch object types */
! 	Pattern_Type.ob_type = Match_Type.ob_type =
 Scanner_Type.ob_type = &PyType_Type;
 
! 	Py_InitModule("_" MODULE, _functions);
 }
 
--- 2193,2201 ----
 init_sre(void)
 {
! /* Patch object types */
! Pattern_Type.ob_type = Match_Type.ob_type =
 Scanner_Type.ob_type = &PyType_Type;
 
! Py_InitModule("_" MODULE, _functions);
 }
 
Index: sre.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/sre.h,v
retrieving revision 2.14
retrieving revision 2.15
diff -C2 -r2.14 -r2.15
*** sre.h	2000年07月03日 21:31:48	2.14
--- sre.h	2000年07月23日 21:46:17	2.15
***************
*** 1,3 ****
--- 1,4 ----
 /*
+ *
 * Secret Labs' Regular Expression Engine
 *
***************
*** 34,37 ****
--- 35,39 ----
 PyObject_VAR_HEAD
 PyObject* string; /* link to the target string */
+ PyObject* regs; /* cached list of matching spans */
 PatternObject* pattern; /* link to the regex (pattern) object */
 int pos, endpos; /* current target slice */
***************
*** 61,64 ****
--- 63,69 ----
 void* start; /* start of current slice */
 void* end; /* end of original string */
+ /* attributes for the match object */
+ PyObject* string;
+ int pos, endpos;
 /* character size */
 int charsize;
***************
*** 79,83 ****
 PyObject_HEAD
 PyObject* pattern;
- PyObject* string;
 SRE_STATE state;
 } ScannerObject;
--- 84,87 ----

AltStyle によって変換されたページ (->オリジナル) /