summaryrefslogtreecommitdiff
path: root/perly.y
diff options
context:
space:
mode:
authorBranislav ZahradnĂ­k <barney@cpan.org>2021-12-23 23:24:09 +0100
committerKarl Williamson <khw@cpan.org>2022-02-05 20:54:09 -0700
commit7cbc5f3bc3cfc72c4863926d390e58bff4ac1800 (patch)
treed947d021a88e6170e46e3ba4c18e7aa771fa334a /perly.y
parentcdcb5e192b6ad45d64cf6f02370472786bd8dfb1 (diff)
downloadperl-7cbc5f3bc3cfc72c4863926d390e58bff4ac1800.tar.gz
Gather all MY variants into single rule
Diffstat (limited to 'perly.y')
-rw-r--r--perly.y7
1 files changed, 4 insertions, 3 deletions
diff --git a/perly.y b/perly.y
index 7c728a9127..540c7ccb35 100644
--- a/perly.y
+++ b/perly.y
@@ -1198,8 +1198,6 @@ term[product] : termbinop
{ $$ = newCONDOP(0, $condition, $then, $else); }
| REFGEN term[operand] /* \$x, \@y, \%z */
{ $$ = newUNOP(OP_REFGEN, 0, $operand); }
- | MY REFGEN term[operand]
- { $$ = newUNOP(OP_REFGEN, 0, localize($operand,1)); }
| myattrterm %prec UNIOP
{ $$ = $myattrterm; }
| LOCAL term[operand] %prec UNIOP
@@ -1346,12 +1344,15 @@ term[product] : termbinop
;
/* "my" declarations, with optional attributes */
-myattrterm: MY myterm myattrlist
+myattrterm
+ : MY myterm myattrlist
{ $$ = my_attrs($myterm,$myattrlist); }
| MY myterm
{ $$ = localize($myterm,1); }
| MY REFGEN myterm myattrlist
{ $$ = newUNOP(OP_REFGEN, 0, my_attrs($myterm,$myattrlist)); }
+ | MY REFGEN term[operand]
+ { $$ = newUNOP(OP_REFGEN, 0, localize($operand,1)); }
;
/* Things that can be "my"'d */