summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y5
1 files changed, 4 insertions, 1 deletions
diff --git a/parse.y b/parse.y
index c61c4a84476..e19e6dcd915 100644
--- a/parse.y
+++ b/parse.y
@@ -7831,6 +7831,8 @@ node_assign_gen(struct parser_params *parser, NODE *lhs, NODE *rhs)
static int
value_expr_gen(struct parser_params *parser, NODE *node)
{
+ int cond = 0;
+
if (!node) {
rb_warning0("empty expression");
}
@@ -7846,7 +7848,7 @@ value_expr_gen(struct parser_params *parser, NODE *node)
case NODE_NEXT:
case NODE_REDO:
case NODE_RETRY:
- yyerror("void value expression");
+ if (!cond) yyerror("void value expression");
/* or "control never reach"? */
return Qfalse;
@@ -7868,6 +7870,7 @@ value_expr_gen(struct parser_params *parser, NODE *node)
case NODE_AND:
case NODE_OR:
+ cond = 1;
node = node->nd_2nd;
break;