summaryrefslogtreecommitdiff
path: root/perly.y
diff options
context:
space:
mode:
authorBranislav ZahradnĂ­k <barney@cpan.org>2020-12-11 17:19:15 +0100
committerKarl Williamson <khw@cpan.org>2020-12-27 09:46:09 -0700
commit0ba95c59b78e1c0733f9a491f242d4ab31128108 (patch)
tree691e1958715973e291a12c82e99cc43742721c18 /perly.y
parent9086c946d76e67c28eff104482c6bc204f32ff68 (diff)
downloadperl-0ba95c59b78e1c0733f9a491f242d4ab31128108.tar.gz
Distinguish C- and perly- literals - PERLY_PERCENT_SIGN
Diffstat (limited to 'perly.y')
-rw-r--r--perly.y12
1 files changed, 6 insertions, 6 deletions
diff --git a/perly.y b/perly.y
index 21cb35c727..7d83819ad2 100644
--- a/perly.y
+++ b/perly.y
@@ -45,7 +45,6 @@
%token <ival> GRAMPROG GRAMEXPR GRAMBLOCK GRAMBARESTMT GRAMFULLSTMT GRAMSTMTSEQ GRAMSUBSIGNATURE
-%token <ival> '%'
%token <ival> PERLY_AMPERSAND
%token <ival> PERLY_BRACE_OPEN
%token <ival> PERLY_BRACE_CLOSE
@@ -55,6 +54,7 @@
%token <ival> PERLY_DOT
%token <ival> PERLY_EQUAL_SIGN
%token <ival> PERLY_MINUS
+%token <ival> PERLY_PERCENT_SIGN
%token <ival> PERLY_PLUS
%token <ival> PERLY_SEMICOLON
%token <ival> PERLY_SNAIL
@@ -661,7 +661,7 @@ sigvarname: /* NULL */
sigslurpsigil:
PERLY_SNAIL
{ $$ = '@'; }
- | '%'
+ | PERLY_PERCENT_SIGN
{ $$ = '%'; }
/* @, %, @foo, %foo */
@@ -1249,7 +1249,7 @@ term[product] : termbinop
{ $$ = newSVREF($operand); }
| term[operand] ARROW PERLY_SNAIL '*'
{ $$ = newAVREF($operand); }
- | term[operand] ARROW '%' '*'
+ | term[operand] ARROW PERLY_PERCENT_SIGN '*'
{ $$ = newHVREF($operand); }
| term[operand] ARROW PERLY_AMPERSAND '*'
{ $$ = newUNOP(OP_ENTERSUB, 0,
@@ -1387,9 +1387,9 @@ ary : PERLY_SNAIL indirob
}
;
-hsh : '%' indirob
+hsh : PERLY_PERCENT_SIGN indirob
{ $$ = newHVREF($indirob);
- if ($$) $$->op_private |= $1;
+ if ($$) $$->op_private |= $PERLY_PERCENT_SIGN;
}
;
@@ -1409,7 +1409,7 @@ sliceme : ary
;
kvslice : hsh
- | term ARROW '%'
+ | term ARROW PERLY_PERCENT_SIGN
{ $$ = newHVREF($term); }
;