foonathan / lexy

C++ parsing DSL
https://lexy.foonathan.net
Boost Software License 1.0
991 stars 66 forks source link

Support `code_point.range` for any byte encoding #168

Closed Spartan322 closed 11 months ago

Spartan322 commented 1 year ago

Perhaps I'm missing a manner to do this otherwise, but while not strictly required as it can be done with a lot of tedious work, it would be really nice to have a quick manner to reference a range within any encoding and not just unicode code points.

foonathan commented 1 year ago

To clarify, you want something like dsl::byte_range<0x10, 0x20> which skips a byte in the range [0x10, 0x20]? And you specifically want something for byte encodings, not texts?

Spartan322 commented 1 year ago

Yeah if I had something that could evaluate in such a way it would be a lot more convenient for my use cases.

foonathan commented 11 months ago

I've added dsl::byte.range<0x10, 0x20>() and dsl::bytes<N>.range<0x10, 0x20>() (as well as other predicates).