diff options
author | Karl Williamson <khw@cpan.org> | 2022-03-09 07:25:46 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2022-03-19 23:17:51 -0600 |
commit | 835f2666d2ae366f7af912303f061f066b8376c4 (patch) | |
tree | 900bc30040ac282972c9d24f9562550fa5802a06 /toke.c | |
parent | 9c9853e81d56a8abb664dd3e6332722675cc9a7c (diff) | |
download | perl-835f2666d2ae366f7af912303f061f066b8376c4.tar.gz |
Allow reversal of some paired delimiters; deprecations
Unicode says certain opening punctuation characters may be used as
closing ones in some languages; and their mirror is instead the opening
one.
This commit changes to allow either one of each such set to be the
opening one.
It also deprecates the use of any of the new mirrored delimiters to be
used outside the feature as an unmirrored delimiter, and the normal
closing delimiter from being used as an unpaired opening one while in
the feature. This gives us the freedom to make some or all of the new
paired delimiters be reversible.
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -11389,12 +11389,24 @@ Perl_scan_str(pTHX_ char *start, int keep_bracketed_quoted, int keep_delims, int legal_paired_opening_delims_end = C_ARRAY_END(EXTRA_OPENING_UTF8_BRACKETS); legal_paired_closing_delims = EXTRA_CLOSING_UTF8_BRACKETS; + + /* We are deprecating using a closing delimiter as the opening, in + * case we want in the future to accept them reversed. The string + * may include ones that are legal, but the code below won't look + * at this string unless it didn't find a legal opening one */ + deprecated_opening_delims = DEPRECATED_OPENING_UTF8_BRACKETS; + deprecated_delims_end = + C_ARRAY_END(DEPRECATED_OPENING_UTF8_BRACKETS); } else { legal_paired_opening_delims = EXTRA_OPENING_NON_UTF8_BRACKETS; legal_paired_opening_delims_end = C_ARRAY_END(EXTRA_OPENING_NON_UTF8_BRACKETS); legal_paired_closing_delims = EXTRA_CLOSING_NON_UTF8_BRACKETS; + + deprecated_opening_delims = DEPRECATED_OPENING_NON_UTF8_BRACKETS; + deprecated_delims_end = + C_ARRAY_END(DEPRECATED_OPENING_NON_UTF8_BRACKETS); } } else { |