-
Notifications
You must be signed in to change notification settings - Fork 721
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
Add a callback for function-like macros #1793
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
Thanks! This looks basically fine. I have some questions, and I think that we should avoid re-tokenizing every macro twice.
Also, why does |
I had previously passed in |
This comment has been minimized.
This comment has been minimized.
Depend on rust-lang/rust-bindgen#1793 for `func_macro` support.
@emilio, I believe I have addressed all your questions and concerns. I no longer re-tokenize twice, and I think I have demonstrated that Please let me know what else I can do. |
@emilio, I was not sure if the right etiquette was to mark the conversations as resolved, or to leave them for you to do so -- I marked them as resolved. Is there anything else this PR needs ? |
No, marking as resolved is all fine. Sorry, just have to get to reviewing this properly again (bindgen is not my Sorry for the lag and thanks for updating the patch. |
Sure, I understand. No rush -- I just do not know whether things get missed and how much active pushing you want from me. I will come back in a few weeks. |
☔ The latest upstream changes (presumably 2ba27bf) made this pull request unmergeable. Please resolve the merge conflicts. |
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.
This looks basically ok to me, with a few minor changes.
I have rebased and force-pushed. I also ensured that every commit passes |
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.
Thanks, this looks good to me! Mind adding that minor comment?
I think squashing the commits would also be great, 52 commits may be a bit too much for this. Your call whether you want to leave it all in one commit, or put the implementation and tests in different commits or what not. (Or I can just squash them before merging).
Thanks again!
Certainly, I will do that next. I did not see your quick review response, or I would have held off on my last push.
I will try to squash down to ten meaningful commits or so.
Thanks for working with me on this ! It has been a pleasure. |
I am as done as I know how to be. I mistakenly re-requested review from you, @emilio. Thanks for your help. |
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.
Sweet, thank you!
@emilio, I could use this feature better in |
Depend on rust-lang/rust-bindgen#1793 for `func_macro` support.
rust-lang/rust-bindgen#1793 has merged to official master, so point to it there.
Yes, I'll try to get a release done soonish. Please nag if it's not done by the end of this week :) |
Depend on rust-lang/rust-bindgen#1793 for `func_macro` support.
rust-lang/rust-bindgen#1793 has merged to official master, so point to it there.
Depend on rust-lang/rust-bindgen#1793 for `func_macro` support.
@emilio, here is your nagging :) although it is really not a big deal to me if it takes a few weeks. Let me know if I can help, for example by writing up a Changelog entry. |
Depend on rust-lang/rust-bindgen#1793 for `func_macro` support.
Just published a new release. Thanks for all the contributions you've sent so far @kulp! |
Closes #1792.
Because whitespace information is not represented explicitly during parsing, it is non-trivial to reconstruct the exact textual form of the macro from the token list. I had previously inserted whitespace between tokens, which I still believe would be correct and acceptable, but it seems that spelling the tokens separately would be better.
Given this input :
and this callback :
this sort of output is achieved (pseudo-code) :