diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-23 07:49:45 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-23 07:49:45 +0000 |
commit | 7f7834abf738ab26236bea159fce7f37dea03f1f (patch) | |
tree | 1e92b71304d4cb6f6a37bee6b74d659ea43a5aad /eval.c | |
parent | 0867b94cb9ec890d608beaa4d100a33508867727 (diff) | |
download | ruby-7f7834abf738ab26236bea159fce7f37dea03f1f.tar.gz |
* 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
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 54 |
1 files changed, 1 insertions, 53 deletions
@@ -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; i<iseq->local_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; -} - - |