From acae5f363dfaedd9c2873cee68c9498da3c072f5 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Thu, 17 Jun 2021 23:43:08 +0900 Subject: ast.rb: RubyVM::AST.parse and .of accepts `save_script_lines: true` This option makes the parser keep the original source as an array of the original code lines. This feature exploits the mechanism of `SCRIPT_LINES__` but records only the specified code that is passed to RubyVM::AST.of or .parse, instead of recording all parsed program texts. --- node.c | 1 + 1 file changed, 1 insertion(+) (limited to 'node.c') diff --git a/node.c b/node.c index bef9d7bcbd..f3dbf6e959 100644 --- a/node.c +++ b/node.c @@ -1407,6 +1407,7 @@ rb_ast_mark(rb_ast_t *ast) iterate_node_values(&nb->markable, mark_ast_value, NULL); } + if (ast->body.script_lines) rb_gc_mark(ast->body.script_lines); } void -- cgit v1.2.3