summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y4
1 files changed, 0 insertions, 4 deletions
diff --git a/parse.y b/parse.y
index 5bf5750333..56332e3125 100644
--- a/parse.y
+++ b/parse.y
@@ -556,8 +556,6 @@ stmt : kALIAS fitem {lex_state = EXPR_FNAME;} fitem
expr : kRETURN call_args
{
- if (!compile_for_eval && !in_def && !in_single)
- yyerror("return appeared outside of method");
$$ = NEW_RETURN(ret_args($2));
}
| kBREAK call_args
@@ -1339,8 +1337,6 @@ primary : literal
}
| kRETURN
{
- if (!compile_for_eval && !in_def && !in_single)
- yyerror("return appeared outside of method");
$$ = NEW_RETURN(0);
}
| kYIELD '(' call_args ')'