In perl.git, the branch sprout/overridesβ has been created

<http://perl5.git.perl.org/perl.git/commitdiff/8cf8f4f7e4a2ffc93e7238577d904a15d48f61a5?hp=0000000000000000000000000000000000000000>

        at  8cf8f4f7e4a2ffc93e7238577d904a15d48f61a5 (commit)

- Log -----------------------------------------------------------------
commit 8cf8f4f7e4a2ffc93e7238577d904a15d48f61a5
Author: Father Chrysostomos <[email protected]>
Date:   Thu May 3 09:29:18 2012 -0700

    Make ‘require 6’ a syntactic special case
    
    This commit removes the special-casing for ‘require 6’ from the token-
    iser and from pp_require.  Now it all happens at optree-building time
    in op.c.  If the argument to require is a constant (not counting
    folded constants) that is a number or a vstring, the require
    op is flagged as being a version check, with the newly-added
    OPpREQUIRE_VER flag.
    
    This means that ‘require $ver’ no longer works, which could be consid-
    ered an incompatible change (some tests had to change), but see the
    bug fixes below.
    
    Since CORE::require($_[0]) will no longer work from an override (actu-
    ally a callback; see perl #108286), overrides are no longer called for
    version checks like ‘require 5’.  The tests for this are marked to-do
    for now, as they will be re-enabled (with ‘use feature "overrides"’)
    when the ‘overrides’ feature comes into effect.
    
    These bug fixes result from this change:
    
    • [perl #105926] These two lines:
    
        $x = "6"; require $x;
        $x = "6"; 0+$x; require $x;
    
      should behave exactly the same way, but the latter was a version
      check.  Now they are both file names. And this no longer happens:
    
        $ perl5.12.4 -le '$x = "34 cabbages"; 0+$x; require $x'
        Invalid version format (non-numeric data) at -e line 1.
    
      In this case, "34 cabbages" should obviously be a file name, but its
      numeric representation was causing it to be treated as a version
      number; yet the version-parsing code used the string representation.
    
    • [perl #105924] An infix operator that has a different meaning when
      an infix operator is not expected (e.g., <<) is now permitted after
      a number immediately following ‘require’, just like infix operators
      that are always unambiguous (such as >>).  The second of these two
      lines used to be a syntax error:
    
        print require 5 >> $3;
        print require 5 << $3;
    
    • [perl #105928] require no longer reports a syntax error when certain
      characters follow a version number.  Previously, only ; { } and
      whitespace were allowed after it.  The first of these lines used to
      be a syntax error, while the second was fine:
    
        require 5, print "ok";
        require 5 , print "ok";
    
    Those last two bug fixes are due to the removal of special-casing from
    the tokeniser.  ‘require’ was using the same version-parsing routine
    as ‘use’, which seems to have been written for the sake of ‘use’
    (which has more stringent parsing requirements, being forbidden in an
    expression), without taking ‘require’ into account.

M       ext/B/B/Concise.pm
M       op.c
M       op.h
M       pp_ctl.c
M       t/comp/require.t
M       t/op/override.t
M       toke.c

commit fa1199d6a1d1a914e10ff00b13aeb34e3d3627bf
Author: Father Chrysostomos <[email protected]>
Date:   Thu May 3 09:12:03 2012 -0700

    override.t: Remove obsolete comment

M       t/op/override.t

commit 71c4d9f2749a961991de15baf3a4275879c0540e
Author: Father Chrysostomos <[email protected]>
Date:   Wed May 2 20:37:12 2012 -0700

    require_errors.t: Test <> error

M       t/op/require_errors.t

commit 4f12d4e084eb2a2109fa6b054ddb908f980e2983
Author: Father Chrysostomos <[email protected]>
Date:   Wed May 2 20:36:20 2012 -0700

    Allow require_errors.t to be run from the top level

M       t/op/require_errors.t

commit f00c2197a4d9aaabb8a2073370351a499c7a503b
Author: Father Chrysostomos <[email protected]>
Date:   Mon Apr 30 18:18:03 2012 -0700

    Record folded constants in the op tree

M       dump.c
M       ext/B/B/Concise.pm
M       ext/B/t/optree_constants.t
M       ext/B/t/optree_samples.t
M       op.c
M       op.h
M       toke.c

commit fe94053fb58b65eb48df29276c5d938049cace09
Author: Father Chrysostomos <[email protected]>
Date:   Mon Apr 30 18:04:23 2012 -0700

    Remove OPpCONST_WARNING from B::Concise

M       ext/B/B/Concise.pm

commit 3639d2ce24d1dfc4f4e69958649a09221748f465
Author: Father Chrysostomos <[email protected]>
Date:   Mon Apr 30 18:03:27 2012 -0700

    Increase $B::Concise::VERSION to 0.90

M       ext/B/B/Concise.pm

commit 4aca037c69379d01e9a02324b815dd10f47534a5
Author: Father Chrysostomos <[email protected]>
Date:   Mon Apr 30 17:46:48 2012 -0700

    Remove OPpCONST_WARNING
    
    This was added to op.h in commit 599cee73:
    
    commit 599cee73f2261c5e09cde7ceba3f9a896989e117
    Author: Paul Marquess <[email protected]>
    Date:   Wed Jul 29 10:28:45 1998 +0100
    
        lexical warnings; tweaks to places that didn't apply correctly
                Message-Id: <[email protected]>
                Subject: lexical warnings patch for 5.005_50
    
        p4raw-id: //depot/perl@1773
    
    dump.c was modified to dump in, in this commit:
    
    commit bf91b999b25fa75a3ef7a327742929592a2e7e9c
    Author: Simon Cozens <[email protected]>
    Date:   Sun May 13 21:20:36 2001 +0100
    
        Op private flags
        Message-ID: <[email protected]>
    
        p4raw-id: //depot/perl@10117
    
    But is apparently completely unused anywhere.  And I want that bit.

M       dump.c
M       op.h

commit c3920808cb90480ec26f8f359cecb93d2e455ddc
Author: Father Chrysostomos <[email protected]>
Date:   Mon Apr 30 08:49:32 2012 -0700

    Add &CORE::prototype

M       gv.c
M       t/op/coreamp.t
M       t/op/coresubs.t

commit c16e66bb5beac4d7dc38f279fe48f9dd04f0ef8b
Author: Father Chrysostomos <[email protected]>
Date:   Sun Apr 29 21:16:51 2012 -0700

    coreamp.t: rename badly-named tests

M       t/op/coreamp.t

commit ff5fea800419273465d60f0a20782e7767ae62ef
Author: Father Chrysostomos <[email protected]>
Date:   Sun Apr 29 21:15:25 2012 -0700

    Add &CORE::pos

M       gv.c
M       op.c
M       t/op/coreamp.t
M       t/op/coresubs.t

commit 1edc90e82915aa26f15d693e8ae4747bcec02a44
Author: Father Chrysostomos <[email protected]>
Date:   Sun Apr 29 17:58:44 2012 -0700

    Add &CORE::glob
    
    I added a special case for OP_GLOB to pp_coreargs, since glob does not
    have the u flag in regen/opcodes; hence PL_opargs[opnum] & OA_DEFGV is
    false, even though glob does imply $_.
    
    Adding the flag to regen/opcodes is not so simple, as the code in
    ck_fun that adds the DEFSV op does not account for list ops, but
    leaves op_last unchanged.
    
    Changing ck_fun to account requires adding more code than this special
    case in pp_coreargs.
    
    OPf_SPECIAL indicates that glob was called with the CORE:: prefix.

M       gv.c
M       op.c
M       pp.c
M       t/op/coreamp.t
M       t/op/coresubs.t

commit 52ccf0477959b1f4f43cde25254f55138cdd7108
Author: Father Chrysostomos <[email protected]>
Date:   Sun Apr 29 11:11:15 2012 -0700

    op.c:ck_glob: Don’t do gv_fetchpv("CORE::GLOBAL::glob")
    
    We have PL_globalstash precisely to avoid the nested stash lookup in
    cases like these.

M       op.c

commit 4b6550788e9cf6c660dace7182f6bcc99aed55a2
Author: Father Chrysostomos <[email protected]>
Date:   Sun Apr 29 00:11:10 2012 -0700

    op.c:ck_require: Ignore sub prototype
    
    The require operator doesn’t allow its syntax to be overridden.  But
    it was still calling an override’s call checker anyway, resulting in
    strange effects like this:
    
    $ perl -e 'use subs "require"; sub require($$){}; require(1,2)'
    Not enough arguments for main::require at -e line 1, at EOF
    Execution of -e aborted due to compilation errors.
    $ perl -e 'use subs "require"; sub require(){}; require()'
    Too many arguments for main::require at -e line 1, at EOF
    Execution of -e aborted due to compilation errors.
    
    The sub’s own prototype should either apply or not apply; we should
    not have some hybrid behaviour half way in between.
    
    In this case, since require has its own parsing, that should take
    precedence.

M       op.c
M       t/comp/bproto.t

commit 2062176cded0ed5278b5cd93ea6fa2effbf50f08
Author: Father Chrysostomos <[email protected]>
Date:   Sun Apr 29 00:06:51 2012 -0700

    op.c:ck_glob: Ignore sub prototype
    
    The glob operator doesn’t allow its syntax to be overridden.  But it
    was still calling an override’s call checker anyway, resulting in
    strange effects like this:
    
    $ perl5.15.9 -e 'use subs "glob"; sub glob($$){} glob 1,2'
    Too many arguments for glob at -e line 1, at EOF
    Not enough arguments for main::glob at -e line 1, at EOF
    Execution of -e aborted due to compilation errors.
    
    The sub’s own prototype should either apply or not apply; we should
    not have some hybrid behaviour half way in between (two many and not
    enough at the same time‽).
    
    In this case, since glob has its own parsing, that should take
    precedence.

M       op.c
M       t/comp/bproto.t

commit e2154a2a84eb13ca3190840154e1b9d948aa3f47
Author: Father Chrysostomos <[email protected]>
Date:   Sat Apr 28 23:59:46 2012 -0700

    op.c:dofile: Ignore sub prototype
    
    The do-FILE operator doesn’t allow its syntax to be overridden.  But
    it was still calling an override’s call checker anyway, resulting in
    strange effects like this:
    
    $ perl -e 'use subs "do"; sub do($$){}; do(1,2)'
    Not enough arguments for main::do at -e line 1, at EOF
    Execution of -e aborted due to compilation errors.
    $ perl -e 'use subs "do"; sub do(){}; do()'
    Too many arguments for main::do at -e line 1, at EOF
    Execution of -e aborted due to compilation errors.
    
    The sub’s own prototype should either apply or not apply; we should
    not have some hybrid behaviour half way in between.
    
    In this case, since ‘do’ has its own parsing, that should take
    precedence.

M       op.c
M       t/comp/bproto.t

commit a1d7763d1e1a1fcda280fe89e9ad6af5be0cb456
Author: Father Chrysostomos <[email protected]>
Date:   Sat Apr 28 23:46:03 2012 -0700

    op.c: Remove a redundant ck_subr call from ck_require
    
    newUNOP(OP_ENTERSUB, ...) already calls ck_subr, so wrapping it in
    ck_subr(...) is unnecessary and wasteful of precious CPU time.

M       op.c

commit 1e8b51d52e370ebab4933933075d9da94e42b93d
Author: Father Chrysostomos <[email protected]>
Date:   Sat Apr 28 23:45:37 2012 -0700

    op.c: Remove a redundant ck_subr call from ck_glob
    
    newUNOP(OP_ENTERSUB, ...) already calls ck_subr, so calling ck_subr on
    its return value is unnecessary and wasteful of precious CPU time.

M       op.c

commit 92a3e45cf8fce71d8309e3cbf5e0c9f43321a2da
Author: Father Chrysostomos <[email protected]>
Date:   Sat Apr 28 23:43:42 2012 -0700

    op.c: Remove a redundant ck_subr call from dofile
    
    newUNOP(OP_ENTERSUB, ...) already calls ck_subr, so wrapping it in
    ck_subr(...) is unnecessary and wasteful of precious CPU time.

M       op.c

commit 01b43fdbca1ad0d06cc3d2ccd4dec81677378f22
Author: Father Chrysostomos <[email protected]>
Date:   Sat Apr 28 21:27:40 2012 -0700

    op.c:ck_glob: Check PL_globhook before loading File::Glob
    
    By loading File::Glob when there is no CORE::GLOBAL::glob, we just end
    up calling Perl_load_module for every glob op, since File::Glob no
    longer uses CORE::GLOBAL::glob by default.
    
    We could just as well check whether PL_globhook is set, which would
    be faster.
    
    (File::Glob sets PL_globhook when it loads.  In 5.14, it didn’t
    set anything, but ck_glob itself would set CORE::GLOBAL::glob to
    File::Glob::csh_glob.)

M       op.c

commit 7d9e13db299882023f22dcccb904628d4638e249
Author: Father Chrysostomos <[email protected]>
Date:   Sat Apr 28 00:26:39 2012 -0700

    Remove the second param to tryAMAGICunTARGET
    
    This macro is unused on CPAN and completely undocumented, so this
    change should be safe.

M       pp.h
M       pp_hot.c
M       pp_sys.c

commit c93e6f73ef9b52dc79bf39e047949f0cf34e4931
Author: Father Chrysostomos <[email protected]>
Date:   Sat Apr 28 00:24:01 2012 -0700

    Zap PL_glob_index
    
    As of the previous commit, nothing is using it.

M       embedvar.h
M       intrpvar.h
M       sv.c

commit 1add7f22f87cac99ba7b540df5c8b9f5e7605b4f
Author: Father Chrysostomos <[email protected]>
Date:   Sat Apr 28 00:18:30 2012 -0700

    Stop using PL_glob_index for PL_globhook
    
    If Glob.xs just uses the address of PL_op as its iterator key all the
    time (when called via PL_globhook too, not just via a glob override),
    the code is simpler.

M       ext/File-Glob/Glob.xs
M       op.c
M       pp_sys.c

commit c96707837da5de559d0b38ac3108e54830928623
Author: Father Chrysostomos <[email protected]>
Date:   Sat Apr 28 00:16:25 2012 -0700

    Test <> ovrld with glob override
    
    In the previous commit, I almost screwed up the stack for those cases
    where glob is overridden and there is iterator overloading.

M       lib/overload.t

commit 77942cc1b3b8892fceb4f8b035c5a9a51b16a2f5
Author: Father Chrysostomos <[email protected]>
Date:   Fri Apr 27 19:50:44 2012 -0700

    Don’t pass PL_glob_index to glob overrides
    
    This magic second argument is undocumented, unused on CPAN and in the
    core (as of the last few commits), and getting in the way of allowing
    glob() to be overridden properly.
    
    It gets in the way because, under the ‘overrides’ feature (still a
    no-op), the glob keyword will be truly overridable, with no magic
    involved, but it will still be called by the built-in <...> operator,
    which consequently must not pass any magic second argument.
    
    See <https://rt.perl.org/rt3/Ticket/Display.html?id=108286>.

M       op.c
M       pp_sys.c

commit 632ec2a4b8cee6b2832227965dde3976a3792585
Author: Father Chrysostomos <[email protected]>
Date:   Fri Apr 27 17:08:15 2012 -0700

    File::Glob: Don’t use the magic 2nd arg to glob
    
    This argument is going away, because it is undocumented, unused on
    CPAN outside of the core, and getting in the way of allowing glob() to
    be overridden properly.
    
    It gets in the way because, under the ‘overrides’ feature (still a
    no-op), the glob keyword will be truly overridable, with no magic
    involved, but it will still be called by the built-in <...> operator,
    which consequently must not pass any magic second argument.
    
    See <https://rt.perl.org/rt3/Ticket/Display.html?id=108286>.

M       ext/File-Glob/Glob.pm
M       ext/File-Glob/Glob.xs

commit 140d1477d9345d3659b2e33906ff513565345614
Author: Father Chrysostomos <[email protected]>
Date:   Fri Apr 27 17:06:19 2012 -0700

    Increase $File::Glob::VERSION to 1.18

M       ext/File-Glob/Glob.pm

commit 509a0c744ee6ea8e1d870e4fc5e2ccd4d3b1895d
Author: Father Chrysostomos <[email protected]>
Date:   Fri Apr 27 16:48:36 2012 -0700

    DosGlob: Don’t use the magic 2nd arg to glob
    
    This argument is going away, because it is undocumented, unused on
    CPAN outside of the core, and getting in the way of allowing glob() to
    be overridden properly.
    
    It gets in the way because, under the ‘overrides’ feature (still a
    no-op), the glob keyword will be truly overridable, with no magic
    involved, but it will still be called by the built-in <...> operator,
    which consequently must not pass any magic second argument.
    
    See <https://rt.perl.org/rt3/Ticket/Display.html?id=108286>.

M       MANIFEST
A       ext/File-DosGlob/DosGlob.xs
M       ext/File-DosGlob/lib/File/DosGlob.pm
M       ext/File-DosGlob/t/DosGlob.t

commit 00902536e16664d9fe56f5b96f2ac57463e93347
Author: Father Chrysostomos <[email protected]>
Date:   Fri Apr 27 16:39:02 2012 -0700

    Increase $File::DosGlob::VERSION to 1.07

M       ext/File-DosGlob/lib/File/DosGlob.pm

commit 62f3500b4ad3ada0b8a94dfef84af30611aa2537
Author: Father Chrysostomos <[email protected]>
Date:   Fri Apr 27 14:05:39 2012 -0700

    Move File::DosGlob from lib to ext

M       MANIFEST
M       Porting/Maintainers.pl
A       ext/File-DosGlob/lib/File/DosGlob.pm
A       ext/File-DosGlob/t/DosGlob.t
D       lib/File/DosGlob.pm
D       lib/File/DosGlob.t

commit 705ed1b866d307fcf1b4412b23fe19aa6d878331
Author: Father Chrysostomos <[email protected]>
Date:   Fri Apr 27 09:53:16 2012 -0700

    Add &CORE::exists

M       gv.c
M       t/op/coreamp.t
M       t/op/coresubs.t

commit 3cf10d06c585083873fc0ad357f5007efa9bb5f6
Author: Father Chrysostomos <[email protected]>
Date:   Thu Apr 26 20:40:48 2012 -0700

    Add &CORE::delete

M       gv.c
M       t/op/coreamp.t
M       t/op/coresubs.t

commit c8bc3bc409de3ed22c86446890a0e0986b2ceeca
Author: Father Chrysostomos <[email protected]>
Date:   Thu Apr 26 20:38:37 2012 -0700

    Add &CORE::defined

M       gv.c
M       t/op/coreamp.t
M       t/op/coresubs.t

commit 55ed00e668be8ecfeb02ea73020fdf838d1bdb4a
Author: Father Chrysostomos <[email protected]>
Date:   Thu Apr 26 20:36:03 2012 -0700

    coresubs.t: Explicitly skip all unsupported keywords
    
    Instead of skipping positive keywords (those that cannot be over-
    ridden) because of their positivity, list them explicitly in the
    skip list.
    
    This will allow them to be removed one by one.

M       t/op/coresubs.t

commit 676c26ab48a8b35302ee8af1559150ebee878b45
Author: Father Chrysostomos <[email protected]>
Date:   Thu Apr 26 20:31:22 2012 -0700

    coreamp.t: Explicitly skip all unsupported keywords
    
    Instead of skipping positive keywords (those that cannot be over-
    ridden) because of their positivity, list them explicitly in the
    skip list.
    
    This will allow them to be removed one by one.

M       t/op/coreamp.t

commit 6e56e2c62a2f1910e75aa91ada86e48ccb95edc7
Author: Father Chrysostomos <[email protected]>
Date:   Thu Apr 26 17:56:46 2012 -0700

    gv.c: List all keywords with no coresubs
    
    S_maybe_add_coresub returns NULL for any keywords that are not
    overridable.
    
    Instead of identifying them by the positivity of their codes, list
    them all explicitly.
    
    This will allow coresubs to be added for them one by one.

M       gv.c

commit 48c1d75132b999e9460f1a080d550fb636e0c12b
Author: Father Chrysostomos <[email protected]>
Date:   Thu Apr 26 15:49:22 2012 -0700

    dump.c: Dump CVf_IN_OVERRIDES

M       dump.c

commit 9533e8fd1388d2dd35da250d6b7f95ef89eeb16f
Author: Father Chrysostomos <[email protected]>
Date:   Thu Apr 26 15:47:49 2012 -0700

    op.c: Record whether subs are compiled under overrides feature

M       op.c

commit 491d2da8633d501c2fbfcb2e750cec48632c9b25
Author: Father Chrysostomos <[email protected]>
Date:   Wed Apr 25 22:30:34 2012 -0700

    cv.h: Add CVf_IN_OVERRIDES flag
    
    This will be used to indicate that a sub was compiled under the
    ‘overrides’ feature.

M       cv.h

commit 425c0c4c747568f2e69b18a71d35d52d5cee9179
Author: Father Chrysostomos <[email protected]>
Date:   Tue Apr 24 06:24:50 2012 -0700

    Increase $feature::VERSION to 1.28

M       lib/feature.pm
M       regen/feature.pl

commit a5afc581374402f2dd7efac4d176d3a77d35c734
Author: Father Chrysostomos <[email protected]>
Date:   Mon Apr 23 23:19:32 2012 -0700

    Add overrides feature
    
    It doesn’t do anything yet.

M       feature.h
M       lib/feature.pm
M       regen/feature.pl

commit 7dbf49ff931137307d53bb5bbe228bd83fd3b6e0
Author: Father Chrysostomos <[email protected]>
Date:   Mon Apr 23 23:17:42 2012 -0700

    Add 5.17-18 feature bundles

M       lib/feature.pm
M       regen/feature.pl

commit ddeb3a89631b7514ecff5611d4e5992f45a482a9
Author: Father Chrysostomos <[email protected]>
Date:   Mon Apr 23 22:55:48 2012 -0700

    Update perlfunc/prototype
    
    to account for the new inconsequentiality of non-overridability.

M       pod/perlfunc.pod

commit bbdd537e46346b75810ed4aafc04b194b693267a
Author: Father Chrysostomos <[email protected]>
Date:   Sat Apr 21 19:12:21 2012 -0700

    [perl #97478] Make ‘Can’t find opnumber’ UTF-8- and null-clean

M       pp.c
M       t/comp/proto.t

commit 1dd8c87bbb5359fca8d2ce693b8a4a0eb043451a
Author: Father Chrysostomos <[email protected]>
Date:   Sat Apr 21 18:55:38 2012 -0700

    cproto.t: Add tests for BEGIN, etc.

M       t/op/cproto.t

commit c9054781ea3110f29730a16949209572952ea0a3
Author: Father Chrysostomos <[email protected]>
Date:   Sat Apr 21 18:30:35 2012 -0700

    Make cproto.t more stringent
    
    It was allowing prototype() to return undef where an empty string
    was expected.

M       t/op/cproto.t

commit 9bf7bf600d81669c46cc48362fcc9b89e5acddff
Author: Father Chrysostomos <[email protected]>
Date:   Sat Apr 21 12:50:25 2012 -0700

    Add protos for positive keywords
    
    ‘Positive’ means having a + before it in regen/keywords.pl; i.e., key-
    words that cannot be overridden.
    
    Since all keywords are going to be overridable, it makes sense to
    return prototypes for all that can have them, which turns out to be
    only a handful.
    
    Some of these can’t (easily) be generated from the information in
    regen/opcodes, without changing the flags.  Changing the flags (e.g.,
    using R instead of S for undef) causes other code paths to differ,
    resulting in test failures that I haven’t looked into yet.  But that
    is low priority.  In those cases I simply hard-coded the prototypes
    into op.c:core_prototype.

M       op.c
M       pp.c
M       t/op/cproto.t
-----------------------------------------------------------------------

--
Perl5 Master Repository

Reply via email to