41 |
struct regexp_cache |
struct regexp_cache |
42 |
{ |
{ |
43 |
struct regexp_cache *next; |
struct regexp_cache *next; |
44 |
Lisp_Object regexp; |
Lisp_Object regexp, whitespace_regexp; |
45 |
struct re_pattern_buffer buf; |
struct re_pattern_buffer buf; |
46 |
char fastmap[0400]; |
char fastmap[0400]; |
47 |
/* Nonzero means regexp was compiled to do full POSIX backtracking. */ |
/* Nonzero means regexp was compiled to do full POSIX backtracking. */ |
109 |
for this pattern. 0 means backtrack only enough to get a valid match. |
for this pattern. 0 means backtrack only enough to get a valid match. |
110 |
MULTIBYTE is nonzero if we want to handle multibyte characters in |
MULTIBYTE is nonzero if we want to handle multibyte characters in |
111 |
PATTERN. 0 means all multibyte characters are recognized just as |
PATTERN. 0 means all multibyte characters are recognized just as |
112 |
sequences of binary data. */ |
sequences of binary data. |
113 |
|
|
114 |
|
The behavior also depends on Vsearch_whitespace_regexp. */ |
115 |
|
|
116 |
static void |
static void |
117 |
compile_pattern_1 (cp, pattern, translate, regp, posix, multibyte) |
compile_pattern_1 (cp, pattern, translate, regp, posix, multibyte) |
162 |
cp->buf.translate = (! NILP (translate) ? translate : make_number (0)); |
cp->buf.translate = (! NILP (translate) ? translate : make_number (0)); |
163 |
cp->posix = posix; |
cp->posix = posix; |
164 |
cp->buf.multibyte = multibyte; |
cp->buf.multibyte = multibyte; |
165 |
|
cp->whitespace_regexp = Vsearch_whitespace_regexp; |
166 |
BLOCK_INPUT; |
BLOCK_INPUT; |
167 |
old = re_set_syntax (RE_SYNTAX_EMACS |
old = re_set_syntax (RE_SYNTAX_EMACS |
168 |
| (posix ? 0 : RE_NO_POSIX_BACKTRACKING)); |
| (posix ? 0 : RE_NO_POSIX_BACKTRACKING)); |
235 |
&& !NILP (Fstring_equal (cp->regexp, pattern)) |
&& !NILP (Fstring_equal (cp->regexp, pattern)) |
236 |
&& EQ (cp->buf.translate, (! NILP (translate) ? translate : make_number (0))) |
&& EQ (cp->buf.translate, (! NILP (translate) ? translate : make_number (0))) |
237 |
&& cp->posix == posix |
&& cp->posix == posix |
238 |
&& cp->buf.multibyte == multibyte) |
&& cp->buf.multibyte == multibyte |
239 |
|
&& !NILP (Fequal (cp->whitespace_regexp, Vsearch_whitespace_regexp))) |
240 |
break; |
break; |
241 |
|
|
242 |
/* If we're at the end of the cache, compile into the nil cell |
/* If we're at the end of the cache, compile into the nil cell |
2985 |
searchbufs[i].buf.buffer = (unsigned char *) xmalloc (100); |
searchbufs[i].buf.buffer = (unsigned char *) xmalloc (100); |
2986 |
searchbufs[i].buf.fastmap = searchbufs[i].fastmap; |
searchbufs[i].buf.fastmap = searchbufs[i].fastmap; |
2987 |
searchbufs[i].regexp = Qnil; |
searchbufs[i].regexp = Qnil; |
2988 |
|
searchbufs[i].whitespace_regexp = Qnil; |
2989 |
staticpro (&searchbufs[i].regexp); |
staticpro (&searchbufs[i].regexp); |
2990 |
searchbufs[i].next = (i == REGEXP_CACHE_SIZE-1 ? 0 : &searchbufs[i+1]); |
searchbufs[i].next = (i == REGEXP_CACHE_SIZE-1 ? 0 : &searchbufs[i+1]); |
2991 |
} |
} |