Skip to content

Conversation

@dag-erling
Copy link
Contributor

When an asterisk is encountered inside a C-style comment, we first check if there is at least one more character left in the buffer, and if that character is a slash, which would terminate the comment. If that is not the case, the next two characters are consumed without being inspected. If one of those is a double quote, or the initial asterisk of an asterisk-slash pair, we end up misparsing the comment.

This fixes #338.

When an asterisk is encountered inside a C-style comment, we first check
if there is at least one more character left in the buffer, and if that
character is a slash, which would terminate the comment.  If that is not
the case, the next two characters are consumed without being inspected.
If one of those is a double quote, or the initial asterisk of an
asterisk-slash pair, we end up misparsing the comment.

This fixes vstakhov#338.
@dag-erling dag-erling force-pushed the des/fix-c-style-comments branch from bdef4c3 to c92d1cc Compare September 30, 2025 20:45
@vstakhov vstakhov merged commit 2e23c2b into vstakhov:master Sep 30, 2025
4 checks passed
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.

Comment parser bug

2 participants