Skip to content

Commit ed35b0d

Browse files
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". See #5959.
1 parent 463db48 commit ed35b0d

File tree

5 files changed

+1331
-1301
lines changed

5 files changed

+1331
-1301
lines changed

0 commit comments

Comments
 (0)