Use rb_str_to_interned_str in parse.y
This commit changes rb_fstring to rb_str_to_interned_str in parse.y. rb_fstring is private so it shouldn't be used by ripper.
This commit is contained in:
parent
9a09e27a73
commit
01f9b2ae41
8
parse.y
8
parse.y
@ -7637,7 +7637,7 @@ yycompile(struct parser_params *p, VALUE fname, int line)
|
||||
p->ruby_sourcefile = "(none)";
|
||||
}
|
||||
else {
|
||||
p->ruby_sourcefile_string = rb_fstring(fname);
|
||||
p->ruby_sourcefile_string = rb_str_to_interned_str(fname);
|
||||
p->ruby_sourcefile = StringValueCStr(fname);
|
||||
}
|
||||
p->ruby_sourceline = line - 1;
|
||||
@ -13485,7 +13485,7 @@ rb_parser_trace_lex_state(struct parser_params *p, enum lex_state_e from,
|
||||
VALUE
|
||||
rb_parser_lex_state_name(struct parser_params *p, enum lex_state_e state)
|
||||
{
|
||||
return rb_fstring(append_lex_state_name(p, state, rb_str_new(0, 0)));
|
||||
return rb_str_to_interned_str(append_lex_state_name(p, state, rb_str_new(0, 0)));
|
||||
}
|
||||
|
||||
static void
|
||||
@ -14026,13 +14026,13 @@ shareable_literal_constant(struct parser_params *p, enum shareability shareable,
|
||||
return value;
|
||||
|
||||
case NODE_STR:
|
||||
lit = rb_fstring(rb_node_str_string_val(value));
|
||||
lit = rb_str_to_interned_str(rb_node_str_string_val(value));
|
||||
value = NEW_LIT(lit, loc);
|
||||
RB_OBJ_WRITE(p->ast, &RNODE_LIT(value)->nd_lit, lit);
|
||||
return value;
|
||||
|
||||
case NODE_FILE:
|
||||
lit = rb_fstring(rb_node_file_path_val(value));
|
||||
lit = rb_str_to_interned_str(rb_node_file_path_val(value));
|
||||
value = NEW_LIT(lit, loc);
|
||||
RB_OBJ_WRITTEN(p->ast, Qnil, RNODE_LIT(value)->nd_lit);
|
||||
return value;
|
||||
|
@ -533,7 +533,7 @@ static const rb_parser_config_t rb_global_parser_config = {
|
||||
.str_resize = rb_str_resize,
|
||||
.str_new = rb_str_new,
|
||||
.str_new_cstr = rb_str_new_cstr,
|
||||
.fstring = rb_fstring,
|
||||
.str_to_interned_str = rb_str_to_interned_str,
|
||||
.is_ascii_string = is_ascii_string2,
|
||||
.enc_str_new = enc_str_new,
|
||||
.enc_str_buf_cat = enc_str_buf_cat,
|
||||
|
@ -1272,7 +1272,7 @@ typedef struct rb_parser_config_struct {
|
||||
VALUE (*str_resize)(VALUE str, long len);
|
||||
VALUE (*str_new)(const char *ptr, long len);
|
||||
VALUE (*str_new_cstr)(const char *ptr);
|
||||
VALUE (*fstring)(VALUE);
|
||||
VALUE (*str_to_interned_str)(VALUE);
|
||||
int (*is_ascii_string)(VALUE str);
|
||||
VALUE (*enc_str_new)(const char *ptr, long len, rb_encoding *enc);
|
||||
VALUE (*enc_str_buf_cat)(VALUE str, const char *ptr, long len, rb_encoding *enc);
|
||||
|
@ -157,7 +157,7 @@ struct rb_imemo_tmpbuf_struct {
|
||||
#define rb_str_new p->config->str_new
|
||||
#undef rb_str_new_cstr
|
||||
#define rb_str_new_cstr p->config->str_new_cstr
|
||||
#define rb_fstring p->config->fstring
|
||||
#define rb_str_to_interned_str p->config->str_to_interned_str
|
||||
#define is_ascii_string p->config->is_ascii_string
|
||||
#define rb_enc_str_new p->config->enc_str_new
|
||||
#define rb_enc_str_buf_cat p->config->enc_str_buf_cat
|
||||
|
Loading…
x
Reference in New Issue
Block a user