#endif
+STATIC bool
+S__invlist_contains_cp(pTHX_ SV* const invlist, const UV cp)
+{
+ /* Does <invlist> contain code point <cp> as part of the set? */
+
+ IV index = invlist_search(invlist, cp);
+
+ PERL_ARGS_ASSERT__INVLIST_CONTAINS_CP;
+
+ return index >= 0 && ELEMENT_RANGE_MATCHES_INVLIST(index);
+}
+
PERL_STATIC_INLINE SV*
S_add_cp_to_invlist(pTHX_ SV* invlist, const UV cp) {
return _add_range_to_invlist(invlist, cp, cp);
n = 1;
}
if (!SIZE_ONLY) {
- SV** invlistsvp;
SV* invlist;
char* name;
if ( ! swash
|| ! SvROK(swash)
|| ! SvTYPE(SvRV(swash)) == SVt_PVHV
- || ! (invlistsvp =
- hv_fetchs(MUTABLE_HV(SvRV(swash)),
- "INVLIST", FALSE))
- || ! (invlist = *invlistsvp))
+ || ! (invlist = _get_swash_invlist(swash)))
{
if (swash) {
SvREFCNT_dec(swash);
invert = ! invert;
/* FALLTHROUGH */
case ANYOF_HORIZWS:
+ is_horizws:
op = (invert) ? NHORIZWS : HORIZWS;
break;
case ANYOF_MAX:
break;
+ case ANYOF_NBLANK:
+ invert = ! invert;
+ /* FALLTHROUGH */
+ case ANYOF_BLANK:
+ if (AT_LEAST_UNI_SEMANTICS && ! AT_LEAST_ASCII_RESTRICTED) {
+ goto is_horizws;
+ }
+ /* FALLTHROUGH */
default:
/* A generic posix class. All the /a ones can be handled
* by the POSIXA opcode. And all are closed under folding
if (! PL_utf8_foldable) {
SV* swash = swash_init("utf8", "_Perl_Any_Folds",
&PL_sv_undef, 1, 0);
- PL_utf8_foldable = _swash_to_invlist(swash);
+ PL_utf8_foldable = _get_swash_invlist(swash);
SvREFCNT_dec(swash);
}
* fold the classes (folding of those is automatically handled by the swash
* fetching code) */
if (posixes) {
- if (AT_LEAST_UNI_SEMANTICS) {
+ if (! DEPENDS_SEMANTICS) {
if (cp_list) {
_invlist_union(cp_list, posixes, &cp_list);
SvREFCNT_dec(posixes);
}
}
else {
-
/* Under /d, we put into a separate list the Latin1 things that
* match only when the target string is utf8 */
SV* nonascii_but_latin1_properties = NULL;