make map behave like grep wrt indirect object slot when
Gurusamy Sarathy [Sun, 25 Jul 1999 16:32:48 +0000 (16:32 +0000)]
there are parentheses; revert an experimental mod by Larry
in change#2038 that failed to parse %{{qw(a b c)}} properly
(this means C<map {use Foo; ...} ...> still needs a proper
fix)

p4raw-link: @2038 on //depot/perl: 834a4ddd8309fbf6aabbbc51bb6fcbe056e7963f

p4raw-id: //depot/perl@3744

toke.c

diff --git a/toke.c b/toke.c
index 85b37a4..e5dcd33 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -2477,7 +2477,7 @@ Perl_yylex(pTHX)
                                   || (*t == '=' && t[1] == '>')))
                    OPERATOR(HASHBRACK);
                if (PL_expect == XREF)
-                   PL_expect = XSTATE; /* was XTERM, trying XSTATE */
+                   PL_expect = XTERM;
                else {
                    PL_lex_brackstack[PL_lex_brackets-1] = XSTATE;
                    PL_expect = XSTATE;
@@ -3675,8 +3675,8 @@ Perl_yylex(pTHX)
            TERM(sublex_start());
 
        case KEY_map:
-           LOP(OP_MAPSTART, XREF);
-           
+           LOP(OP_MAPSTART, *s == '(' ? XTERM : XREF);
+
        case KEY_mkdir:
            LOP(OP_MKDIR,XTERM);