From 3480a8d2d46562b783befbcecf951d5a2b4067d7 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Tue, 24 May 2005 11:22:21 +0000 Subject: The tokenizer should expect an operator after qw(). This fixes [perl #35885] qw and x operators doesn't mix p4raw-id: //depot/perl@24560 --- t/op/repeat.t | 5 ++++- toke.c | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/t/op/repeat.t b/t/op/repeat.t index e728413e9b..d1083e8a8f 100755 --- a/t/op/repeat.t +++ b/t/op/repeat.t @@ -6,7 +6,7 @@ BEGIN { } require './test.pl'; -plan(tests => 41); +plan(tests => 42); # compile time @@ -151,3 +151,6 @@ is(77, scalar ((1,7)x2), 'stack truncation'); } is($y, 'abcdabcd'); } + +# [perl #35885] +is( (join ',', (qw(a b c) x 3)), 'a,b,c,a,b,c,a,b,c', 'x on qw produces list' ); diff --git a/toke.c b/toke.c index d496f48c35..874f8ab4dd 100644 --- a/toke.c +++ b/toke.c @@ -4956,6 +4956,7 @@ Perl_yylex(pTHX) s = scan_str(s,FALSE,FALSE); if (!s) missingterm((char*)0); + PL_expect = XOPERATOR; force_next(')'); if (SvCUR(PL_lex_stuff)) { OP *words = Nullop; -- cgit v1.2.1