Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EXPERIMENT] more paired delimiters for quote-like operators #19765

Open
rjbs opened this issue May 21, 2022 · 6 comments
Open

[EXPERIMENT] more paired delimiters for quote-like operators #19765

rjbs opened this issue May 21, 2022 · 6 comments
Labels
experiment ticket tracking an active experiment

Comments

@rjbs
Copy link
Member

rjbs commented May 21, 2022

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!

@rjbs rjbs added the experiment ticket tracking an active experiment label May 21, 2022
@mauke
Copy link
Contributor

mauke commented Apr 11, 2024

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..

@HaraldJoerg
Copy link
Contributor

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.

@Grinnz
Copy link
Contributor

Grinnz commented Apr 11, 2024

Note that list may at some point move from there to a more permanent documentation like perlop.

@zmughal
Copy link
Contributor

zmughal commented Apr 11, 2024

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.

@rwp0
Copy link
Contributor

rwp0 commented Apr 11, 2024

Calling for the GitHub maintainer to close this issue after @leonerd's 4b6ad51 commit making the feature stable.

@haarg
Copy link
Contributor

haarg commented May 29, 2024

This feature has been moved back to experimental due to #22228/#22229

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
experiment ticket tracking an active experiment
Projects
None yet
Development

No branches or pull requests

7 participants