mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
* io.c (READ_DATA_BUFFERED): new macro to detect whether stdio
buffer filled. * io.c (rb_io_fptr_cleanup): move path deallocation to rb_io_fptr_finalize (finalizer called by GC). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
cf22db8d69
commit
1a8ccefafc
6 changed files with 132 additions and 72 deletions
36
eval.c
36
eval.c
|
@ -2585,6 +2585,42 @@ rb_eval(self, n)
|
|||
}
|
||||
goto again;
|
||||
|
||||
case NODE_WHEN:
|
||||
while (node) {
|
||||
NODE *tag;
|
||||
|
||||
if (nd_type(node) != NODE_WHEN) goto again;
|
||||
tag = node->nd_head;
|
||||
while (tag) {
|
||||
if (trace_func) {
|
||||
call_trace_func("line", tag, self,
|
||||
ruby_frame->last_func,
|
||||
ruby_frame->last_class);
|
||||
}
|
||||
if (tag->nd_head && nd_type(tag->nd_head) == NODE_WHEN) {
|
||||
VALUE v = rb_eval(self, tag->nd_head->nd_head);
|
||||
long i;
|
||||
|
||||
if (TYPE(v) != T_ARRAY) v = rb_ary_to_ary(v);
|
||||
for (i=0; i<RARRAY(v)->len; i++) {
|
||||
if (RTEST(RARRAY(v)->ptr[i])) {
|
||||
node = node->nd_body;
|
||||
goto again;
|
||||
}
|
||||
}
|
||||
tag = tag->nd_next;
|
||||
continue;
|
||||
}
|
||||
if (RTEST(rb_eval(self, tag->nd_head))) {
|
||||
node = node->nd_body;
|
||||
goto again;
|
||||
}
|
||||
tag = tag->nd_next;
|
||||
}
|
||||
node = node->nd_next;
|
||||
}
|
||||
RETURN(Qnil);
|
||||
|
||||
case NODE_CASE:
|
||||
{
|
||||
VALUE val;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue