Skip to content

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

Merged
firewave merged 1 commit intodanmar:masterfrom
firewave:macro-ex
Mar 27, 2026
Merged

fixed #632 - avoid unhandled simplecpp::Macro::Error in simplecpp::preprocess with -D#631
firewave merged 1 commit intodanmar:masterfrom
firewave:macro-ex

Conversation

@firewave
Copy link
Copy Markdown
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
@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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done.

@firewave firewave marked this pull request as draft March 11, 2026 13:41
@firewave firewave changed the title fixed #632 - avoid unhandled simplecpp::Macro::Error in simplecpp::preprocess with -D / small cleanup fixed #632 - avoid unhandled simplecpp::Macro::Error in simplecpp::preprocess with -D Mar 24, 2026
@firewave firewave marked this pull request as ready for review March 24, 2026 12:10
@firewave firewave merged commit f437d61 into danmar:master Mar 27, 2026
22 checks passed
@firewave firewave deleted the macro-ex branch March 27, 2026 17:16
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