From 7b4a171158fffbb984378a094e7195072b0a5b05 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 12 Apr 2008 03:41:51 +0000 Subject: * eval.c (ruby_exec_node, ruby_run_node), ruby.c (process_options): use iseq instead of NODE. * gc.c (source_filenames): removed. * include/ruby/intern.h, parse.y (yycompile, parser_mark, parser_free, ripper_initialize): rb_source_filename() is no longer used. * compile.c, compile.h (ERROR_ARGS), parse.y (node_newnode, fixpos, parser_warn, e_option_supplied, warn_unless_e_option, range_op, cond0): nd_file is no longer used. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- eval.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index f3a0806654..ab2c33dbcb 100644 --- a/eval.c +++ b/eval.c @@ -214,22 +214,19 @@ ruby_cleanup(int ex) } int -ruby_exec_node(void *n, char *file) +ruby_exec_node(void *n, const char *file) { int state; - VALUE val; - NODE *node = n; + VALUE iseq = (VALUE)n; rb_thread_t *th = GET_THREAD(); - if (!node) return 0; + if (!n) return 0; PUSH_TAG(); if ((state = EXEC_TAG()) == 0) { - VALUE iseq = rb_iseq_new(n, rb_str_new2("
"), - rb_str_new2(file), Qfalse, ISEQ_TYPE_TOP); SAVE_ROOT_JMPBUF(th, { th->base_block = 0; - val = rb_iseq_eval(iseq); + rb_iseq_eval(iseq); }); } POP_TAG(); @@ -245,17 +242,17 @@ ruby_stop(int ex) int ruby_run_node(void *n) { - NODE *node = (NODE *)n; + VALUE v = (VALUE)n; - switch ((VALUE)n) { + switch (v) { case Qtrue: return EXIT_SUCCESS; case Qfalse: return EXIT_FAILURE; } - if (FIXNUM_P((VALUE)n)) { - return FIX2INT((VALUE)n); + if (FIXNUM_P(v)) { + return FIX2INT(v); } Init_stack((void *)&n); - return ruby_cleanup(ruby_exec_node(node, node->nd_file)); + return ruby_cleanup(ruby_exec_node(n, 0)); } VALUE -- cgit v1.2.3