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

* parse.y (lex_getline): should update ruby_debug_lines.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2004-10-20 06:53:42 +00:00
parent 3054488377
commit fbdc2bf5f7
4 changed files with 13 additions and 4 deletions

View file

@ -1,3 +1,7 @@
Wed Oct 20 10:31:33 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* parse.y (lex_getline): should update ruby_debug_lines.
Wed Oct 20 04:17:55 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/dbm/dbm.c (fdbm_delete_if): should check if deleting element

3
eval.c
View file

@ -2457,6 +2457,7 @@ call_trace_func(event, node, self, id, klass)
if (!trace_func) return;
if (tracing) return;
if (id == ID_ALLOCATOR) return;
if (!node && ruby_sourceline == 0) return;
if (!(node_save = ruby_current_node)) {
node_save = NEW_BEGIN(0);
@ -2491,7 +2492,7 @@ call_trace_func(event, node, self, id, klass)
INT2FIX(ruby_sourceline),
id?ID2SYM(id):Qnil,
self?rb_f_binding(self):Qnil,
klass),
klass?klass:Qnil),
Qundef, 0);
}
if (raised) thread_set_raised();

View file

@ -97,6 +97,7 @@ class Tracer
SCRIPT_LINES__[file] = list = []
end
end
if l = list[line - 1]
l
else

View file

@ -4351,6 +4351,7 @@ yycompile(parser, f, line)
ruby_current_node = 0;
ruby_sourcefile = rb_source_filename(f);
ruby_sourceline = line - 1;
n = yyparse((void*)parser);
ruby_debug_lines = 0;
compile_for_eval = 0;
@ -4402,7 +4403,11 @@ static VALUE
lex_getline(parser)
struct parser_params *parser;
{
return (*parser->parser_lex_gets)(parser, parser->parser_lex_input);
VALUE line = (*parser->parser_lex_gets)(parser, parser->parser_lex_input);
if (ruby_debug_lines && !NIL_P(line)) {
rb_ary_push(ruby_debug_lines, line);
}
return line;
}
#ifndef RIPPER
@ -4419,7 +4424,6 @@ rb_compile_string(f, s, line)
lex_gets_ptr = 0;
lex_input = s;
lex_pbeg = lex_p = lex_pend = 0;
ruby_sourceline = line - 1;
compile_for_eval = ruby_in_eval;
return yycompile(parser, f, line);
@ -4454,7 +4458,6 @@ rb_compile_file(f, file, start)
lex_gets = lex_io_gets;
lex_input = file;
lex_pbeg = lex_p = lex_pend = 0;
ruby_sourceline = start - 1;
return yycompile(parser, f, start);
}