Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions ext/rbs_extension/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,7 @@ static VALUE parse_type_try(VALUE a) {
arg->encoding
);


VALUE ruby_ast = rbs_struct_to_ruby_value(ctx, type);
rbs_node_destroy((rbs_node_t *) type);
return ruby_ast;
return rbs_struct_to_ruby_value(ctx, type);
}

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

VALUE ruby_ast = rbs_struct_to_ruby_value(ctx, (rbs_node_t *) method_type);
rbs_node_destroy((rbs_node_t *) method_type);
return ruby_ast;
return rbs_struct_to_ruby_value(ctx, (rbs_node_t *) method_type);
}

static VALUE rbsparser_parse_method_type(VALUE self, VALUE buffer, VALUE start_pos, VALUE end_pos, VALUE variables, VALUE require_eof) {
Expand Down Expand Up @@ -254,9 +249,7 @@ static VALUE parse_signature_try(VALUE a) {
arg->encoding
);

VALUE ruby_ast = rbs_struct_to_ruby_value(ctx, (rbs_node_t *) signature);
rbs_node_destroy((rbs_node_t *) signature);
return ruby_ast;
return rbs_struct_to_ruby_value(ctx, (rbs_node_t *) signature);
}

static VALUE rbsparser_parse_signature(VALUE self, VALUE buffer, VALUE start_pos, VALUE end_pos) {
Expand Down
2 changes: 0 additions & 2 deletions include/rbs/ast.h
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,4 @@ rbs_types_union_t *rbs_types_union_new(rbs_allocator_t *allocator, rbs_location_
rbs_types_untyped_function_t *rbs_types_untyped_function_new(rbs_allocator_t *allocator, rbs_location_t *location, rbs_node_t *return_type);
rbs_types_variable_t *rbs_types_variable_new(rbs_allocator_t *allocator, rbs_location_t *location, rbs_ast_symbol_t *name);

void rbs_node_destroy(rbs_node_t *any_node);

#endif
Loading
Loading