diff options
Diffstat (limited to 'internal/parse.h')
-rw-r--r-- | internal/parse.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/internal/parse.h b/internal/parse.h index 80328686c1..4a9c4acf8a 100644 --- a/internal/parse.h +++ b/internal/parse.h @@ -13,7 +13,7 @@ #include "internal/static_assert.h" #ifdef UNIVERSAL_PARSER -#define rb_encoding void +#define rb_encoding const void #endif struct rb_iseq_struct; /* in vm_core.h */ @@ -53,14 +53,13 @@ void rb_ruby_parser_set_options(rb_parser_t *p, int print, int loop, int chomp, rb_parser_t *rb_ruby_parser_set_context(rb_parser_t *p, const struct rb_iseq_struct *base, int main); void rb_ruby_parser_set_script_lines(rb_parser_t *p); void rb_ruby_parser_error_tolerant(rb_parser_t *p); -rb_ast_t* rb_ruby_parser_compile_file_path(rb_parser_t *p, VALUE fname, VALUE file, int start); void rb_ruby_parser_keep_tokens(rb_parser_t *p); -rb_ast_t* rb_ruby_parser_compile_generic(rb_parser_t *p, VALUE (*lex_gets)(VALUE, int), VALUE fname, VALUE input, int start); -rb_ast_t* rb_ruby_parser_compile_string_path(rb_parser_t *p, VALUE f, VALUE s, int line); +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, VALUE fname, rb_parser_input_data input, int line); RUBY_SYMBOL_EXPORT_BEGIN -VALUE rb_ruby_parser_encoding(rb_parser_t *p); +rb_encoding *rb_ruby_parser_encoding(rb_parser_t *p); int rb_ruby_parser_end_seen_p(rb_parser_t *p); int rb_ruby_parser_set_yydebug(rb_parser_t *p, int flag); rb_parser_string_t *rb_str_to_parser_string(rb_parser_t *p, VALUE str); @@ -73,6 +72,11 @@ int rb_parser_local_defined(struct parser_params *p, ID id, const struct rb_iseq RUBY_SYMBOL_EXPORT_END +#ifndef UNIVERSAL_PARSER +rb_parser_t *rb_ruby_parser_allocate(void); +rb_parser_t *rb_ruby_parser_new(void); +#endif + #ifdef RIPPER void ripper_parser_mark(void *ptr); void ripper_parser_free(void *ptr); @@ -86,7 +90,7 @@ VALUE rb_ruby_parser_debug_output(rb_parser_t *p); void rb_ruby_parser_set_debug_output(rb_parser_t *p, VALUE output); VALUE rb_ruby_parser_parsing_thread(rb_parser_t *p); void rb_ruby_parser_set_parsing_thread(rb_parser_t *p, VALUE parsing_thread); -void rb_ruby_parser_ripper_initialize(rb_parser_t *p, VALUE (*gets)(struct parser_params*,VALUE), VALUE input, VALUE sourcefile_string, const char *sourcefile, int sourceline); +void rb_ruby_parser_ripper_initialize(rb_parser_t *p, rb_parser_lex_gets_func *gets, rb_parser_input_data input, VALUE sourcefile_string, const char *sourcefile, int sourceline); VALUE rb_ruby_parser_result(rb_parser_t *p); rb_encoding *rb_ruby_parser_enc(rb_parser_t *p); VALUE rb_ruby_parser_ruby_sourcefile_string(rb_parser_t *p); @@ -94,7 +98,6 @@ int rb_ruby_parser_ruby_sourceline(rb_parser_t *p); int rb_ruby_parser_lex_state(rb_parser_t *p); void rb_ruby_ripper_parse0(rb_parser_t *p); int rb_ruby_ripper_dedent_string(rb_parser_t *p, VALUE string, int width); -VALUE rb_ruby_ripper_lex_get_str(rb_parser_t *p, VALUE s); int rb_ruby_ripper_initialized_p(rb_parser_t *p); void rb_ruby_ripper_parser_initialize(rb_parser_t *p); long rb_ruby_ripper_column(rb_parser_t *p); |