Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Commits on Mar 3, 2015
  1. @schwern
Commits on Sep 21, 2014
  1. @barefootcoder

    Merge pull request #109 from evalEmpire/issue/104

    barefootcoder authored
    Fix line numbers for multi-line signatures
Commits on Sep 20, 2014
  1. @barefootcoder

    Merge pull request #110 from evalEmpire/issue/108

    barefootcoder authored
    A required positional after an optional positional is an error.
  2. @barefootcoder

    fix for pull request #82

    barefootcoder authored
    test was failing on 5.8.9
    not entirely sure why, but falling back to a simpler string eval seems to fix it, so I'm just going with that
Commits on Sep 18, 2014
  1. @barefootcoder

    Merge pull request #82 from Hercynium/master

    barefootcoder authored
    Feature to change name of invocant variable on import
Commits on Sep 14, 2014
  1. @schwern

    A required positional after an optional positional is an error.

    schwern authored
    As documented...
    
       * If one positional param is optional, everything to the right must be
       optional
    
           method foo($a, $b?, $c?)  # legal
    
           method bar($a, $b?, $c)   # illegal, ambiguous
    
       Does "->bar(1,2)" mean $a = 1 and $b = 2 or $a = 1, $c = 3?
    
    A required positional after a slurpy technically falls under this, but gets
    its own specific error message elsewhere.  This is good because "slurpy
    args can only come last" is the information the user needs.
Commits on Sep 12, 2014
  1. @schwern
  2. @schwern

    Skip tests about line numbers for computed defaults on earlier Perls.

    schwern authored
    5.10 and back probably set the line number after parsing a "line"
    rather than per op code.  This might explain why Perl would often be
    off by one in error reporting inside things like if statements.
    
    The important thing is the body of the subroutine is correct, so I'm
    skipping the tests for default line numbers on those Perls.  My yak
    shears are dull.
  3. @schwern
Commits on Sep 11, 2014
  1. @schwern
  2. @schwern

    Line numbers in the signature are now accounted for.

    schwern authored
    Devel::Declare::set_linestr() cannot normally add multiple lines.  Toby and I
    figured out a way to trick the parser into continuing to process multiple lines
    without executing any addiitonal code.
    http://stackoverflow.com/a/25738997/14660
Commits on Sep 10, 2014
  1. @schwern

    Change MS::Parameter->line_number to first_line_number.

    schwern authored
    Since parameters can span multiple lines, this is more explicit about
    what it is.
  2. @schwern

    Test and fix MS::Parameter->line_number.

    schwern authored
    We have to look at the first *significant* token in a parameter.
    Otherwise we'll pick up the whitespace after a comma, for example.
  3. @schwern

    Better name for a test.

    schwern authored
    split_proto() no longer exists.  MS::Signature->parameters takes over its
    work.
  4. @schwern

    Add the line number to the Parameter object.

    schwern authored
    Because the PPI tokens have the line number informaiton, this required
    unifying the parameter splitting with building the Parameter object.
    This is a good idea, the intermediate step was unnecessary, but I'm
    not happy with how complicated the loop has gotten.
    
    Ideally, MS::Parameter->new would be passed the PPI tokens and be left
    to do the work that _build_parameters is currently doing.  This would
    also avoid having to reconstruct the code and then reparse it with PPI
    inside Parameter.  The problem is how to neatly snip off a fragment
    of a PPI::Statement.  Not ready to tackle that.
    
    Haven't tested the line number yet.  That's coming next.
Commits on Aug 6, 2014
  1. @schwern

    Test multi-line string defaults.

    schwern authored
    Seem Devel::Declare::set_linestr() doesn't mind them.  We got lucky.
  2. @schwern

    Fix multi-line defaults.

    schwern authored
    Devel::Declare cannot inject multiple lines.  This code flattens multi-
    line default expressions into a single line which Devel::Declare can
    handle.
    
    This will cause further problems with maintaining line numbers for
    calculated expressions within a complex expression, such as...
    
        func stuff(
            $arg = {
                foo => get_foo(),
                bar => 23
            }
        ) {
           ...
        }
    
    but there's no solution for that problem yet.
  3. @barefootcoder

    Merge pull request #103 from evalEmpire/issue/102

    barefootcoder authored
    Type check *after* the default is applied.  For #102
Commits on Jul 30, 2014
  1. @schwern

    5.8 fixed for reals this time.

    schwern authored
    when doesn't work on 5.8 either, which is puzzling.
  2. @schwern
  3. @schwern
Commits on Jul 29, 2014
  1. @schwern

    Type check *after* the default is applied.

    schwern authored
    Types were checked before defaults were applied which worked when
    defaults could only apply to arguments that weren't passed in.  Now that
    we have the where clause (and the //= shortcut) you can pass in a value
    and still get a default.
    
        func hi( Str $place //= "World" ) { print "Hi, $place!\n" }
        hi();      # works
        hi(undef); # the 'place' parameter (undef) is not of type Str
    
    This patch fixes that.  Type checks are done after defaults are
    applied, and args with defaults are now always type checked.
    
    Another consequence is defaults are now type checked.  This will now fail.
        Object $thing = "string"
    This could maybe be optimized by type checking the default once
    at compile time.
Commits on Mar 23, 2014
  1. @barefootcoder

    Merge branch 'master' into refactor/signature_class

    barefootcoder authored
    Conflicts:
    	lib/Method/Signatures.pm
Commits on Mar 6, 2014
  1. @schwern

    Remove 'use experimental', it doesn't work with 5.8.

    schwern authored
    Alas, "use experimental" 0.006 added a requirement for 5.10.
    Use the equivalent "use if, no warnings" statement instead.
    
    Might be a better long term fix, but this gets Travis working
    again on 5.8 and that's more important.
  2. @schwern

    Move tokenization of the parameter list into MS::Signature.

    schwern authored
    MS::Parser is now just a utility library and needs to be renamed.
    
    MS::Signature now completely handles signature parsing.
    
    I'm pretty sure MS::Signature could hand MS::Parameter pieces of
    the PPI document and avoid having to reparse each parameter.
  3. @schwern

    Eliminate the now redundant parse_signature().

    schwern authored
    parse_signature() is a better name, but all that functionality will
    move into MS::Signature so it's moot.
  4. @schwern

    Collapse parse_func() and parse_signature() together.

    schwern authored
    No need to split them anymore.
    
    parse_signature() seemed more namey of the two.
  5. @schwern

    Refactor $self->{signature} into Method::Signatures::Signature

    schwern authored
    MS::Signature is just a basic data container object for now to
    prepare for moving the functionality out of MS and into MS::Signature.
Commits on Oct 7, 2013
  1. @barefootcoder
Commits on Oct 4, 2013
  1. @barefootcoder
Commits on Jul 16, 2013
  1. @hercynium
Commits on Jun 10, 2013
  1. @hercynium
Commits on Mar 25, 2013
  1. @schwern

    Tests can no longer assume we don't load Mouse.

    schwern authored
    MS::Parameter loads it.  The tests are moot.
  2. @schwern
Commits on Feb 17, 2013
  1. @barefootcoder

    eliminate Moose as a testing requirement

    barefootcoder authored
    part of cleaning up larryl's fix for #54
Something went wrong with that request. Please try again.