diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-05-07 09:26:29 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-05-07 09:26:29 +0000 |
| commit | d7d4acb14eb2fcb505bf8532273e413017045d43 (patch) | |
| tree | e88cf34d1e19ece721133a8ad3582e8ed4727dc6 /parse.y | |
| parent | b82260bc45cccea93abd4d254f8e14d77fec1d30 (diff) | |
| download | ruby-d7d4acb14eb2fcb505bf8532273e413017045d43.tar.gz ruby-d7d4acb14eb2fcb505bf8532273e413017045d43.tar.xz ruby-d7d4acb14eb2fcb505bf8532273e413017045d43.zip | |
* parse.y (arg): "||=" should not warn for uninitialized instance
variables.
* eval.c (rb_eval): ditto.
* eval.c (eval): preserve and restore ruby_cref as well.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
| -rw-r--r-- | parse.y | 21 |
1 files changed, 8 insertions, 13 deletions
@@ -411,15 +411,15 @@ stmt : kALIAS fitem {lex_state = EXPR_FNAME;} fitem { $$ = node_assign($1, $3); } - | expr - -expr : mlhs '=' mrhs + | mlhs '=' mrhs { value_expr($3); $1->nd_value = $3; $$ = $1; } - | kRETURN ret_args + | expr + +expr : kRETURN ret_args { if (!compile_for_eval && !in_def && !in_single) yyerror("return appeared outside of method"); @@ -671,6 +671,9 @@ arg : lhs '=' arg if ($2 == tOROP) { $<node>3->nd_value = $4; $$ = NEW_OP_ASGN_OR(gettable($1), $<node>3); + if (is_instance_id($1)) { + $$->nd_aid = $1; + } } else if ($2 == tANDOP) { $<node>3->nd_value = $4; @@ -903,14 +906,10 @@ arg : lhs '=' arg } aref_args : none - | command_call opt_nl + | command opt_nl { $$ = NEW_LIST($1); } - | args ',' command_call opt_nl - { - $$ = list_append($1, $3); - } | args trailer { $$ = $1; @@ -954,10 +953,6 @@ call_args : command { $$ = NEW_LIST($1); } - | args ',' command - { - $$ = list_append($1, $3); - } | args opt_block_arg { $$ = arg_blk_pass($1, $2); |
