lua-protobuf
lua-protobuf copied to clipboard
reserved keyword in enum definition
Hi there,
I recently faced a bug that if there's a reserved
keyword in enum definition it will raise an error.
For example, I have this proto definition:
message Icon {
enum Name {
reserved 5, 96;
...
}
}
At this line of the code it expects to have '=' but there's not and it will raise an error.
Unfortunately, I need a deep understanding of the code, If you give me some hint I can contribute and help to fix it.
IMHO it's not allowed by protobuf syntax: https://developers.google.com/protocol-buffers/docs/reference/proto3-spec#enum_definition
so maybe you should change your schema file...
@starwing Hi, I meet this problem too, and it seems this should be legal? https://developers.google.com/protocol-buffers/docs/proto3#reserved_values.
And it is worked under golang:
enum Foo {
reserved 2, 15, 9 to 11, 40 to max;
reserved "FOO", "BAR";
}
Okay, It seems protobuf3 language reference out of updated. I will add this feature in time.
landed on https://github.com/starwing/lua-protobuf/commit/a0ef7a33ac980f005e3e02e8fe5d99bb36dcdd5f