All zero-width operations need to be taken into account when reaching
`succeed` in `mutually_exclusive_one`!
* src/regex-emacs.c (forall_firstchar_1): Call `f` for all zero-width
matching operators.
(analyze_first_fastmap, analyze_first_null, mutually_exclusive_one):
Adjust accordingly.
else
switch (*p)
{
+ case no_op:
+ p++; continue;
+
/* Cases which stop the iteration. */
case succeed:
case exactn:
/* Cases which may match the empty string. */
case at_dot:
case begbuf:
- case no_op:
case wordbound:
case notwordbound:
case begline:
- p++;
- continue;
-
- /* Cases which may match the empty string and may
- tell us something about the next char. */
case endline:
case endbuf:
case wordbeg:
}
return true;
+ case at_dot:
+ case begbuf:
+ case wordbound:
+ case notwordbound:
+ case begline:
case endline:
case endbuf:
case wordbeg:
case notcategoryspec:
return true;
+ case at_dot:
+ case begbuf:
+ case wordbound:
+ case notwordbound:
+ case begline:
case endline:
case endbuf:
case wordbeg:
RETURN_CONSTRAIN (*data->p1 == syntaxspec
&& (data->p1[1] == Ssymbol || data->p1[1] == Sword));
+ case at_dot:
+ case begbuf:
+ case wordbound:
+ case notwordbound:
+ case begline:
+ RETURN_CONSTRAIN (false);
+
case duplicate:
/* At this point, we know nothing about what this can match, sadly. */
return false;