Skip to content

fixed #632 - avoid unhandled simplecpp::Macro::Error in simplecpp::preprocess with -D / small cleanup#631

Draft
firewave wants to merge 1 commit intodanmar:masterfrom
firewave:macro-ex
Draft

fixed #632 - avoid unhandled simplecpp::Macro::Error in simplecpp::preprocess with -D / small cleanup#631
firewave wants to merge 1 commit intodanmar:masterfrom
firewave:macro-ex

Conversation

@firewave
Copy link
Collaborator

No description provided.

@firewave firewave marked this pull request as draft March 10, 2026 09:40
@firewave firewave changed the title small simplecpp::Macro::Error cleanup fixed #632 - avoid unhandled simplecpp::Macro::Error in simplecpp::preprocess with -D / small cleanup Mar 10, 2026
…lecpp::preprocess` with `-D` / small cleanup
@firewave firewave marked this pull request as ready for review March 10, 2026 10:17
simplecpp::Output err{
simplecpp::Output out{
Output::SYNTAX_ERROR,
rawtok->location,
Copy link
Owner

Choose a reason for hiding this comment

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

this will not read the location from the exception. are you 100% sure that exception provides the rawtok location?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point. The location in the existing test did not change so I missed that. The issue is that the tests do not provide a filename. I will improve the tests.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I wonder if the location here is actually correct since a std::runtime_error can already be thrown from several places. We should possibly throw a custom class.

I will adjust this PR to add the additional exception handling to address the issue and extract all the further changes into a separate PR.

@firewave firewave marked this pull request as draft March 11, 2026 13:41
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.

2 participants