mransan/ocaml-protoc

Parse error when using options feature

Closed this issue · 1 comments

I'm actually trying to use ocaml-protoc to generate the ocaml code.
I actually share theses protobuf files definition in two different projects, one in scala and another one in ocaml.
For the scala side i use scalapb library and it works fine with my protobuf files. When i'm using ocaml-protoc, it can't parse them.
Scalapb can use the options feature of protobuf 3(https://developers.google.com/protocol-buffers/docs/proto3#options) which i think ocaml-protoc doesn't support it.

I try to generate code for javascript using protobufjs and it can generate the code correctly without parsing error.
Here a sample of a file where ocaml-protoc fails.

`
syntax = "proto3";

option (scalapb.options) = {
package_name: "com.sample"
flat_package: true
single_file: true
};
`

Sorry i found the where the real problem is. It is not a parsing error but just that scalapb provide all the necessary proto files to be able to generate the code. I will close the issue.