summaryrefslogtreecommitdiff
path: root/regen/mk_PL_charclass.pl
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2014-08-26 15:34:25 -0600
committerKarl Williamson <khw@cpan.org>2014-09-06 21:12:05 -0600
commit8e35b0561082715dcfa5b85db6cfb4fd650e72f1 (patch)
treefa89f495b9ee94ad55a0ad41ab723330973a169b /regen/mk_PL_charclass.pl
parent549b4e78e20d6b000653c2b3d043c46bf7ba0d57 (diff)
downloadperl-8e35b0561082715dcfa5b85db6cfb4fd650e72f1.tar.gz
regcomp.c: Make macro a lookup
The recently introduced macro isMNEMONIC_CNTRL has a look-up and several tests in it, which occupy time and space. Since it was only used for debugging, that did not matter much, but future commits will use it in more mainline code. This commit changes it to be a single look-up, using up one of the spare bits available for that purpose in PL_charclass. There are enough available bits that we aren't likely to run out, really ever. (We can always add a 2nd word of bits if necessary.)
Diffstat (limited to 'regen/mk_PL_charclass.pl')
-rw-r--r--regen/mk_PL_charclass.pl4
1 files changed, 4 insertions, 0 deletions
diff --git a/regen/mk_PL_charclass.pl b/regen/mk_PL_charclass.pl
index aaefb467f3..8a682dc3c7 100644
--- a/regen/mk_PL_charclass.pl
+++ b/regen/mk_PL_charclass.pl
@@ -47,6 +47,7 @@ my @properties = qw(
XDIGIT
VERTSPACE
IS_IN_SOME_FOLD
+ MNEMONIC_CNTRL
);
# Read in the case fold mappings.
@@ -235,6 +236,9 @@ for my $ord (0..255) {
$re = qr/\p{Is_Non_Final_Fold}/;
} elsif ($name eq 'IS_IN_SOME_FOLD') {
$re = qr/\p{_Perl_Any_Folds}/;
+ } elsif ($name eq 'MNEMONIC_CNTRL') {
+ # These are the control characters that there are mnemonics for
+ $re = qr/[\a\b\e\f\n\r\t]/;
} else { # The remainder have the same name and values as Unicode
$re = eval "qr/\\p{$name}/";
use Carp;