summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-11-07 09:01:34 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-11-07 09:01:34 +0000
commit2f12c07c76c38a377e98555f1af738a8aa12f112 (patch)
tree0ca8dfde034e3a4837a4d4c7b5536a0bf3540e03 /parse.y
parent566c793d9b032ae1bc03340a10c4b5d1dcd116a7 (diff)
* dir.c (my_getcwd): do not rely on MAXPATHLEN.
* eval.c (rb_yield_0): should not call rb_f_block_given_p(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1814 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y33
1 files changed, 19 insertions, 14 deletions
diff --git a/parse.y b/parse.y
index 7852163b58..ed18f5e355 100644
--- a/parse.y
+++ b/parse.y
@@ -669,24 +669,29 @@ arg : lhs '=' arg
}
| variable tOP_ASGN {$$ = assignable($1, 0);} 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;
+ if ($<node>3) {
+ 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;
- $$ = NEW_OP_ASGN_AND(gettable($1), $<node>3);
+ else if ($2 == tANDOP) {
+ $<node>3->nd_value = $4;
+ $$ = NEW_OP_ASGN_AND(gettable($1), $<node>3);
+ }
+ else {
+ $$ = $<node>3;
+ if ($$) {
+ $$->nd_value = call_op(gettable($1),$2,1,$4);
+ }
+ }
+ fixpos($$, $4);
}
else {
- $$ = $<node>3;
- if ($$) {
- $$->nd_value = call_op(gettable($1),$2,1,$4);
- }
+ $$ = 0;
}
- fixpos($$, $4);
}
| primary '[' aref_args ']' tOP_ASGN arg
{