summaryrefslogtreecommitdiff
path: root/perly.y
diff options
context:
space:
mode:
authorBranislav ZahradnĂ­k <barney@cpan.org>2020-12-11 17:19:11 +0100
committerKarl Williamson <khw@cpan.org>2020-12-27 09:46:09 -0700
commit68a66a8beadf6521143536cc70b76b1127b141e7 (patch)
tree0d5592d0e0faa9df012a63bf59a96f1f17525e5f /perly.y
parenta1ad62bfea2492db90c01a1b1dfe6612521d7c3a (diff)
downloadperl-68a66a8beadf6521143536cc70b76b1127b141e7.tar.gz
Distinguish C- and perly- literals - PERLY_MINUS
Diffstat (limited to 'perly.y')
-rw-r--r--perly.y5
1 files changed, 3 insertions, 2 deletions
diff --git a/perly.y b/perly.y
index 7f1158857e..2a32ef1d6b 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
@@ -54,6 +54,7 @@
%token <ival> PERLY_COMMA
%token <ival> PERLY_DOT
%token <ival> PERLY_EQUAL_SIGN
+%token <ival> PERLY_MINUS
%token <ival> PERLY_SEMICOLON
%token <opval> BAREWORD METHOD FUNCMETH THING PMFUNC PRIVATEREF QWLIST
@@ -1095,7 +1096,7 @@ eqopchain: term[lhs] CHEQOP term[rhs]
;
/* Unary operators and terms */
-termunop : '-' term %prec UMINUS /* -$x */
+termunop : PERLY_MINUS term %prec UMINUS /* -$x */
{ $$ = newUNOP(OP_NEGATE, 0, scalar($term)); }
| '+' term %prec UMINUS /* +$x */
{ $$ = $term; }