summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-15 06:06:47 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-15 06:06:47 +0000
commit2a0b6280bb5c10bf69c699dbcc0d9dc1f3025815 (patch)
tree3f4ab82de006e0588ff84353dcc5725dd76bf7fb /parse.y
parent0149e4515da3ef6508e9ecca7f422c029f1b9c22 (diff)
* parse.y (command): moved return/break/next from command_call for
better error message. * parse.y (call_args): void value check added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y49
1 files changed, 25 insertions, 24 deletions
diff --git a/parse.y b/parse.y
index 2074cb6730..511568427c 100644
--- a/parse.y
+++ b/parse.y
@@ -1212,30 +1212,6 @@ expr_value : expr
command_call : command
| block_command
- | keyword_return call_args
- {
- /*%%%*/
- $$ = NEW_RETURN(ret_args($2));
- /*%
- $$ = dispatch1(return, $2);
- %*/
- }
- | keyword_break call_args
- {
- /*%%%*/
- $$ = NEW_BREAK(ret_args($2));
- /*%
- $$ = dispatch1(break, $2);
- %*/
- }
- | keyword_next call_args
- {
- /*%%%*/
- $$ = NEW_NEXT(ret_args($2));
- /*%
- $$ = dispatch1(next, $2);
- %*/
- }
;
block_command : block_call
@@ -1362,6 +1338,30 @@ command : operation command_args %prec tLOWEST
$$ = dispatch1(yield, $2);
%*/
}
+ | keyword_return call_args
+ {
+ /*%%%*/
+ $$ = NEW_RETURN(ret_args($2));
+ /*%
+ $$ = dispatch1(return, $2);
+ %*/
+ }
+ | keyword_break call_args
+ {
+ /*%%%*/
+ $$ = NEW_BREAK(ret_args($2));
+ /*%
+ $$ = dispatch1(break, $2);
+ %*/
+ }
+ | keyword_next call_args
+ {
+ /*%%%*/
+ $$ = NEW_NEXT(ret_args($2));
+ /*%
+ $$ = dispatch1(next, $2);
+ %*/
+ }
;
mlhs : mlhs_basic
@@ -2337,6 +2337,7 @@ opt_call_args : none
call_args : command
{
/*%%%*/
+ value_expr($1);
$$ = NEW_LIST($1);
/*%
$$ = arg_add(arg_new(), $1);