New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
B::Deparse fails with utf8 and our #7744
Comments
From @nwc10Created by @nwc10./perl -Ilib -MO=Deparse born born is one of the examples from t/run/freshperl.t use strict; I assume that Deparse should be able to handle it. Nicholas Clark Perl Info
|
From @cpansproutOn Mon Jan 10 14:59:13 2005, nicholas wrote:
The attached patch fixes this. |
From @cpansproutInline Patchdiff -Nurp blead-33752-unideparse.base/dist/B-Deparse/Deparse.pm blead-33752-unideparse/dist/B-Deparse/Deparse.pm
--- blead-33752-unideparse.base/dist/B-Deparse/Deparse.pm 2010-09-20 22:06:11.000000000 -0700
+++ blead-33752-unideparse/dist/B-Deparse/Deparse.pm 2010-10-16 10:01:58.000000000 -0700
@@ -1041,9 +1041,11 @@ sub maybe_local {
and not $self->{'avoid_local'}{$$op}) {
my $our_local = ($op->private & OPpLVAL_INTRO) ? "local" : "our";
if( $our_local eq 'our' ) {
- # XXX This assertion fails code with non-ASCII identifiers,
- # like ./ext/Encode/t/jperl.t
- die "Unexpected our($text)\n" unless $text =~ /^\W(\w+::)*\w+\z/;
+ if ( $text !~ /^\W(\w+::)*\w+\z/
+ and !utf8::decode($text) || $text !~ /^\W(\w+::)*\w+\z/
+ ) {
+ die "Unexpected our($text)\n";
+ }
$text =~ s/(\w+::)+//;
}
if (want_scalar($op)) {
diff -Nurp blead-33752-unideparse.base/dist/B-Deparse/t/deparse.t blead-33752-unideparse/dist/B-Deparse/t/deparse.t
--- blead-33752-unideparse.base/dist/B-Deparse/t/deparse.t 2010-09-20 22:06:11.000000000 -0700
+++ blead-33752-unideparse/dist/B-Deparse/t/deparse.t 2010-10-16 16:48:47.000000000 -0700
@@ -17,7 +17,7 @@ BEGIN {
require feature;
feature->import(':5.10');
}
-use Test::More tests => 90;
+use Test::More tests => 91;
use Config ();
use B::Deparse;
@@ -166,6 +166,19 @@ eval <<EOFCODE and test($x);
1
EOFCODE
+# [perl #33752]
+{
+ my $code = <<"EOCODE";
+{
+ our \$\x{1e1f}\x{14d}\x{14d};
+}
+EOCODE
+ my $deparsed
+ = $deparse->coderef2text(eval "sub { our \$\x{1e1f}\x{14d}\x{14d} }" );
+ s/$ \n//x for $deparsed, $code;
+ is $deparsed, $code, 'our $funny_Unicode_chars';
+}
+
__DATA__
# 2
1; |
From [Unknown Contact. See original ticket]On Mon Jan 10 14:59:13 2005, nicholas wrote:
The attached patch fixes this. |
@cpansprout - Status changed from 'new' to 'open' |
From @cpansproutOn Sun Oct 17 13:09:33 2010, sprout wrote:
Applied as 640d5d4. |
From [Unknown Contact. See original ticket]On Sun Oct 17 13:09:33 2010, sprout wrote:
Applied as 640d5d4. |
@cpansprout - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#33752 (status was 'resolved')
Searchable as RT33752$
The text was updated successfully, but these errors were encountered: