diff options
author | Karl Williamson <public@khwilliamson.com> | 2012-06-18 12:55:42 -0600 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2012-08-02 09:24:52 -0600 |
commit | b72a36d4f2738e8e15eb2e22819c8ffee7421c93 (patch) | |
tree | 8b913134ddf1b6356c3be23af5cde9b81cecdfaa /regen | |
parent | c4854deaa322105e69b0d84640b741c340711a77 (diff) | |
download | perl-b72a36d4f2738e8e15eb2e22819c8ffee7421c93.tar.gz |
mktables: Generate tables for chars that aren't in final fold pos
This starts with the existing table that mktables generates that lists
all the characters in Unicode that occur in multi-character folds, and
aren't in the final positions of any such fold.
It generates data structures with this information to make it quickly
available to code that wants to use it. Future commits will use these
tables.
Diffstat (limited to 'regen')
-rw-r--r-- | regen/mk_PL_charclass.pl | 11 | ||||
-rw-r--r-- | regen/mk_invlists.pl | 2 |
2 files changed, 10 insertions, 3 deletions
diff --git a/regen/mk_PL_charclass.pl b/regen/mk_PL_charclass.pl index 53c08f78be..e272033e45 100644 --- a/regen/mk_PL_charclass.pl +++ b/regen/mk_PL_charclass.pl @@ -1,5 +1,5 @@ #!perl -w -use 5.012; +use v5.15.8; use strict; use warnings; require 'regen/regen_lib.pl'; @@ -32,6 +32,7 @@ my @properties = qw( GRAPH IDFIRST LOWER + NON_FINAL_FOLD PRINT PSXSPC PUNCT @@ -166,13 +167,19 @@ for my $ord (0..255) { $re = qr/\p{Alnum}/; } elsif ($name eq 'QUOTEMETA') { $re = qr/\p{_Perl_Quotemeta}/; + } elsif ($name eq 'NON_FINAL_FOLD') { + $re = qr/\p{_Perl_Non_Final_Folds}/; } else { # The remainder have the same name and values as Unicode $re = eval "qr/\\p{$name}/"; use Carp; carp $@ if ! defined $re; } #print "$ord, $name $property, $re\n"; - if ($char =~ $re) { # Add this property if matches + if ($char =~ $re # Add this property if matches + || ($name eq 'NON_FINAL_FOLD' + # Also include chars that fold to the non-final + && CORE::fc($char) =~ $re)) + { $bits[$ord] .= '|' if $bits[$ord]; $bits[$ord] .= "(1U<<_CC_$property)"; } diff --git a/regen/mk_invlists.pl b/regen/mk_invlists.pl index 97b0eec38a..9cdbd4ca8e 100644 --- a/regen/mk_invlists.pl +++ b/regen/mk_invlists.pl @@ -126,7 +126,7 @@ for my $prop (qw( L1PosixWord PosixXDigit XPosixXDigit - _Perl_Non_Final_Folds + NonL1_Perl_Non_Final_Folds ) ) { |