diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | eval.c | 9 |
2 files changed, 13 insertions, 0 deletions
@@ -1,3 +1,7 @@ +Tue Aug 5 15:47:34 2003 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * eval.c (rb_load): should preserve current source file/line. + Mon Aug 4 17:25:18 2003 Yukihiro Matsumoto <matz@ruby-lang.org> * stable version 1.8.0 released. @@ -5715,6 +5715,7 @@ rb_load(fname, wrap) volatile ID last_func; volatile VALUE wrapper = 0; volatile VALUE self = ruby_top_self; + NODE *volatile last_node; NODE *saved_cref = ruby_cref; TMP_PROTECT; @@ -5759,6 +5760,11 @@ rb_load(fname, wrap) PUSH_TAG(PROT_NONE); state = EXEC_TAG(); last_func = ruby_frame->last_func; + last_node = ruby_current_node; + if (!ruby_current_node && ruby_sourcefile) { + last_node = NEW_NEWLINE(0); + } + ruby_current_node = 0; if (state == 0) { NODE *node; volatile int critical; @@ -5777,6 +5783,9 @@ rb_load(fname, wrap) } ALLOW_INTS; ruby_frame->last_func = last_func; + ruby_current_node = last_node; + ruby_sourcefile = 0; + ruby_set_current_source(); if (ruby_scope->flags == SCOPE_ALLOCA && ruby_class == rb_cObject) { if (ruby_scope->local_tbl) /* toplevel was empty */ free(ruby_scope->local_tbl); |