-
Notifications
You must be signed in to change notification settings - Fork 42
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
warnings when parsing projects with C #334
Comments
Thanks for the heads up. I think we just ignore the C files, but somehow |
Thanks for the heads up. I think we just ignore the C files, but somehow GNATCOLL.Projects is still generating those warnings. We'll take a look into why it does that.
I think it doesn’t ignore “C” files.
I think the project might have an explicit list of file names, including “json.c” for instance. GNATCOLL (and libgpr)
are just telling us that this file, which it knows is part of the project, has no known language.
In GNATCOLL, this is done by registering extensions (“.c” and “.h”) for all languages we want (perhaps there even
is a function to register some usual extensions).
Since you have no way to know the full list of languages the user wants to support, I think you might have to
expose a function to let users do that. As I remember, as of 3 years ago, GNATCOLL came with a python API
for the projects (extracted from GPS). If it still exists, perhaps we should simply get access to it. Then such
issues are gnatcoll issues, not libadalang issues, and you are out of the loop :-)
Manu
|
@briot The rejuvenation library offers some functions on top of libadalang that explicitly ignore non-Ada files: P.S. When you experiment on windows, be aware that using GNAT native 12.1.2 exposes a bug in libadalang's Create_Context function that is used within the functions I just referred you to! |
I am not trying to parse C files :-)
But I have a few projects in the closure that include both C and Ada files, via the
Languages
attribute in the.gpr
file. When I parse those projects vialal.UnitProvider.for_project
, I get warnings on stdout (or stderr, not sure):Obviously, libadalang cannot do anything with the C files, but it would be nice to just ignore them.
If I remember right, GNATCOLL.Projects supports this, but you need some initialization to register the language extensions. So maybe
for_project
needs a parameter like a dictionary mapping language names to extensions.The text was updated successfully, but these errors were encountered: