tafia / quick-protobuf

A rust implementation of protobuf parser
MIT License
446 stars 82 forks source link

Replaced nom 3.2 with 7. This replaces the entire parser module. #199

Closed runfalk closed 2 years ago

runfalk commented 2 years ago

Nom 3 is a bit old now and I was curious enough to try my hands at modernizing the parser. I've tried to copy the old structure as much as possible but in some cases I simplified it/condensed some functions. All tests and the benchmarks seems to run fine, but this one likely requires a bit more thorough review than my previous uplift.

The one "breaking" change here is that the file is parsed as UTF-8 rather than bytes (but it seems like proto files must be utf-8 anyway https://github.com/protocolbuffers/protobuf/issues/1418).

tafia commented 2 years ago

Great Thanks!

imotai commented 2 years ago

@runfalk the new parser fails when parsing quick-protobuf/tests/rust_protobuf/common/mesos.proto

./pb-rs ../../quick-protobuf/tests/rust_protobuf/common/mesos.proto 
pb-rs fatal error No message or enum were read;either definition might be invalid or there were only unsupported structures