summaryrefslogtreecommitdiff
path: root/perly.y
diff options
context:
space:
mode:
authorBranislav ZahradnĂ­k <barney@cpan.org>2020-12-11 17:19:14 +0100
committerKarl Williamson <khw@cpan.org>2020-12-27 09:46:09 -0700
commit9086c946d76e67c28eff104482c6bc204f32ff68 (patch)
tree432a02e1c006d9772979a42570262bbc36e472bd /perly.y
parent5776f3e52dc3d9bddaadfc7c058c4e18589018b3 (diff)
downloadperl-9086c946d76e67c28eff104482c6bc204f32ff68.tar.gz
Distinguish C- and perly- literals - PERLY_SNAIL
Diffstat (limited to 'perly.y')
-rw-r--r--perly.y13
1 files changed, 7 insertions, 6 deletions
diff --git a/perly.y b/perly.y
index c5e79c8d4f..21cb35c727 100644
--- a/perly.y
+++ b/perly.y
@@ -45,7 +45,7 @@
%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
@@ -57,6 +57,7 @@
%token <ival> PERLY_MINUS
%token <ival> PERLY_PLUS
%token <ival> PERLY_SEMICOLON
+%token <ival> PERLY_SNAIL
%token <opval> BAREWORD METHOD FUNCMETH THING PMFUNC PRIVATEREF QWLIST
%token <opval> FUNC0OP FUNC0SUB UNIOPSUB LSTOPSUB
@@ -658,7 +659,7 @@ sigvarname: /* NULL */
;
sigslurpsigil:
- '@'
+ PERLY_SNAIL
{ $$ = '@'; }
| '%'
{ $$ = '%'; }
@@ -1246,7 +1247,7 @@ term[product] : termbinop
}
| term[operand] ARROW '$' '*'
{ $$ = newSVREF($operand); }
- | term[operand] ARROW '@' '*'
+ | term[operand] ARROW PERLY_SNAIL '*'
{ $$ = newAVREF($operand); }
| term[operand] ARROW '%' '*'
{ $$ = newHVREF($operand); }
@@ -1380,9 +1381,9 @@ scalar : '$' indirob
{ $$ = newSVREF($indirob); }
;
-ary : '@' indirob
+ary : PERLY_SNAIL indirob
{ $$ = newAVREF($indirob);
- if ($$) $$->op_private |= $1;
+ if ($$) $$->op_private |= $PERLY_SNAIL;
}
;
@@ -1403,7 +1404,7 @@ star : '*' indirob
;
sliceme : ary
- | term ARROW '@'
+ | term ARROW PERLY_SNAIL
{ $$ = newAVREF($term); }
;