Skip to content

Commit fba6470

Browse files
S-H-GAMELINKSyui-knk
authored andcommitted
Remove uneeded Universal Parser properties
1 parent 2a4b6ed commit fba6470

File tree

3 files changed

+0
-34
lines changed

3 files changed

+0
-34
lines changed

ruby_parser.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -358,12 +358,6 @@ syntax_error_new(void)
358358
return rb_class_new_instance(0, 0, rb_eSyntaxError);
359359
}
360360

361-
static int
362-
obj_frozen(VALUE obj)
363-
{
364-
return (int)RB_OBJ_FROZEN(obj);
365-
}
366-
367361
static VALUE
368362
obj_write(VALUE old, VALUE *slot, VALUE young)
369363
{
@@ -511,7 +505,6 @@ static const rb_parser_config_t rb_global_parser_config = {
511505

512506
.obj_freeze = rb_obj_freeze,
513507
.obj_hide = rb_obj_hide,
514-
.obj_frozen = obj_frozen,
515508
.type_p = type_p,
516509
.obj_freeze_raw = OBJ_FREEZE_RAW,
517510

@@ -523,17 +516,13 @@ static const rb_parser_config_t rb_global_parser_config = {
523516
.ary_new = rb_ary_new,
524517
.ary_push = rb_ary_push,
525518
.ary_new_from_args = rb_ary_new_from_args,
526-
.ary_pop = rb_ary_pop,
527-
.ary_last = rb_ary_last,
528519
.ary_unshift = rb_ary_unshift,
529520
.ary_new2 = rb_ary_new2,
530-
.ary_entry = rb_ary_entry,
531521
.ary_clear = rb_ary_clear,
532522
.ary_modify = rb_ary_modify,
533523
.array_len = rb_array_len,
534524
.array_aref = RARRAY_AREF,
535525

536-
.sym_intern_ascii_cstr = rb_sym_intern_ascii_cstr,
537526
.make_temporary_id = rb_make_temporary_id,
538527
.is_local_id = is_local_id2,
539528
.is_attrset_id = is_attrset_id2,
@@ -546,7 +535,6 @@ static const rb_parser_config_t rb_global_parser_config = {
546535
.intern_str = rb_intern_str,
547536
.is_notop_id = is_notop_id2,
548537
.enc_symname_type = enc_symname_type,
549-
.str_intern = rb_str_intern,
550538
.id2name = rb_id2name,
551539
.id2str = rb_id2str,
552540
.id2sym = rb_id2sym,
@@ -555,7 +543,6 @@ static const rb_parser_config_t rb_global_parser_config = {
555543
.str_catf = rb_str_catf,
556544
.str_cat_cstr = rb_str_cat_cstr,
557545
.str_subseq = rb_str_subseq,
558-
.str_dup = rb_str_dup,
559546
.str_new_frozen = rb_str_new_frozen,
560547
.str_buf_new = rb_str_buf_new,
561548
.str_buf_cat = rb_str_buf_cat,

rubyparser.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,7 +1211,6 @@ typedef struct rb_parser_config_struct {
12111211
/* Object */
12121212
VALUE (*obj_freeze)(VALUE obj);
12131213
VALUE (*obj_hide)(VALUE obj);
1214-
int (*obj_frozen)(VALUE obj);
12151214
int (*type_p)(VALUE, int);
12161215
void (*obj_freeze_raw)(VALUE obj);
12171216

@@ -1225,18 +1224,14 @@ typedef struct rb_parser_config_struct {
12251224
VALUE (*ary_new)(void);
12261225
VALUE (*ary_push)(VALUE ary, VALUE elem);
12271226
VALUE (*ary_new_from_args)(long n, ...);
1228-
VALUE (*ary_pop)(VALUE ary);
1229-
VALUE (*ary_last)(int argc, const VALUE *argv, VALUE ary);
12301227
VALUE (*ary_unshift)(VALUE ary, VALUE item);
12311228
VALUE (*ary_new2)(long capa); // ary_new_capa
1232-
VALUE (*ary_entry)(VALUE ary, long offset);
12331229
VALUE (*ary_clear)(VALUE ary);
12341230
void (*ary_modify)(VALUE ary);
12351231
long (*array_len)(VALUE a);
12361232
VALUE (*array_aref)(VALUE, long);
12371233

12381234
/* Symbol */
1239-
VALUE (*sym_intern_ascii_cstr)(const char *ptr);
12401235
ID (*make_temporary_id)(size_t n);
12411236
int (*is_local_id)(ID);
12421237
int (*is_attrset_id)(ID);
@@ -1249,7 +1244,6 @@ typedef struct rb_parser_config_struct {
12491244
ID (*intern_str)(VALUE str);
12501245
int (*is_notop_id)(ID);
12511246
int (*enc_symname_type)(const char *name, long len, rb_encoding *enc, unsigned int allowed_attrset);
1252-
VALUE (*str_intern)(VALUE str);
12531247
const char *(*id2name)(ID id);
12541248
VALUE (*id2str)(ID id);
12551249
VALUE (*id2sym)(ID x);
@@ -1260,7 +1254,6 @@ typedef struct rb_parser_config_struct {
12601254
VALUE (*str_catf)(VALUE str, const char *format, ...);
12611255
VALUE (*str_cat_cstr)(VALUE str, const char *ptr);
12621256
VALUE (*str_subseq)(VALUE str, long beg, long len);
1263-
VALUE (*str_dup)(VALUE str);
12641257
VALUE (*str_new_frozen)(VALUE orig);
12651258
VALUE (*str_buf_new)(long capa);
12661259
VALUE (*str_buf_cat)(VALUE, const char*, long);

universal_parser.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,9 @@ struct rb_imemo_tmpbuf_struct {
115115

116116
#define compile_callback p->config->compile_callback
117117
#define reg_named_capture_assign p->config->reg_named_capture_assign
118-
#define script_lines_defined p->config->script_lines_defined
119-
#define script_lines_get p->config->script_lines_get
120118

121119
#define rb_obj_freeze p->config->obj_freeze
122120
#define rb_obj_hide p->config->obj_hide
123-
#undef RB_OBJ_FROZEN
124-
#define RB_OBJ_FROZEN p->config->obj_frozen
125121
#undef RB_TYPE_P
126122
#define RB_TYPE_P p->config->type_p
127123
#undef OBJ_FREEZE_RAW
@@ -138,20 +134,15 @@ struct rb_imemo_tmpbuf_struct {
138134
#define rb_ary_push p->config->ary_push
139135
#undef rb_ary_new_from_args
140136
#define rb_ary_new_from_args p->config->ary_new_from_args
141-
#define rb_ary_pop p->config->ary_pop
142-
#define rb_ary_last p->config->ary_last
143137
#define rb_ary_unshift p->config->ary_unshift
144138
#undef rb_ary_new2
145139
#define rb_ary_new2 p->config->ary_new2
146-
#define rb_ary_entry p->config->ary_entry
147140
#define rb_ary_clear p->config->ary_clear
148141
#define rb_ary_modify p->config->ary_modify
149142
#undef RARRAY_LEN
150143
#define RARRAY_LEN p->config->array_len
151144
#define RARRAY_AREF p->config->array_aref
152145

153-
#undef rb_sym_intern_ascii_cstr
154-
#define rb_sym_intern_ascii_cstr p->config->sym_intern_ascii_cstr
155146
#define rb_make_temporary_id p->config->make_temporary_id
156147
#define is_local_id p->config->is_local_id
157148
#define is_attrset_id p->config->is_attrset_id
@@ -165,10 +156,8 @@ struct rb_imemo_tmpbuf_struct {
165156
#define rb_intern_str p->config->intern_str
166157
#define is_notop_id p->config->is_notop_id
167158
#define rb_enc_symname_type p->config->enc_symname_type
168-
#define rb_str_intern p->config->str_intern
169159
#define rb_id2name p->config->id2name
170160
#define rb_id2str p->config->id2str
171-
#define rb_id2sym p->config->id2sym
172161
#undef ID2SYM
173162
#define ID2SYM p->config->id2sym
174163
#undef SYM2ID
@@ -178,7 +167,6 @@ struct rb_imemo_tmpbuf_struct {
178167
#undef rb_str_cat_cstr
179168
#define rb_str_cat_cstr p->config->str_cat_cstr
180169
#define rb_str_subseq p->config->str_subseq
181-
#define rb_str_dup p->config->str_dup
182170
#define rb_str_new_frozen p->config->str_new_frozen
183171
#define rb_str_buf_new p->config->str_buf_new
184172
#undef rb_str_buf_cat
@@ -262,7 +250,6 @@ struct rb_imemo_tmpbuf_struct {
262250

263251
#define rb_ractor_make_shareable p->config->ractor_make_shareable
264252

265-
#define ruby_vm_keep_script_lines p->config->vm_keep_script_lines()
266253
#define rb_local_defined p->config->local_defined
267254
#define rb_dvar_defined p->config->dvar_defined
268255

@@ -333,7 +320,6 @@ struct rb_imemo_tmpbuf_struct {
333320
#define SPECIAL_CONST_P p->config->special_const_p
334321
#undef BUILTIN_TYPE
335322
#define BUILTIN_TYPE p->config->builtin_type
336-
#define ruby_snprintf p->config->snprintf
337323

338324
#define rb_node_case_when_optimizable_literal p->config->node_case_when_optimizable_literal
339325

0 commit comments

Comments
 (0)