diff options
author | Adrian M. Enache <enache@rdslink.ro> | 2003-04-19 04:41:07 +0300 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2003-04-29 20:31:07 +0000 |
commit | 0f5d0394b2f5b3a7ac4dba1b324a4ccfb7799a4b (patch) | |
tree | df545c9af7332f34b3ee9daa5cb1ebd5a209c6ea | |
parent | 4801ca722fb86c6dd33d0230c35f5c5bdfc8d04a (diff) | |
download | perl-0f5d0394b2f5b3a7ac4dba1b324a4ccfb7799a4b.tar.gz |
buglet: sub a(;&) { } doesn't work
Message-ID: <20030418224107.GA2751@ratsnest.hole>
p4raw-id: //depot/perl@19367
-rw-r--r-- | t/comp/parser.t | 5 | ||||
-rw-r--r-- | toke.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/t/comp/parser.t b/t/comp/parser.t index b50d8af29d..25025cc06c 100644 --- a/t/comp/parser.t +++ b/t/comp/parser.t @@ -9,7 +9,7 @@ BEGIN { } require "./test.pl"; -plan( tests => 37 ); +plan( tests => 38 ); eval '%@x=0;'; like( $@, qr/^Can't modify hash dereference in repeat \(x\)/, '%@x=0' ); @@ -89,6 +89,9 @@ ${a}{ ${a}[ @{b}{ ${a}{ } +eval q{ sub a(;; &) { } a { } }; +is($@, '', "';&' sub prototype confuses the lexer"); + # Bug #21575 # ensure that the second print statement works, by playing a bit # with the test output. @@ -4086,6 +4086,8 @@ Perl_yylex(pTHX) TERM(FUNC0SUB); if (strEQ(proto, "$")) OPERATOR(UNIOPSUB); + while (*proto == ';') + proto++; if (*proto == '&' && *s == '{') { sv_setpv(PL_subname, PL_curstash ? "__ANON__" : "__ANON__::__ANON__"); |