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.
This commit is contained in:
Yusuke Endoh 2021-06-17 23:43:08 +09:00
parent c639b58823
commit acae5f363d
Notes: git 2021-06-18 02:34:57 +09:00
8 changed files with 145 additions and 22 deletions

1
node.h
View file

@ -399,6 +399,7 @@ typedef struct rb_ast_body_struct {
const NODE *root;
VALUE compile_option;
int line_count;
VALUE script_lines;
} rb_ast_body_t;
typedef struct rb_ast_struct {
VALUE flags;