Skip to content

Commit

Permalink
Remove unused functions from struct rb_parser_config_struct
Browse files Browse the repository at this point in the history
  • Loading branch information
S-H-GAMELINKS authored and yui-knk committed Apr 6, 2024
1 parent c6c75f3 commit dae5038
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 36 deletions.
23 changes: 0 additions & 23 deletions ruby_parser.c
Expand Up @@ -297,12 +297,6 @@ rbool(VALUE v)
return RBOOL(v);
}

static int
undef_p(VALUE v)
{
return RB_UNDEF_P(v);
}

static int
rtest(VALUE obj)
{
Expand Down Expand Up @@ -357,18 +351,6 @@ rb_errno_ptr2(void)
return rb_errno_ptr();
}

static int
fixnum_p(VALUE obj)
{
return (int)RB_FIXNUM_P(obj);
}

static int
symbol_p(VALUE obj)
{
return (int)RB_SYMBOL_P(obj);
}

static void *
zalloc(size_t elemsiz)
{
Expand Down Expand Up @@ -447,17 +429,13 @@ static const rb_parser_config_t rb_global_parser_config = {
.compile_callback = rb_suppress_tracing,
.reg_named_capture_assign = reg_named_capture_assign,

.fixnum_p = fixnum_p,
.symbol_p = symbol_p,

.attr_get = rb_attr_get,

.ary_new = rb_ary_new,
.ary_push = rb_ary_push,
.ary_new_from_args = rb_ary_new_from_args,
.ary_unshift = rb_ary_unshift,
.ary_new2 = rb_ary_new2,
.ary_clear = rb_ary_clear,
.ary_modify = rb_ary_modify,
.array_len = rb_array_len,
.array_aref = RARRAY_AREF,
Expand Down Expand Up @@ -586,7 +564,6 @@ static const rb_parser_config_t rb_global_parser_config = {
.strtod = ruby_strtod,

.rbool = rbool,
.undef_p = undef_p,
.rtest = rtest,
.nil_p = nil_p,
.qnil = Qnil,
Expand Down
5 changes: 0 additions & 5 deletions rubyparser.h
Expand Up @@ -1248,9 +1248,6 @@ typedef struct rb_parser_config_struct {
VALUE (*compile_callback)(VALUE (*func)(VALUE), VALUE arg);
NODE *(*reg_named_capture_assign)(struct parser_params* p, VALUE regexp, const rb_code_location_t *loc);

int (*fixnum_p)(VALUE);
int (*symbol_p)(VALUE);

/* Variable */
VALUE (*attr_get)(VALUE obj, ID id);

Expand All @@ -1260,7 +1257,6 @@ typedef struct rb_parser_config_struct {
VALUE (*ary_new_from_args)(long n, ...);
VALUE (*ary_unshift)(VALUE ary, VALUE item);
VALUE (*ary_new2)(long capa); // ary_new_capa
VALUE (*ary_clear)(VALUE ary);
void (*ary_modify)(VALUE ary);
long (*array_len)(VALUE a);
VALUE (*array_aref)(VALUE, long);
Expand Down Expand Up @@ -1409,7 +1405,6 @@ typedef struct rb_parser_config_struct {

/* Misc */
VALUE (*rbool)(VALUE);
int (*undef_p)(VALUE);
int (*rtest)(VALUE obj);
int (*nil_p)(VALUE obj);
VALUE qnil;
Expand Down
8 changes: 0 additions & 8 deletions universal_parser.c
Expand Up @@ -88,11 +88,6 @@
#define compile_callback p->config->compile_callback
#define reg_named_capture_assign p->config->reg_named_capture_assign

#undef FIXNUM_P
#define FIXNUM_P p->config->fixnum_p
#undef SYMBOL_P
#define SYMBOL_P p->config->symbol_p

#define rb_attr_get p->config->attr_get

#define rb_ary_new p->config->ary_new
Expand All @@ -102,7 +97,6 @@
#define rb_ary_unshift p->config->ary_unshift
#undef rb_ary_new2
#define rb_ary_new2 p->config->ary_new2
#define rb_ary_clear p->config->ary_clear
#define rb_ary_modify p->config->ary_modify
#undef RARRAY_LEN
#define RARRAY_LEN p->config->array_len
Expand Down Expand Up @@ -245,8 +239,6 @@

#undef RBOOL
#define RBOOL p->config->rbool
#undef UNDEF_P
#define UNDEF_P p->config->undef_p
#undef RTEST
#define RTEST p->config->rtest
#undef NIL_P
Expand Down

0 comments on commit dae5038

Please sign in to comment.