diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-12-20 22:53:13 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-12-20 23:30:04 -0800 |
commit | b89b72572533bd5be1cc901f1d10aadca7e64154 (patch) | |
tree | f9b9b1a4817275695568145221302d4e8a28dfee /hv.c | |
parent | 3e58017a75042bfef5966f41ba7799b045f69388 (diff) | |
download | perl-b89b72572533bd5be1cc901f1d10aadca7e64154.tar.gz |
[perl #91416] Deparse open("blah blah blah") properly
‘open bareword’ compiles down to
open
`--+--pushmark
`--gv
whereas ‘open "string"’ compiles down to
open
`--+--pushmark
`--rv2gv
`----gv
the same as ‘open *glob’.
B::Deparse was deparsing the child of the rv2gv, in order to deparse
things like open(my $fh...) as they were entered, instead of
open(*my $fh), which wouldn’t work. gvops were being deparsed as
the name. But this meant that ‘open "open"’ would be deparsed as
‘open open’, which does something different, ‘open’ being a keyword.
It also did that with ‘open '%^$^$%'’, which would deparse without the
quotation marks.
This commit changes the deparsing of filehandle-op -> rv2gv -> gv,
by keeping the explicit * present if the name of the gv is a valid
identifier (so open("foo") and open(*foo), which compile identi-
cally, both come out as open(*foo)), or by using quotation marks if
it is not.
Diffstat (limited to 'hv.c')
0 files changed, 0 insertions, 0 deletions