UV literal_endpoint = 0;
#endif
UV stored = 0; /* how many chars stored in the bitmap */
+ bool invert = FALSE; /* Is this class to be complemented */
regnode * const orig_emit = RExC_emit; /* Save the original RExC_emit in
case we need to change the emitted regop to an EXACT. */
if (UCHARAT(RExC_parse) == '^') { /* Complement of range. */
RExC_naughty++;
RExC_parse++;
- if (!SIZE_ONLY)
- ANYOF_FLAGS(ret) |= ANYOF_INVERT;
+ invert = TRUE;
/* We have decided to not allow multi-char folds in inverted character
* classes, due to the confusion that can happen, especially with
|| (prevvalue == '0' && value == '9')))
{
U8 op;
- bool invert = ANYOF_FLAGS(ret) & ANYOF_INVERT;
const char * cur_parse = RExC_parse;
if (has_special_charset_op) {
* optimize locale. Doing so perhaps could be done as long as there is
* nothing like \w in it; some thought also would have to be given to the
* interaction with above 0x100 chars */
- if ((ANYOF_FLAGS(ret) & ANYOF_INVERT)
+ if (invert
&& ! LOC
&& ! depends_list
&& ! unicode_alternate
}
/* Clear the invert flag since have just done it here */
- ANYOF_FLAGS(ret) &= ~ANYOF_INVERT;
+ invert = FALSE;
}
/* Here, <cp_list> contains all the code points we can determine at
}
}
+ if (invert) {
+ ANYOF_FLAGS(ret) |= ANYOF_INVERT;
+ }
+
/* Combine the two lists into one. */
if (depends_list) {
if (cp_list) {