Skip to content

Commit aadb704

Browse files
committed
Use case when
1 parent ca4b73e commit aadb704

File tree

1 file changed

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

1 file changed

+5
-2
lines changed

_tools/ruby_h_to_go/lib/ruby_header_parser/parser.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,13 +307,16 @@ def analyze_argument_type(function_name:, arg_pos:, parts:)
307307

308308
original_type = Util.sanitize_type(parts[0...-1].join(" "))
309309

310-
if original_type.match?(/\*+$/)
310+
case original_type
311+
when /\*+$/
311312
type = original_type.gsub(/\*+$/, "").strip
312313
pointer = data.function_arg_pointer_hint(function_name:, pos: arg_pos)
313-
elsif /^void\s*\s/.match?(original_type) || /\(.*\)/.match?(original_type)
314+
315+
when /^void\s*/, /\(.*\)/
314316
# function pointer (e.g. void *(*func)(void *)) is treated as `void*`
315317
type = "void"
316318
pointer = data.function_arg_pointer_hint(function_name:, pos: arg_pos)
319+
317320
else
318321
type = original_type
319322
end

0 commit comments

Comments
 (0)