keichi / binary-parser

A blazing-fast declarative parser builder for binary data
MIT License
857 stars 133 forks source link

Don't assume nest contains a bit field #241

Closed nick-hunter closed 1 year ago

nick-hunter commented 1 year ago

This should be a fix for Issue #240. Previously a bit field followed by a nest would generate parser code in the wrong order. This PR adds additional logic to determine if the next field is a bit field or not. If the next parser is a nest, we now examine the first field in it. I'll try to add some additional test cases but just want to get this open so the review process can start. Currently all test cases pass.

nick-hunter commented 1 year ago

Just want to follow up on this. Is there anything additional I can do for this PR?

keichi commented 1 year ago

Sorry for the delay, this looks good. As you might have guessed, the bit parsers haven't been extensively used. Your debugging is really helpful!

nick-hunter commented 1 year ago

Thanks for all of your work on this library! It's been very helpful. I saw you've been working on some other housekeeping changes. Are you planning to release a new version of the library on NPM soon?