@@ -52,19 +52,19 @@ static void declare_type_variables(rbs_parser_t *parser, VALUE variables, VALUE
5252 if (NIL_P (variables )) return ; // Nothing to do.
5353
5454 if (!RB_TYPE_P (variables , T_ARRAY )) {
55- free_parser (parser );
55+ rbs_parser_free (parser );
5656 rb_raise (rb_eTypeError ,
5757 "wrong argument type %" PRIsVALUE " (must be an Array of Symbols or nil)" ,
5858 rb_obj_class (variables ));
5959 }
6060
61- parser_push_typevar_table (parser , true);
61+ rbs_parser_push_typevar_table (parser , true);
6262
6363 for (long i = 0 ; i < rb_array_len (variables ); i ++ ) {
6464 VALUE symbol = rb_ary_entry (variables , i );
6565
6666 if (!RB_TYPE_P (symbol , T_SYMBOL )) {
67- free_parser (parser );
67+ rbs_parser_free (parser );
6868 rb_raise (rb_eTypeError ,
6969 "Type variables Array contains invalid value %" PRIsVALUE " of type %" PRIsVALUE " (must be an Array of Symbols or nil)" ,
7070 rb_inspect (symbol ), rb_obj_class (symbol ));
@@ -78,7 +78,7 @@ static void declare_type_variables(rbs_parser_t *parser, VALUE variables, VALUE
7878 RSTRING_LEN (name_str )
7979 );
8080
81- if (!parser_insert_typevar (parser , id )) {
81+ if (!rbs_parser_insert_typevar (parser , id )) {
8282 raise_error (parser -> error , buffer );
8383 }
8484 }
@@ -92,7 +92,7 @@ struct parse_type_arg {
9292};
9393
9494static VALUE ensure_free_parser (VALUE parser ) {
95- free_parser ((rbs_parser_t * )parser );
95+ rbs_parser_free ((rbs_parser_t * )parser );
9696 return Qnil ;
9797}
9898
@@ -105,14 +105,14 @@ static VALUE parse_type_try(VALUE a) {
105105 }
106106
107107 rbs_node_t * type ;
108- parse_type (parser , & type );
108+ rbs_parse_type (parser , & type );
109109
110110 raise_error_if_any (parser , arg -> buffer );
111111
112112 if (RB_TEST (arg -> require_eof )) {
113- parser_advance (parser );
113+ rbs_parser_advance (parser );
114114 if (parser -> current_token .type != pEOF ) {
115- set_error (parser , parser -> current_token , true, "expected a token `%s`" , rbs_token_type_str (pEOF ));
115+ rbs_parser_set_error (parser , parser -> current_token , true, "expected a token `%s`" , rbs_token_type_str (pEOF ));
116116 raise_error (parser -> error , arg -> buffer );
117117 }
118118 }
@@ -136,7 +136,7 @@ static lexstate *alloc_lexer_from_buffer(rbs_allocator_t *allocator, VALUE strin
136136
137137 const char * encoding_name = rb_enc_name (encoding );
138138
139- return alloc_lexer (
139+ return rbs_lexer_new (
140140 allocator ,
141141 rbs_string_from_ruby_string (string ),
142142 rbs_encoding_find ((const uint8_t * ) encoding_name , (const uint8_t * ) (encoding_name + strlen (encoding_name ))),
@@ -156,7 +156,7 @@ static rbs_parser_t *alloc_parser_from_buffer(VALUE buffer, int start_pos, int e
156156 rb_encoding * encoding = rb_enc_get (string );
157157 const char * encoding_name = rb_enc_name (encoding );
158158
159- return alloc_parser (
159+ return rbs_parser_new (
160160 rbs_string_from_ruby_string (string ),
161161 rbs_encoding_find ((const uint8_t * ) encoding_name ,
162162 (const uint8_t * ) (encoding_name + strlen (encoding_name ))),
@@ -195,14 +195,14 @@ static VALUE parse_method_type_try(VALUE a) {
195195 }
196196
197197 rbs_methodtype_t * method_type = NULL ;
198- parse_method_type (parser , & method_type );
198+ rbs_parse_method_type (parser , & method_type );
199199
200200 raise_error_if_any (parser , arg -> buffer );
201201
202202 if (RB_TEST (arg -> require_eof )) {
203- parser_advance (parser );
203+ rbs_parser_advance (parser );
204204 if (parser -> current_token .type != pEOF ) {
205- set_error (parser , parser -> current_token , true, "expected a token `%s`" , rbs_token_type_str (pEOF ));
205+ rbs_parser_set_error (parser , parser -> current_token , true, "expected a token `%s`" , rbs_token_type_str (pEOF ));
206206 raise_error (parser -> error , arg -> buffer );
207207 }
208208 }
@@ -244,7 +244,7 @@ static VALUE parse_signature_try(VALUE a) {
244244 rbs_parser_t * parser = arg -> parser ;
245245
246246 rbs_signature_t * signature = NULL ;
247- parse_signature (parser , & signature );
247+ rbs_parse_signature (parser , & signature );
248248
249249 raise_error_if_any (parser , arg -> buffer );
250250
0 commit comments