-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Labels
Description
Hi and thanks for the project! I have found a small issue which is not blocking but yet interesting to point out.
Issue
ocaml-protoc cannot compile an enum that contains the reserved keyword.
Steps to reproduce
Write a myenum.proto file with the following content
// myenum.proto
syntax = "proto3";
enum MyEnum {
foo = 0;
reserved 1;
}Compile it with ocaml-protoc
$ ocaml-protoc ./myenum.proto --ml_out .
./myenum.proto:5:10: Parsing error at `foo = 0 ; reserved <<< HERE'.
zsh: exit 1However it works as expected with the official protoc compiler
$ protoc --python_out=. ./myenum.proto
zsh: exit 0Workaround
Replace the reserved keyword by a field which explicitly prevents usage.
enum MyEnum {
foo = 0;
OBSOLETE_bar = 1 [deprecated = true];
}Versions
ocaml-protoc: 3.1.1
ocaml: 4.14.2