perl5
perl5 copied to clipboard
[EXPERIMENT] more paired delimiters for quote-like operators
Perl 5.36.0 introduced the extra_paired_delimiters feature, which allows many non-ASCII mirrored bracketing pairs to be used for quote-like operators. For example:
my @words = qw« tinker tailor soldier spy »;
This is likely to change as Unicode evolves. In fact, Unicode appears to be in the process of identifying just the character set we'd like to use!
There is a full list (as of Unicode 14) in https://perldoc.perl.org/feature#The-'extra_paired_delimiters'-feature, but the build code generates the delimiters from the Unicode database shipped with Perl. The algorithm is in regen/unicode_constants.pl
, and it's really hairy because it doesn't just take Bidi_Mirroring_Glyph
into account, but does name-based shenanigans (like looking for a RIGHT FOO
if the character is called a LEFT FOO
, or flipping EAST
and WEST
, or looking for a REVERSED FOO
if the character is called FOO
) with lots of special cases..
I apologize for the noise: I thought that I had deleted my comment before anyone would notice. So you're answering my now-extinct question (about what makes "many non-ASCII mirrored bracketing pairs") - for which I had in the meantime found another answer in perldoc feature. I'll use the rather human-readable (and also Perl-parseable) list in feature.pm to set up the syntax highlighting in Emacs CPerl mode.
Note that list may at some point move from there to a more permanent documentation like perlop.
This is also the code used to generate the constants for the C code: https://github.com/Perl/perl5/blob/v5.39.9/regen/unicode_constants.pl#L391 which becomes https://github.com/Perl/perl5/blob/v5.39.9/unicode_constants.h#L100.
Calling for the GitHub maintainer to close this issue after @leonerd's https://github.com/Perl/perl5/commit/4b6ad5110c29c13149771584eabe8b42feb5c63c commit making the feature stable.
This feature has been moved back to experimental due to #22228/#22229