Skip to content

Commit

Permalink
Remove dependency for rb_rational_new/rb_rational_raw
Browse files Browse the repository at this point in the history
  • Loading branch information
yui-knk committed Apr 16, 2023
1 parent 3c2e78d commit 028c76b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion external/parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ typedef struct rb_parser_config_struct {
void (*bignum_negate)(VALUE b);

/* Rational */
VALUE (*rational_new)(VALUE x, VALUE y);
VALUE (*rational_raw)(VALUE x, VALUE y);
void (*rational_set_num)(VALUE r, VALUE n);
VALUE (*rational_get_num)(VALUE obj);

Expand All @@ -86,7 +88,6 @@ typedef struct rb_parser_config_struct {
VALUE (*rcomplex_get_real)(VALUE obj);
VALUE (*rcomplex_get_imag)(VALUE obj);


/* IO */
int (*stderr_tty_p)(void);
void (*write_error_str)(VALUE mesg);
Expand Down
2 changes: 2 additions & 0 deletions parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ RBIMPL_WARNING_POP()

#define bignum_negate p->config.bignum_negate

#define rrb_ational_new p->config.rational_new
#define rb_rational_raw p->config.rational_raw
#define rational_set_num p->config.rational_set_num
#define rational_get_num p->config.rational_get_num

Expand Down
2 changes: 2 additions & 0 deletions ruby_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,8 @@ rb_parser_config_initialize(rb_parser_config_t *config)

config->bignum_negate = bignum_negate;

config->rational_new = rb_rational_new;
config->rational_raw = rb_rational_raw;
config->rational_set_num = rational_set_num;
config->rational_get_num = rational_get_num;

Expand Down

0 comments on commit 028c76b

Please sign in to comment.