dsymonds / gotoc

Protocol Buffer compiler written in Go
Other
121 stars 8 forks source link

fails parsing with custom options in messages, enums, ... #5

Open jozn opened 7 years ago

jozn commented 7 years ago

Hi The project fails at compiling protos with option at messages, enums, services levels. we are trying to do some custom code generating based on our custom options.

https://developers.google.com/protocol-buffers/docs/proto3#options

Some options are message-level options, meaning they should be written inside message definitions. Some options are field-level options, meaning they should be written inside field definitions. Options can also be written on enum types, enum values, service types, and service methods

a proper syntax semantic based on anterl4 grammar is in here :https://github.com/antlr/grammars-v4/blob/master/protobuf3/Protobuf3.g4

If you support this it would be great. Thanks

emicklei commented 7 years ago

@jozn did you consider using an alternative package https://github.com/emicklei/proto ? ( @dsymonds , i hope you don't mind me mentioning this )

jozn commented 7 years ago

@emicklei sorry for delayed response, i didn't see it. i defiantly will check it out, thank you.