mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
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:
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
1
node.h
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue