summaryrefslogtreecommitdiff
path: root/regen/unicode_constants.pl
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2014-08-23 18:10:44 -0600
committerKarl Williamson <khw@cpan.org>2014-08-25 11:13:41 -0600
commit09cc440d0851dfabed3792481a855af6a4a79f93 (patch)
treed3e63e5307557b4c47bece3a1b3f736d6fdea330 /regen/unicode_constants.pl
parent96ca48da9bec7b317ccdc743dffe3f593d5f56f3 (diff)
downloadperl-09cc440d0851dfabed3792481a855af6a4a79f93.tar.gz
regen/unicode_constants.pl: Find max ascii print cp
This creates a #define that gives the highest code point that is an ASCII printable. On ASCII-ish platforms, this is 0x7E, but on EBCDIC platforms it varies, and can be as high as 0xFF. This is in preparation for needing this value in a future commit in regcomp.c
Diffstat (limited to 'regen/unicode_constants.pl')
-rw-r--r--regen/unicode_constants.pl7
1 files changed, 7 insertions, 0 deletions
diff --git a/regen/unicode_constants.pl b/regen/unicode_constants.pl
index 763b7bbdc9..c81f7676d2 100644
--- a/regen/unicode_constants.pl
+++ b/regen/unicode_constants.pl
@@ -147,6 +147,13 @@ foreach my $charset (get_supported_code_pages()) {
}
printf $out_fh "# define %s%s %s /* U+%04X */\n", $name, $suffix, $str, $U_cp;
}
+
+ my $max_PRINT_A = 0;
+ for my $i (0x20 .. 0x7E) {
+ $max_PRINT_A = $a2n[$i] if $a2n[$i] > $max_PRINT_A;
+ }
+ printf $out_fh "# define MAX_PRINT_A_FOR_USE_ONLY_BY_REGCOMP_DOT_C 0x%02X /* The max code point that isPRINT_A */\n", $max_PRINT_A;
+
print $out_fh "\n" . get_conditional_compile_line_end();
}