Ability to provide own encoding #192
Unanswered
Xottab-DUTY
asked this question in
Q&A
Replies: 2 comments 1 reply
-
Well, now I'm unsure if this exact feature is needed, maybe there's a better solution for my use case? Pseudo-code: struct production
{
static constexpr auto rule = []
{
return lexy::bytes<2>.range(65534, 65535);
}
} I want to read 2 bytes and validate that they are in the allowed range. Yes, it's possible to validate each byte, but this is unwanted :) |
Beta Was this translation helpful? Give feedback.
1 reply
-
Custom encodings aren't supported, and I don't plan on supporting them. An input that consists of 2 byte words is still a byte input, you just want rules that read two bytes at a time. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently lexy has static assertions that only allow predefined encodings.
I want to create my custom
word_encoding
so I can read 2 bytes instead of just byte one by one.Beta Was this translation helpful? Give feedback.
All reactions