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

Doesn't support imports of "google/protobuf/*.proto". #20

Open
kayabaNerve opened this issue Jul 28, 2020 · 4 comments
Open

Doesn't support imports of "google/protobuf/*.proto". #20

kayabaNerve opened this issue Jul 28, 2020 · 4 comments

Comments

@kayabaNerve
Copy link

kayabaNerve commented Jul 28, 2020

protobuf-nim tries to automatically import said files, yet they're not shipped with the library.

@kayabaNerve kayabaNerve changed the title Doesn't support parsing special import "google/protobuf/any.proto". Doesn't support imports of "google/protobuf/*.proto". Jul 28, 2020
@kayabaNerve
Copy link
Author

Updated the title/description as multiple other files exist, not just any.proto.

@PMunch
Copy link
Owner

PMunch commented Aug 3, 2020

It should support importing them if you have them on your system IIRC

@kayabaNerve
Copy link
Author

Thanks for the headsup. The any.proto file has a lot of syntax which isn't supported by the parser though, such as use of option to declare effectively magic values. Even though they could be imported, I don't think they could be parsed due to other problems, but that's a separate discussion.

@PMunch
Copy link
Owner

PMunch commented Aug 3, 2020

Hmm, that is unfortunate.. TBH the parser that protobuf uses is pretty poor, I wrote it because there weren't any good options for a compile-time parser at the time, but now it should probably be switched to https://github.com/zevv/npeg. This would probably make it easier to implement these new parsing rules as well as speeding up compilation when using protobuf (the slow part currently is the parser).

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