summaryrefslogtreecommitdiff
path: root/perly.y
diff options
context:
space:
mode:
authorZefram <zefram@fysh.org>2017-11-10 02:07:46 +0000
committerZefram <zefram@fysh.org>2017-11-10 02:12:38 +0000
commit29d69c3c41c7e93f884256b1087face64d5fdd1e (patch)
tree5c0108ddd1fc112b404980837e6608abb8d6059b /perly.y
parentc6fbd3534700ea217d0e7553adb13aaaf116c6a6 (diff)
downloadperl-29d69c3c41c7e93f884256b1087face64d5fdd1e.tar.gz
parse yada-yada only as a statement
Commit f5727a1c71878a34f6255eb1a506c0b21af7d36f tried to make yada-yada be parsed consistently as a term expression, but actually things are more complicated than that. The tokeniser didn't accept yada-yada in the right contexts to make it usable as an expression, and changing that would require decisions on resolving ambiguities between yada-yada and flip-flop. It's also documented as being a statement rather than an expression, though with some incorrect information about ambiguities. Overall it looks more like the intent was for yada-yada to be a statement. This commit makes it grammatically treated as such, and also fixes up the dubious parts of the documentation. [perl #132150]
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 56e34da7b4..0a7c30c042 100644
--- a/perly.y
+++ b/perly.y
@@ -90,7 +90,7 @@
%left <ival> ','
%right <ival> ASSIGNOP
%right <ival> '?' ':'
-%nonassoc DOTDOT YADAYADA
+%nonassoc DOTDOT
%left <ival> OROR DORDOR
%left <ival> ANDAND
%left <ival> BITOROP
@@ -481,6 +481,11 @@ barestmt: PLUGSTMT
{
$$ = $1;
}
+ | YADAYADA ';'
+ {
+ $$ = newLISTOP(OP_DIE, 0, newOP(OP_PUSHMARK, 0),
+ newSVOP(OP_CONST, 0, newSVpvs("Unimplemented")));
+ }
| ';'
{
$$ = NULL;
@@ -1210,11 +1215,6 @@ term : termbinop
{ $$ = pmruntime($1, $4, $5, 1, $<ival>2); }
| BAREWORD
| listop
- | YADAYADA
- {
- $$ = newLISTOP(OP_DIE, 0, newOP(OP_PUSHMARK, 0),
- newSVOP(OP_CONST, 0, newSVpvs("Unimplemented")));
- }
| PLUGEXPR
;