printf ("re_nsub: %zu\t", bufp->re_nsub);
printf ("regs_alloc: %d\t", bufp->regs_allocated);
printf ("can_be_null: %d\t", bufp->can_be_null);
- printf ("no_sub: %d\t", bufp->no_sub);
- printf ("not_bol: %d\t", bufp->not_bol);
- printf ("not_eol: %d\t", bufp->not_eol);
#ifndef emacs
printf ("syntax: %lx\n", bufp->syntax);
#endif
`used' is set to the length of the compiled pattern;
`fastmap_accurate' is zero;
`re_nsub' is the number of subexpressions in PATTERN;
- `not_bol' and `not_eol' are zero;
The `fastmap' field is neither examined nor set. */
/* Initialize the pattern buffer. */
bufp->fastmap_accurate = 0;
- bufp->not_bol = bufp->not_eol = 0;
bufp->used_syntax = 0;
/* Set `used' to zero, so that if we return an error, the pattern
at the end. */
bufp->used = 0;
- /* Always count groups, whether or not bufp->no_sub is set. */
bufp->re_nsub = 0;
if (bufp->allocated == 0)
and SIZE2, respectively). We start matching at POS, and stop
matching at STOP.
- If REGS is non-null and the `no_sub' field of BUFP is nonzero, we
- store offsets for the substring each group matched in REGS. See the
- documentation for exactly how many groups we fill.
+ If REGS is non-null, store offsets for the substring each group
+ matched in REGS.
We return -1 if no match, -2 if an internal error (such as the
failure stack overflowing). Otherwise, we return the length of the
DEBUG_PRINT ("Accepting match.\n");
/* If caller wants register contents data back, do it. */
- if (regs && !bufp->no_sub)
+ if (regs)
{
/* Have the register data arrays been allocated? */
if (bufp->regs_allocated == REGS_UNALLOCATED)
-1 at the end. */
for (reg = num_regs; reg < regs->num_regs; reg++)
regs->start[reg] = regs->end[reg] = -1;
- } /* regs && !bufp->no_sub */
+ }
DEBUG_PRINT ("%u failure points pushed, %u popped (%u remain).\n",
nfailure_points_pushed, nfailure_points_popped,
break;
- /* begline matches the empty string at the beginning of the string
- (unless `not_bol' is set in `bufp'), and after newlines. */
+ /* begline matches the empty string at the beginning of the string,
+ and after newlines. */
case begline:
DEBUG_PRINT ("EXECUTING begline.\n");
if (AT_STRINGS_BEG (d))
- {
- if (!bufp->not_bol) break;
- }
+ break;
else
{
unsigned c;
if (c == '\n')
break;
}
- /* In all other cases, we fail. */
goto fail;
DEBUG_PRINT ("EXECUTING endline.\n");
if (AT_STRINGS_END (d))
- {
- if (!bufp->not_eol) break;
- }
- else
- {
- PREFETCH_NOLIMIT ();
- if (*d == '\n')
- break;
- }
+ break;
+ PREFETCH_NOLIMIT ();
+ if (*d == '\n')
+ break;
goto fail;
(and at least one extra will be -1). */
bufp->regs_allocated = REGS_UNALLOCATED;
- /* And GNU code determines whether or not to get register information
- by passing null for the REGS argument to re_search, etc., not by
- setting no_sub. */
- bufp->no_sub = 0;
-
ret = regex_compile ((re_char *) pattern, length,
posix_backtracking,
whitespace_regexp,
\f
/* This data structure represents a compiled pattern. Before calling
the pattern compiler, the fields `buffer', `allocated', `fastmap',
- `translate', and `no_sub' can be set. After the pattern has been
+ and `translate' can be set. After the pattern has been
compiled, the `re_nsub' field is available. All other fields are
private to the regex routines. */
by `re_compile_fastmap' if it updates the fastmap. */
unsigned fastmap_accurate : 1;
- /* If set, `re_match_2' does not return information about
- subexpressions. */
- unsigned no_sub : 1;
-
- /* If set, a beginning-of-line anchor doesn't match at the
- beginning of the string. */
- unsigned not_bol : 1;
-
- /* Similarly for an end-of-line anchor. */
- unsigned not_eol : 1;
-
/* If true, the compilation of the pattern had to look up the syntax table,
so the compiled pattern is only valid for the current syntax table. */
unsigned used_syntax : 1;
compiled into BUFFER. Start searching at position START, for RANGE
characters. Return the starting position of the match, -1 for no
match, or -2 for an internal error. Also return register
- information in REGS (if REGS and BUFFER->no_sub are nonzero). */
+ information in REGS (if REGS is nonzero). */
extern ptrdiff_t re_search (struct re_pattern_buffer *buffer,
const char *string, size_t length,
ptrdiff_t start, ptrdiff_t range,