1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-27 15:52:00 -08:00
Commit graph

135 commits

Author SHA1 Message Date
Gerd Moellmann
d9e455fbec (POP_FAILURE_POINT): Use failure_id.integer
as arg to DEBUG_POP and DEBUG_PRINT.
1999-10-28 21:17:43 +00:00
Gerd Moellmann
7d0ff46626 (POP_FAILURE_POINT): Extract failure_id as an integer. 1999-10-25 12:31:55 +00:00
Dave Love
f71b19b645 1999-09-04 Richard M. Stallman <rms@gnu.org>
* regex.c [emacs] (ISALNUM, ISALPHA, ISPUNCT): Don't depend on locale
        [emacs] (ISASCII): Don't define ISASCII in this case.
        (IS_REAL_ASCII): New macro, 2 alternate definitions.
        (ISUNIBYTE): Likewise.
        [emacs] (ISDIGIT, ISCNTRL, ISXDIGIT, ISGRAPH, ISPRINT):
        Don't use ISASCII.

        * regex.c: Handle new class names `ascii', `nonascii',
        `unibyte, `multibyte'.
        (BIT_ASCII, BIT_NONASCII, BIT_UNIBYTE, BIT_MULTIBYTE): New macros.
        (IS_CHAR_CLASS): Accept new class names.
        (regex_compile, re_match_2_internal): Handle the new classes.
1999-10-06 18:25:22 +00:00
Richard M. Stallman
96cc36cc58 [emacs]: Handle character classes for multibyte chars:
(ISBLANK, ISGRAPH, ISPRINT, ISALNUM, ISALPHA, ISLOWER)
(ISPUNCT, ISSPACE, ISUPPER): New definitions for emacs only.
(ISWORD): New macro.
(re_opcode_t): Add 2 bytes of flag bits to charset and charset_not.
(CHARSET_RANGE_TABLE): Update definition.
(CHARSET_RANGE_TABLE_BITS): New macro.
(print_partial_compiled_pattern): Skip charset's range table.
(struct range_table_work_area): New field `bits'.
(SET_RANGE_TABLE_WORK_AREA_BIT): New macro.
(BIT_ALNUM, BIT_ALPHA, BIT_WORD, BIT_GRAPH, BIT_LOWER, BIT_PRINT)
(BIT_PUNCT, BIT_SPACE, BIT_UPPER): New macros.
(CLEAR_RANGE_TABLE_WORK_USED): Clear field `bits'.
(RANGE_TABLE_WORK_BITS): New macro.
(IS_CHAR_CLASS): Check for "word".
(regex_compile): Set the `bits' field for some character classes.
Handle the `word' class.  Store the `bits' field into the range table.
(re_compile_fastmap): Handle flag bits in range table.
(re_match_2_internal): For charset and charset_not,
handle flag bits in the range table.
1999-08-29 20:38:11 +00:00
Richard M. Stallman
27c3b45d28 (re_match_2_internal) [WINDOWSNT & emacs]: Insert QUIT at various places. 1999-01-19 03:24:03 +00:00
Richard M. Stallman
ba5c004d4b (re_compile_fastmap): Do something similar to the
previous change, for charset_not, wordchar, notwordchar,
categoryspec, notcategoryspec.
1998-12-30 20:44:39 +00:00
Karl Heuer
d18b62f211 (re_compile_fastmap): For anychar, set all fastmap
elements for all possible unibyte chars (except newline).
1998-12-10 03:09:12 +00:00
Karl Heuer
3583e969a4 (regex_compile): Handle translation of multibyte
exact-match characters.
1998-11-10 07:03:05 +00:00
Richard M. Stallman
2233624503 (regex_compile): Declare p with non-const type on AIX. 1998-07-25 06:40:50 +00:00
Richard M. Stallman
5135279640 (PTR_TO_OFFSET): Alternate definition if not `emacs'. 1998-06-09 20:12:44 +00:00
Richard M. Stallman
7e95234e31 (POS_AS_IN_BUFFER): Add 1 only if operating on a buffer.
(re_match_2, re_search_2): Adjust startpos or pos by 1
only if acting on a buffer.
nil for re_match_object means a buffer.
(re_match_2_internal <notwordbeg>): Assume POS1 is positive.
1998-06-06 21:59:21 +00:00
Richard M. Stallman
33c4693956 (re_search_2): Don't use ++ inside RE_TRANSLATE.
(re_match_2_internal): Likewise.
1998-05-25 20:14:54 +00:00
Richard M. Stallman
9d99031fcf (regex_compile): When checking after exactn
for a repetition operator, don't look beyond end of pattern arg.
1998-05-06 20:46:35 +00:00
Andreas Schwab
28ae27ae28 (re_search_2): Fix indentation. 1998-04-29 09:23:15 +00:00
Richard M. Stallman
7b140fd7c7 (re_search_2): Fix handling of at_dot.
Fix the way RANGE is set when handling begbuf.
1998-04-25 03:37:36 +00:00
Andreas Schwab
28703c16f3 Use RE_TRANSLATE_P to check whether translation is
needed.
1998-04-15 10:33:18 +00:00
Andreas Schwab
64e3c718c6 (realloc) <emacs>: Define to xrealloc. 1998-04-15 09:39:40 +00:00
Karl Heuer
cc9b4df2b4 (re_match_2, re_search_2): Convert position to a charpos,
before calling SETUP_SYNTAX_TABLE_FOR_OBJECT.
1998-04-12 06:57:47 +00:00
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