}
re_match_object = Qnil;
-
+
i = re_match_2 (bufp, (char *) p1, s1, (char *) p2, s2,
PT_BYTE - BEGV_BYTE, &search_regs,
ZV_BYTE - BEGV_BYTE);
immediate_quit = 0;
-
+
if (i == -2)
matcher_overflow ();
STRING_MULTIBYTE (string));
immediate_quit = 1;
re_match_object = string;
-
+
val = re_search (bufp, (char *) SDATA (string),
SBYTES (string), pos_byte,
SBYTES (string) - pos_byte,
0, STRING_MULTIBYTE (string));
immediate_quit = 1;
re_match_object = string;
-
+
val = re_search (bufp, (char *) SDATA (string),
SBYTES (string), 0,
SBYTES (string), 0);
int allow_quit;
{
struct region_cache *newline_cache;
- int direction;
+ int direction;
if (count > 0)
{
ceiling_byte = min (tem, ceiling_byte);
{
- /* The termination address of the dumb loop. */
+ /* The termination address of the dumb loop. */
register unsigned char *ceiling_addr
= BYTE_POS_ADDR (ceiling_byte) + 1;
register unsigned char *cursor
if (shortage == 0)
pos--;
-
+
return pos;
}
\f
s2 = 0;
}
re_match_object = Qnil;
-
+
while (n < 0)
{
int val;
int infinity, limit, stride_for_teases = 0;
register int *BM_tab;
int *BM_tab_base;
- register unsigned char *cursor, *p_limit;
+ register unsigned char *cursor, *p_limit;
register int i, j;
unsigned char *pat, *pat_end;
int multibyte = ! NILP (current_buffer->enable_multibyte_characters);
/* a single test, a test for having gone past the end of the */
/* permissible match region, to test for both possible matches (when */
/* the stride goes past the end immediately) and failure to */
- /* match (where you get nudged past the end one stride at a time). */
+ /* match (where you get nudged past the end one stride at a time). */
/* Here we make a "mickey mouse" BM table. The stride of the search */
/* is determined only by the last character of the putative match. */
/* If that character does not match, we will stride the proper */
/* distance to propose a match that superimposes it on the last */
/* instance of a character that matches it (per trt), or misses */
- /* it entirely if there is none. */
+ /* it entirely if there is none. */
dirlen = len_byte * direction;
infinity = dirlen - (lim_byte + pos_byte + len_byte + len_byte) * direction;
BM_tab[j] = dirlen - i;
/* A translation table is accompanied by its inverse -- see */
- /* comment following downcase_table for details */
+ /* comment following downcase_table for details */
if (this_translated)
{
int starting_ch = ch;
/* This loop can be coded for space rather than */
/* speed because it will usually run only once. */
/* (the reach is at most len + 21, and typically */
- /* does not exceed len) */
+ /* does not exceed len) */
while ((limit - pos_byte) * direction >= 0)
pos_byte += BM_tab[FETCH_BYTE (pos_byte)];
/* now run the same tests to distinguish going off the */
for (i = 0, i_byte = 0; i < len; )
{
int c;
-
+
FETCH_STRING_CHAR_ADVANCE (c, string, i, i_byte);
if (SYNTAX (c) != Sword)
{
int c;
int i_byte_orig = i_byte;
-
+
FETCH_STRING_CHAR_ADVANCE (c, string, i, i_byte);
if (SYNTAX (c) == Sword)
if (c == '\\')
{
FETCH_STRING_CHAR_ADVANCE (c, newtext, pos, pos_byte);
-
+
if (c == '&')
{
substart = search_regs.start[sub];
/* Now move point "officially" to the start of the inserted replacement. */
move_if_not_intangible (newpoint);
-
+
return Qnil;
}
\f
Lisp_Object subexp;
{
return match_limit (subexp, 0);
-}
+}
DEFUN ("match-data", Fmatch_data, Smatch_data, 0, 2, 0,
doc: /* Return a list containing all info on what the last search matched.
last_thing_searched);
data[2 * i + 1] = Fmake_marker ();
Fset_marker (data[2 * i + 1],
- make_number (search_regs.end[i]),
+ make_number (search_regs.end[i]),
last_thing_searched);
}
else
if (!CONSP (list) && !NILP (list))
list = wrong_type_argument (Qconsp, list);
- /* Unless we find a marker with a buffer in LIST, assume that this
+ /* Unless we find a marker with a buffer in LIST, assume that this
match data came from a string. */
last_thing_searched = Qt;
list = Fcdr (list);
}
- return Qnil;
+ return Qnil;
}
/* If non-zero the match data have been saved in saved_search_regs
in = SDATA (string);
end = in + SBYTES (string);
- out = temp;
+ out = temp;
for (; in != end; in++)
{
out - temp,
STRING_MULTIBYTE (string));
}
-\f
+\f
void
syms_of_search ()
{