appnexus / pyrobuf

A Cython alternative to Google's Python Protobuf library
Other
556 stars 71 forks source link

Implement rudimentary "reserved" field support #148

Closed thirtythreeforty closed 1 day ago

thirtythreeforty commented 4 years ago

This implementation does not validate that the field names and/or numbers are not reused; it simply ignores them. This allows parsing files that contain the reserved keyword.

tburmeister commented 4 years ago

Thanks! Looks pretty good but...

  1. We should add a test
  2. I think this only partially works, based on the example in the language guide:
message Foo {
  reserved 2, 15, 9 to 11;
  reserved "foo", "bar";
}

As is, something like reserved 2, 15 will work, but this will fail for 9 to 11 or "foo", "bar".