This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Deparse my var attributes correctly
authorDavid Mitchell <davem@iabyn.com>
Fri, 24 Feb 2017 14:32:28 +0000 (14:32 +0000)
committerDavid Mitchell <davem@iabyn.com>
Mon, 5 Jun 2017 11:52:18 +0000 (12:52 +0100)
commit82ab48fa8c6c51b80c9b69419850061640110339
tree6261756cecf64bec07b4c28e12e6df4258ad754a
parent0a30b526db0a91f5cad699185aecc65e6eef7965
Deparse my var attributes correctly

Formerly this:

    my $x :foo;

deparsed as

    'attributes'->import('main', \$x, 'foo'), my $x;

it now deparses as:

    my $x :foo;

It handles all the common forms, such as

    my Foo::Bar ($s, @a, %h) :foo(foo1) bar(bar1);

but doesn't yet handle an attribute declaration that's not a statement,
e.g.

    f(1, $x :foo);

Under TEST -deparse, this fixes the following unexpectedly failing
scripts:

    ../dist/IO/t/io_file_export.t
    ../dist/IO/t/io_multihomed.t
    ../dist/IO/t/io_udp.t
    ../dist/Thread-Queue/t/02_refs.t
    ../dist/Thread-Semaphore/t/01_basic.t
    ../dist/Thread-Semaphore/t/04_nonblocking.t
    ../dist/Thread-Semaphore/t/05_force.t
    ../dist/Thread-Semaphore/t/06_timed.t
    ../dist/threads-shared/t/av_refs.t
    ../dist/threads-shared/t/blessed.t
    ../dist/threads-shared/t/clone.t
    ../dist/threads-shared/t/cond.t
    ../dist/threads-shared/t/dualvar.t
    ../dist/threads-shared/t/hv_refs.t
    ../dist/threads-shared/t/object.t
    ../dist/threads-shared/t/object2.t
    ../dist/threads-shared/t/shared_attr.t
    ../dist/threads-shared/t/sv_refs.t
    ../dist/threads-shared/t/utf8.t
    ../dist/threads-shared/t/wait.t
    ../dist/threads-shared/t/waithires.t
    ../dist/threads/t/err.t
    ../dist/threads/t/free.t
    ../dist/threads/t/join.t
    ../dist/threads/t/kill.t
    ../dist/threads/t/kill2.t
    ../dist/threads/t/libc.t
    ../dist/threads/t/problems.t
    ../dist/threads/t/state.t
    op/threads-dirh.t

and fixes the following expected-to-fail scripts:

    ../dist/Thread-Queue/t/08_nothreads.t
    ../dist/threads/t/exit.t
    ../dist/threads/t/thread.t
    op/attrs.t
    op/getpid.t
Porting/deparse-skips.txt
lib/B/Deparse.pm
lib/B/Deparse.t