keichi / binary-parser

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

Add wrapper to transform data before further parsing #164

Closed abductedPlatypus closed 3 years ago

abductedPlatypus commented 3 years ago

I couldn't find a clean way to pre-process data before further parsing so I added some functionality to wrap and transform data and then parse it further. This allows for e.g. partially compressed data structures, that further parsing after decompression of these compressed sections.

The code quality is not the greatest and I did some cleanup to get rid of some IDE errors for myself - my apologies for that. But I figured it was worth making a PR / allow you to cherry pick in case you're interested.

abductedPlatypus commented 3 years ago

Thanks for the review. Let me know if there are any further changes you would like see.