crystal-lang / crystal_lib

Automatic binding generator for native libraries in Crystal
138 stars 30 forks source link

Import bitwise expression definitions #80

Open qualterz opened 1 year ago

qualterz commented 1 year ago

There is need to import bitwise flag definitions: https://github.com/bitcoin-core/secp256k1/blob/01b819a8c7d485fdd3f024d77273f5769d75b2d3/include/secp256k1.h#L191-L214

Currently, any expressions are ignored: https://github.com/crystal-lang/crystal_lib/blob/c3012aad7eb0074ba09fc8086dc6f4439a363eba/src/crystal_lib/prefix_importer.cr#L21

qualterz commented 1 year ago

The naive solution I found is to add Crystal::Expressions to the allowed types:

return unless value.is_a?(Crystal::NumberLiteral | Crystal::Expressions)