For non-locale, \d, etc are compiled in with their actual code points they
match, so the class portion of the synthetic start class node is
irrelevant, and should initialized to zero to avoid confusion. But for
locale it is highly relevant, and should be initialized to all ones, to
indicate matching anything.
PERL_ARGS_ASSERT_CL_ANYTHING;
ANYOF_BITMAP_SETALL(cl);
- ANYOF_CLASS_ZERO(cl); /* all bits set, so class is irrelevant */
cl->flags = ANYOF_CLASS|ANYOF_EOS|ANYOF_UNICODE_ALL
|ANYOF_LOC_NONBITMAP_FOLD|ANYOF_NON_UTF8_LATIN1_ALL;
* parts of it may not work properly, it is safest to avoid locale unless
* necessary. */
if (RExC_contains_locale) {
+ ANYOF_CLASS_SETALL(cl); /* /l uses class */
cl->flags |= ANYOF_LOCALE;
}
+ else {
+ ANYOF_CLASS_ZERO(cl); /* Only /l uses class now */
+ }
}
/* Can match anything (initialization) */