Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
Copyright (C) 1995 Sun Microsystems, Inc.
Copyright (C) 1995 Ben Wing.
+ Copyright (C) 1999,2000,2001 MORIOKA Tomohiko
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
when matching. If this number is exceeded, we allocate more
space, so it is not a hard limit. */
#ifndef INIT_FAILURE_ALLOC
-#define INIT_FAILURE_ALLOC 5
+#define INIT_FAILURE_ALLOC 20
#endif
/* Roughly the maximum number of failure points on the stack. Would be
#if defined (MATCH_MAY_ALLOCATE) || defined (REGEX_MALLOC)
/* 4400 was enough to cause a crash on Alpha OSF/1,
whose default stack limit is 2mb. */
-int re_max_failures = 20000;
+int re_max_failures = 40000;
#else
-int re_max_failures = 2000;
+int re_max_failures = 4000;
#endif
union fail_stack_elt
ranges entirely within the first 256 chars. */
if ((range_start >= 0x100 || range_end >= 0x100)
- && CHAR_LEADING_BYTE (range_start) !=
- CHAR_LEADING_BYTE (range_end))
+#ifdef UTF2000
+ && CHAR_CHARSET_ID (range_start) != CHAR_CHARSET_ID (range_end)
+#else
+ && CHAR_LEADING_BYTE (range_start) != CHAR_LEADING_BYTE (range_end)
+#endif
+ )
return REG_ERANGESPAN;
/* As advertised, translations only work over the 0 - 0x7F range.
#endif
matchsyntax:
#ifdef MULE
+#ifdef UTF2000
+ for (j = 0; j < 0x80; j++)
+ if (SYNTAX_UNSAFE
+ (XCHAR_TABLE
+ (regex_emacs_buffer->syntax_table), j) ==
+ (enum syntaxcode) k)
+ fastmap[j] = 1;
+#else
for (j = 0; j < 0x80; j++)
if (SYNTAX_UNSAFE
(XCHAR_TABLE
(regex_emacs_buffer->mirror_syntax_table), j) ==
(enum syntaxcode) k)
fastmap[j] = 1;
+#endif
for (j = 0x80; j < 0xA0; j++)
{
+#ifndef UTF2000
if (LEADING_BYTE_PREFIX_P(j))
/* too complicated to calculate this right */
fastmap[j] = 1;
else
{
+#endif
int multi_p;
Lisp_Object cset;
== Sword || multi_p)
fastmap[j] = 1;
}
+#ifndef UTF2000
}
+#endif
}
#else /* not MULE */
for (j = 0; j < (1 << BYTEWIDTH); j++)
#endif
matchnotsyntax:
#ifdef MULE
+#ifdef UTF2000
+ for (j = 0; j < 0x80; j++)
+ if (SYNTAX_UNSAFE
+ (XCHAR_TABLE
+ (regex_emacs_buffer->syntax_table), j) !=
+ (enum syntaxcode) k)
+ fastmap[j] = 1;
+#else
for (j = 0; j < 0x80; j++)
if (SYNTAX_UNSAFE
(XCHAR_TABLE
(regex_emacs_buffer->mirror_syntax_table), j) !=
(enum syntaxcode) k)
fastmap[j] = 1;
+#endif
for (j = 0x80; j < 0xA0; j++)
{
+#ifndef UTF2000
if (LEADING_BYTE_PREFIX_P(j))
/* too complicated to calculate this right */
fastmap[j] = 1;
else
{
+#endif
int multi_p;
Lisp_Object cset;
!= Sword || multi_p)
fastmap[j] = 1;
}
+#ifndef UTF2000
}
+#endif
}
#else /* not MULE */
for (j = 0; j < (1 << BYTEWIDTH); j++)
#define POS_AFTER_GAP_UNSAFE(d) ((d) == end1 ? string2 : (d))
/* Test if CH is a word-constituent character. (XEmacs change) */
+#ifdef UTF2000
+#define WORDCHAR_P_UNSAFE(ch) \
+ (SYNTAX_UNSAFE (XCHAR_TABLE (regex_emacs_buffer->syntax_table), \
+ ch) == Sword)
+#else
#define WORDCHAR_P_UNSAFE(ch) \
(SYNTAX_UNSAFE (XCHAR_TABLE (regex_emacs_buffer->mirror_syntax_table), \
ch) == Sword)
+#endif
/* Free everything we malloc. */
#ifdef MATCH_MAY_ALLOCATE
#endif
emch = charptr_emchar ((const Bufbyte *) d);
+#ifdef UTF2000
+ matches = (SYNTAX_FROM_CACHE (XCHAR_TABLE (regex_emacs_buffer->syntax_table),
+ emch) == (enum syntaxcode) mcnt);
+#else
matches = (SYNTAX_FROM_CACHE (XCHAR_TABLE (regex_emacs_buffer->mirror_syntax_table),
emch) == (enum syntaxcode) mcnt);
+#endif
INC_CHARPTR (d);
if (matches != should_succeed)
goto fail;