summaryrefslogtreecommitdiff
path: root/perly.y
diff options
context:
space:
mode:
authorYitzchak Scott-Thoennes <sthoenna@efn.org>2005-09-01 10:41:36 -0700
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-09-13 13:25:23 +0000
commit9a9798c21b8a0b65f8e87f35074ebb595dc00f1c (patch)
tree7844ebfa00e69c9218ffdb8baf48861bcb7ac7a3 /perly.y
parent7579600832ee021c8e462ff004f49fb7da5fca41 (diff)
downloadperl-9a9798c21b8a0b65f8e87f35074ebb595dc00f1c.tar.gz
Allow non-arrowed form of chained subscripts after slices
Subject: Re: [perl #37039] perlref documentation about optional -> is too vague Date: Thu, 1 Sep 2005 17:41:36 -0700 Message-ID: <20050902004136.GA2656@efn.org> Date: Mon, 5 Sep 2005 08:10:20 -0700 Message-ID: <20050905151020.GA3556@efn.org> p4raw-id: //depot/perl@25399
Diffstat (limited to 'perly.y')
-rw-r--r--perly.y8
1 files changed, 4 insertions, 4 deletions
diff --git a/perly.y b/perly.y
index 16ba650bc1..2e218624c2 100644
--- a/perly.y
+++ b/perly.y
@@ -487,6 +487,10 @@ subscripted: star '{' expr ';' '}' /* *main::{something} */
| subscripted '(' ')' /* $foo->{bar}->() */
{ $$ = newUNOP(OP_ENTERSUB, OPf_STACKED,
newCVREF(0, scalar($1))); }
+ | '(' expr ')' '[' expr ']' /* list slice */
+ { $$ = newSLICEOP(0, $5, $2); }
+ | '(' ')' '[' expr ']' /* empty list slice! */
+ { $$ = newSLICEOP(0, $4, Nullop); }
;
/* Binary operators between terms */
@@ -622,10 +626,6 @@ term : termbinop
{ $$ = newUNOP(OP_AV2ARYLEN, 0, ref($1, OP_AV2ARYLEN));}
| subscripted
{ $$ = $1; }
- | '(' expr ')' '[' expr ']' /* list slice */
- { $$ = newSLICEOP(0, $5, $2); }
- | '(' ')' '[' expr ']' /* empty list slice! */
- { $$ = newSLICEOP(0, $4, Nullop); }
| ary '[' expr ']' /* array slice */
{ $$ = prepend_elem(OP_ASLICE,
newOP(OP_PUSHMARK, 0),