This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
unicode_constants.pl: Refactor to catch more paired delims
authorKarl Williamson <khw@cpan.org>
Thu, 17 Mar 2022 01:11:08 +0000 (19:11 -0600)
committerKarl Williamson <khw@cpan.org>
Sun, 20 Mar 2022 05:17:51 +0000 (23:17 -0600)
commit1df06faef81d6e2c5662cfb5d6cfc0844c38766e
tree3b56aea1f63f56697d9df59148f2d9f6f5a38b72
parent835f2666d2ae366f7af912303f061f066b8376c4
unicode_constants.pl: Refactor to catch more paired delims

Previously, only characters that Unicode included in its bidirectional
algorithm have been eligible to be found by this program to be mirrored
string delimiters.

This commit adds 5 quotation marker character pairs that
are omitted from the bidirectional algorithm, as most quotes are,
because, as the Standard says, their "directionality and pairing status
is less predictable than paired brackets."

But we're not particularly interested in those semantics, most string
delimiters will be selected only for their visual appearance.

Because they aren't in the bidi algorithm, there is no property that
maps one member of a pair to its mate. However, Two characters whose
names pair only by LEFT vs RIGHT are almost certainly a mirrored pair.
This doesn't catch all possibilities; future commits will expand the
ones caught.

The commit refactors things so as to make future commits easier which
look at even more delimiter possibilities.
lib/feature.pm
regen/feature.pl
regen/unicode_constants.pl
unicode_constants.h