summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-09-27 04:26:21 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-09-27 04:26:21 +0000
commitaf181db7846b3ca38b443bdf7d65e6d26f87da6a (patch)
tree9c05af34210f699bd1425b5ff6f5b2e39919f2af /parse.y
parent35e4d1319b86f9a2899a0fc1bb6ffafd7f26840e (diff)
* eval.c (rb_eval): Class#inherited should be called after the
execution of the class body. * parse.y (primary): remove "return outside of method" check at compile time. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 ')'