From c34c2111bef12c31cf53049232328873b2d75a90 Mon Sep 17 00:00:00 2001 From: vaitkus Date: Sun, 16 Feb 2025 04:13:13 +0200 Subject: [PATCH] lib/Unicode/UCD.pm: update num() usage example A combination of two Rumi digits is not considered a valid decimal number by num() thus resulting in an undef result value. While such behaviour is properly documented in the num() description and thus expected, it might be better to give an example that returns a proper numeric value. An equivalent change was made to an example in pod/perlunicook.pod. --- charclass_invlists.h | 2 +- lib/Unicode/UCD.pm | 4 ++-- lib/unicore/uni_keywords.pl | 2 +- pod/perlunicook.pod | 3 ++- regcharclass.h | 6 +++--- uni_keywords.h | 4 ++-- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/charclass_invlists.h b/charclass_invlists.h index 15f622247d37..7ff9ac643eff 100644 --- a/charclass_invlists.h +++ b/charclass_invlists.h @@ -436029,7 +436029,7 @@ static const U8 WB_table[23][23] = { #define MAX_FOLD_FROMS 3 /* Generated from: - * 688d673ec947f7ccf898b4eae9848139d4d33676b688dee54f449f8bf9d3bbd2 lib/Unicode/UCD.pm + * 0e8307ab7c654d9c133ea885f5413a4eb5c0123ed2178f7e1cbabed36b67792c lib/Unicode/UCD.pm * eb840f36e0a7446293578c684a54c6d83d249abde7bdd4dfa89794af1d7fe9e9 lib/unicore/ArabicShaping.txt * 333ae1e99db0504ca8a046a07dc45b5e7aa91869c685e6bf955ebe674804827a lib/unicore/BidiBrackets.txt * b4b9e1d87d8ea273613880de9d2b2f0b0b696244b42152bfa0a3106e7d983a20 lib/unicore/BidiMirroring.txt diff --git a/lib/Unicode/UCD.pm b/lib/Unicode/UCD.pm index 6f4c4b25028c..e8e97455d082 100644 --- a/lib/Unicode/UCD.pm +++ b/lib/Unicode/UCD.pm @@ -5,7 +5,7 @@ use warnings; no warnings 'surrogate'; # surrogates can be inputs to this use charnames (); -our $VERSION = '0.78'; +our $VERSION = '0.79'; sub DEBUG () { 0 } $|=1 if DEBUG; @@ -113,7 +113,7 @@ Unicode::UCD - Unicode character database my $unicode_version = Unicode::UCD::UnicodeVersion(); my $convert_to_numeric = - Unicode::UCD::num("\N{RUMI DIGIT ONE}\N{RUMI DIGIT TWO}"); + Unicode::UCD::num("\N{VAI DIGIT ONE}\N{VAI DIGIT TWO}"); =head1 DESCRIPTION diff --git a/lib/unicore/uni_keywords.pl b/lib/unicore/uni_keywords.pl index 6a47f7ff9deb..11796c248003 100644 --- a/lib/unicore/uni_keywords.pl +++ b/lib/unicore/uni_keywords.pl @@ -1282,7 +1282,7 @@ 1; # Generated from: -# 688d673ec947f7ccf898b4eae9848139d4d33676b688dee54f449f8bf9d3bbd2 lib/Unicode/UCD.pm +# 0e8307ab7c654d9c133ea885f5413a4eb5c0123ed2178f7e1cbabed36b67792c lib/Unicode/UCD.pm # eb840f36e0a7446293578c684a54c6d83d249abde7bdd4dfa89794af1d7fe9e9 lib/unicore/ArabicShaping.txt # 333ae1e99db0504ca8a046a07dc45b5e7aa91869c685e6bf955ebe674804827a lib/unicore/BidiBrackets.txt # b4b9e1d87d8ea273613880de9d2b2f0b0b696244b42152bfa0a3106e7d983a20 lib/unicore/BidiMirroring.txt diff --git a/pod/perlunicook.pod b/pod/perlunicook.pod index 33a0e87211cb..f01646c9f26c 100644 --- a/pod/perlunicook.pod +++ b/pod/perlunicook.pod @@ -452,7 +452,8 @@ convert such strings manually. say "@nums"; # 12 4567 0.875 1000000000000 use charnames qw(:full); - my $nv = num("\N{RUMI DIGIT ONE}\N{RUMI DIGIT TWO}"); + my $nv = num("\N{VAI DIGIT ONE}\N{VAI DIGIT TWO}"); + say $nv; # 12 =head2 ℞ 29: Match Unicode grapheme cluster in regex diff --git a/regcharclass.h b/regcharclass.h index 576d7dd435bf..7a005852e3b7 100644 --- a/regcharclass.h +++ b/regcharclass.h @@ -8,7 +8,7 @@ * License or the Artistic License, as specified in the README file. * * !!!!!!! DO NOT EDIT THIS FILE !!!!!!! - * This file is built by regen/regcharclass.pl. + * This file is built by ./regen/regcharclass.pl. * Any changes made here will be lost! * WARNING: These macros are for internal Perl core use only, and may be * changed or removed without notice. @@ -3801,7 +3801,8 @@ #endif /* PERL_REGCHARCLASS_H_ */ /* Generated from: - * 688d673ec947f7ccf898b4eae9848139d4d33676b688dee54f449f8bf9d3bbd2 lib/Unicode/UCD.pm + * acc94e4afc339fe2cf2ae74d6e1cbcf2c396328d78e56236ad314eadbfc84125 ./regen/regcharclass.pl + * 0e8307ab7c654d9c133ea885f5413a4eb5c0123ed2178f7e1cbabed36b67792c lib/Unicode/UCD.pm * eb840f36e0a7446293578c684a54c6d83d249abde7bdd4dfa89794af1d7fe9e9 lib/unicore/ArabicShaping.txt * 333ae1e99db0504ca8a046a07dc45b5e7aa91869c685e6bf955ebe674804827a lib/unicore/BidiBrackets.txt * b4b9e1d87d8ea273613880de9d2b2f0b0b696244b42152bfa0a3106e7d983a20 lib/unicore/BidiMirroring.txt @@ -3853,6 +3854,5 @@ * 8968a5ee00063fa31ff15474b95ccb6b9c228e3ebad6c20bc77f4225187e2023 lib/unicore/mktables * 55d90fdc3f902e5c0b16b3378f9eaa36e970a1c09723c33de7d47d0370044012 lib/unicore/version * 0a6b5ab33bb1026531f816efe81aea1a8ffcd34a27cbea37dd6a70a63d73c844 regen/charset_translations.pl - * acc94e4afc339fe2cf2ae74d6e1cbcf2c396328d78e56236ad314eadbfc84125 regen/regcharclass.pl * b2f896452d2b30da3e04800f478c60c1fd0b03d6b668689b020f1e3cf1f1cdd9 regen/regcharclass_multi_char_folds.pl * ex: set ro ft=c: */ diff --git a/uni_keywords.h b/uni_keywords.h index 428379ac9182..4a398f5ee2b5 100644 --- a/uni_keywords.h +++ b/uni_keywords.h @@ -10,7 +10,7 @@ #define MPH_VALt I16 /* -generator script: regen/mk_invlists.pl +generator script: ./regen/mk_invlists.pl split strategy: squeeze srand: 1785235451 rows: 7498 @@ -7707,7 +7707,7 @@ match_uniprop( const unsigned char * const key, const U16 key_len ) { #endif /* #if defined(PERL_CORE) || defined(PERL_EXT_RE_BUILD) */ /* Generated from: - * 688d673ec947f7ccf898b4eae9848139d4d33676b688dee54f449f8bf9d3bbd2 lib/Unicode/UCD.pm + * 0e8307ab7c654d9c133ea885f5413a4eb5c0123ed2178f7e1cbabed36b67792c lib/Unicode/UCD.pm * eb840f36e0a7446293578c684a54c6d83d249abde7bdd4dfa89794af1d7fe9e9 lib/unicore/ArabicShaping.txt * 333ae1e99db0504ca8a046a07dc45b5e7aa91869c685e6bf955ebe674804827a lib/unicore/BidiBrackets.txt * b4b9e1d87d8ea273613880de9d2b2f0b0b696244b42152bfa0a3106e7d983a20 lib/unicore/BidiMirroring.txt