1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-02 08:22:22 +00:00
Commit Graph

108 Commits

Author SHA1 Message Date
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
Richard M. Stallman
01fadb4d84 [! emacs]: #undef REL_ALLOC. 1995-05-06 20:14:52 +00:00
Richard M. Stallman
d0b490f571 (union fail_stack_elt): New union.
(fail_stack_elt_t): Use that union.
(PUSH_PATTERN_OP, PUSH_FAILURE_POINTER, PUSH_FAILURE_INT)
(POP_FAILURE_POINTER, POP_FAILURE_INT): Corresponding changes.
(re_compile_fastmap): Corresponding changes.
(PUSH_FAILURE_ELT): New macro.
(FAIL_STACK_TOP): Macro deleted.
(WIDE_INT): Macro deleted.
(PUSH_FAILURE_POINT): Use PUSH_FAILURE_ELT.
(POP_FAILURE_ELT): New macro.
(POP_FAILURE_POINT): Use POP_FAILURE_ELT.
1995-05-02 16:27:24 +00:00
Richard M. Stallman
c823611d96 (PUSH_FAILURE_INT, POP_FAILURE_INT): Use WIDE_INT.
(WIDE_INT): Defined (two alternate definitions).

(C_ALLOCA): Undef it, if __GNUC__.

(REGEX_ALLOCATE_STACK, REGEX_REALLOCATE_STACK)
(REGEX_FREE_STACK): New macros.
(INIT_FAIL_STACK, DOUBLE_FAIL_STACK, FREE_VARIABLES): Use them.
(re_max_failures) [REL_ALLOC]: Alternative larger initial value.
(re_compile_fastmap): Use REGEX_FREE_STACK.
(re_match_2_internal): Always call FREE_VARIABLES before returning.
Always init regstart, old_regstart, etc. whenever MATCH_MAY_ALLOCATE
is defined.
(FREE_VARIABLES) [REL_ALLOC]: Define non-trivially.
1995-04-29 20:21:41 +00:00
Richard M. Stallman
85e36d2b62 (re_match_2_internal): Eliminate cast of ptr to int.
(PUSH_FAILURE_ITEM, POP_FAILURE_ITEM): Macros deleted.
(PUSH_FAILURE_INT, POP_FAILURE_INT): New macros.
(PUSH_FAILURE_POINTER, POP_FAILURE_POINTER): New macros.

(re_match_2_internal): Rename label `succeed' to `succeed_label'.
1995-04-09 19:14:40 +00:00
Jim Meyering
6c3fe73934 (SET_REGS_MATCHED): Enclose if-stmt in `do {...} while(0)'
instead of using trailing `else' -- otherwise, gcc -Wall complains
of `empty body in an else-statement'.
1995-02-28 13:46:40 +00:00
Karl Heuer
c1d4ff308d [!emacs] (SWITCH_ENUM_CAST): New macro, from emacs/lisp.h
(re_compile_fastmap, re_match_2_internal): Use that macro instead of testing
SWITCH_ENUM_BUG.
1995-01-18 20:47:36 +00:00
Richard M. Stallman
03414ea2b6 (regex_compile): Use putchar, not printchar. 1994-12-30 23:28:45 +00:00
Richard M. Stallman
eff52a4c6f (SET_REGS_MATCHED): Do nothing if set_regs_matched_done is 1.
Set set_regs_matched_done to 1.
(re_match_2_internal): New local var set_regs_matched_done.
Set it to 0 when appropriate.
(POP_FAILURE_POINT): Set set_regs_matched_done to 0.

(re_match_2_internal, case duplicate): Call SET_REGS_MATCHED.
1994-12-24 23:40:43 +00:00
Jim Meyering
b744df55d2 [REG_UNSET_VALUE]: Define to the address of a static variable rather than to
((char *) -1).  The latter got a warning on IRIX64.
1994-12-11 23:16:11 +00:00