summaryrefslogtreecommitdiff
path: root/regen
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-10-17 06:55:50 -0600
committerKarl Williamson <khw@cpan.org>2020-11-22 20:06:03 -0700
commitc62fdeb784c7643c90d2ea8c2ec0f03a548da338 (patch)
tree9c5f6ad7fe164633a5a8667402320e12d2755b45 /regen
parent8dff134de1f0dc51682889d5cf8c25ab7c31bf45 (diff)
downloadperl-c62fdeb784c7643c90d2ea8c2ec0f03a548da338.tar.gz
Restrict scope/Shorten some very long macro names
The names were intended to force people to not use them outside their intended scopes. But by restricting those scopes in the first place, we don't need such unwieldy names
Diffstat (limited to 'regen')
-rw-r--r--regen/unicode_constants.pl32
1 files changed, 24 insertions, 8 deletions
diff --git a/regen/unicode_constants.pl b/regen/unicode_constants.pl
index aba447ae6a..44c633e711 100644
--- a/regen/unicode_constants.pl
+++ b/regen/unicode_constants.pl
@@ -162,9 +162,15 @@ foreach my $charset (get_supported_code_pages()) {
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;
+ $max_PRINT_A = sprintf "0x%02X", $max_PRINT_A;
+ print $out_fh <<"EOT";
- print $out_fh "\n" . get_conditional_compile_line_end();
+# ifdef PERL_IN_REGCOMP_C
+# define MAX_PRINT_A $max_PRINT_A /* The max code point that isPRINT_A */
+# endif
+EOT
+
+ print $out_fh get_conditional_compile_line_end();
}
@@ -178,9 +184,14 @@ for (my $i = 0; $i < @other_invlist; $i += 2) {
: 0x110000)
- $other_invlist[$i];
}
-printf $out_fh "\n/* The number of code points not matching \\pC */\n"
- . "#define NON_OTHER_COUNT_FOR_USE_ONLY_BY_REGCOMP_DOT_C %d\n",
- 0x110000 - $count;
+$count = 0x110000 - $count;
+print $out_fh <<~"EOT";
+
+ /* The number of code points not matching \\pC */
+ #ifdef PERL_IN_REGCOMP_C
+ # define NON_OTHER_COUNT $count
+ #endif
+ EOT
# If this release has both the CWCM and CWCF properties, find the highest code
# point which changes under any case change. We can use this to short-circuit
@@ -192,9 +203,14 @@ if (@cwcm) {
my $max = ($cwcm[-1] < $cwcf[-1])
? $cwcf[-1]
: $cwcm[-1];
- printf $out_fh "\n/* The highest code point that has any type of case change */\n"
- . "#define HIGHEST_CASE_CHANGING_CP_FOR_USE_ONLY_BY_UTF8_DOT_C 0x%X\n",
- $max - 1;
+ $max = sprintf "0x%X", $max - 1;
+ print $out_fh <<~"EOS";
+
+ /* The highest code point that has any type of case change */
+ #ifdef PERL_IN_UTF8_C
+ # define HIGHEST_CASE_CHANGING_CP $max
+ #endif
+ EOS
}
}