This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
move sub attributes before the signature
authorDavid Mitchell <davem@iabyn.com>
Thu, 18 Jan 2018 09:44:10 +0000 (09:44 +0000)
committerDavid Mitchell <davem@iabyn.com>
Fri, 19 Jan 2018 21:01:21 +0000 (21:01 +0000)
commit894f226e51fd4f80c130447477b789cd25f37574
tree8ece1b7b33c24bd2fca57a1c37329b7636c3fb2f
parent8162c1afb1f54c157e62cc2627c156ef349a83d4
move sub attributes before the signature

RT #132141

Attributes such as :lvalue have to come *before* the signature to ensure
that they're applied to any code block within the signature; e.g.

    sub f :lvalue ($a = do { $x = "abc"; return substr($x,0,1)}) {
        ....
    }

So this commit moves sub attributes to come before the signature.  This is
how they were originally, but they were swapped with v5.21.7-394-gabcf453.
This commit is essentially a revert of that commit (and its followups
v5.21.7-395-g71917f6, v5.21.7-421-g63ccd0d), plus some extra work for
Deparse, and an extra test.

See:
    RT #123069 for why they were originally swapped
    RT #132141 for why that broke :lvalue
    http://nntp.perl.org/group/perl.perl5.porters/247999
               for a general discussion about RT #132141
lib/B/Deparse.pm
lib/B/Deparse.t
perly.act
perly.h
perly.tab
perly.y
pod/perlsub.pod
t/op/signatures.t