summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-09-23 03:40:57 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-09-23 03:40:57 +0000
commit638bc1181648408738bc0f85920fa60225c46a73 (patch)
treebe472bcaa36371fa519b7be765a65f7cac691f68 /op.c
parent2c92fcc021607c4bf4864b88404323ad4f5d9156 (diff)
downloadperl-638bc1181648408738bc0f85920fa60225c46a73.tar.gz
better diagnostic for do{} used as lvalue
p4raw-id: //depot/perl@1808
Diffstat (limited to 'op.c')
-rw-r--r--op.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/op.c b/op.c
index 5b06f6f156..58cf51124f 100644
--- a/op.c
+++ b/op.c
@@ -1135,7 +1135,8 @@ mod(OP *o, I32 type)
if (type == OP_GREPSTART || type == OP_ENTERSUB || type == OP_REFGEN)
break;
yyerror(form("Can't modify %s in %s",
- op_desc[o->op_type],
+ (o->op_type == OP_NULL && (o->op_flags & OPf_SPECIAL)
+ ? "do block" : op_desc[o->op_type]),
type ? op_desc[type] : "local"));
return o;
@@ -1264,7 +1265,9 @@ mod(OP *o, I32 type)
break;
case OP_NULL:
- if (!(o->op_flags & OPf_KIDS))
+ if (o->op_flags & OPf_SPECIAL) /* do BLOCK */
+ goto nomod;
+ else if (!(o->op_flags & OPf_KIDS))
break;
if (o->op_targ != OP_LIST) {
mod(cBINOPo->op_first, type);