@@ -64,8 +64,8 @@ ast_new_internal(rb_ast_t *ast, const NODE *node)
64
64
return obj ;
65
65
}
66
66
67
- static VALUE rb_ast_parse_str (VALUE str , VALUE save_script_lines );
68
- static VALUE rb_ast_parse_file (VALUE path , VALUE save_script_lines );
67
+ static VALUE rb_ast_parse_str (VALUE str , VALUE keep_script_lines );
68
+ static VALUE rb_ast_parse_file (VALUE path , VALUE keep_script_lines );
69
69
70
70
static VALUE
71
71
ast_parse_new (void )
@@ -85,31 +85,31 @@ ast_parse_done(rb_ast_t *ast)
85
85
}
86
86
87
87
static VALUE
88
- ast_s_parse (rb_execution_context_t * ec , VALUE module , VALUE str , VALUE save_script_lines )
88
+ ast_s_parse (rb_execution_context_t * ec , VALUE module , VALUE str , VALUE keep_script_lines )
89
89
{
90
- return rb_ast_parse_str (str , save_script_lines );
90
+ return rb_ast_parse_str (str , keep_script_lines );
91
91
}
92
92
93
93
static VALUE
94
- rb_ast_parse_str (VALUE str , VALUE save_script_lines )
94
+ rb_ast_parse_str (VALUE str , VALUE keep_script_lines )
95
95
{
96
96
rb_ast_t * ast = 0 ;
97
97
98
98
StringValue (str );
99
99
VALUE vparser = ast_parse_new ();
100
- if (RTEST (save_script_lines )) rb_parser_save_script_lines (vparser );
100
+ if (RTEST (keep_script_lines )) rb_parser_keep_script_lines (vparser );
101
101
ast = rb_parser_compile_string_path (vparser , Qnil , str , 1 );
102
102
return ast_parse_done (ast );
103
103
}
104
104
105
105
static VALUE
106
- ast_s_parse_file (rb_execution_context_t * ec , VALUE module , VALUE path , VALUE save_script_lines )
106
+ ast_s_parse_file (rb_execution_context_t * ec , VALUE module , VALUE path , VALUE keep_script_lines )
107
107
{
108
- return rb_ast_parse_file (path , save_script_lines );
108
+ return rb_ast_parse_file (path , keep_script_lines );
109
109
}
110
110
111
111
static VALUE
112
- rb_ast_parse_file (VALUE path , VALUE save_script_lines )
112
+ rb_ast_parse_file (VALUE path , VALUE keep_script_lines )
113
113
{
114
114
VALUE f ;
115
115
rb_ast_t * ast = 0 ;
@@ -119,7 +119,7 @@ rb_ast_parse_file(VALUE path, VALUE save_script_lines)
119
119
f = rb_file_open_str (path , "r" );
120
120
rb_funcall (f , rb_intern ("set_encoding" ), 2 , rb_enc_from_encoding (enc ), rb_str_new_cstr ("-" ));
121
121
VALUE vparser = ast_parse_new ();
122
- if (RTEST (save_script_lines )) rb_parser_save_script_lines (vparser );
122
+ if (RTEST (keep_script_lines )) rb_parser_keep_script_lines (vparser );
123
123
ast = rb_parser_compile_file_path (vparser , Qnil , f , 1 );
124
124
rb_io_close (f );
125
125
return ast_parse_done (ast );
@@ -139,13 +139,13 @@ lex_array(VALUE array, int index)
139
139
}
140
140
141
141
static VALUE
142
- rb_ast_parse_array (VALUE array , VALUE save_script_lines )
142
+ rb_ast_parse_array (VALUE array , VALUE keep_script_lines )
143
143
{
144
144
rb_ast_t * ast = 0 ;
145
145
146
146
array = rb_check_array_type (array );
147
147
VALUE vparser = ast_parse_new ();
148
- if (RTEST (save_script_lines )) rb_parser_save_script_lines (vparser );
148
+ if (RTEST (keep_script_lines )) rb_parser_keep_script_lines (vparser );
149
149
ast = rb_parser_compile_generic (vparser , lex_array , Qnil , array , 1 );
150
150
return ast_parse_done (ast );
151
151
}
@@ -193,7 +193,7 @@ script_lines(VALUE path)
193
193
}
194
194
195
195
static VALUE
196
- ast_s_of (rb_execution_context_t * ec , VALUE module , VALUE body , VALUE save_script_lines )
196
+ ast_s_of (rb_execution_context_t * ec , VALUE module , VALUE body , VALUE keep_script_lines )
197
197
{
198
198
VALUE path , node , lines ;
199
199
int node_id ;
@@ -221,13 +221,13 @@ ast_s_of(rb_execution_context_t *ec, VALUE module, VALUE body, VALUE save_script
221
221
}
222
222
223
223
if (!NIL_P (lines = script_lines (path ))) {
224
- node = rb_ast_parse_array (lines , save_script_lines );
224
+ node = rb_ast_parse_array (lines , keep_script_lines );
225
225
}
226
226
else if (RSTRING_LEN (path ) == 2 && memcmp (RSTRING_PTR (path ), "-e" , 2 ) == 0 ) {
227
- node = rb_ast_parse_str (rb_e_script , save_script_lines );
227
+ node = rb_ast_parse_str (rb_e_script , keep_script_lines );
228
228
}
229
229
else {
230
- node = rb_ast_parse_file (path , save_script_lines );
230
+ node = rb_ast_parse_file (path , keep_script_lines );
231
231
}
232
232
233
233
return node_find (node , node_id );
0 commit comments