to add an additional semicolon somewhere in outer (e.g. option (my_option).a = true;;) causes the following error to be returned:
invalid MessageBody type &{<nil>} of &{<nil>}
This PR causes these empty statements to be included on the returned MessageBody instead.
While debugging this issue, I also noticed the error message was repeating the same format argument. In the second commit I fixed the error messages so they contain the name of the invalid type and then a representation of the value.
invalid MessageBody type *parser.SomeUnexpectedStatement of &{<nil>}
An additional trailing semicolon in the body of a message currently causes
UnorderedInterpret
to fail.For example, changing the example proto file from the
README
https://github.com/yoheimuta/go-protoparser/blob/a1aa0a07fe86a183dd06da85e9c5ef6f9a11faa1/README.md?plain=1#L36-L44
to add an additional semicolon somewhere in
outer
(e.g.option (my_option).a = true;;
) causes the following error to be returned:This PR causes these empty statements to be included on the returned
MessageBody
instead.While debugging this issue, I also noticed the error message was repeating the same format argument. In the second commit I fixed the error messages so they contain the name of the invalid type and then a representation of the value.