Change 33215 by [EMAIL PROTECTED] on 2008/02/02 22:01:58
Integrate:
[ 33151]
Integrate:
[ 32869]
Fix bug #49298: B::Deparse fails to deparse a reference to an anonymous
hash
[ 32909]
Subject: [PATCH] B::Deparse fixes for implicit smartmatching in
given/when
From: Florian Ragwitz <[EMAIL PROTECTED]>
Date: Tue, 8 Jan 2008 19:56:47 +0100
Message-ID: <[EMAIL PROTECTED]>
[ 33162]
Integrate:
[ 33127]
Formatting for C<<{ bydepth => 1 }>> doesn't seem to be working
right in the manpage.
[ 33144]
Subject: [PATCH] fix for regression to File/DosGlob.pm
From: "Davies, Alex" <[EMAIL PROTECTED]>
Date: Wed, 30 Jan 2008 12:39:11 -0500
Message-ID: <[EMAIL PROTECTED]>
Fixes File::DosGlob's handling of drive relative glob patterns
(e.g. "D:*pl")
Affected files ...
... //depot/maint-5.8/perl/ext/B/B/Deparse.pm#40 integrate
... //depot/maint-5.8/perl/ext/B/t/deparse.t#17 integrate
... //depot/maint-5.8/perl/lib/File/DosGlob.pm#2 integrate
... //depot/maint-5.8/perl/lib/File/Find.pm#18 integrate
Differences ...
==== //depot/maint-5.8/perl/ext/B/B/Deparse.pm#40 (text) ====
Index: perl/ext/B/B/Deparse.pm
--- perl/ext/B/B/Deparse.pm#39~33210~ 2008-02-02 11:08:57.000000000 -0800
+++ perl/ext/B/B/Deparse.pm 2008-02-02 14:01:58.000000000 -0800
@@ -21,7 +21,7 @@
PMf_KEEP PMf_GLOBAL PMf_CONTINUE PMf_EVAL PMf_ONCE
PMf_MULTILINE PMf_SINGLELINE PMf_FOLD PMf_EXTENDED),
($] < 5.009 ? 'PMf_SKIPWHITE' : 'RXf_SKIPWHITE');
-$VERSION = 0.84;
+$VERSION = 0.85;
use strict;
use vars qw/$AUTOLOAD/;
use warnings ();
@@ -1826,9 +1826,7 @@
my $kid = $op->first;
if ($kid->name eq "null") {
$kid = $kid->first;
- if ($kid->name eq "anonlist" || $kid->name eq "anonhash") {
- return $self->anon_hash_or_list($op, $cx);
- } elsif (!null($kid->sibling) and
+ if (!null($kid->sibling) and
$kid->sibling->name eq "anoncode") {
return $self->e_anoncode({ code =>
$self->padval($kid->sibling->targ) });
} elsif ($kid->name eq "pushmark") {
@@ -2117,7 +2115,7 @@
sub pp_smartmatch {
my ($self, $op, $cx) = @_;
if ($op->flags & OPf_SPECIAL) {
- return $self->deparse($op->first, $cx);
+ return $self->deparse($op->last, $cx);
}
else {
binop(@_, "~~", 14);
==== //depot/maint-5.8/perl/ext/B/t/deparse.t#17 (text) ====
Index: perl/ext/B/t/deparse.t
--- perl/ext/B/t/deparse.t#16~33210~ 2008-02-02 11:08:57.000000000 -0800
+++ perl/ext/B/t/deparse.t 2008-02-02 14:01:58.000000000 -0800
@@ -27,7 +27,7 @@
require feature;
feature->import(':5.10');
}
-use Test::More tests => 57;
+use Test::More tests => 59;
use B::Deparse;
my $deparse = B::Deparse->new();
@@ -395,3 +395,16 @@
# 50 keys @array; values @array
keys @$a if keys @ARGV;
values @ARGV if values @$a;
+####
+my $a = {};
+my $b = \{};
+my $c = [];
+my $d = \[];
+####
+# SKIP ?$] < 5.010 && "smartmatch and given/when not implemented on this Perl
version"
+# 51 implicit smartmatch in given/when
+given ('foo') {
+ when ('bar') { continue; }
+ when ($_ ~~ 'quux') { continue; }
+ default { 0; }
+}
==== //depot/maint-5.8/perl/lib/File/DosGlob.pm#2 (text) ====
Index: perl/lib/File/DosGlob.pm
--- perl/lib/File/DosGlob.pm#1~17645~ 2002-07-19 12:29:57.000000000 -0700
+++ perl/lib/File/DosGlob.pm 2008-02-02 14:01:58.000000000 -0800
@@ -9,7 +9,7 @@
package File::DosGlob;
-our $VERSION = '1.00';
+our $VERSION = '1.01';
use strict;
use warnings;
@@ -35,7 +35,7 @@
# wildcards with a drive prefix such as h:*.pm must be changed
# to h:./*.pm to expand correctly
if ($pat =~ m|^([A-Za-z]:)[^/\\]|s) {
- substr($_,0,2) = $1 . "./";
+ substr($pat,0,2) = $1 . "./";
}
if ($pat =~ m|^(.*)([\\/])([^\\/]*)\z|s) {
($head, $sepchr, $tail) = ($1,$2,$3);
==== //depot/maint-5.8/perl/lib/File/Find.pm#18 (text) ====
Index: perl/lib/File/Find.pm
--- perl/lib/File/Find.pm#17~32455~ 2007-11-22 14:07:11.000000000 -0800
+++ perl/lib/File/Find.pm 2008-02-02 14:01:58.000000000 -0800
@@ -84,7 +84,7 @@
Reports the name of a directory only AFTER all its entries
have been reported. Entry point C<finddepth()> is a shortcut for
-specifying C<<{ bydepth => 1 }>> in the first argument of C<find()>.
+specifying C<{ bydepth =E<gt> 1 }> in the first argument of C<find()>.
=item C<preprocess>
End of Patch.