Skip to content

Commit

Permalink
fix bogus "at end of line" error message for "my (my $x, $y, $z)"
Browse files Browse the repository at this point in the history
  • Loading branch information
mauke committed Jun 4, 2016
1 parent cc93473 commit 37808b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
14 changes: 7 additions & 7 deletions t/lib/croak/toke
Expand Up @@ -251,46 +251,46 @@ Unterminated delimiter for here document at - line 1.
# NAME my (our $x) errors
my (our $x);
EXPECT
Can't redeclare "our" in "my" at - line 1, at end of line
Can't redeclare "our" in "my" at - line 1, near "(our"
Execution of - aborted due to compilation errors.
########
# NAME our (my $x) errors
our (my $x);
EXPECT
Can't redeclare "my" in "our" at - line 1, at end of line
Can't redeclare "my" in "our" at - line 1, near "(my"
Execution of - aborted due to compilation errors.
########
# NAME state (my $x) errors
use feature 'state';
state (my $x);
EXPECT
Can't redeclare "my" in "state" at - line 2, at end of line
Can't redeclare "my" in "state" at - line 2, near "(my"
Execution of - aborted due to compilation errors.
########
# NAME our (state $x) errors
use feature 'state';
our (state $x);
EXPECT
Can't redeclare "state" in "our" at - line 2, at end of line
Can't redeclare "state" in "our" at - line 2, near "(state"
Execution of - aborted due to compilation errors.
########
# NAME my (my $x) errors
my (my $x, $y, $z);
EXPECT
Can't redeclare "my" in "my" at - line 1, at end of line
Can't redeclare "my" in "my" at - line 1, near "(my"
Execution of - aborted due to compilation errors.
########
# NAME our (our $x) errors
our ($x, our($y), $z);
EXPECT
Can't redeclare "our" in "our" at - line 1, near ", "
Can't redeclare "our" in "our" at - line 1, near ", our"
Execution of - aborted due to compilation errors.
########
# NAME state (state $x) errors
use feature 'state';
state ($x, $y, state $z);
EXPECT
Can't redeclare "state" in "state" at - line 2, near ", "
Can't redeclare "state" in "state" at - line 2, near ", state"
Execution of - aborted due to compilation errors.
########
# NAME BEGIN <> [perl #125341]
Expand Down
1 change: 1 addition & 0 deletions toke.c
Expand Up @@ -7777,6 +7777,7 @@ Perl_yylex(pTHX)
case KEY_my:
case KEY_state:
if (PL_in_my) {
PL_bufptr = s;
yyerror(Perl_form(aTHX_
"Can't redeclare \"%s\" in \"%s\"",
tmp == KEY_my ? "my" :
Expand Down

0 comments on commit 37808b0

Please sign in to comment.