Skip to content

Commit b5e5032

Browse files
committed
Merge branch 'c-api' into merge-master
2 parents afc0f98 + 73060a6 commit b5e5032

File tree

6 files changed

+71
-947
lines changed

6 files changed

+71
-947
lines changed

ext/rbs_extension/main.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,7 @@ static VALUE parse_type_try(VALUE a) {
123123
arg->encoding
124124
);
125125

126-
127-
VALUE ruby_ast = rbs_struct_to_ruby_value(ctx, type);
128-
rbs_node_destroy((rbs_node_t *) type);
129-
return ruby_ast;
126+
return rbs_struct_to_ruby_value(ctx, type);
130127
}
131128

132129
static rbs_lexer_t *alloc_lexer_from_buffer(rbs_allocator_t *allocator, VALUE string, rb_encoding *encoding, int start_pos, int end_pos) {
@@ -213,9 +210,7 @@ static VALUE parse_method_type_try(VALUE a) {
213210
arg->encoding
214211
);
215212

216-
VALUE ruby_ast = rbs_struct_to_ruby_value(ctx, (rbs_node_t *) method_type);
217-
rbs_node_destroy((rbs_node_t *) method_type);
218-
return ruby_ast;
213+
return rbs_struct_to_ruby_value(ctx, (rbs_node_t *) method_type);
219214
}
220215

221216
static VALUE rbsparser_parse_method_type(VALUE self, VALUE buffer, VALUE start_pos, VALUE end_pos, VALUE variables, VALUE require_eof) {
@@ -254,9 +249,7 @@ static VALUE parse_signature_try(VALUE a) {
254249
arg->encoding
255250
);
256251

257-
VALUE ruby_ast = rbs_struct_to_ruby_value(ctx, (rbs_node_t *) signature);
258-
rbs_node_destroy((rbs_node_t *) signature);
259-
return ruby_ast;
252+
return rbs_struct_to_ruby_value(ctx, (rbs_node_t *) signature);
260253
}
261254

262255
static VALUE rbsparser_parse_signature(VALUE self, VALUE buffer, VALUE start_pos, VALUE end_pos) {

include/rbs/ast.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,4 @@ rbs_types_union_t *rbs_types_union_new(rbs_allocator_t *allocator, rbs_location_
745745
rbs_types_untyped_function_t *rbs_types_untyped_function_new(rbs_allocator_t *allocator, rbs_location_t *location, rbs_node_t *return_type);
746746
rbs_types_variable_t *rbs_types_variable_new(rbs_allocator_t *allocator, rbs_location_t *location, rbs_ast_symbol_t *name);
747747

748-
void rbs_node_destroy(rbs_node_t *any_node);
749-
750748
#endif

0 commit comments

Comments
 (0)