regcomp.c: Revise bracketed char class optimizations
This commit uses the inversion list instead of the bit map constructed
during compilation of [bracketed classes] for determining the
optimizations that are done at the very end of processing the class.
This provides optimizations for things that can't be seen by just
looking at the bitmap.
There are optimizations done earlier in the code for things
that can be easily caught in Pass 1, but now we have complete
information. At this time, I'm not repeating checking for most
optimizations that are checked for earlier, though this could be added.
The earlier optimizations could overlook cases where someone specified a
class in a suboptimal way. For example the earlier code looks for a
class with a single range [0-9], but those 10 code points could instead
have been specified via [
0123456789], and the code doesn't catch that
currently; here we could, but I'm not doing so at this time.
The code does do some duplicate checking. For example, some Unicode
properties match only a single code point, such as lb=cr, and these
aren't known at the earlier point where single code point classes are
checked for.