Skip to content

Commit 71f85e1

Browse files
committed
Fix invalid typeref
1 parent 5df7422 commit 71f85e1

File tree

1 file changed

+3
-2
lines changed
  • _tools/ruby_h_to_go/lib/ruby_header_parser

1 file changed

+3
-2
lines changed

_tools/ruby_h_to_go/lib/ruby_header_parser/parser.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,12 @@ def parse_definition_args(function_name, signature)
216216
def create_typeref(definition:, function_name:, typeref_field:)
217217
typeref_type =
218218
if typeref_field
219-
typeref_field.gsub(/^RBIMPL_ATTR_NONNULL\s*\(\(\)\)/, "").strip
219+
type = typeref_field.gsub(/[A-Z_]+\s*\(\(.*\)\)/, "").gsub("RUBY_SYMBOL_EXPORT_BEGIN", "")
220+
Util.sanitize_type(type) # rubocop:disable Style/IdenticalConditionalBranches
220221
else
221222
# parse typeref in definition
222223
type = definition[0...definition.index(function_name)].gsub("char *", "char*").strip
223-
Util.sanitize_type(type)
224+
Util.sanitize_type(type) # rubocop:disable Style/IdenticalConditionalBranches
224225
end
225226

226227
typeref_pointer = nil

0 commit comments

Comments
 (0)