diff options
author | Karl Williamson <khw@cpan.org> | 2014-08-23 18:10:44 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2014-08-25 11:13:41 -0600 |
commit | 09cc440d0851dfabed3792481a855af6a4a79f93 (patch) | |
tree | d3e63e5307557b4c47bece3a1b3f736d6fdea330 | |
parent | 96ca48da9bec7b317ccdc743dffe3f593d5f56f3 (diff) | |
download | perl-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
-rw-r--r-- | regen/unicode_constants.pl | 7 | ||||
-rw-r--r-- | unicode_constants.h | 4 |
2 files changed, 11 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(); } diff --git a/unicode_constants.h b/unicode_constants.h index 76dee35d9c..6cd8cc6b99 100644 --- a/unicode_constants.h +++ b/unicode_constants.h @@ -52,6 +52,7 @@ # define LATIN_CAPITAL_LETTER_A_WITH_RING_ABOVE_NATIVE 0xC5 /* U+00C5 */ # define LATIN_SMALL_LETTER_Y_WITH_DIAERESIS_NATIVE 0xFF /* U+00FF */ # define MICRO_SIGN_NATIVE 0xB5 /* U+00B5 */ +# define MAX_PRINT_A_FOR_USE_ONLY_BY_REGCOMP_DOT_C 0x7E /* The max code point that isPRINT_A */ #endif /* ASCII/Latin1 */ @@ -89,6 +90,7 @@ # define LATIN_CAPITAL_LETTER_A_WITH_RING_ABOVE_NATIVE 0x67 /* U+00C5 */ # define LATIN_SMALL_LETTER_Y_WITH_DIAERESIS_NATIVE 0xDF /* U+00FF */ # define MICRO_SIGN_NATIVE 0xA0 /* U+00B5 */ +# define MAX_PRINT_A_FOR_USE_ONLY_BY_REGCOMP_DOT_C 0xF9 /* The max code point that isPRINT_A */ #endif /* EBCDIC 1047 */ @@ -126,6 +128,7 @@ # define LATIN_CAPITAL_LETTER_A_WITH_RING_ABOVE_NATIVE 0x67 /* U+00C5 */ # define LATIN_SMALL_LETTER_Y_WITH_DIAERESIS_NATIVE 0xDF /* U+00FF */ # define MICRO_SIGN_NATIVE 0xA0 /* U+00B5 */ +# define MAX_PRINT_A_FOR_USE_ONLY_BY_REGCOMP_DOT_C 0xF9 /* The max code point that isPRINT_A */ #endif /* EBCDIC 037 */ @@ -163,6 +166,7 @@ # define LATIN_CAPITAL_LETTER_A_WITH_RING_ABOVE_NATIVE 0x67 /* U+00C5 */ # define LATIN_SMALL_LETTER_Y_WITH_DIAERESIS_NATIVE 0xDF /* U+00FF */ # define MICRO_SIGN_NATIVE 0xA0 /* U+00B5 */ +# define MAX_PRINT_A_FOR_USE_ONLY_BY_REGCOMP_DOT_C 0xFF /* The max code point that isPRINT_A */ #endif /* EBCDIC POSIX-BC */ |