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

Support for parsing weak imports #3226

Open
paul35621 opened this issue Dec 31, 2024 · 0 comments
Open

Support for parsing weak imports #3226

paul35621 opened this issue Dec 31, 2024 · 0 comments

Comments

@paul35621
Copy link

paul35621 commented Dec 31, 2024

I use ProtoParser to detect if a file with a proto extension is really a Protocol Buffers file. Sometimes someone uses a weak import and parsing fails. It would be nice if weak imports are supported.

This is relevant parsing code is here.

I made pull request 3227 that implements the parsing. (not the linking)

Specification

import = "import" [ "weak" | "public" ] strLit ";"

A "weak" import means that the import is not required as a runtime dependency. Fields that depend on types defined in these imports can also be marked with a field option named weak.

Use of weak imports and weak field options is strongly discouraged and is supported by few target runtimes.

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

1 participant