-
Notifications
You must be signed in to change notification settings - Fork 169
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
Function parameters are not visited #20
Comments
Are they visited if you visit a function? If not, that's by design, template parameters aren't visited as well, you'd have to iterate over . parameters () then. Feel free to question that design decision though. |
So do you mean I should cast the entity to cpp_member_function and it has a paramaters() member? That's workable for me. Not sure if I would criticize the design, though I'm not sure if this scales well for when function bodies will be parsed. |
Yes, cast and you'll have everything. The general problem is: how do I handle entities that have more than one kind of children? The best example is a class, it has base classes and members, should both be visited? |
It does feel natural to have everything in the tree, and allows uniform appending/deleting of source "items" when source rewriting is implemented. I wonder libclang or libtooling do in this case? |
It depends on the entity, they sometimes visit, sometimes don't. I'll see what I can come up with. |
I think this is because
member_function_t
is not treated as a container indetail::visit
, and simply the callback is called instead of recursive visitation. I'd assume standardese would need to parse function paramters, wouldn't it?libclang_parser
Explanation of the error.
Input:
Output:
I would expect the function parameters
a
andb
to be visible in the output.The text was updated successfully, but these errors were encountered: