summaryrefslogtreecommitdiff
path: root/perly.y
diff options
context:
space:
mode:
authorBranislav ZahradnĂ­k <barney@cpan.org>2020-12-11 17:19:06 +0100
committerKarl Williamson <khw@cpan.org>2020-12-27 09:46:09 -0700
commit581f9a7a8ac03dde592c9c645423bcb369116e24 (patch)
tree6f97cf600ce2583f29e616b01e8d72d8dd48a86a /perly.y
parent25a505006bae8916ab7e2625092a90ef093fac01 (diff)
downloadperl-581f9a7a8ac03dde592c9c645423bcb369116e24.tar.gz
Distinguish C- and perly- literals - PERLY_COMMA
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 3d1a09e918..9f01052bbc 100644
--- a/perly.y
+++ b/perly.y
@@ -51,6 +51,7 @@
%token <ival> PERLY_BRACE_CLOSE
%token <ival> PERLY_BRACKET_OPEN
%token <ival> PERLY_BRACKET_CLOSE
+%token <ival> PERLY_COMMA
%token <ival> PERLY_DOT
%token <ival> PERLY_EQUAL_SIGN
%token <ival> PERLY_SEMICOLON
@@ -99,7 +100,7 @@
%left <ival> ANDOP
%right <ival> NOTOP
%nonassoc LSTOP LSTOPSUB
-%left <ival> ','
+%left PERLY_COMMA
%right <ival> ASSIGNOP
%right <ival> '?' ':'
%nonassoc DOTDOT
@@ -763,9 +764,9 @@ sigelem: sigscalarelem
/* list of subroutine signature elements */
siglist:
- siglist[list] ','
+ siglist[list] PERLY_COMMA
{ $$ = $list; }
- | siglist[list] ',' sigelem[element]
+ | siglist[list] PERLY_COMMA sigelem[element]
{
$$ = op_append_list(OP_LINESEQ, $list, $element);
}
@@ -900,9 +901,9 @@ expr : expr[lhs] ANDOP expr[rhs]
;
/* Expressions are a list of terms joined by commas */
-listexpr: listexpr[list] ','
+listexpr: listexpr[list] PERLY_COMMA
{ $$ = $list; }
- | listexpr[list] ',' term
+ | listexpr[list] PERLY_COMMA term
{
OP* term = $term;
$$ = op_append_elem(OP_LIST, $list, term);