1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-28 16:21:07 -08:00
Commit graph

117 commits

Author SHA1 Message Date
Karl Heuer
85bc1d4ea5 (re_match_2) <anychar>: In unibyte case, set buf_ch as unsigned. 1998-04-07 04:07:58 +00:00
Richard M. Stallman
e71b197157 (re_match_2_internal): Declare buf_ch unsigned int. 1998-04-07 03:21:46 +00:00
Richard M. Stallman
a26f4ccdd5 (regex_compile) [!MATCH_MAY_ALLOCATE]: Fix paren error. 1998-04-04 00:00:06 +00:00
Richard M. Stallman
e934739e62 (compile_range): Unused function deleted.
(regex_compile): Special handling for range \177-\377.
(regex_compile): Cast args to TRANSLATE to unsigned char.
(re_search_2): Fix forward scan handling multibyte.
Recognize that nonascii characters are not in the fastmap.
Handle fetching multibyte characters for backward scan,
(re_match_2_internal): Handle multibyte and translation
in exactn and anychar.
(bcmp_translate): Handle multibyte chars for translation.

(TRANSLATE): Don't cast to  unsigned char.

(PATFETCH): Use RE_TRANSLATE to translate.
1998-04-03 07:33:13 +00:00
Richard M. Stallman
92432794c1 (re_match_2_internal): Use SYNTAX_TABLE_BYTE_TO_CHAR.
(re_match_2_internal) <wordbeg, wordend>:
Call UPDATE_SYNTAX_TABLE properly with a charpos.
1998-01-16 17:56:40 +00:00
Richard M. Stallman
5d967c7a10 (re_search_2): Fix call to CHAR_HEAD_P.
(re_match_2_internal): Use PTR_BYTE_POS and PT_BYTE.
1998-01-09 23:24:24 +00:00
Karl Heuer
eead07d624 (GROW_FAIL_STACK): Fix test for stack size at max. 1997-12-11 07:21:05 +00:00
Karl Heuer
6453db4572 (GROW_FAIL_STACK): Fix previous change:
update (fail_stack).size properly.
1997-12-09 23:04:38 +00:00
Karl Heuer
320a2a7349 (TYPICAL_FAILURE_SIZE): Renamed from MAX_FAILURE_ITEMS.
Define it simply as a number.
(DOUBLE_FAIL_STACK, regex_compile): Set the limit at the size
TYPICAL_FAILURE_SIZE specifies, rather than at twice that much.
(re_max_failures): Double the initial values.
(INIT_FAIL_STACK): Use TYPICAL_FAILURE_SIZE so that INIT_FAILURE_ALLOC
counts in the proper units.
(INIT_FAILURE_ALLOC): Increase to 20.
(FAIL_STACK_GROWTH_FACTOR): New macro.
(GROW_FAIL_STACK): Renamed from DOUBLE_FAIL_STACK.
FAIL_STACK_GROWTH_FACTOR controls what ratio to increase size by.
1997-12-09 23:01:27 +00:00
Richard M. Stallman
657fcfbd41 Whitespace change. 1997-08-06 06:31:13 +00:00
Richard M. Stallman
bc192b5b1a (TRANSLATE, re_search_2, re_match_2_internal,bcmp_translate):
Use RE_TRANSLATE instead of accessing translate	array directly.
1997-07-04 20:46:22 +00:00
Richard M. Stallman
b560c39793 (re_search_2): Cast result of POS_ADDR_VSTRING. 1997-07-02 06:25:00 +00:00
Richard M. Stallman
00049484b8 Fix previous change. 1997-06-15 19:43:01 +00:00
Richard M. Stallman
25fe55afa6 Fix up whitespace. 1997-06-15 19:05:59 +00:00
Richard M. Stallman
b18215fce4 (PTR_TO_OFFSET): New macro.
(POS_AS_IN_BUFFER): New macro.
(SYNTAX_ENTRY_VIA_PROPERTY): Set to take `syntax-table' text
property into account when doing SYNTAX (c).
(re_compile_fastmap): disable fastmap if any of wordbound
notwordbound wordbeg wordend notsyntaxspec syntaxspec are seen.
(re_search_2): SETUP_SYNTAX_TABLE_FOR_OBJECT at the start.
(re_match_object): New variable.
(re_match_2): SETUP_SYNTAX_TABLE_FOR_OBJECT at the start.
(re_match_2_internal): For any of wordbound notwordbound wordbeg
wordend notsyntaxspec syntaxspec call UPDATE_SYNTAX_TABLE before
doing SYNTAX (c).


[emacs]: Include charset.h and category.h

[!emacs] (BASE_LEADING_CODE_P, WORD_BOUNDARY_P,	CHAR_HEAD_P,
SINGLE_BYTE_CHAR_P, SAME_CHARSET_P, MULTIBYTE_FORM_LENGTH,
STRING_CHAR_AND_LENGTH, GET_CHAR_AFTER_2, GET_CHAR_BEFORE_2):
New dummy macros.

(enum re_opcode_t): New member categoryspec and notcategoryspec.

(STORE_CHARACTER_AND_INCR, EXTRACT_CHARACTER,
CHARSET_LOOKUP_RANGE_TABLE_WITH_COUNT,
CHARSET_LOOKUP_RANGE_TABLE, CHARSET_BITMAP_SIZE,
CHARSET_RANGE_TABLE_EXISTS_P, CHARSET_RANGE_TABLE
CHARSET_PAST_RANGE_TABLE): New macros.

(TRANSLATE): Cast return value to unsigned char, not char.

(struct range_table_work_area): New structure.

(EXTEND_RANGE_TABLE_WORK_AREA, SET_RANGE_TABLE_WORK_AREA,
FREE_RANGE_TABLE_WORK_AREA, CLEAR_RANGE_TABLE_WORK_USED,
RANGE_TABLE_WORK_USED, RANGE_TABLE_WORK_ELT): New macros.

(FREE_STACK_RETURN): Call FREE_RANGE_TABLE_WORK_AREA.

(regex_compile): Declare `c' and `c1' as int to store multibyte characters.
Declare range_table_work and initialize	it.
Initialize bufp->multibyte to 0 if not emacs.
For case '[' and `default', code re-written to handle multibyte characters.
Add code for case 'c' and 'C' to handle category spec.

(re_compile_fastmap): New local variables k, simple_char_max,
and match_any_multibyte_characters.
Use macro CHARSET_BITMAP_SIZE.
Handle multibyte characters in cases charset, charset_not,
wordchar, notwordchar, anychar, syntaxspec, notsyntaxspec,
categoryspec, notcategoryspec.

(STOP_ADDR_VSTRING, POS_ADDR_VSTRING): New macros.

(re_search_2): Code re-written to handle multibyte characters.

(AT_WORD_BOUNDARY): Macro disabled.

(re_match_2_internal): New local variable multibyte.  `d' is
incremented while paying attention to multibyte characters if necessary.
For case charset, charsetnot, wordbound, notwordbound,
wordbeg, wordend, matchsyntax, and matchnotsyntax, code
re-written to handle multibyte characters.
Add code for case categoryspec and notcategoryspec.
Declare c, c1 as unsigned int, not unsigned char.
1997-06-15 19:00:12 +00:00
Richard M. Stallman
9abbd16515 [emacs] (malloc, free): Define as xmalloc, and xfree. 1996-11-07 21:13:22 +00:00
Richard M. Stallman
7ae6863365 (regex_compile): Use TRANSLATE before calling SET_LIST_BIT. 1996-09-19 03:00:06 +00:00
Karl Heuer
ae93ce928a (re_match_2_internal) [emacs]: Use PT, not point. 1996-09-01 19:02:26 +00:00
Richard M. Stallman
e318085a3a Clean up whitespace. 1996-08-31 23:41:26 +00:00
Richard M. Stallman
c8499ba5d8 (re_search_2): Optimize regexp that starts with ^. 1996-08-31 23:40:19 +00:00
Richard M. Stallman
590027f762 (FREE_VAR): Clean up C syntax. 1996-08-31 22:29:12 +00:00
Richard M. Stallman
6411ab239c (re_max_failures): Increase to 20000 again. 1996-08-09 10:44:37 +00:00
Roland McGrath
48afdd4400 [_LIBC] (re_comp, re_exec): Use `weak_function' keyword in defn instead of
weak_symbol macro after.
1996-07-09 09:10:39 +00:00
Richard M. Stallman
0f374b2b6c (re_max_failures): Reduce to 4000. 1996-06-26 18:00:52 +00:00
Richard M. Stallman
264d34bf38 (re_max_failures): Reduce to 8000. 1996-06-02 21:33:01 +00:00
Roland McGrath
0c085854ba Tue May 21 19:18:05 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* regex.c [_LIBC] (re_comp, re_exec): Define these, but weakly.
1996-05-24 18:33:30 +00:00
Richard M. Stallman
25a1fadb43 Delete the Emacs local variables spec. 1996-05-12 22:19:55 +00:00
Richard M. Stallman
12c11fcd42 (re_match_2_internal): Fix off-by-one error; don't use
length of exactn as character, and don't use length of bitmap of
charset as bitmap.
1996-05-11 18:05:52 +00:00
Richard M. Stallman
ffd76827b0 (MAX_FAILURE_ITEMS): Use 5 instead of actual number of regs. 1996-04-12 22:57:28 +00:00
Karl Heuer
ba4a8e51f9 Update FSF address in comment. 1996-01-29 22:30:55 +00:00
Karl Heuer
9121ca4020 (AT_WORD_BOUNDARY): Disable macro.
(re_match_2_internal): Work around compiler bug.
1995-12-13 02:52:23 +00:00
Roland McGrath
5e69f11ee5 (gettext_noop): New macro, identity fn.
(re_error_msgid): Mark strings with that, to ease message catalog creation.
1995-11-16 02:51:19 +00:00
Richard M. Stallman
68d96f02f3 (NUM_FAILURE_ITEMS, POP_FAILURE_POINT, PUSH_FAILURE_POINT):
Do not test for backtracking--do the same thing with or without.

(_GNU_SOURCE): Undef before defining.

(re_max_failures): Initialize to just 20000.
1995-11-11 20:51:37 +00:00
Richard M. Stallman
4fcecab107 (POP_FAILURE_POINT): Use .word.integer. 1995-10-29 19:36:39 +00:00
Richard M. Stallman
f3c4387ff0 Don't declare alloca. 1995-10-22 17:47:13 +00:00
Richard M. Stallman
6676cb1c6c (TRANSLATE, PATFETCH): Cast elt of `translate'.
Don't define if already defined.
(regex_compile): Use RE_TRANSLATE_TYPE for `translate'.
(compile_range, re_search_2, re_match_2_internal, bcmp_translate)
(regcomp): Use RE_TRANSLATE_TYPE for `translate'.
1995-10-19 00:50:51 +00:00
Richard M. Stallman
34597fa951 (re_search_2): Use 0, not -1, as the lower bound
for the match position when we adjust RANGE.
1995-10-01 20:17:02 +00:00
Richard M. Stallman
ae4788a82b (re_search_2): If pattern starts with \=, optimize search. 1995-09-01 18:43:30 +00:00
Richard M. Stallman
faec11dbd4 (PUSH_FAILURE_POINT, POP_FAILURE_POINT): Don't push or pop
register values if POSIX backtracking is turned off.
(NUM_FAILURE_ITEMS): Value is 0 if no POSIX backtracking.
1995-08-22 19:44:26 +00:00
Karl Heuer
33487cc80b Fix conditional. 1995-07-17 23:24:57 +00:00
Richard M. Stallman
4297555ed2 Don't use relocatable allocator. 1995-07-07 13:20:16 +00:00
Richard M. Stallman
7f998252d6 Use `defined' to test HAVE_STRING_H and STDC_HEADERS. 1995-06-20 03:11:14 +00:00
Karl Heuer
9e4ecb2619 Undefined INHIBIT_STRING_HEADER when we have no
other way of getting a bcopy and a bzero.
1995-06-03 17:32:10 +00:00
Karl Heuer
5bb5297112 (at_endline_loc_p): Use 0, not NULL, in ?: for next_next. 1995-05-29 06:15:30 +00:00
Karl Heuer
075f06eca3 (NULL): Use explicit cast. 1995-05-26 22:35:10 +00:00
Jim Meyering
c2e1680ae1 [REGEX_FREE]: Use ((void)0) instead of just (0). 1995-05-21 06:19:05 +00:00
Roland McGrath
fa9a63c5c2 Add `#ifdef _LIBC' in a few places, so this can be compiled in libc. 1995-05-20 16:40:11 +00:00
Roland McGrath
2860be63dd Updated from ../gpl2lgpl.sed /home/gd/gnu/lib/regex.c 1995-05-17 20:54:49 +00:00
Karl Heuer
809a2f57c2 (re_compile_fastmap): Undo previous change.
(RESET_FAIL_STACK): New macro.
(re_compile_fastmap): Use RESET_FAIL_STACK, not REGEX_FREE_STACK
directly.
1995-05-17 20:29:52 +00:00
Richard M. Stallman
4e9ffb56ab (re_compile_fastmap): Don't free stack if it's empty.
(re_match_failures): Reduce the larger value to 200000,
and use whenever if MATCH_MAY_ALLOCATE.
(MATCH_MAY_ALLOCATE): Don't consider REL_ALLOC when deciding
whether to undef this.
1995-05-15 23:30:28 +00:00