Permalink
Commits on Dec 19, 2012
  1. converted remaining compile-time errors

    using the new sig_parsing_error() function
    this should polish off the last of GitHub #61
    barefootcoder committed Dec 19, 2012
  2. fix for GitHub #61

    turns out Damian (@thoughtstream) had done all the hard work, really
    fatal() was already a variation on signature_error() that was designed for compile-time errors
    I just needed to get that renamed and exported so it was accessible outside Method::Signatures::Parser
    I also took the opportunity to clean up and consistencize the compile-time errors,
    	and also expanded the error reporting testing structure in t/error_reporting.t
    barefootcoder committed Dec 19, 2012
  3. renamed and exporter compile-time error sub

    renamed from fatal() to sig_parsing_error() for clarity
    exported so can be used by the mispositioned slurpy parameter error
    	(which will fix GitHub #61)
    I've not tried to make it overridable, like signature_error()
    	partially because it seems like compile-time errors probably _shouldn't_ be overridden
    	but also because it would be a major PITA to do that
    barefootcoder committed Dec 19, 2012
  4. added test for other compile-time errors

    turns out there was really only one more
    there are a few errors that would trigger if PPI failed to parse,
    	but those are difficult to simulate
    there are also 3 errors that trigger in Perl 5.8.x,
    	but those are already being tested in t/before_510.t,
    	and I didn't want to clutter this file with $] checks
    so that just leave the one that checks for trailing garbage after a parameter has been parsed
    barefootcoder committed Dec 19, 2012
  5. first compile-time error check

    mostly a proof-of-concept
    checks the "bad parameter specification" error
    barefootcoder committed Dec 18, 2012
  6. change existing compile-time errors ...

    ... both to match what the new compile-time error reporting testing will expect
    ... and also to just look a bit nicer
    barefootcoder committed Dec 18, 2012
  7. refactoring tests to allow reporting compile-time errors

    original version of t/error_reporting.t did this
    	but the only compile time erorr we were checking for was removed
    	so when the structure was refactored (including making t/lib/GenErrorRegex.pm), compile-time errors were not included
    now we have some compile-time errors to test, so this capability has been restored
    this will make it easier to address GitHub #61
    barefootcoder committed Dec 18, 2012
Commits on Dec 15, 2012
Commits on Dec 13, 2012
  1. fix for GitHub #57

    The attached patch (against yesterday's dev release)
    adds the ability to alias named parameters, using either
    the '\:@param' or ':@param is alias' syntaxes.
    
    I was surprised how easy it turned out to be to add in this
    feature. Data::Alias to the rescue again!
    thoughtstream committed with barefootcoder Dec 13, 2012
Commits on Dec 1, 2012
Commits on Nov 29, 2012
Commits on Nov 24, 2012
  1. Trailing commas on parameter lists are ok.

    For rt.cpan.org 81364
    schwern committed Nov 24, 2012
  2. Add additional debugging information showing the actual code replacem…

    …ent.
    
    This is important information as it shows the actual code before and after compiling.
    
    The "if $DEBUG" is to avoid $self->get_linestr() from being called extra times
    while debugging is off.
    schwern committed Nov 24, 2012
  3. Add a TODO test for closing parens in commas.

    For rt.cpan.org 81365
    schwern committed Nov 24, 2012
  4. Check if PPI failed to parse a document and produce an error.

    Better than "Can't call method 'prune' on undefined value".
    schwern committed Nov 24, 2012
Commits on Nov 8, 2012
  1. Merge pull request #51 from schwern/feature/inject_BEGIN

    Remove Devel::BeginLift
    barefootcoder committed Nov 8, 2012
Commits on Nov 4, 2012
Commits on Oct 28, 2012
  1. Fix `when {}`.

    Also added a test for `when []`.  I didn't find a good file for
    testing when parsing issues, so I made one up.
    
    For #60
    schwern committed Oct 28, 2012
  2. Eliminate all the eval blocks from the where clause tests.

    Makes it much easier to code and debug.
    
    All the tests for errors on Perls prior to 5.10 have been moved to their own file.
    schwern committed Oct 28, 2012
Commits on Oct 27, 2012
  1. Remove the big eval block in zero_defaults.t.

    It's not necessary and makes debugging hard.  Just skip_all at compile time
    before Perl has a chance to see the rest of the script.
    schwern committed Oct 27, 2012
  2. Fix handling of anonymous methods with attributes.

    Buddy also thought the way anonymous functions with attributes were handled
    is fishy.  Figured out why Devel::Declare::MethodInstaller::Simple->parser
    will only add the "sub" for attributes.  It has to do with a quirk in how
    prototypes are parsed.  Here's two versions of what a compiled anon
    func might look like.
    
      # If we leave out the "sub".
      sub func(&) { return shift; };
      my $a = [ func { 123 }, 1 ];
    
      # If we always put in a "sub".
      sub func(&) { return shift; };
      my $a = [ func sub { 123 }, 1 ];
    
    The top one works, the bottom one fails "too many arguments for
    main::func".  The prototype must be getting confused.  This may be why
    it fixed a 5.10 bug, there may have been a prototype glitch.  Or maybe
    this behavior is a prototype glitch.  Either way it works now on
    5.10.0 and 5.14.1.
    
    The t/larna.t tests catch this problem.
    
    There's no need to replicate the Devel::Declare logic, only in the
    case of a BEGIN lift.  I can no longer replicate a 5.10 bug.  It's
    possible the bug was tickled by Devel::BeginLift.
    
    Signed-off-by: Michael G. Schwern <schwern@pobox.com>
    schwern committed Oct 27, 2012
  3. Merge branch 'master' into feature/inject_BEGIN

    Conflicts:
    	lib/Method/Signatures.pm
    schwern committed Oct 27, 2012
Commits on Oct 26, 2012