regex.c


Log

Author Commit Date CI Message
Stefan Monnier 16816fd5 2000-10-30T15:20:17 (re_iswctype, re_wctype_to_bit): Fix braino. (regex_compile): Catch bogus \(\1\).
Stefan Monnier 5343a3e2 2000-10-27T13:29:36 (POP_FAILURE_REG_OR_COUNT, re_match_2_internal) (re_match_2_internal, re_match_2_internal, re_match_2_internal): Giving in to popular pressure to shut up the compiler with casts.
Stefan Monnier 7ae0247f 2000-10-26T00:45:01 More `unsigned char' -> `re_char' changes. Also change several `int' into `re_wchar_t'. (PATTERN_STACK_EMPTY, PUSH_PATTERN_OP, POP_PATTERN_OP): Remove. (PUSH_FAILURE_POINTER): Don't cast any more. (POP_FAILURE_REG_OR_COUNT): Remove the cast that strips `const'. We want GCC to complain, since this piece of code makes re_match non-reentrant, which *should* be fixed. (GET_BUFFER_SPACE): Use size_t rather than unsigned long. (EXTEND_BUFFER): Use RETALLOC. (SET_LIST_BIT): Don't cast. (re_wchar_t): New type. (re_iswctype, re_wctype_to_bit): Make it crystal clear to GCC that those two functions will always properly return. (IMMEDIATE_QUIT_CHECK): Cast to void. (analyse_first): Use recursion rather than an explicit stack. (re_compile_fastmap): Can't fail anymore. (re_search_2): Don't check re_compile_fastmap for failure. (PUSH_NUMBER): Renamed from PUSH_FAILURE_COUNT. Now also sets the new value (passed in a new argument). (re_match_2_internal): Use it. Also, use a new var `reg' of type size_t when looping through regs rather than reuse the inappropriate `mcnt'.
Andrew Innes 89892cc1 2000-10-24T14:00:55 (IMMEDIATE_QUIT_CHECK): New macro, which does QUIT on NT-Emacs only. (re_match_2_internal): Use IMMEDIATE_QUIT_CHECK instead of QUIT, so that re_search functions only quit when callers expect them to.
Kenichi Handa 4f606842 2000-10-24T08:27:34 (regex_compile): Fix previous change.
Kenichi Handa 4c90fe8b 2000-10-24T08:10:27 (regex_compile): Change the way of handling a range from a char less than 256 to a char not less than 256.
Jeff Bailey 92d64a23 2000-10-17T06:55:04 Remove warning that noone noticed anyway
Stefan Monnier 7bbb7f5d 2000-10-15T16:44:45 (WIDE_CHAR_SUPPORT): Define if _LIBC as well. Mostly, just a test of the CVS repository.
Jeff Bailey 0ee31d9c 2000-09-19T15:47:02 Add warning to top of source files
Stefan Monnier af496701 2000-09-04T04:24:00 (WIDE_CHAR_SUPPORT): New macro. (btowc, iswctype, wctype) [_LIBC]: Redefine to __<fun>. (BIT_ALPHA, BIT_ALNUM, BIT_ASCII, BIT_NONASCII, BIT_GRAPH, BIT_PRINT) (BIT_UNIBYTE): Remove. (re_match_2_internal): Delete corresponding code and streamline the BIT_MULTIBYTE case to not bother checking ISUNIBYTE. (CHAR_CLASS_MAX_LENGTH) [!WIDE_CHAR_SUPPORT]: Set to 9 rather than 6. (re_wctype_t): New type. (re_wctype, re_iswctype, re_wctype_to_bit): New functions. (regex_compile): Use them and fix handling of overly long char classes.
Stefan Monnier 0806807c 2000-08-31T17:19:13 * regex.h (RE_NO_NEWLINE_ANCHOR): New syntax flag. (struct re_pattern_buffer): Remove newline_anchor. * regex.c: Keep namespace clean for GNU libc by renaming <fun> to __<fun> and using `weak_alias (__<fun>, <fun>)'. (re_max_failures, fail_stack): Use size_t rather than unsigned. (regex_compile): For ^ and $, choose between buffer and line (beg|end) depending on the new RE_NO_NEWLINE_ANCHOR syntax flag. (print_compiled_pattern, re_search_2, mutually_exclusive_p) (re_match_2_internal, re_compile_pattern, re_comp, regcomp): Get rid of references to newline_anchor. (regcomp): Allocate and precompute a fastmap.
Stefan Monnier 7566b76a 2000-08-30T18:31:17 Merge some changes from GNU libc. Add prototypes. (bcopy, bcmp, REGEX_REALLOCATE, re_match_2_internal): Use memcmp and memcpy instead of bcopy and bcmp. (init_syntax_once): Use ISALNUM. (PUSH_FAILURE_POINT, re_match_2_internal): Remove failure_id. (REG_UNSET_VALUE): Remove. Use NULL instead. (REG_UNSET, re_match_2_internal): Use NULL. (SET_HIGH_BOUND, MOVE_BUFFER_POINTER, ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros. (EXTEND_BUFFER): Use them (to work with BOUNDED_POINTERS). (GET_UNSIGNED_NUMBER): Don't use ISDIGIT. (regex_compile): In handle_interval, return an error rather than try to unfetch the interval if we can't find the closing brace. Obey the RE_NO_GNU_OPS syntax bit. (TOLOWER): New macro. (regcomp): Use it. (regexec): Allocate regs.start and regs.end as one block.
Stefan Monnier ef7d99e1 2000-08-28T00:37:22 * regex.c: Indent cpp directives and remove parens after `defined'. (PTR_TO_OFFSET, POS_AS_IN_BUFFER): Move to a better place. (ISDIGIT, ISCNTRL, ISXDIGIT) [!emacs]: Remove duplicate definition. (regex_compile): Use RE_FRUGAL instead of RE_ALL_GREEDY. (re_compile_pattern): Use size_t for length. (init_syntax_once): Move to a better place. * regex.h: Merge changes from GNU libc. Indent cpp directives. (RE_FRUGAL): Replaces RE_ALL_GREEDY (inverted meaning).
Stefan Monnier d92c1d4b 2000-08-25T14:35:12 (PUSH_FAILURE_COUNT): New macro. (POP_FAILURE_REG_OR_COUNT): Renamed from POP_FAILURE_REG. Handle popping of a register's or a counter's data. (POP_FAILURE_POINT): Use the new name. (re_match_2_internal): Push counter data on the stack for succeed_n, jump_n and set_number_at and remove misleading dead code in succeed_n.
Kenichi Handa ef7682a4 2000-08-11T01:56:59 (regex_compile) <normal_char>: Pay attention to multibyteness. (analyse_first) <exactn>: Setup fastmap correctly for eight-bit-control characters.
Stefan Monnier 1d7122be 2000-06-20T16:48:05 (re_match, re_match_2): Protect calls to alloca (0). (re_comp): Cast gettext return value to avoid complaints when !HAVE_LIBINTL.
Kenichi Handa da455340 2000-06-10T08:04:33 (MAKE_CHAR) [!emacs]: Dummy macro for non-Emacs env. (regex_compile): Fix the code for handling the case of single byte char and multibyte char being mixed in a range within [...].
Stefan Monnier 9be66ab4 2000-05-30T02:58:58 (PREFETCH_NOLIMIT): New function. (re_match_2_internal): Use it and adjust the end_match_2 logic.
Stefan Monnier 768ec972 2000-05-25T16:30:40 (at_begline_loc_p): Also recognize the \\(?:^ case of an anchor at the beginning of a shy-group.
Stefan Monnier 6a4fc8be 2000-04-19T21:39:18 (re_match_2_internal): Don't shorten the strings anymore, instead define end_match(1|2) more carefully. Use GET_CHAR_BEFORE_2 for `begline'.
Stefan Monnier ecd70598 2000-04-02T23:56:45 * regex.c (PTR_TO_OFFSET) [!emacs]: Remove. (RE_MULTIBYTE_P, RE_STRING_CHAR_AND_LENGTH): New macros. (GET_CHAR_BEFORE_2): Moved from charset.h plus fixed minor bug when we are between str1 and str2. (MAX_MULTIBYTE_LENGTH, CHAR_STRING) [!emacs]: Provide trivial default. (PATFETCH): Use `TRANSLATE'. (PATFETCH_RAW): Fetch multibyte char if applicable. (PATUNFETCH): Remove. (regex_compile): Rely on PATFETCH to do most of the multibyte magic. When writing a char, write it directly into the pattern buffer rather than going needlessly through a temp char-array. (re_match_2_internal): Similarly, rely on RE_STRING_CHAR to do the multibyte magic and remove the useless `#ifdef emacs'. (bcmp_translate): Don't compare as multibyte chars when in a unibyte buffer. * regex.h (struct re_pattern_buffer): Make field `multibyte' conditional on `emacs'. * charset.h (GET_CHAR_BEFORE_2): Moved to regex.c.
Stefan Monnier 0be3fccc 2000-03-29T04:01:25 (analyse_first): New function obtained by ripping out most of re_compile_fastmap and generalizing it a little bit so that it can also just return whether a given (sub)pattern can match the empty string or not. (regex_compile): Use `analyse_first' to decide whether the loop-check needs to be done or not for *, +, *? and +? (the loop check is costly for non-greedy repetition). (re_compile_fastmap): Delegate the actual work to `analyse_first'.
Stefan Monnier 1570cc6b 2000-03-27T22:26:37 (REGEX_FREE_STACK, RESET_FAIL_STACK): Make them usable as an expression. (enum re_opcode_t): Update description of succeed_n. (PATFETCH): Always define. (regex_compile): Use lookahead rather than PATUNFETCH (for repetition operators, char classes, shy-groups and intervals). Optimize special cases of intervals so as to only use succeed_n and jump_n when really needed. (re_compile_fastmap): Simplify handling of jump_n and succeed_n now that we don't have to handle the special cases any more. Simplify on_failure_jump handling as well.
Stefan Monnier aeb359a7 2000-03-26T23:05:51 (enum re_opcode_t): New opcode on_failure_jump_nastyloop. (print_partial_compiled_pattern, re_compile_fastmap): Handle new opcode. (regex_compile): Use on_failure_jump_nastyloop for non-greedy loops. (re_match_2_internal): Add code for on_failure_jump_nastyloop when executing it as well as when popping it off the stack to find infinite loops in non-greedy repetition operators.
Stefan Monnier 4918e100 2000-03-23T04:36:14 (enum syntaxcode): Provide default for non-Emacs. (re_compile_fastmap, re_match_2_internal): Undo Dave's previous fix.
Dave Love 017e46a8 2000-03-22T14:25:38 (re_compile_fastmap, re_match_2_internal): Fix cast to re_opcode_t.
Stefan Monnier 27d8e5f0 2000-03-22T04:17:32 (CHAR_CHARSET, CHARSET_LEADING_CODE_BASE): Add default definitions for non-Emacs compilation. (enum re_opcode_t): Remove (not)wordchar and move (not)syntaxspec outside of `#ifdef emacs'. (print_partial_compiled_pattern): Update. (regex_compile): Use (not)syntaxspec(Sword) instead of (not)wordchar. (re_compile_fastmap): Merge handling of charset and charset_not (for emacs and non-emacs compilation as well). Similarly for (not)categoryspec and (not)syntaxspec. Don't use the fastmap when reaching `anychar' since the added complexity is not justified. (re_match_2_internal): Merge (not)wordchar (emacs and non-emacs) and (not)syntaxspec. Merge (not)categoryspec.
Stefan Monnier 7540e140 2000-03-19T23:22:06 (RE_STRING_CHAR): New macro. (GET_CHAR_AFER_2): Remove. (RE_TRANSLATE, RE_TRANSLATE_P): New macros moved from regex.h. (enum re_opcode_t): Remove on_failure_jump_exclusive. (print_partial_compiled_pattern, re_compile_fastmap) (re_match_2_internal): Remove on_failure_jump_exclusive. (regex_compile): Turn optimizable P+ loops into PP*, so that the optimization only need to work for * (ie. can use of_keep_string_jump). Remove the special case for .*\n since it is now covered by the general optimization. (re_search_2): Don't bother with `room'. (skip_one_char): New function. (skip_noops): Simplify since `memory' is not needed any more. (mutually_exclusive_p): Restructure slightly to use `switch' and add handling for "all" remaining cases. (re_match_2_internal): Change on_failure_jump_smart to use on_failure_keep_string_jump (and redirect the end-of-loop jump) rather than on_failure_jump_exclusive.
Stefan Monnier 5f5a55d6 2000-03-16T02:53:38 (re_match_2): Fix string shortening (to fit `stop') to make sure POINTER_TO_OFFSET gives the same value before and after PREFETCH. Use `dfail' to guarantee "atomic" matching. (PTR_TO_OFFSET): Use POINTER_TO_OFFSET. (debug): Now only active if > 0 rather than if != 0. (DEBUG_*): Update for the new meaning of `debug'. (print_partial_compiled_pattern): Add missing `succeed' case. Use CHARSET_* macros in the charset(_not) branch. Fix off-by-two bugs in `succeed_n', `jump_n' and `set_number_at'. (store_op1, store_op2, insert_op1, insert_op2) (at_begline_loc_p, at_endline_loc_p): Add prototype. (group_in_compile_stack): Move to after its arg's types are declared and add a prototype. (PATFETCH): Define in terms of PATFETCH_RAW. (GET_UNSIGNED_NUMBER): Add the usual `do { ... } while(0)' wrapper. (QUIT): Redefine as a nop except for NTemacs. (regex_compile): Handle intervals {,M} as if it was {0,M}. Fix indentation of the greedy-op and shy-group code. (at_(beg|end)line_loc_p): Fix argument's types. (re_compile_fastmap): Ifdef out failure_stack_ptr to shut up gcc. (re_search_2): Use POS_AS_IN_BUFFER. Simplify `room' computation. (MATCHING_IN_FIRST_STRING): Remove. (re_match_2): Use POS_AS_IN_BUFFER. Ifdef out failure_stack_ptr to shut up gcc. Use FIRST_STRING_P and POINTER_TO_OFFSET. Use QUIT unconditionally.
Stefan Monnier c0b1cf90 2000-03-14T00:27:57 * regex.c: Declare a new type `re_char' used throughout the code for the string char type. It's `const unsigned char' to match the rest of Emacs. Consistently make sure all pointers to strings use it and make sure all pointers into the pattern use `unsigned char'. (re_match_2_internal): Use `PREFETCH+STRING_CHAR' instead of GET_CHAR_AFTER_2. Also merge wordbound and notwordbound to reduce code duplication. * charset.h (GET_CHAR_AFTER_2): Remove. (GET_CHAR_BEFORE_2): Use unsigned chars, like everywhere else.
Stefan Monnier 9ff01e71 2000-03-08T23:25:41 This is a big redesign of failure-stack and register handling, prompted by bugs revealed when trying to add shy-groups. Overall, what happened is that loops are now structured a little differently, groups can be shy and the code is a little simpler. (enum re_opcode_t): Remove jump_past_alt, maybe_pop_jump, push_dummy_failure and dumy_failure_jump. Add on_failure_jump_(exclusive, loop and smart). Also fix the comment for (start|stop)_memory since they now only take one argument (the second has becomes unnecessary). (print_partial_compiled_pattern): Adjust for changes in re_opcode_t. (print_compiled_pattern): Use %ld to printf long ints and flush to make debugging a little easier. (union fail_stack_elt): Make the integer unsigned. (struct fail_stack_type): Add a `frame' element. (INIT_FAIL_STACK): Init `frame' as well. (POP_PATTERN_OP): New macro for re_compile_fastmap. (DEBUG_PUSH, DEBUG_POP): Remove. (NUM_REG_ITEMS): Remove. (NUM_NONREG_ITEMS): Adjust. (FAILURE_PAT, FAILURE_STR, NEXT_FAILURE_HANDLE, TOP_FAILURE_HANDLE): New macros for the cycle detection. (ENSURE_FAIL_STACK): New macro for PUSH_FAILURE_(REG|POINT). (PUSH_FAILURE_REG, POP_FAILURE_REG, CHECK_INFINITE_LOOP): New macros. (PUSH_FAILURE_POINT): Don't push registers any more. The pattern address pushed is not the destination of the jump but the source of it instead. (NUM_FAILURE_ITEMS): Remove. (POP_FAILURE_POINT): Adapt to the new stack structure (i.e. pop registers before the actual failure point). Don't hardcode any meaning for str==NULL anymore. (union register_info_type, REG_MATCH_NULL_STRING_P, IS_ACTIVE) (MATCHED_SOMETHING, EVER_MATCHED_SOMETHING, SET_REGS_MATCHED): Remove. (REG_UNSET_VALUE): Use NULL (why not?). (compile_range): Remove declaration since it doesn't exist. (struct compile_stack_elt_t): Remove inner_group_offset. (old_reg(start|end), reg_info, reg_dummy, reg_info_dummy): Remove. (regex_grow_registers): Remove dead code. (FIXUP_ALT_JUMP): New macro. (regex_compile): Add shy-groups Change loops to use on_failure_jump_smart&jump instead of on_failure_jump&maybe_pop_jump. Change + loops to eliminate the initial (dummy_failure_)jump. Remove c1_base (looks like unused variable to me). Use `jump' instead of `jump_past_alt' and don't bother with push_dummy_failure in alternatives since it is now unnecessary. Use FIXUP_ALT_JUMP. Eliminate a useless `#ifdef emacs' for (re)allocating the stack. (re_compile_fastmap): Remove dead variables i and num_regs. Exit from loop when bufp->can_be_null rather than jumping to `done'. Avoid jumping backwards so as to ensure termination. Use PATTERN_STACK_EMPTY and POP_PATTERN_OP. Improved handling of backreferences. Remove dead code in handling of `anychar'. (skip_noops, mutually_exclusive_p): New functions taken from the handling of `maybe_pop_jump' in re_match_2_internal. Slightly improve mutually_exclusive_p to handle ".+\n". ((lowest|highest)_active_reg, NO_(LOWEST|HIGHEST)_ACTIVE_REG) Remove. (re_match_2_internal): Use %p instead of 0x%x when printf'ing ptrs. Don't SET_REGS_MATCHED anymore. Remove many dead variables. Push register (in `start_memory') on the stack rather than storing it in old_reg(start|end). Remove the cycle detection from `stop_memory', replaced by the use of on_failure_jump_loop for greedy loops. Add code for the new on_failure_jump_<foo>. Remove ad-hoc code in `on_failure_jump' to push more registers in the case of a loop. Take out code from `maybe_pop_jump' into separate functions and adapt it to the semantics of `on_failure_jump_smart'. Remove jump_past_alt, dummy_failure_jump and push_dummy_failure. Remove dummy_failure handling and handling of `failures to jump to on_failure_jump' (this last one was already dead code, it seems). ((group|alt|common_op)_match_null_string_p): Remove.
Richard Stallman 33394ab9 2000-01-18T20:11:41 (re_compile_fastmap): While checking a range table for `charset', skip flag bits for a character class correctly.
Dave Love b8d882a7 1999-12-15T15:18:34 Copyright up-date.
Dave Love d6156acf 1999-12-15T15:15:29 1999-12-15 Kenichi Handa <handa@etl.go.jp> * regex.c (regex_compile): Adjusted for the change of CHAR_STRING. 1999-12-04 Stefan Monnier <monnier@cs.yale.edu> * regex.c (regex_compile): Recognize *?, +? and ?? as non-greedy operators and handle them properly. * regex.h (RE_ALL_GREEDY): New option. (RE_UNMATCHED_RIGHT_PAREN_ORD): Moved to the end where alphabetic sorting would put it. (RE_SYNTAX_AWK, RE_SYNTAX_GREP, RE_SYNTAX_EGREP) (_RE_SYNTAX_POSIX_COMMON): Use the new option to keep old behavior.
Gerd Moellmann 0c82451f 1999-10-28T21:16:22 (POP_FAILURE_POINT): Use failure_id.integer as arg to DEBUG_POP and DEBUG_PRINT.
Gerd Moellmann 0000c41d 1999-10-25T12:31:55 (POP_FAILURE_POINT): Extract failure_id as an integer.
Dave Love 23fe33a2 1999-10-06T18:25:22 1999-09-04 Richard 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.
Richard Stallman 7d4daee6 1999-08-29T20:38:11 [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.
Richard Stallman 34755e3a 1999-01-19T03:24:03 (re_match_2_internal) [WINDOWSNT & emacs]: Insert QUIT at various places.
Richard Stallman 139214a5 1998-12-30T20:44:39 (re_compile_fastmap): Do something similar to the previous change, for charset_not, wordchar, notwordchar, categoryspec, notcategoryspec.
Karl Heuer 2f425990 1998-12-10T03:09:12 (re_compile_fastmap): For anychar, set all fastmap elements for all possible unibyte chars (except newline).
Karl Heuer c62520bb 1998-11-10T07:03:05 (regex_compile): Handle translation of multibyte exact-match characters.
Richard Stallman 19668ec8 1998-07-25T06:40:50 (regex_compile): Declare p with non-const type on AIX.
Richard Stallman 47f34bb6 1998-06-09T20:12:44 (PTR_TO_OFFSET): Alternate definition if not `emacs'.
Richard Stallman f78b8d0d 1998-06-06T21:59:21 (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.
Richard Stallman f6fc39af 1998-05-25T20:14:54 (re_search_2): Don't use ++ inside RE_TRANSLATE. (re_match_2_internal): Likewise.
Richard Stallman 393454fb 1998-05-06T20:46:35 (regex_compile): When checking after exactn for a repetition operator, don't look beyond end of pattern arg.
Andreas Schwab 6f65addf 1998-04-29T09:23:15 (re_search_2): Fix indentation.
Richard Stallman a12e40eb 1998-04-25T03:37:36 (re_search_2): Fix handling of at_dot. Fix the way RANGE is set when handling begbuf.
Andreas Schwab 213afad1 1998-04-15T10:33:18 Use RE_TRANSLATE_P to check whether translation is needed.
Andreas Schwab 7a847ad3 1998-04-15T09:39:40 (realloc) <emacs>: Define to xrealloc.
Karl Heuer 64af85fe 1998-04-12T06:57:47 (re_match_2, re_search_2): Convert position to a charpos, before calling SETUP_SYNTAX_TABLE_FOR_OBJECT.
Karl Heuer 2d79084e 1998-04-07T04:07:58 (re_match_2) <anychar>: In unibyte case, set buf_ch as unsigned.
Richard Stallman 5e47a7f0 1998-04-07T03:21:46 (re_match_2_internal): Declare buf_ch unsigned int.
Richard Stallman f4b339a2 1998-04-04T00:00:06 (regex_compile) [!MATCH_MAY_ALLOCATE]: Fix paren error.
Richard Stallman 42f97e3f 1998-04-03T07:33:13 (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.
Richard Stallman 02c33167 1998-01-16T17:56:40 (re_match_2_internal): Use SYNTAX_TABLE_BYTE_TO_CHAR. (re_match_2_internal) <wordbeg, wordend>: Call UPDATE_SYNTAX_TABLE properly with a charpos.
Richard Stallman 7bb256f0 1998-01-09T23:24:24 (re_search_2): Fix call to CHAR_HEAD_P. (re_match_2_internal): Use PTR_BYTE_POS and PT_BYTE.
Karl Heuer 6362f299 1997-12-11T07:21:05 (GROW_FAIL_STACK): Fix test for stack size at max.
Karl Heuer fbbc28d1 1997-12-09T23:04:38 (GROW_FAIL_STACK): Fix previous change: update (fail_stack).size properly.
Karl Heuer 9a15e12b 1997-12-09T23:01:27 (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.
Richard Stallman f5edf8ad 1997-08-06T06:31:13 Whitespace change.
Richard Stallman dfa8d626 1997-07-04T20:46:22 (TRANSLATE, re_search_2, re_match_2_internal,bcmp_translate): Use RE_TRANSLATE instead of accessing translate array directly.
Richard Stallman 837c5301 1997-07-02T06:25:00 (re_search_2): Cast result of POS_ADDR_VSTRING.
Richard Stallman 3f8c9c6b 1997-06-15T19:43:01 Fix previous change.
Richard Stallman 2d876c4b 1997-06-15T19:05:59 Fix up whitespace.
Richard Stallman e074b658 1997-06-15T19:00:12 (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.
Richard Stallman c90c4710 1996-11-07T21:13:22 [emacs] (malloc, free): Define as xmalloc, and xfree.
Richard Stallman c38e8a15 1996-09-19T03:00:06 (regex_compile): Use TRANSLATE before calling SET_LIST_BIT.
Karl Heuer e09c3726 1996-09-01T19:02:26 (re_match_2_internal) [emacs]: Use PT, not point.
Richard Stallman 2f647319 1996-08-31T23:41:26 Clean up whitespace.
Richard Stallman 414709cd 1996-08-31T23:40:19 (re_search_2): Optimize regexp that starts with ^.
Richard Stallman 69897078 1996-08-31T22:29:12 (FREE_VAR): Clean up C syntax.
Richard Stallman 83ad3d8c 1996-08-09T10:44:37 (re_max_failures): Increase to 20000 again.
Roland McGrath 301bba0b 1996-07-09T09:10:39 [_LIBC] (re_comp, re_exec): Use `weak_function' keyword in defn instead of weak_symbol macro after.
Richard Stallman 93f802eb 1996-06-26T18:00:52 (re_max_failures): Reduce to 4000.
Richard Stallman 9fd34984 1996-06-02T21:33:01 (re_max_failures): Reduce to 8000.
Roland McGrath 0b53893b 1996-05-24T18:33:30 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.
Richard Stallman 49fb692d 1996-05-12T22:19:55 Delete the Emacs local variables spec.
Richard Stallman 23c946d6 1996-05-11T18:05:52 (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.
Richard Stallman 41bedd57 1996-04-12T22:57:28 (MAX_FAILURE_ITEMS): Use 5 instead of actual number of regs.
Karl Heuer df2594c7 1996-01-29T22:25:51 Update FSF address in comment.
Karl Heuer d8e9ddab 1995-12-13T02:52:23 (AT_WORD_BOUNDARY): Disable macro. (re_match_2_internal): Work around compiler bug.
Roland McGrath b15e81ad 1995-11-16T02:51:19 (gettext_noop): New macro, identity fn. (re_error_msgid): Mark strings with that, to ease message catalog creation.
Richard Stallman c26fc754 1995-11-11T20:51:37 (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.
Richard Stallman bacf0a7d 1995-10-29T19:36:39 (POP_FAILURE_POINT): Use .word.integer.
Richard Stallman 3bb6a39f 1995-10-22T17:47:13 Don't declare alloca.
Richard Stallman b28e3978 1995-10-19T00:50:51 (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'.
Richard Stallman 58d50470 1995-10-01T20:17:02 (re_search_2): Use 0, not -1, as the lower bound for the match position when we adjust RANGE.
Richard Stallman 38f1379d 1995-09-01T18:43:30 (re_search_2): If pattern starts with \=, optimize search.
Richard Stallman dcfe0405 1995-08-22T19:44:26 (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.
Karl Heuer f4a6f048 1995-07-17T23:24:57 Fix conditional.
Richard Stallman 2db486e1 1995-07-07T13:20:16 Don't use relocatable allocator.
Richard Stallman f5480e4a 1995-06-20T03:11:14 Use `defined' to test HAVE_STRING_H and STDC_HEADERS.
Karl Heuer 0424b458 1995-06-03T17:32:10 Undefined INHIBIT_STRING_HEADER when we have no other way of getting a bcopy and a bzero.
Karl Heuer 19a3ecee 1995-05-29T06:15:30 (at_endline_loc_p): Use 0, not NULL, in ?: for next_next.
Karl Heuer 4ab0903a 1995-05-26T22:35:10 (NULL): Use explicit cast.
Jim Meyering 03f2d7c0 1995-05-21T06:19:05 [REGEX_FREE]: Use ((void)0) instead of just (0).
Roland McGrath 72d7735e 1995-05-20T16:40:11 Add `#ifdef _LIBC' in a few places, so this can be compiled in libc.
Roland McGrath 024d33aa 1995-05-17T20:54:49 Updated from ../gpl2lgpl.sed /home/gd/gnu/lib/regex.c