-
Notifications
You must be signed in to change notification settings - Fork 769
Add item_name parse callback. #1438
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok, but needs tests, any chance you can add some basic tests to bindgen-integration?
|
lgtm |
|
I added two tests, let me know if you need more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine, thanks! It may also be worth adding tests with types and users of the test, so something like:
struct my_prefix_bar {
int foo;
};
struct my_prefix_foo {
my_prefix_bar member;
};
Just knowing it builds is probably fine :)
|
I added the test you mentioned, I create an instance of the foo struct to validate it works as expected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks!
|
@bors-servo r+ |
|
📌 Commit 5b741da has been approved by |
Add item_name parse callback. Issue: #428
|
☀️ Test successful - status-travis |
|
This turns out to be not very useful, because whitelist/blacklist checking is done after the mapping in the PR is performed. @emilio do you know what the correct place to put the rename logic would be? |
Well that means that you could whitelist with the stripped prefix, right? I'd rather not introduce two different names... The nice thing of this PR is that the complexity doesn't blow up because everything uses the new name. But we could somehow add a new option |
That's not possible, because the whitelist regex is matching exactly on the part that's being stripped. |
|
Oh I see, that's indeed unfortunate... Let me think a bit about how to do this. |
|
I opened #1452, could you give that a spin? |
Issue: #428