summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y5
1 files changed, 3 insertions, 2 deletions
diff --git a/parse.y b/parse.y
index a34c5aabf38..b4a96de5c2f 100644
--- a/parse.y
+++ b/parse.y
@@ -401,14 +401,12 @@ expr : mlhs '=' mrhs
}
| kRETURN ret_args
{
- value_expr($2);
if (!compile_for_eval && !cur_mid && !in_single)
yyerror("return appeared outside of method");
$$ = NEW_RETURN($2);
}
| kYIELD ret_args
{
- value_expr($2);
$$ = NEW_YIELD($2);
}
| command_call
@@ -4095,6 +4093,9 @@ value_expr(node)
}
return value_expr(node->nd_head);
+ case NODE_BEGIN:
+ return value_expr(node->nd_body);
+
case NODE_IF:
return value_expr(node->nd_body) && value_expr(node->nd_else);