-
Notifications
You must be signed in to change notification settings - Fork 589
Commit 0e87955
committed
move "illegal anon sub" error from toke.c to perly.y
This fixes the TODO test in t/op/anonsub.t, but breaks two other tests:
- t/op/anonsub.t
not ok 12 - '{ $x = sub }' is illegal
# Failed test 12 - '{ $x = sub }' is illegal at t/op/anonsub.t line 15
# got 'Global symbol \"$x\" requires explicit package name (did you forget to declare \"my $x\"?) at (eval 12) line 1, <DATA> line 87.\nIllegal declaration of anonymous subroutine at (eval 12) line 1, at EOF\n'
# expected /(?^:^Illegal declaration of anonymous subroutine at)/
- t/lib/croak.t
FILE: lib/croak/toke ; line 644
PROG:
no feature 'apostrophe_as_package_separator';
sub 'Hello'_he_said (_);
EXPECTED:
Illegal declaration of anonymous subroutine at - line 2.
EXIT STATUS: != 0
GOT:
Bareword found where operator expected (Missing operator before "_he_said"?) at - line 2, near "'Hello'_he_said"
Illegal declaration of anonymous subroutine at - line 2, near "sub 'Hello'"
Execution of - aborted due to compilation errors.
EXIT STATUS: 255
not ok 247 - tick in names: initial character of sub name (no feature)
# Failed test 247 - tick in names: initial character of sub name (no feature) at lib/croak/toke line 644
Since we don't immediately error out from the lexer anymore, the parser
may accumulate more errors before failing with "Illegal declaration of
anonymous subroutine".
The tests have been changed to accomodate the new diagnostics.
Fixes #5959.1 parent aa1c6e9 commit 0e87955Copy full SHA for 0e87955
0 commit comments