summaryrefslogtreecommitdiff
path: root/perly.y
diff options
context:
space:
mode:
authorZefram <zefram@fysh.org>2017-12-29 12:39:31 +0000
committerZefram <zefram@fysh.org>2017-12-29 12:39:31 +0000
commit7896dde7482a2851e73f0ac2c32d1c71f6e97dca (patch)
tree52321aee169ab06ffe8069908bacf96cbc4b4df9 /perly.y
parent14e4cec412927f1f65c5d2b21526e01b33029447 (diff)
downloadperl-7896dde7482a2851e73f0ac2c32d1c71f6e97dca.tar.gz
revert smartmatch to 5.27.6 behaviour
The pumpking has determined that the CPAN breakage caused by changing smartmatch [perl #132594] is too great for the smartmatch changes to stay in for 5.28. This reverts most of the merge in commit da4e040f42421764ef069371d77c008e6b801f45. All core behaviour and documentation is reverted. The removal of use of smartmatch from a couple of tests (that aren't testing smartmatch) remains. Customisation of a couple of CPAN modules to make them portable across smartmatch types remains. A small bugfix in scope.c also remains.
Diffstat (limited to 'perly.y')
-rw-r--r--perly.y24
1 files changed, 7 insertions, 17 deletions
diff --git a/perly.y b/perly.y
index 4ef8478fa0..8f3e303af1 100644
--- a/perly.y
+++ b/perly.y
@@ -53,7 +53,7 @@
%token <pval> LABEL
%token <ival> FORMAT SUB ANONSUB PACKAGE USE
%token <ival> WHILE UNTIL IF UNLESS ELSE ELSIF CONTINUE FOR
-%token <ival> GIVEN WHERESO
+%token <ival> GIVEN WHEN DEFAULT
%token <ival> LOOPEX DOTDOT YADAYADA
%token <ival> FUNC0 FUNC1 FUNC UNIOP LSTOP
%token <ival> RELOP EQOP MULOP ADDOP
@@ -378,14 +378,10 @@ barestmt: PLUGSTMT
$$ = block_end($3, newGIVENOP($4, op_scope($6), 0));
parser->copline = (line_t)$1;
}
- | WHERESO '(' remember mexpr ')' mblock
- {
- OP *cond = $4;
- if ($1)
- cond = newBINOP(OP_SMARTMATCH, 0, newDEFSVOP(),
- scalar(cond));
- $$ = block_end($3, newWHERESOOP(cond, op_scope($6)));
- }
+ | WHEN '(' remember mexpr ')' mblock
+ { $$ = block_end($3, newWHENOP($4, op_scope($6))); }
+ | DEFAULT block
+ { $$ = newWHENOP(0, op_scope($2)); }
| WHILE '(' remember texpr ')' mintro mblock cont
{
$$ = block_end($3,
@@ -537,14 +533,8 @@ sideff : error
| expr FOR expr
{ $$ = newFOROP(0, NULL, $3, $1, NULL);
parser->copline = (line_t)$2; }
- | expr WHERESO expr
- {
- OP *cond = $3;
- if ($2)
- cond = newBINOP(OP_SMARTMATCH, 0, newDEFSVOP(),
- scalar(cond));
- $$ = newWHERESOOP(cond, op_scope($1));
- }
+ | expr WHEN expr
+ { $$ = newWHENOP($3, op_scope($1)); }
;
/* else and elsif blocks */