aboutsummaryrefslogtreecommitdiffstats
path: root/src/regex.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Copyright up-date.Dave Love1999-12-151-1/+1
|
* 1999-12-15 Kenichi Handa <handa@etl.go.jp>Dave Love1999-12-151-5/+46
| | | | | | | | | | | | | | * 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.
* (POP_FAILURE_POINT): Use failure_id.integerGerd Moellmann1999-10-281-1/+1
| | | | as arg to DEBUG_POP and DEBUG_PRINT.
* (POP_FAILURE_POINT): Extract failure_id as an integer.Gerd Moellmann1999-10-251-1/+1
|
* 1999-09-04 Richard M. Stallman <rms@gnu.org>Dave Love1999-10-061-34/+83
| | | | | | | | | | | | | | | * 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.
* [emacs]: Handle character classes for multibyte chars:Richard M. Stallman1999-08-291-35/+201
| | | | | | | | | | | | | | | | | | | | | | (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.
* (re_match_2_internal) [WINDOWSNT & emacs]: Insert QUIT at various places.Richard M. Stallman1999-01-191-0/+13
|
* (re_compile_fastmap): Do something similar to theRichard M. Stallman1998-12-301-7/+13
| | | | | previous change, for charset_not, wordchar, notwordchar, categoryspec, notcategoryspec.
* (re_compile_fastmap): For anychar, set all fastmapKarl Heuer1998-12-101-13/+5
| | | | elements for all possible unibyte chars (except newline).
* (regex_compile): Handle translation of multibyteKarl Heuer1998-11-101-9/+20
| | | | exact-match characters.
* (regex_compile): Declare p with non-const type on AIX.Richard M. Stallman1998-07-251-0/+5
|
* (PTR_TO_OFFSET): Alternate definition if not `emacs'.Richard M. Stallman1998-06-091-0/+4
|
* (POS_AS_IN_BUFFER): Add 1 only if operating on a buffer.Richard M. Stallman1998-06-061-5/+6
| | | | | | | (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.
* (re_search_2): Don't use ++ inside RE_TRANSLATE.Richard M. Stallman1998-05-251-5/+12
| | | | (re_match_2_internal): Likewise.
* (regex_compile): When checking after exactnRichard M. Stallman1998-05-061-6/+6
| | | | for a repetition operator, don't look beyond end of pattern arg.
* (re_search_2): Fix indentation.Andreas Schwab1998-04-291-2/+2
|
* (re_search_2): Fix handling of at_dot.Richard M. Stallman1998-04-251-4/+4
| | | | Fix the way RANGE is set when handling begbuf.
* Use RE_TRANSLATE_P to check whether translation isAndreas Schwab1998-04-151-7/+8
| | | | needed.
* (realloc) <emacs>: Define to xrealloc.Andreas Schwab1998-04-151-0/+1
|
* (re_match_2, re_search_2): Convert position to a charpos,Karl Heuer1998-04-121-8/+12
| | | | before calling SETUP_SYNTAX_TABLE_FOR_OBJECT.
* (re_match_2) <anychar>: In unibyte case, set buf_ch as unsigned.Karl Heuer1998-04-071-1/+1
|
* (re_match_2_internal): Declare buf_ch unsigned int.Richard M. Stallman1998-04-071-2/+2
|
* (regex_compile) [!MATCH_MAY_ALLOCATE]: Fix paren error.Richard M. Stallman1998-04-041-1/+1
|
* (compile_range): Unused function deleted.Richard M. Stallman1998-04-031-97/+133
| | | | | | | | | | | | | | | (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.
* (re_match_2_internal): Use SYNTAX_TABLE_BYTE_TO_CHAR.Richard M. Stallman1998-01-161-8/+8
| | | | | (re_match_2_internal) <wordbeg, wordend>: Call UPDATE_SYNTAX_TABLE properly with a charpos.
* (re_search_2): Fix call to CHAR_HEAD_P.Richard M. Stallman1998-01-091-11/+26
| | | | (re_match_2_internal): Use PTR_BYTE_POS and PT_BYTE.
* (GROW_FAIL_STACK): Fix test for stack size at max.Karl Heuer1997-12-111-1/+2
|
* (GROW_FAIL_STACK): Fix previous change:Karl Heuer1997-12-091-3/+5
| | | | update (fail_stack).size properly.
* (TYPICAL_FAILURE_SIZE): Renamed from MAX_FAILURE_ITEMS.Karl Heuer1997-12-091-28/+42
| | | | | | | | | | | | | 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.
* Whitespace change.Richard M. Stallman1997-08-061-6/+7
|
* (TRANSLATE, re_search_2, re_match_2_internal,bcmp_translate):Richard M. Stallman1997-07-041-4/+5
| | | | Use RE_TRANSLATE instead of accessing translate array directly.
* (re_search_2): Cast result of POS_ADDR_VSTRING.Richard M. Stallman1997-07-021-6/+9
|
* Fix previous change.Richard M. Stallman1997-06-151-1/+1
|
* Fix up whitespace.Richard M. Stallman1997-06-151-1686/+1686
|
* (PTR_TO_OFFSET): New macro.Richard M. Stallman1997-06-151-1951/+2687
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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.
* [emacs] (malloc, free): Define as xmalloc, and xfree.Richard M. Stallman1996-11-071-0/+3
|
* (regex_compile): Use TRANSLATE before calling SET_LIST_BIT.Richard M. Stallman1996-09-191-3/+4
|
* (re_match_2_internal) [emacs]: Use PT, not point.Karl Heuer1996-09-011-3/+3
|
* Clean up whitespace.Richard M. Stallman1996-08-311-1914/+1913
|
* (re_search_2): Optimize regexp that starts with ^.Richard M. Stallman1996-08-311-1/+19
|
* (FREE_VAR): Clean up C syntax.Richard M. Stallman1996-08-311-1/+1
|
* (re_max_failures): Increase to 20000 again.Richard M. Stallman1996-08-091-1/+1
|
* [_LIBC] (re_comp, re_exec): Use `weak_function' keyword in defn instead ofRoland McGrath1996-07-091-9/+9
| | | | weak_symbol macro after.
* (re_max_failures): Reduce to 4000.Richard M. Stallman1996-06-261-2/+2
|
* (re_max_failures): Reduce to 8000.Richard M. Stallman1996-06-021-1/+3
|
* Tue May 21 19:18:05 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>Roland McGrath1996-05-241-2/+11
| | | | * regex.c [_LIBC] (re_comp, re_exec): Define these, but weakly.
* Delete the Emacs local variables spec.Richard M. Stallman1996-05-121-8/+0
|
* (re_match_2_internal): Fix off-by-one error; don't useRichard M. Stallman1996-05-111-3/+3
| | | | | length of exactn as character, and don't use length of bitmap of charset as bitmap.
* (MAX_FAILURE_ITEMS): Use 5 instead of actual number of regs.Richard M. Stallman1996-04-121-2/+5
|
* Update FSF address in comment.Karl Heuer1996-01-291-1/+2
|