Closed sgtsquiggs closed 3 years ago
What version of protoc? That is not valid with the current version of protoc from what I can tell.
$ cat tst.proto
syntax="proto2";
enum EnumWithOptionValue {
zero = 0;
first = 1;
second = 2;
option = 3;
}
$ protoc --version
libprotoc 3.14.0
$ protoc tst.proto -o out.pb
tst.proto:6:10: Expected identifier.
You can see in the official parser that if lines within an enum block start with option
or reserved
, different paths are followed. No attempt is made to parse these lines as enum constants.
Interesting - I've been using buf
to compile protobuf for the past few months. Seems it isn't 1:1 yet.
Example:
Errors with:
illegal name '=' (/path/to/file.proto, line XXX)
It seems to be assuming that
option
is something likeoption allow_alias = true;
yet the above protobuf is perfectly valid.