[Python-checkins] CVS: python/dist/src/Modules _sre.c,2.8,2.9 sre.h,2.7,2.8
Fredrik Lundh
python-dev@python.org
Thu, 29 Jun 2000 05:48:40 -0700
- Previous message: [Python-checkins] CVS: python/dist/src/Misc ACKS,1.57,1.58
- Next message: [Python-checkins] CVS: python/dist/src/Lib sre.py,1.10,1.11 sre_compile.py,1.8,1.9 sre_constants.py,1.8,1.9 sre_parse.py,1.8,1.9
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/python/python/dist/src/Modules
In directory slayer.i.sourceforge.net:/tmp/cvs-serv1507/Modules
Modified Files:
_sre.c sre.h
Log Message:
- renamed "tolower" hook (it happened to work with
my compiler, but not on guido's box...)
Index: _sre.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_sre.c,v
retrieving revision 2.8
retrieving revision 2.9
diff -C2 -r2.8 -r2.9
*** _sre.c 2000/06/29 12:38:45 2.8
--- _sre.c 2000/06/29 12:48:37 2.9
***************
*** 95,99 ****
24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 0, 0, 0, 0, 0 };
! static char sre_char_tolower[128] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
--- 95,99 ----
24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 0, 0, 0, 0, 0 };
! static char sre_char_lower[128] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
***************
*** 105,111 ****
120, 121, 122, 123, 124, 125, 126, 127 };
! static unsigned int sre_tolower(unsigned int ch)
{
! return ((ch) < 128 ? sre_char_tolower[ch] : ch);
}
--- 105,111 ----
120, 121, 122, 123, 124, 125, 126, 127 };
! static unsigned int sre_lower(unsigned int ch)
{
! return ((ch) < 128 ? sre_char_lower[ch] : ch);
}
***************
*** 123,127 ****
/* locale-specific character predicates */
! static unsigned int sre_tolower_locale(unsigned int ch)
{
return ((ch) < 256 ? tolower((ch)) : ch);
--- 123,127 ----
/* locale-specific character predicates */
! static unsigned int sre_lower_locale(unsigned int ch)
{
return ((ch) < 256 ? tolower((ch)) : ch);
***************
*** 136,140 ****
#if defined(HAVE_UNICODE)
! static unsigned int sre_tolower_unicode(unsigned int ch)
{
return (unsigned int) Py_UNICODE_TOLOWER((Py_UNICODE)(ch));
--- 136,140 ----
#if defined(HAVE_UNICODE)
! static unsigned int sre_lower_unicode(unsigned int ch)
{
return (unsigned int) Py_UNICODE_TOLOWER((Py_UNICODE)(ch));
***************
*** 498,502 ****
while (p < e) {
if (ptr >= end ||
! state->tolower(*ptr) != state->tolower(*p))
goto failure;
p++; ptr++;
--- 498,502 ----
while (p < e) {
if (ptr >= end ||
! state->lower(*ptr) != state->lower(*p))
goto failure;
p++; ptr++;
***************
*** 509,513 ****
TRACE(("%8d: literal lower(%c)\n", PTR(ptr), (SRE_CHAR) *pattern));
if (ptr >= end ||
! state->tolower(*ptr) != state->tolower(*pattern))
goto failure;
pattern++;
--- 509,513 ----
TRACE(("%8d: literal lower(%c)\n", PTR(ptr), (SRE_CHAR) *pattern));
if (ptr >= end ||
! state->lower(*ptr) != state->lower(*pattern))
goto failure;
pattern++;
***************
*** 519,523 ****
(SRE_CHAR) *pattern));
if (ptr >= end ||
! state->tolower(*ptr) == state->tolower(*pattern))
goto failure;
pattern++;
--- 519,523 ----
(SRE_CHAR) *pattern));
if (ptr >= end ||
! state->lower(*ptr) == state->lower(*pattern))
goto failure;
pattern++;
***************
*** 528,532 ****
TRACE(("%8d: set lower(%c)\n", PTR(ptr), *ptr));
if (ptr >= end
! || !SRE_MEMBER(pattern+1, (SRE_CHAR) state->tolower(*ptr)))
goto failure;
pattern += pattern[0];
--- 528,532 ----
TRACE(("%8d: set lower(%c)\n", PTR(ptr), *ptr));
if (ptr >= end
! || !SRE_MEMBER(pattern+1, (SRE_CHAR) state->lower(*ptr)))
goto failure;
pattern += pattern[0];
***************
*** 612,616 ****
SRE_CHAR chr = (SRE_CHAR) pattern[4];
while (count < (int) pattern[2]) {
! if (ptr >= end || (SRE_CHAR) state->tolower(*ptr) != chr)
break;
ptr++;
--- 612,616 ----
SRE_CHAR chr = (SRE_CHAR) pattern[4];
while (count < (int) pattern[2]) {
! if (ptr >= end || (SRE_CHAR) state->lower(*ptr) != chr)
break;
ptr++;
***************
*** 632,636 ****
SRE_CHAR chr = (SRE_CHAR) pattern[4];
while (count < (int) pattern[2]) {
! if (ptr >= end || (SRE_CHAR) state->tolower(*ptr) == chr)
break;
ptr++;
--- 632,636 ----
SRE_CHAR chr = (SRE_CHAR) pattern[4];
while (count < (int) pattern[2]) {
! if (ptr >= end || (SRE_CHAR) state->lower(*ptr) == chr)
break;
ptr++;
***************
*** 1002,1006 ****
static PyObject *
! sre_lower(PyObject* self, PyObject* args)
{
int character, flags;
--- 1002,1006 ----
static PyObject *
! sre_getlower(PyObject* self, PyObject* args)
{
int character, flags;
***************
*** 1008,1017 ****
return NULL;
if (flags & SRE_FLAG_LOCALE)
! return Py_BuildValue("i", sre_tolower_locale(character));
#if defined(HAVE_UNICODE)
if (flags & SRE_FLAG_UNICODE)
! return Py_BuildValue("i", sre_tolower_unicode(character));
#endif
! return Py_BuildValue("i", sre_tolower(character));
}
--- 1008,1017 ----
return NULL;
if (flags & SRE_FLAG_LOCALE)
! return Py_BuildValue("i", sre_lower_locale(character));
#if defined(HAVE_UNICODE)
if (flags & SRE_FLAG_UNICODE)
! return Py_BuildValue("i", sre_lower_unicode(character));
#endif
! return Py_BuildValue("i", sre_lower(character));
}
***************
*** 1083,1093 ****
if (pattern->flags & SRE_FLAG_LOCALE)
! state->tolower = sre_tolower_locale;
#if defined(HAVE_UNICODE)
else if (pattern->flags & SRE_FLAG_UNICODE)
! state->tolower = sre_tolower_unicode;
#endif
else
! state->tolower = sre_tolower;
return string;
--- 1083,1093 ----
if (pattern->flags & SRE_FLAG_LOCALE)
! state->lower = sre_lower_locale;
#if defined(HAVE_UNICODE)
else if (pattern->flags & SRE_FLAG_UNICODE)
! state->lower = sre_lower_unicode;
#endif
else
! state->lower = sre_lower;
return string;
***************
*** 1877,1881 ****
{"compile", _compile, 1},
{"getcodesize", sre_codesize, 1},
! {"getlower", sre_lower, 1},
{NULL, NULL}
};
--- 1877,1881 ----
{"compile", _compile, 1},
{"getcodesize", sre_codesize, 1},
! {"getlower", sre_getlower, 1},
{NULL, NULL}
};
Index: sre.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/sre.h,v
retrieving revision 2.7
retrieving revision 2.8
diff -C2 -r2.7 -r2.8
*** sre.h 2000/06/29 12:38:45 2.7
--- sre.h 2000/06/29 12:48:37 2.8
***************
*** 63,67 ****
int stackbase;
/* hooks */
! SRE_TOLOWER_HOOK tolower;
} SRE_STATE;
--- 63,67 ----
int stackbase;
/* hooks */
! SRE_TOLOWER_HOOK lower;
} SRE_STATE;
- Previous message: [Python-checkins] CVS: python/dist/src/Misc ACKS,1.57,1.58
- Next message: [Python-checkins] CVS: python/dist/src/Lib sre.py,1.10,1.11 sre_compile.py,1.8,1.9 sre_constants.py,1.8,1.9 sre_parse.py,1.8,1.9
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]