diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | eval.c | 19 | ||||
-rw-r--r-- | parse.y | 2 |
3 files changed, 11 insertions, 17 deletions
@@ -15,6 +15,13 @@ Sat Sep 2 12:00:32 2006 NAKAMURA, Hiroshi <nahi@ruby-lang.org> instead of String#[](idx) to check utf BOM. follows String#[](idx) behavior change of 1.9. +Sat Sep 2 11:47:58 2006 Yukihiro Matsumoto <matz@ruby-lang.org> + + * eval.c (rb_eval): should handle when in else clause. a patch + from Eric Hodel <drbrain at segment7.net>. [ruby-core:08662] + + * parse.y (primary): wrap with NODE_CASE. [ruby-core:08663] + Fri Sep 1 22:07:04 2006 Yukihiro Matsumoto <matz@ruby-lang.org> * ruby.h (RSTRING_EMBED_LEN_MASK): uses 5 bits to support 64bit @@ -2861,25 +2861,12 @@ rb_eval(VALUE self, NODE *n) } goto again; - case NODE_WHEN: - while (node) { - if (nd_type(node) != NODE_WHEN) goto again; - EXEC_EVENT_HOOK(RUBY_EVENT_LINE, node->nd_head, self, - ruby_frame->this_func, - ruby_frame->this_class); - if (when_check(node->nd_head, Qundef, self)) { - node = node->nd_body; - goto again; - } - node = node->nd_next; - } - RETURN(Qnil); - case NODE_CASE: { - VALUE val; + VALUE val = Qundef; - val = rb_eval(self, node->nd_head); + if (node->nd_head) + val = rb_eval(self, node->nd_head); node = node->nd_body; while (node) { if (nd_type(node) != NODE_WHEN) { @@ -2605,7 +2605,7 @@ primary : literal | keyword_case opt_terms case_body keyword_end { /*%%%*/ - $$ = $3; + $$ = NEW_CASE(0, $3); /*% $$ = dispatch2(case, Qnil, $3); %*/ |