Mercurial > hg > octave-nkf > gnulib-hg
comparison regex.h @ 2344:6d1817aab7c9
Update the copyright.
(RE_SHY_GROUPS): New value.
(RE_UNMATCHED_RIGHT_PAREN_ORD): Renumber.
(RE_SYNTAX_EMACS): Add RE_SHY_GROUPS.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Wed, 08 Mar 2000 23:24:54 +0000 |
parents | 90fc17cfc883 |
children | d0b3c2f6b497 |
comparison
equal
deleted
inserted
replaced
2343:5bc9f02339fb | 2344:6d1817aab7c9 |
---|---|
1 /* Definitions for data structures and routines for the regular | 1 /* Definitions for data structures and routines for the regular |
2 expression library, version 0.12. | 2 expression library, version 0.12. |
3 | 3 |
4 Copyright (C) 1985, 89, 90, 91, 92, 93, 95 Free Software Foundation, Inc. | 4 Copyright (C) 1985,89,90,91,92,93,95,2000 Free Software Foundation, Inc. |
5 | 5 |
6 This program is free software; you can redistribute it and/or modify | 6 This program is free software; you can redistribute it and/or modify |
7 it under the terms of the GNU General Public License as published by | 7 it under the terms of the GNU General Public License as published by |
8 the Free Software Foundation; either version 2, or (at your option) | 8 the Free Software Foundation; either version 2, or (at your option) |
9 any later version. | 9 any later version. |
133 | 133 |
134 /* If this bit is set, succeed as soon as we match the whole pattern, | 134 /* If this bit is set, succeed as soon as we match the whole pattern, |
135 without further backtracking. */ | 135 without further backtracking. */ |
136 #define RE_NO_POSIX_BACKTRACKING (RE_NO_EMPTY_RANGES << 1) | 136 #define RE_NO_POSIX_BACKTRACKING (RE_NO_EMPTY_RANGES << 1) |
137 | 137 |
138 /* If this bit is set, then (?:...) is treated as a shy group. */ | |
139 #define RE_SHY_GROUPS (RE_NO_POSIX_BACKTRACKING << 1) | |
140 | |
138 /* If this bit is set, then an unmatched ) is ordinary. | 141 /* If this bit is set, then an unmatched ) is ordinary. |
139 If not set, then an unmatched ) is invalid. */ | 142 If not set, then an unmatched ) is invalid. */ |
140 #define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_POSIX_BACKTRACKING << 1) | 143 #define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_SHY_GROUPS << 1) |
141 | 144 |
142 /* This global variable defines the particular regexp syntax to use (for | 145 /* This global variable defines the particular regexp syntax to use (for |
143 some interfaces). When a regexp is compiled, the syntax used is | 146 some interfaces). When a regexp is compiled, the syntax used is |
144 stored in the pattern buffer, so changing this does not affect | 147 stored in the pattern buffer, so changing this does not affect |
145 already-compiled regexps. */ | 148 already-compiled regexps. */ |
154 | 157 |
155 /* Define combinations of the above bits for the standard possibilities. | 158 /* Define combinations of the above bits for the standard possibilities. |
156 (The [[[ comments delimit what gets put into the Texinfo file, so | 159 (The [[[ comments delimit what gets put into the Texinfo file, so |
157 don't delete them!) */ | 160 don't delete them!) */ |
158 /* [[[begin syntaxes]]] */ | 161 /* [[[begin syntaxes]]] */ |
159 #define RE_SYNTAX_EMACS (RE_CHAR_CLASSES | RE_INTERVALS) | 162 #define RE_SYNTAX_EMACS (RE_CHAR_CLASSES | RE_INTERVALS | RE_SHY_GROUPS) |
160 | 163 |
161 #define RE_SYNTAX_AWK \ | 164 #define RE_SYNTAX_AWK \ |
162 (RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \ | 165 (RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \ |
163 | RE_NO_BK_PARENS | RE_NO_BK_REFS \ | 166 | RE_NO_BK_PARENS | RE_NO_BK_REFS \ |
164 | RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \ | 167 | RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \ |
329 size_t re_nsub; | 332 size_t re_nsub; |
330 | 333 |
331 /* Zero if this pattern cannot match the empty string, one else. | 334 /* Zero if this pattern cannot match the empty string, one else. |
332 Well, in truth it's used only in `re_search_2', to see | 335 Well, in truth it's used only in `re_search_2', to see |
333 whether or not we should use the fastmap, so we don't set | 336 whether or not we should use the fastmap, so we don't set |
334 this absolutely perfectly; see `re_compile_fastmap' (the | 337 this absolutely perfectly; see `re_compile_fastmap'. */ |
335 `duplicate' case). */ | |
336 unsigned can_be_null : 1; | 338 unsigned can_be_null : 1; |
337 | 339 |
338 /* If REGS_UNALLOCATED, allocate space in the `regs' structure | 340 /* If REGS_UNALLOCATED, allocate space in the `regs' structure |
339 for `max (RE_NREGS, re_nsub + 1)' groups. | 341 for `max (RE_NREGS, re_nsub + 1)' groups. |
340 If REGS_REALLOCATE, reallocate space if necessary. | 342 If REGS_REALLOCATE, reallocate space if necessary. |