-
Notifications
You must be signed in to change notification settings - Fork 804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update breaks 11-bit parser- always Incomplete #768
Comments
oh, thanks for catching this one. Not sure I'll be able to fix it right now, but it shouldn't be too hard :) |
It seems to me that this is the expected behavior: https://github.com/Geal/nom/blob/6000cce44d044ddc2a90d2adbe34fa932d7ceeed/src/multi.rs#L1219-L1231 With a bit more digging this is what I found:
So, you either need to replace Unfortunately, If the above is a correct summary, I can take a crack at generalizing the bit parsers to handle |
Apologies for taking so long to get to this I missed the notification. If I understand what you're saying, there's currently no way to slice a byte (or bytes) into an n-bit iterator? |
As far as I know, there is no way. |
Thank you for your PR, I've gone back to and tested in nom 1, 2 and 3 and my code parses properly in 1&2, but not 3 or 4. So it appears to be a regression introduced in nom 3 |
Any movement on this? |
Fixes #768: Generalize bits.rs to handle inputs other than &[u8]
Prerequisites
I saw your blog post today about the new version, congrats! I have a small bit of nom from a while ago I'm trying to upgrade but it appears the behaviour is different.
In your 'upgrading to 4' design doc, you mentioned that 4 is stricter with 'Incomplete' however in this case the data is already here, I am not waiting on anything (in the real program the Vec isn't pasted in but already allocated, the result is the same). I've made the appropriate syntax changes.
rustc -V
1.27macros
Test case
working (will print an idx for every 11 bits in the Vec):
not working, says Incomplete, will not print any idx values:
The text was updated successfully, but these errors were encountered: