Skip to content
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

Support a single #pragma without body #191

Merged
merged 1 commit into from
Oct 25, 2023

Conversation

jefftrull
Copy link
Collaborator

This approach differs from the initial plan - which just returned when an empty pragma was detected - because we still need to fire pragma hooks.

The existing code assumed there was at least one space following
 #pragma, but that is not required.
@jefftrull jefftrull requested a review from hkaiser October 24, 2023 03:13
@jefftrull
Copy link
Collaborator Author

If merged this will resolve #188

Copy link
Collaborator

@hkaiser hkaiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@jefftrull jefftrull merged commit de0d131 into boostorg:develop Oct 25, 2023
4 of 6 checks passed
@@ -2456,7 +2455,6 @@ pp_iterator_functor<ContextT>::on_pragma(
#endif
}
}
expanded.push_back(result_type(T_NEWLINE, "\n", act_token.get_position()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the final new line will cause emitted pragmas to miss the final new line and be misintepreted by following compile steps. For example

#pragma foo
#define X hello
X

will currently get preprocessed to

#pragma foo#define X hello
X

but should be actually

#pragma foo
hello

Shall i add an issue with more details?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yikes, yes please!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants