Remove unused functions from `struct rb_parser_config_struct`
authorS-H-GAMELINKS <[email protected]>
Fri, 5 Apr 2024 16:18:08 +0000 (6 01:18 +0900)
committerYuichiro Kaneko <[email protected]>
Sat, 6 Apr 2024 00:29:44 +0000 (6 09:29 +0900)
ruby_parser.c
rubyparser.h
universal_parser.c

index eabf2cf..b3617d5 100644 (file)
@@ -298,12 +298,6 @@ rbool(VALUE v)
 }
 
 static int
-undef_p(VALUE v)
-{
-    return RB_UNDEF_P(v);
-}
-
-static int
 rtest(VALUE obj)
 {
     return (int)RB_TEST(obj);
@@ -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)
 {
@@ -447,9 +429,6 @@ 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,
@@ -457,7 +436,6 @@ static const rb_parser_config_t rb_global_parser_config = {
     .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,
@@ -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,
index 2b47d08..1705097 100644 (file)
@@ -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);
 
@@ -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);
@@ -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;
index 1a9619b..80a6f5d 100644 (file)
 #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
 #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
 
 #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