aboutsummaryrefslogtreecommitdiffstats
path: root/node.c
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2021-06-17 23:43:08 +0900
committerYusuke Endoh <mame@ruby-lang.org>2021-06-18 02:34:27 +0900
commitacae5f363dfaedd9c2873cee68c9498da3c072f5 (patch)
tree8919487eefdc8610b2914366abe637ac34812331 /node.c
parentc639b58823cd8cc62853acf00a49b67ac359ea73 (diff)
downloadruby-acae5f363dfaedd9c2873cee68c9498da3c072f5.tar.gz
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.
Diffstat (limited to 'node.c')
-rw-r--r--node.c1
1 files changed, 1 insertions, 0 deletions
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