-
Notifications
You must be signed in to change notification settings - Fork 43
Closed
Description
This script
require 'fiddle/import'
module Test
extend Fiddle::Importer
test_struct = struct [
'int int_member',
'bool boolean_member'
]
end
fails with this error:
PS D:\code\ruby\sdl_test> ruby .\struct_test.rb
C:/Users/Dee/scoop/apps/ruby/3.3.6-2/lib/ruby/3.3.0/fiddle/cparser.rb:261:in `parse_ctype': unknown type: bool (Fiddle::DLError)
from C:/Users/Dee/scoop/apps/ruby/3.3.6-2/lib/ruby/3.3.0/fiddle/cparser.rb:71:in `block in parse_struct_signature'
from C:/Users/Dee/scoop/apps/ruby/3.3.6-2/lib/ruby/3.3.0/fiddle/cparser.rb:43:in `each'
from C:/Users/Dee/scoop/apps/ruby/3.3.6-2/lib/ruby/3.3.0/fiddle/cparser.rb:43:in `parse_struct_signature'
from C:/Users/Dee/scoop/apps/ruby/3.3.6-2/lib/ruby/3.3.0/fiddle/import.rb:223:in `struct'
from ./struct_test.rb:6:in `<module:Test>'
from ./struct_test.rb:3:in `<main>'
Looks like parse_struct_signature
passes the whole bool boolean_member
string to parse_ctype
, where it fails to be parsed because case expression tries to match on "bool"
(i.e. a plain string) instead of a regex, something like /\Abool(?:\s+\w+)?\z/
:
Line 250 in 2131aa1
when "bool" |
Metadata
Metadata
Assignees
Labels
No labels