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

protoparse: trying to set extension field on a custom option whose type is message results in syntax error #307

Closed
bufdev opened this issue Apr 7, 2020 · 2 comments

Comments

@bufdev
Copy link
Contributor

bufdev commented Apr 7, 2020

https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/unittest_custom_options.proto#L281

src/google/protobuf/unittest_custom_options.proto:281:29:syntax error: unexpected '('
src/google/protobuf/unittest_custom_options.proto:282:29:syntax error: unexpected '('
src/google/protobuf/unittest_custom_options.proto:282:53:syntax error: unexpected ')'

It seems that the double parentheses are tripping up protoreflect

@jhump
Copy link
Owner

jhump commented Apr 11, 2020

Welp, I thought I had implemented support for this correctly. I see the intent to support this in the grammar.

But I think there is a legit shift-reduce conflict in the grammar; there are actually many such conflicts reported by yacc, but I thought they were all harmless and that the generated parser would still work. In this case, I think the conflict causes the parser to not properly recognize this production. Luckily, I think it's a pretty easy fix.

@jhump jhump changed the title Custom options parting issue from protocolbuffers/protobuf unit test file protoparse: trying to set extension field on a custom option whose type is message results in syntax error Apr 11, 2020
@jhump
Copy link
Owner

jhump commented Apr 27, 2020

Fixed in #316

@jhump jhump closed this as completed Apr 27, 2020
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