Commit 004c1e1d authored by Guido van Rossum's avatar Guido van Rossum

Latest from Jeffrey Ollie.

Infinite failure stack, some bugs fixed (fastmap, star_jump, register bug).
parent 1681429b
This diff is collapsed.
...@@ -69,9 +69,7 @@ typedef struct re_registers ...@@ -69,9 +69,7 @@ typedef struct re_registers
#define re_set_syntax _Py_re_set_syntax #define re_set_syntax _Py_re_set_syntax
#define re_compile_pattern _Py_re_compile_pattern #define re_compile_pattern _Py_re_compile_pattern
#define re_match _Py_re_match #define re_match _Py_re_match
#define re_match_2 _Py_re_match_2
#define re_search _Py_re_search #define re_search _Py_re_search
#define re_search_2 _Py_re_search_2
#define re_compile_fastmap _Py_re_compile_fastmap #define re_compile_fastmap _Py_re_compile_fastmap
#define re_comp _Py_re_comp #define re_comp _Py_re_comp
#define re_exec _Py_re_exec #define re_exec _Py_re_exec
...@@ -96,20 +94,12 @@ char *re_compile_pattern(char *regex, int regex_size, regexp_t compiled); ...@@ -96,20 +94,12 @@ char *re_compile_pattern(char *regex, int regex_size, regexp_t compiled);
translation table, or NULL if it is not used. */ translation table, or NULL if it is not used. */
int re_match(regexp_t compiled, char *string, int size, int pos, int re_match(regexp_t compiled, char *string, int size, int pos,
regexp_registers_t regs); regexp_registers_t old_regs);
/* This tries to match the regexp against the string. This returns the /* This tries to match the regexp against the string. This returns the
length of the matched portion, or -1 if the pattern could not be length of the matched portion, or -1 if the pattern could not be
matched and -2 if an error (such as failure stack overflow) is matched and -2 if an error (such as failure stack overflow) is
encountered. */ encountered. */
int re_match_2(regexp_t compiled, char *string1, int size1,
char *string2, int size2, int pos, regexp_registers_t regs,
int mstop);
/* This tries to match the regexp to the concatenation of string1 and
string2. This returns the length of the matched portion, or -1 if the
pattern could not be matched and -2 if an error (such as failure stack
overflow) is encountered. */
int re_search(regexp_t compiled, char *string, int size, int startpos, int re_search(regexp_t compiled, char *string, int size, int startpos,
int range, regexp_registers_t regs); int range, regexp_registers_t regs);
/* This rearches for a substring matching the regexp. This returns the first /* This rearches for a substring matching the regexp. This returns the first
...@@ -119,12 +109,6 @@ int re_search(regexp_t compiled, char *string, int size, int startpos, ...@@ -119,12 +109,6 @@ int re_search(regexp_t compiled, char *string, int size, int startpos,
which a match must not go. This returns -1 if no match is found, and which a match must not go. This returns -1 if no match is found, and
-2 if an error (such as failure stack overflow) is encountered. */ -2 if an error (such as failure stack overflow) is encountered. */
int re_search_2(regexp_t compiled, char *string1, int size1,
char *string2, int size2, int startpos, int range,
regexp_registers_t regs, int mstop);
/* This is like re_search, but search from the concatenation of string1 and
string2. */
void re_compile_fastmap(regexp_t compiled); void re_compile_fastmap(regexp_t compiled);
/* This computes the fastmap for the regexp. For this to have any effect, /* This computes the fastmap for the regexp. For this to have any effect,
the calling program must have initialized the fastmap field to point the calling program must have initialized the fastmap field to point
...@@ -146,9 +130,7 @@ extern int re_syntax; ...@@ -146,9 +130,7 @@ extern int re_syntax;
int re_set_syntax(); int re_set_syntax();
char *re_compile_pattern(); char *re_compile_pattern();
int re_match(); int re_match();
int re_match_2();
int re_search(); int re_search();
int re_search_2();
void re_compile_fastmap(); void re_compile_fastmap();
char *re_comp(); char *re_comp();
int re_exec(); int re_exec();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment