diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-12-17 10:34:30 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-12-17 10:34:30 +0000 |
| commit | 8026cf3d34a12e432640666d329d654fa64e0626 (patch) | |
| tree | 379c349bd378072c2907f4e6579b677573a2e087 /eval.c | |
| parent | acc6cd3ae29505eb02c9cd82144ee2906ac87d23 (diff) | |
| download | ruby-8026cf3d34a12e432640666d329d654fa64e0626.tar.gz ruby-8026cf3d34a12e432640666d329d654fa64e0626.tar.xz ruby-8026cf3d34a12e432640666d329d654fa64e0626.zip | |
* node.h (NODE_ATTRASGN): new node, assignment to attribute.
[ruby-core:00637].
* eval.c (is_defined, rb_eval): ditto.
* parse.y (attrset, node_assign): ditto.
* string.c (rb_str_substr): tail sharing. [ruby-core:00650]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
| -rw-r--r-- | eval.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -1881,6 +1881,7 @@ is_defined(self, node, buf) goto check_bound; case NODE_CALL: + case NODE_ATTRASGN: PUSH_TAG(PROT_NONE); if ((state = EXEC_TAG()) == 0) { val = rb_eval(self, node->nd_recv); @@ -2742,6 +2743,23 @@ rb_eval(self, n) rb_eval(self, node->nd_body)); break; + case NODE_ATTRASGN: + { + VALUE recv; + int argc; VALUE *argv; /* used in SETUP_ARGS */ + TMP_PROTECT; + + BEGIN_CALLARGS; + recv = rb_eval(self, node->nd_recv); + SETUP_ARGS(node->nd_args); + END_CALLARGS; + + SET_CURRENT_SOURCE(); + rb_call(CLASS_OF(recv),recv,node->nd_mid,argc,argv,0); + result = argv[argc-1]; + } + break; + case NODE_CALL: { VALUE recv; |
