summaryrefslogtreecommitdiff
path: root/perly.y
diff options
context:
space:
mode:
authorBranislav ZahradnĂ­k <barney@cpan.org>2020-12-11 17:19:05 +0100
committerKarl Williamson <khw@cpan.org>2020-12-27 09:46:09 -0700
commit25a505006bae8916ab7e2625092a90ef093fac01 (patch)
tree04fde53e7c8840a16e9d9a9f2b0f64de49d15464 /perly.y
parentdb83e45c10af8c06705fef1c3bd933ffa6a5e3f0 (diff)
downloadperl-25a505006bae8916ab7e2625092a90ef093fac01.tar.gz
Distinguish C- and perly- literals - PERLY_AMPERSAND
Diffstat (limited to 'perly.y')
-rw-r--r--perly.y11
1 files changed, 6 insertions, 5 deletions
diff --git a/perly.y b/perly.y
index 517758f9df..3d1a09e918 100644
--- a/perly.y
+++ b/perly.y
@@ -45,7 +45,8 @@
%token <ival> GRAMPROG GRAMEXPR GRAMBLOCK GRAMBARESTMT GRAMFULLSTMT GRAMSTMTSEQ GRAMSUBSIGNATURE
-%token <ival> '-' '+' '@' '%' '&'
+%token <ival> '-' '+' '@' '%'
+%token <ival> PERLY_AMPERSAND
%token <ival> PERLY_BRACE_OPEN
%token <ival> PERLY_BRACE_CLOSE
%token <ival> PERLY_BRACKET_OPEN
@@ -1246,9 +1247,9 @@ term[product] : termbinop
{ $$ = newAVREF($operand); }
| term[operand] ARROW '%' '*'
{ $$ = newHVREF($operand); }
- | term[operand] ARROW '&' '*'
+ | term[operand] ARROW PERLY_AMPERSAND '*'
{ $$ = newUNOP(OP_ENTERSUB, 0,
- scalar(newCVREF($3,$operand))); }
+ scalar(newCVREF($PERLY_AMPERSAND,$operand))); }
| term[operand] ARROW '*' '*' %prec '('
{ $$ = newGVREF(0,$operand); }
| LOOPEX /* loop exiting command (goto, last, dump, etc) */
@@ -1368,8 +1369,8 @@ my_refgen: MY REFGEN
| REFGEN MY
;
-amper : '&' indirob
- { $$ = newCVREF($1,$indirob); }
+amper : PERLY_AMPERSAND indirob
+ { $$ = newCVREF($PERLY_AMPERSAND,$indirob); }
;
scalar : '$' indirob