This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Deparse.pm: handle optimised-away keys() better
authorDavid Mitchell <davem@iabyn.com>
Fri, 17 Nov 2017 11:16:08 +0000 (11:16 +0000)
committerDavid Mitchell <davem@iabyn.com>
Thu, 23 Nov 2017 08:52:16 +0000 (08:52 +0000)
commited34dca8117dd19b8eb9b3668892fd309157c5ad
treefc1ac69a07d9e9833459b407fd83f6fb716e51fe
parent676321c705825beee6e77d7855d45247c0500a02
Deparse.pm: handle optimised-away keys() better

keys() in void/scalar context optimises away the OP_KEYS op and handles
the action directly in the OP_PADHV or OP_RV2HV op.  However, Deparse
wasn't handling precedence correctly, so for example

    keys(%h) / 2

was being deparsed as

    keys %h/2

Also, keys wasn't being output as CORE::keys in the presence of

    sub keys {}
lib/B/Deparse.pm
lib/B/Deparse.t