Make Deparse work with y/å/ø/
authorFather Chrysostomos <sprout@cpan.org>
Sat, 6 Nov 2010 07:05:36 +0000 (00:05 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 6 Nov 2010 07:05:36 +0000 (00:05 -0700)
dist/B-Deparse/Deparse.pm
dist/B-Deparse/t/deparse.t

index bec809e..ba5fd01 100644 (file)
@@ -4087,8 +4087,12 @@ sub pp_trans {
     my $self = shift;
     my($op, $cx) = @_;
     my($from, $to);
-    if (class($op) eq "PVOP") {
+    my $class = class($op);
+    if ($class eq "PVOP") {
        ($from, $to) = tr_decode_byte($op->pv, $op->private);
+    } elsif ($class eq "PADOP") {
+       ($from, $to)
+         = tr_decode_utf8($self->padval($op->padix)->RV, $op->private);
     } else { # class($op) eq "SVOP"
        ($from, $to) = tr_decode_utf8($op->sv->RV, $op->private);
     }
index b9c2bf4..570f64e 100644 (file)
@@ -17,7 +17,7 @@ BEGIN {
     require feature;
     feature->import(':5.10');
 }
-use Test::More tests => 93;
+use Test::More tests => 94;
 use Config ();
 
 use B::Deparse;
@@ -675,3 +675,6 @@ foreach $' (1, 2) {
 ####
 # y///r
 tr/a/b/r;
+####
+# y/uni/code/
+tr/\x{345}/\x{370}/;