exprotobuf icon indicating copy to clipboard operation
exprotobuf copied to clipboard

filter reserved_numbers and reserved_names tuples when converting from gpb representation

Open cheng81 opened this issue 6 years ago • 2 comments

The current implementation mistakenly uses reserved_numbers tuples coming from gpb as proto3_msg, since the name in the tuple matches the one used in the proper message definition. The commit simply skips over those tuples, since to the best of my knowledge they are useless in the generated code: those fields are by definition not mentioned in the protobuf message, hence they will never be either written or read. This PR addresses bitwalker/exprotobuf#81

cheng81 avatar Dec 04 '19 15:12 cheng81

I seriously can't find any valid reason to keep the {{:reserved_numbers, _}, _} and {{:reserved_names, _}, _} around, so in the latest commit I just filter them out in Protobuf.Parser directly, so they don't ever creep up in other parts of the code.

cheng81 avatar Dec 05 '19 12:12 cheng81

@bitwalker any chance we can get this reviewed?

cheng81 avatar Dec 09 '19 13:12 cheng81