This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regexec.c: Most /iaa nodes are now pre-folded
So, we don't have to re-fold them.
Previous commits have caused any EXACTFAA nodes to be pre-folded, and we
now have the infrastructure in regexec.c to take advantage of this,
including in non-UTF-8 patterns. This commit changes to do this.
The only non-pre-folded EXACTFAA nodes are those that are not UTF-8, but
the target string is. The reason is that the MICRO SIGN folds to
something representable only in UTF-8, so if you have both non-UTF-8, it
effectively is folded, and if you have the pattern in UTF-8, it gets
folded to the proper character.
In order for non-UTF-8 /iaa nodes to always be fully folded, there would
need to be a separate node for ones that contain the MICRO SIGN, and
then only that one wouldn't be considered folded when the target is
UTF-8. I don't think it's worth it, as the only gain would be in
matching a non-UTF-8 /iaa node against a UTF-8 target string. I suspect
/iaa will be used mostly in non-UTF8 target strings. Comments have been
added to point this out in case someone thinks it should be implemented.