neelance / ffi_gen

A generator for Ruby FFI bindings, directly from header files via LLVM's Clang compiler
MIT License
88 stars 26 forks source link

enum fails to parse (in `block in read_declaration': undefined method `raw' for nil:NilClass (NoMethodError)) #36

Open ghazel opened 9 years ago

ghazel commented 9 years ago
#pragma GCC visibility push(default)

enum fun {
    FOO,
    BAR
};

#pragma GCC visibility pop
/Library/Ruby/Gems/2.0.0/gems/ffi_gen-1.2.0/lib/ffi_gen.rb:379:in `block in read_declaration': undefined method `raw' for nil:NilClass (NoMethodError)
    from /Library/Ruby/Gems/2.0.0/gems/ffi_gen-1.2.0/lib/ffi_gen.rb:372:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/ffi_gen-1.2.0/lib/ffi_gen.rb:372:in `read_declaration'
    from /Library/Ruby/Gems/2.0.0/gems/ffi_gen-1.2.0/lib/ffi_gen.rb:346:in `block in declarations'
    from /Library/Ruby/Gems/2.0.0/gems/ffi_gen-1.2.0/lib/ffi_gen.rb:338:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/ffi_gen-1.2.0/lib/ffi_gen.rb:338:in `each_with_index'
    from /Library/Ruby/Gems/2.0.0/gems/ffi_gen-1.2.0/lib/ffi_gen.rb:338:in `declarations'
    from /Library/Ruby/Gems/2.0.0/gems/ffi_gen-1.2.0/lib/ffi_gen/ruby_output.rb:10:in `block in generate_rb'
    from /Library/Ruby/Gems/2.0.0/gems/ffi_gen-1.2.0/lib/ffi_gen.rb:150:in `indent'
    from /Library/Ruby/Gems/2.0.0/gems/ffi_gen-1.2.0/lib/ffi_gen/ruby_output.rb:5:in `generate_rb'
    from /Library/Ruby/Gems/2.0.0/gems/ffi_gen-1.2.0/lib/ffi_gen.rb:280:in `generate'
    from /Library/Ruby/Gems/2.0.0/gems/ffi_gen-1.2.0/lib/ffi_gen.rb:749:in `generate'
    from foo.rb:3:in `<main>'