Skip to content

Commit b6bba88

Browse files
committed
[perl #123947] deparse $#_ as $#_ not as $#{_}
8c2e27d changed B::Deparse to deparse $#{1} as that instead of as $#1 which is a syntax error, but also changed $#_ to deparse as $#{_} which isn't necessary, and broke GFUJI/macro-0.06.tar.gz This could be considered a bug in macro.pm, but since we don't need to deparse $#_ as $#{_} let's not do that.
1 parent 813d2eb commit b6bba88

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/B/Deparse.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ use B qw(class main_root main_start main_cv svref_2object opnumber perlstring
4646
MDEREF_SHIFT
4747
);
4848

49-
$VERSION = '1.33';
49+
$VERSION = '1.34';
5050
use strict;
5151
use vars qw/$AUTOLOAD/;
5252
use warnings ();
@@ -1724,7 +1724,7 @@ sub stash_variable {
17241724
return "$prefix$name";
17251725
}
17261726

1727-
if ($name =~ /^[^[:alpha:]+-]$/) {
1727+
if ($name =~ /^[^[:alpha:]_+-]$/) {
17281728
if (defined $cx && $cx == 26) {
17291729
if ($prefix eq '@') {
17301730
return "$prefix\{$name}";

lib/B/Deparse.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1534,7 +1534,7 @@ my @x;
15341534
@x = ($#{`}, $#{~}, $#{!}, $#{@}, $#{$}, $#{%}, $#{^}, $#{&}, $#{*});
15351535
@x = ($#{(}, $#{)}, $#{[}, $#{{}, $#{]}, $#{}}, $#{'}, $#{"}, $#{,});
15361536
@x = ($#{<}, $#{.}, $#{>}, $#{/}, $#{?}, $#{=}, $#+, $#{\}, $#{|}, $#-);
1537-
@x = ($#{;}, $#{:}, $#{1});
1537+
@x = ($#{;}, $#{:}, $#{1}), $#_;
15381538
####
15391539
# ${#} interpolated
15401540
# It's a known TODO that warnings are deparsed as bits, not textually.

0 commit comments

Comments
 (0)