From 7f7834abf738ab26236bea159fce7f37dea03f1f Mon Sep 17 00:00:00 2001 From: ko1 Date: Tue, 23 Sep 2008 07:49:45 +0000 Subject: * include/ruby/node.h, vm_core.h: move definition of RUBY_VM_METHOD_NODE to node.h. * class.c, common.mk: remove useless inclusion. * compile.h, iseq.h, vm_core.h: rename compile.h to iseq.h. move some definitions from vm_core.h to iseq.h. * compile.c, iseq.c, vm.c: ditto. * eval.c, compile.c: move some functions for parser from eval.c to compile.c. * eval_intern.h, vm_core.h: move va_init_list() macro to vm_core.h. * iseq.c (rb_iseq_new_top, rb_iseq_first_lineno): added. * load.c, ruby.c: use rb_iseq_new_top() instead of rb_iseq_new() with ISEQ_TYPE_TOP constant directly. * proc.c: use rb_iseq_first_lineno() instead of accessing iseq structure. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- eval.c | 54 +----------------------------------------------------- 1 file changed, 1 insertion(+), 53 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index e2d7cfcfd9..ca01e02e81 100644 --- a/eval.c +++ b/eval.c @@ -12,6 +12,7 @@ **********************************************************************/ #include "eval_intern.h" +#include "iseq.h" VALUE proc_invoke(VALUE, VALUE, VALUE, VALUE); VALUE rb_binding_new(void); @@ -1175,56 +1176,3 @@ Init_eval(void) OBJ_TAINT(exception_error); OBJ_FREEZE(exception_error); } - - -/* for parser */ - -int -rb_dvar_defined(ID id) -{ - rb_thread_t *th = GET_THREAD(); - rb_iseq_t *iseq; - if (th->base_block && (iseq = th->base_block->iseq)) { - while (iseq->type == ISEQ_TYPE_BLOCK || - iseq->type == ISEQ_TYPE_RESCUE || - iseq->type == ISEQ_TYPE_ENSURE || - iseq->type == ISEQ_TYPE_EVAL) { - int i; - - for (i = 0; i < iseq->local_table_size; i++) { - if (iseq->local_table[i] == id) { - return 1; - } - } - iseq = iseq->parent_iseq; - } - } - return 0; -} - -int -rb_local_defined(ID id) -{ - rb_thread_t *th = GET_THREAD(); - rb_iseq_t *iseq; - - if (th->base_block && th->base_block->iseq) { - int i; - iseq = th->base_block->iseq->local_iseq; - - for (i=0; ilocal_table_size; i++) { - if (iseq->local_table[i] == id) { - return 1; - } - } - } - return 0; -} - -int -rb_parse_in_eval(void) -{ - return GET_THREAD()->parse_in_eval != 0; -} - - -- cgit v1.2.3