Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comments inside field options break parser #116

Closed
adamhosier opened this issue Jul 12, 2019 · 2 comments
Closed

Comments inside field options break parser #116

adamhosier opened this issue Jul 12, 2019 · 2 comments

Comments

@adamhosier
Copy link

For example:

syntax = "proto3";

message Foo {
  string bar = 1 [
    // comment 
    deprecated=true
  ];
}

this file compiles with protoc, but fails parsing with

2019/07/12 14:27:53 visit proto file:/tmp/proto/foo.proto:5:5: found "// comment " but expected [option identifier]
@emicklei
Copy link
Owner

thank you for reporting this. will fix it soon

@emicklei
Copy link
Owner

the current fix does not preserve the comment.

emicklei added a commit that referenced this issue Aug 28, 2019
* add test to parse comment inside option array value, issue #116

* fixed issue, adds comment to option, extended test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants