-
Notifications
You must be signed in to change notification settings - Fork 50
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
Emit line directives for includes with directive on first line #223
Conversation
Signed-off-by: Nick Nobles <[email protected]>
Signed-off-by: Nick Nobles <[email protected]>
Signed-off-by: Nick Nobles <[email protected]>
Hi @jefftrull, Apologies for reaching out directly, but you mind reviewing this PR when you have some available time? It seems like one of the GitHub Actions failed, but it looks like it was a container setup issue and I'm not sure if there's anyway I could try to trigger a re-run. Thank you! |
Hi! Sorry I've been traveling for the last week and a half :) I saw this PR and hope to get on it soon. Thanks in advance for your contribution (and for including a test!). I agree that the one check failure looks like some infrastructure problem and not due to your code changes. |
Hi! Not a problem at all. I hope you enjoyed your travel :) Thanks in advance for taking a look at it! |
- Fixing up some comments related to include processing - putting new_iter_ctx modification next to its construction
Please review my PR to your PR when you have time :) |
Reviewed and merged :) |
Thank you for the helpful contribution! |
* Emit line directives for includes with directive on first line * Add nested include tests Thanks to Nick Nobles for this bug report and fix
Attempts to address #222
Include files that begin with an
#if
/#ifdef
/#define
directive now properly emit the line directive that was previously missing.Because the test suite is using the
eat_whitespace
context policy, the issue only shows if the directive in the include file occurs on the very first line of the file (hence why the copyright comments have been moved to the end of the test files). If thedefault_preprocessing_hooks
was used, the copyright comment could be at the beginning and still show the issue.From my debugging, it seems like the line directive was failing to be emitted because it would errantly fall into this portion of the if-block in cpp_iterator: https://github.com/boostorg/wave/blob/develop/include/boost/wave/util/cpp_iterator.hpp#L786
Here's the output for the
t_2_032.cpp
test that I added prior to the change:And here's the output after this change: