This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Deparse: Emit package before use
[perl5.git] / lib / utf8_heavy.pl
index d8f1de3..e0c3d5e 100644 (file)
@@ -95,9 +95,9 @@ sub _loose_name ($) {
         #   keys TYPE, BITS, EXTRAS, LIST, and NONE with values having the
         #   same meanings as the input parameters.
         #   SPECIALS contains a reference to any special-treatment hash in the
+        #       property.
         #   INVERT_IT is non-zero if the result should be inverted before use
         #   USER_DEFINED is non-zero if the result came from a user-defined
-        #       property.
         my $file; ## file to load data from, and also part of the %Cache key.
 
         # Change this to get a different set of Unicode tables
@@ -135,8 +135,11 @@ sub _loose_name ($) {
 
 
                 my $caller0 = caller(0);
-                my $caller1 = $type =~ s/(.+)::// ? $1 : $caller0 eq 'main' ?
-                'main' : caller(1);
+                my $caller1 = $type =~ s/(.+):://
+                              ? $1
+                              : $caller0 eq 'main'
+                                ? 'main'
+                                : caller(1);
 
                 if (defined $caller1 && $type =~ /^I[ns]\w+$/) {
                     my $prop = "${caller1}::$type";
@@ -172,7 +175,11 @@ sub _loose_name ($) {
                 }
                 if (miniperl) {
                     eval "require '$unicore_dir/Heavy.pl'";
-                    last GETFILE if $@;
+                    if ($@) {
+                        print STDERR __LINE__, ": '$@'\n" if DEBUG;
+                        pop @recursed if @recursed;
+                        return $type;
+                    }
                 }
                 else {
                     require "$unicore_dir/Heavy.pl";
@@ -514,7 +521,7 @@ sub _loose_name ($) {
                 # new-lines.  Since it is in-line there is no advantage to
                 # caching the result
                 if ($file =~ s!^#/!!) {
-                    $list = $file =~ s/;/\n/gr;
+                    $list = $utf8::inline_definitions[$file];
                 }
                 else {
                     # Here, we have an actual file to read in and load, but it
@@ -567,8 +574,8 @@ sub _loose_name ($) {
                 $list = join '', $taint,
                         map  { $_->[1] }
                         sort { $a->[0] <=> $b->[0] }
-                        map  { /^([0-9a-fA-F]+)/; [ CORE::hex($1), $_ ] }
-                        grep { /^([0-9a-fA-F]+)/ and not $seen{$1}++ } @tmp; # XXX doesn't do ranges right
+                        map  { /^([0-9a-fA-F]+)/ && !$seen{$1}++ ? [ CORE::hex($1), $_ ] : () }
+                        @tmp; # XXX doesn't do ranges right
             }
             else {
                 # mktables has gone to some trouble to make non-user defined