This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #81424] Make Deparse handle /aelemfast_lex/
authorFather Chrysostomos <sprout@cpan.org>
Sat, 24 Dec 2011 02:44:43 +0000 (18:44 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 24 Dec 2011 02:52:13 +0000 (18:52 -0800)
commit4b58603b60aa116b5fc03c6b7fb5bb3303aab4f9
treefeb86460d76eb43731ebff3327a74ad02837337b
parentd4963d040dfafb02552348395220af7f6f232dca
[perl #81424] Make Deparse handle /aelemfast_lex/

B::Deparse’s pure_string subroutine, that checks whether an op tree
can fit in double-quotish syntax, didn’t know about aelemfast_lex, or,
formerly, aelemfast on lexical variables.  (It did know how to han-
dle aelemfast for package variables.)  Consequently it was deparsing
/$a[0]/ as $a[0] for a lexical @a.

/$a[0]/ with a package variable looks like this:

9        </> match() lK/RTIME ->a
8           <|> regcomp(other->9) sK/1 ->9
6              <1> regcreset sK/1 ->7
-                 <1> ex-aelem sK/2 ->8
-                    <1> ex-rv2av sKR/1 ->-
7                       <#> aelemfast[*s] s/1 ->8
-                    <0> ex-const s ->-

There are two null ops (ex-*) before the aelemfast.

/$a[0]/ with a lexical variable looks like this:

9        </> match() lK/RTIME ->a
8           <|> regcomp(other->9) sK/1 ->9
6              <1> regcreset sK/1 ->7
-                 <1> ex-aelem sK/2 ->8
7                    <0> aelemfast_lex[@s:1,2] sR/1 ->8
-                    <0> ex-const s ->-

There is only one null op (ex-aelem).
dist/B-Deparse/Deparse.pm
dist/B-Deparse/t/deparse.t