This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Allow more EXACTFish nodes to be trieable
authorKarl Williamson <khw@cpan.org>
Tue, 4 Dec 2018 16:58:13 +0000 (09:58 -0700)
committerKarl Williamson <khw@cpan.org>
Sat, 8 Dec 2018 04:12:16 +0000 (21:12 -0700)
commit8a100c918ec81926c0536594df8ee1fcccb171da
tree61553beb7d50f69a1c65e5295f7cf7fc079097cd
parent127a194773690138ef2e74691af748a925a2f47a
regcomp.c: Allow more EXACTFish nodes to be trieable

The previous two commits fixed bugs where it would be possible during
optimization to join two EXACTFish nodes together, and the result would
not work properly with LATIN SMALL LETTER SHARP S.  But by doing so,
the commits caused all non-UTF-8 EXACTFU nodes that begin or end with
[Ss] from being trieable.

This commit changes things so that the only the ones that are
non-trieable are the ones that, when joined, have the sequence [Ss][Ss]
in them.  To do so, I created three new node types that indicate if the
node begins with [Ss] or ends with them, or both.  These preclude having
to examine the node contents at joining to determine this.  And since
there are plenty of node types available, it seemed the best choice.
But other options would be available should we run out of nodes.
Examining the first and final characters of a node is not expensive, for
example.
pod/perldebguts.pod
regcomp.c
regcomp.sym
regnodes.h
t/porting/known_pod_issues.dat