1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* eval.c (rb_eval, eval): make line number consistent on eval with

Proc.  [ruby-talk:101253]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2004-05-26 05:19:50 +00:00
parent 00fe662f6f
commit 74ab20eb37
2 changed files with 10 additions and 4 deletions

View file

@ -1,6 +1,11 @@
Wed May 26 14:19:42 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (rb_eval, eval): make line number consistent on eval with
Proc. [ruby-talk:101253]
Wed May 26 13:59:17 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::skip_for_variable): Allow for
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::skip_for_variable): Allow for
'do' after for statement
Wed May 26 13:56:03 2004 Dave Thomas <dave@pragprog.com>

7
eval.c
View file

@ -2931,6 +2931,7 @@ rb_eval(self, n)
iter_retry:
PUSH_ITER(ITER_PRE);
if (nd_type(node) == NODE_ITER) {
ruby_frame->node = node;
result = rb_eval(self, node->nd_iter);
}
else {
@ -6042,10 +6043,10 @@ eval(self, src, scope, file, line)
ruby_cref = data->cref;
old_wrapper = ruby_wrapper;
ruby_wrapper = data->wrapper;
if ((file == 0 || (line == 1 && strcmp(file, "(eval)") == 0)) && data->body) {
file = data->body->nd_file;
if (file == 0 || (line == 1 && strcmp(file, "(eval)") == 0)) {
file = data->frame.node->nd_file;
if (!file) file = "__builtin__";
line = nd_line(data->body);
line = nd_line(data->frame.node);
}
self = data->self;