diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-09-15 16:07:11 -0700 |
---|---|---|
committer | Ricardo Signes <rjbs@cpan.org> | 2013-10-05 14:20:09 -0400 |
commit | 76eba8ab520b5c85d3a1566e1ae17ca49faeccf1 (patch) | |
tree | 981a0c8b4908f600f55c4c2ebe5e846d710796ec /perly.y | |
parent | ed3f8f871063863e8e0cf35f2b79b686fd23a622 (diff) | |
download | perl-76eba8ab520b5c85d3a1566e1ae17ca49faeccf1.tar.gz |
->%{ ->%[
Diffstat (limited to 'perly.y')
-rw-r--r-- | perly.y | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -94,7 +94,7 @@ %type <opval> stmtseq fullstmt labfullstmt barestmt block mblock else %type <opval> expr term subscripted scalar ary hsh arylen star amper sideff -%type <opval> sliceme gelem +%type <opval> sliceme kvslice gelem %type <opval> listexpr nexpr texpr iexpr mexpr mnexpr miexpr %type <opval> optlistexpr optexpr indirob listop method %type <opval> formname subname proto subbody cont my_scalar formblock @@ -1208,7 +1208,7 @@ term : termbinop TOKEN_GETMAD($2,$$,'['); TOKEN_GETMAD($4,$$,']'); } - | hsh '[' expr ']' /* array key/value slice */ + | kvslice '[' expr ']' /* array key/value slice */ { $$ = op_prepend_elem(OP_KVASLICE, newOP(OP_PUSHMARK, 0), newLISTOP(OP_KVASLICE, 0, @@ -1234,7 +1234,7 @@ term : termbinop TOKEN_GETMAD($4,$$,';'); TOKEN_GETMAD($5,$$,'}'); } - | hsh '{' expr ';' '}' /* %hash{@keys} */ + | kvslice '{' expr ';' '}' /* %hash{@keys} */ { $$ = op_prepend_elem(OP_KVHSLICE, newOP(OP_PUSHMARK, 0), newLISTOP(OP_KVHSLICE, 0, @@ -1494,6 +1494,13 @@ sliceme : ary } ; +kvslice : hsh + | term ARROW '%' + { $$ = newHVREF($1); + TOKEN_GETMAD($3,$$,'@'); + } + ; + gelem : star | term ARROW '*' { $$ = newGVREF(0,$1); |