develooper Front page | perl.perl5.porters | Postings from May 2010

Re: package block syntax

Thread Previous | Thread Next
May 1, 2010 09:59
Re: package block syntax
Message ID:
Attached patch is an updated version of my "package Foo { }"
implementation.  This fixes the SEGV in parser error recovery and adds
more tests.  No one has objected to the new syntax, and a few people
have expressed approval, so I think this can be applied.

This message provides a single patch incorporating both the original
implementation and these new changes, for ease of testing.  For
application to blead it might be preferred to apply the three patches
separately.  Whoever wants to apply it can negotiate with me about the
best form in which to supply the patches.  My git log has this:

commit 19dcffbd38634cd58401fcab66da7dcbc8fcca05
Author: Zefram <>
Date:   Sat May 1 17:51:21 2010 +0100

    additional tests for package block syntax
    Test that __PACKAGE__ propagates into string eval correctly.  Test that
    __LINE__ is correct.  Test that goto into and out of package blocks
    works correctly.

commit bdf8b2094a086d18ae0d3970228a650e4e1b4783
Author: Zefram <>
Date:   Sat May 1 17:30:26 2010 +0100

    fix SEGV with eval("package Foo {")
    OPs relating to the package name and version were subject to double
    freeing during error recovery from an incomplete package block.  Fixed by
    using the op_latefree mechanism to shift the op free time.

commit 4f4789ec446d15b1b5dafe18919f024523b6f613
Author: Zefram <>
Date:   Mon Apr 19 20:37:25 2010 +0100

    support "package Foo { ... }"
    Package block syntax limits the scope of the package declaration to the
    attached block.  It's cleaner than requiring the declaration to come
    inside the block.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About