Skip to content

Commit

Permalink
Remove "internal/io.h"
Browse files Browse the repository at this point in the history
  • Loading branch information
yui-knk committed Apr 13, 2023
1 parent e738293 commit afbbd1d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions external/parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ 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);


} rb_parser_config_t;

Expand Down
5 changes: 4 additions & 1 deletion parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ struct lex_context;
#include "internal/encoding.h"
#include "internal/error.h"
#include "internal/imemo.h"
#include "internal/io.h"
#include "internal/re.h"
#include "internal/symbol.h"
#include "internal/thread.h"
Expand All @@ -63,6 +62,7 @@ struct lex_context;
#include "internal/complex.h"
#include "internal/numeric.h"
#include "internal/hash.h"
#include "internal/io.h"
#include "internal/rational.h"
#endif

Expand Down Expand Up @@ -142,6 +142,9 @@ RBIMPL_WARNING_POP()
#define rcomplex_get_real p->config.rcomplex_get_real
#define rcomplex_get_imag p->config.rcomplex_get_imag

#define rb_stderr_tty_p p->config.stderr_tty_p
#define rb_write_error_str p->config.write_error_str

#endif

#define NO_LEX_CTXT (struct lex_context){0}
Expand Down
4 changes: 4 additions & 0 deletions ruby_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "internal/bignum.h"
#include "internal/complex.h"
#include "internal/hash.h"
#include "internal/io.h"
#include "internal/parse.h"
#include "internal/rational.h"
#include "internal/ruby_parser.h"
Expand Down Expand Up @@ -138,6 +139,9 @@ rb_parser_config_initialize(rb_parser_config_t *config)
config->rcomplex_set_imag = rcomplex_set_imag;
config->rcomplex_get_real = rcomplex_get_real;
config->rcomplex_get_imag = rcomplex_get_imag;

config->stderr_tty_p = rb_stderr_tty_p;
config->write_error_str = rb_write_error_str;
}

VALUE
Expand Down

0 comments on commit afbbd1d

Please sign in to comment.