summaryrefslogtreecommitdiff
path: root/internal
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 /internal
parentc639b58823cd8cc62853acf00a49b67ac359ea73 (diff)
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.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4581
Diffstat (limited to 'internal')
-rw-r--r--internal/parse.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/internal/parse.h b/internal/parse.h
index a37a39f84d..588b2b34da 100644
--- a/internal/parse.h
+++ b/internal/parse.h
@@ -15,6 +15,7 @@ struct rb_iseq_struct; /* in vm_core.h */
/* parse.y */
VALUE rb_parser_set_yydebug(VALUE, VALUE);
void *rb_parser_load_file(VALUE parser, VALUE name);
+void rb_parser_save_script_lines(VALUE vparser);
RUBY_SYMBOL_EXPORT_BEGIN
VALUE rb_parser_set_context(VALUE, const struct rb_iseq_struct *, int);