summaryrefslogtreecommitdiff
path: root/perly.y
diff options
context:
space:
mode:
authorBranislav ZahradnĂ­k <barney@cpan.org>2020-12-11 17:19:18 +0100
committerKarl Williamson <khw@cpan.org>2020-12-27 09:46:09 -0700
commitd02b2fbf99fe056004dcc6ba704fd2846d208bb0 (patch)
treee9836ecca783d126395f745b11d00abaa3532ad5 /perly.y
parent04884b684761ed5aea5bf4bb362f56cf963b41f5 (diff)
downloadperl-d02b2fbf99fe056004dcc6ba704fd2846d208bb0.tar.gz
Distinguish C- and perly- literals - PERLY_STAR
Diffstat (limited to 'perly.y')
-rw-r--r--perly.y17
1 files changed, 9 insertions, 8 deletions
diff --git a/perly.y b/perly.y
index ab6f3958da..0997e3e2dd 100644
--- a/perly.y
+++ b/perly.y
@@ -58,6 +58,7 @@
%token <ival> PERLY_PLUS
%token <ival> PERLY_SEMICOLON
%token <ival> PERLY_SNAIL
+%token <ival> PERLY_STAR
%token <opval> BAREWORD METHOD FUNCMETH THING PMFUNC PRIVATEREF QWLIST
%token <opval> FUNC0OP FUNC0SUB UNIOPSUB LSTOPSUB
@@ -1245,16 +1246,16 @@ term[product] : termbinop
{ $$ = newUNOP(OP_ENTERSUB, OPf_STACKED,
op_append_elem(OP_LIST, $optlistexpr, scalar($subname)));
}
- | term[operand] ARROW '$' '*'
+ | term[operand] ARROW '$' PERLY_STAR
{ $$ = newSVREF($operand); }
- | term[operand] ARROW PERLY_SNAIL '*'
+ | term[operand] ARROW PERLY_SNAIL PERLY_STAR
{ $$ = newAVREF($operand); }
- | term[operand] ARROW PERLY_PERCENT_SIGN '*'
+ | term[operand] ARROW PERLY_PERCENT_SIGN PERLY_STAR
{ $$ = newHVREF($operand); }
- | term[operand] ARROW PERLY_AMPERSAND '*'
+ | term[operand] ARROW PERLY_AMPERSAND PERLY_STAR
{ $$ = newUNOP(OP_ENTERSUB, 0,
scalar(newCVREF($PERLY_AMPERSAND,$operand))); }
- | term[operand] ARROW '*' '*' %prec PERLY_PAREN_OPEN
+ | term[operand] ARROW PERLY_STAR PERLY_STAR %prec PERLY_PAREN_OPEN
{ $$ = newGVREF(0,$operand); }
| LOOPEX /* loop exiting command (goto, last, dump, etc) */
{ $$ = newOP($LOOPEX, OPf_SPECIAL);
@@ -1395,11 +1396,11 @@ hsh : PERLY_PERCENT_SIGN indirob
arylen : DOLSHARP indirob
{ $$ = newAVREF($indirob); }
- | term ARROW DOLSHARP '*'
+ | term ARROW DOLSHARP PERLY_STAR
{ $$ = newAVREF($term); }
;
-star : '*' indirob
+star : PERLY_STAR indirob
{ $$ = newGVREF(0,$indirob); }
;
@@ -1414,7 +1415,7 @@ kvslice : hsh
;
gelem : star
- | term ARROW '*'
+ | term ARROW PERLY_STAR
{ $$ = newGVREF(0,$term); }
;