fixed #632 - avoid unhandled simplecpp::Macro::Error in simplecpp::preprocess with -D / small cleanup#631
Draft
firewave wants to merge 1 commit intodanmar:masterfrom
Draft
fixed #632 - avoid unhandled simplecpp::Macro::Error in simplecpp::preprocess with -D / small cleanup#631firewave wants to merge 1 commit intodanmar:masterfrom
simplecpp::Macro::Error in simplecpp::preprocess with -D / small cleanup#631firewave wants to merge 1 commit intodanmar:masterfrom
Conversation
simplecpp::Macro::Error cleanupsimplecpp::Macro::Error in simplecpp::preprocess with -D / small cleanup
…lecpp::preprocess` with `-D` / small cleanup
danmar
reviewed
Mar 11, 2026
| simplecpp::Output err{ | ||
| simplecpp::Output out{ | ||
| Output::SYNTAX_ERROR, | ||
| rawtok->location, |
Owner
There was a problem hiding this comment.
this will not read the location from the exception. are you 100% sure that exception provides the rawtok location?
Collaborator
Author
There was a problem hiding this comment.
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.
Collaborator
Author
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.