X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDevel%2FDeclare%2FContext%2FSimple.pm;h=8cbc8c111f5d57ff91d69952d354ca94e35422e7;hb=strip_names_and_args;hp=8d83cdf4f1bdd4ca5eaccf5415c2a20a04a9237b;hpb=01fadf71d4d8248a714b8639f2d661dc17badc80;p=p5sagit%2FDevel-Declare.git diff --git a/lib/Devel/Declare/Context/Simple.pm b/lib/Devel/Declare/Context/Simple.pm index 8d83cdf..8cbc8c1 100644 --- a/lib/Devel/Declare/Context/Simple.pm +++ b/lib/Devel/Declare/Context/Simple.pm @@ -133,9 +133,9 @@ sub strip_names_and_args { while (1) { # Get the bareword my $thing = $self->strip_name; - # If there's no bareword here, bail the caller can check if - # we returned anything. - return unless defined $thing; + # If there's no bareword here, bail + confess "failed to parse bareword. found ${linestr}" + unless defined $thing; $linestr = $self->get_linestr; if (substr($linestr, $self->offset, 1) eq '(') { @@ -168,14 +168,14 @@ sub strip_names_and_args { } else { # fail if it isn't there - #FIXME + confess "couldn't find closing paren for argument. found ${linestr}" } } else { # No parens, so expect a single arg my $thing = $self->strip_name; - # If there's no bareword here, bail the caller can check if - # we returned anything. - return unless defined $thing; + # If there's no bareword here, bail + confess "failed to parse bareword. found ${linestr}" + unless defined $thing; $linestr = $self->get_linestr; if (substr($linestr, $self->offset, 1) eq '(') { # This one had a proto, pull it out