From 418ad65db40200058a023b57682f4a3853fd63bc Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Thu, 15 Nov 2018 23:29:55 +0900 Subject: Fixed a bug in continuous read of target files; ref #4138 Line number information in a compiled file was wrong. --- mrbgems/mruby-compiler/core/parse.y | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mrbgems/mruby-compiler/core/parse.y') diff --git a/mrbgems/mruby-compiler/core/parse.y b/mrbgems/mruby-compiler/core/parse.y index 1c06be839..ac8724377 100644 --- a/mrbgems/mruby-compiler/core/parse.y +++ b/mrbgems/mruby-compiler/core/parse.y @@ -133,6 +133,10 @@ cons_gen(parser_state *p, node *car, node *cdr) c->cdr = cdr; c->lineno = p->lineno; c->filename_index = p->current_filename_index; + /* beginning of next partial file; need to point the previous file */ + if (p->lineno == 0 && p->current_filename_index > 0) { + c->filename_index-- ; + } return c; } #define cons(a,b) cons_gen(p,(a),(b)) -- cgit v1.2.3