This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regen/mk_invlists.pl: Move some code around
authorKarl Williamson <khw@cpan.org>
Thu, 19 Apr 2018 22:34:04 +0000 (16:34 -0600)
committerKarl Williamson <khw@cpan.org>
Fri, 20 Apr 2018 07:11:51 +0000 (01:11 -0600)
This moves the switching of #if's to be adjacent to the area it is used

charclass_invlists.h
regen/mk_invlists.pl

index 98f5adf..797be59 100644 (file)
@@ -170534,5 +170534,5 @@ static const U8 WB_table[24][24] = {
  * ba5b13123afb59ea004c14fcbac80b5ff428c5b8f1b84bf8602b4ffb7da0407f lib/unicore/mktables
  * 21653d2744fdd071f9ef138c805393901bb9547cf3e777ebf50215a191f986ea lib/unicore/version
  * 913d2f93f3cb6cdf1664db888bf840bc4eb074eef824e082fceda24a9445e60c regen/charset_translations.pl
- * 795035df1100cf2e6a79dda246226da7b59279dad9788fea9ae59e659008902d regen/mk_invlists.pl
+ * 04d2f5ff19b435dea6213d012d11f8a5316cc6b59e7a9d5822e554ba2e7faa07 regen/mk_invlists.pl
  * ex: set ro: */
index 7f0a4d2..2e0eed8 100644 (file)
@@ -353,22 +353,6 @@ sub output_invmap ($$$$$$$) {
             }
         }
 
-        # Inversion map stuff is used only by regexec or utf-8 (if it is
-        # for code points) , unless it is in the enum exception list
-        my $where = (exists $where_to_define_enums{$name})
-                    ? $where_to_define_enums{$name}
-                    : ($input_format =~ /a/)
-                       ? 'PERL_IN_UTF8_C'
-                       : 'PERL_IN_REGEXEC_C';
-
-        my $is_public_enum = exists $public_enums{$name};
-        if ($is_public_enum) {
-            end_file_pound_if;
-        }
-        else {
-            switch_pound_if($name, $where);
-        }
-
         # The short names tend to be two lower case letters, but it looks
         # better for those if they are upper. XXX
         $short_name = uc($short_name) if length($short_name) < 3
@@ -433,8 +417,24 @@ sub output_invmap ($$$$$$$) {
 
         $enum_declaration_type = "${name_prefix}enum";
 
-        # Finished with the enum definition.  If it only contains one element,
-        # that is a dummy, default one
+        # Finished with the enum definition.  Inversion map stuff is used only
+        # by regexec or utf-8 (if it is for code points) , unless it is in the
+        # enum exception list
+        my $where = (exists $where_to_define_enums{$name})
+                    ? $where_to_define_enums{$name}
+                    : ($input_format =~ /a/)
+                       ? 'PERL_IN_UTF8_C'
+                       : 'PERL_IN_REGEXEC_C';
+
+        my $is_public_enum = exists $public_enums{$name};
+        if ($is_public_enum) {
+            end_file_pound_if;
+        }
+        else {
+            switch_pound_if($name, $where);
+        }
+
+        # If the enum only contains one element, that is a dummy, default one
         if (scalar @enum_definition > 1) {
 
             # Currently unneeded