diff options
author | Zefram <zefram@fysh.org> | 2017-11-10 02:07:46 +0000 |
---|---|---|
committer | Zefram <zefram@fysh.org> | 2017-11-10 02:12:38 +0000 |
commit | 29d69c3c41c7e93f884256b1087face64d5fdd1e (patch) | |
tree | 5c0108ddd1fc112b404980837e6608abb8d6059b /perly.y | |
parent | c6fbd3534700ea217d0e7553adb13aaaf116c6a6 (diff) | |
download | perl-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.y | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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 ; |