From cf74ff714aa795a82cc0ea46e26937efcedfaa45 Mon Sep 17 00:00:00 2001 From: yui-knk Date: Thu, 25 Apr 2024 16:09:42 +0900 Subject: Change return value of `gets` function to be `rb_parser_string_t *` instead of `VALUE` This change reduces parser's dependency on ruby object. --- internal/parse.h | 2 +- internal/ruby_parser.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'internal') diff --git a/internal/parse.h b/internal/parse.h index 5d68993017..a7e8e08912 100644 --- a/internal/parse.h +++ b/internal/parse.h @@ -54,7 +54,7 @@ rb_parser_t *rb_ruby_parser_set_context(rb_parser_t *p, const struct rb_iseq_str void rb_ruby_parser_set_script_lines(rb_parser_t *p); void rb_ruby_parser_error_tolerant(rb_parser_t *p); void rb_ruby_parser_keep_tokens(rb_parser_t *p); -typedef VALUE (rb_parser_lex_gets_func)(struct parser_params*, rb_parser_input_data, int); +typedef rb_parser_string_t*(rb_parser_lex_gets_func)(struct parser_params*, rb_parser_input_data, int); rb_ast_t *rb_parser_compile(rb_parser_t *p, rb_parser_lex_gets_func *gets, const char *fname_ptr, long fname_len, rb_encoding *fname_enc, rb_parser_input_data input, int line); RUBY_SYMBOL_EXPORT_BEGIN diff --git a/internal/ruby_parser.h b/internal/ruby_parser.h index f7f859cb70..8e306d18de 100644 --- a/internal/ruby_parser.h +++ b/internal/ruby_parser.h @@ -25,7 +25,7 @@ VALUE rb_parser_new(void); VALUE rb_parser_compile_string_path(VALUE vparser, VALUE fname, VALUE src, int line); VALUE rb_str_new_parser_string(rb_parser_string_t *str); VALUE rb_str_new_mutable_parser_string(rb_parser_string_t *str); -VALUE rb_parser_lex_get_str(struct lex_pointer_string *ptr_str); +rb_parser_string_t *rb_parser_lex_get_str(struct parser_params *p, struct lex_pointer_string *ptr_str); VALUE rb_node_str_string_val(const NODE *); VALUE rb_node_sym_string_val(const NODE *); -- cgit v1.2.3