zeek / spicy

C++ parser generator for dissecting protocols & files.
https://docs.zeek.org/projects/spicy
Other
246 stars 35 forks source link

`bytes::match` returns undocumented type `result<bytes>` #1733

Closed bbannier closed 3 months ago

bbannier commented 4 months ago

Currently the Spicy operator bytes::match returns result<bytes> where result is a HILTI type we do not expose or documented anywhere in Spicy, https://github.com/zeek/spicy/blob/b1f54e4d42fb950230f70633ad74d1aac9216e18/hilti/toolchain/src/ast/operators/bytes.cc#L987-L988

I would naively have expected that this should be able to return just bytes, but it seems that we rely on being able to convert the result to a boolean so simply changing the signature breaks things,

 .result = {Constness::Const, builder->typeBytes()},