crystal_lib icon indicating copy to clipboard operation
crystal_lib copied to clipboard

Import bitwise expression definitions

Open qualterz opened this issue 3 years ago • 1 comments

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 avatar Dec 27 '22 20:12 qualterz

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

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

qualterz avatar Dec 27 '22 21:12 qualterz