Revamp qr/[...]/ optimizations
authorKarl Williamson <khw@cpan.org>
Wed, 26 Dec 2018 05:56:48 +0000 (22:56 -0700)
committerKarl Williamson <khw@cpan.org>
Wed, 26 Dec 2018 19:50:38 +0000 (12:50 -0700)
commitb2296192536090829ba6d2cb367456f4e346dcc6
treedc44a3f320b048d1cc3d6950b4e4fd0df15e9e3d
parent317a726d5977fc277a50871ea89e79ce9da36bed
Revamp qr/[...]/ optimizations

This commit extensively changes the optimizations for ANYOF regnodes
that represent bracketed character classes.

The removal of the regex compilation pass now makes these feasible and
desirable.  Compilation now tries hard to optimize an ANYOF node into
something smaller and/or faster when feasible.

Now, qr/[X]/ for any single character or POSIX class X, and any
modifiers like /d, /i, etc, should be the same as qr/X/ for the same
modifiers, unless it would require the pattern to be upgraded from
non-UTF-8 to UTF-8, unless not doing so could introduce bugs.

These changes fix some issues with multi-character /i folding.
regcomp.c
t/re/anyof.t
t/re/re_tests
t/uni/fold.t