Skip to content

fix: ignore parenthesis in value comments - #311

Merged
abice merged 1 commit into
abice:masterfrom
KevSlashNull:kev-ignore-paren
Jul 9, 2026
Merged

fix: ignore parenthesis in value comments#311
abice merged 1 commit into
abice:masterfrom
KevSlashNull:kev-ignore-paren

Conversation

@KevSlashNull

Copy link
Copy Markdown
Contributor

This fixes a bug where the enum declaration parser respects closing parenthesis (to close the ENUM( with a )) if they are in a value comment.

For example, the following enum declaration parses incorrectly in the latest version:

ENUM(
  dog, // dog :)
  cat, // cat :3
)

The resulting enum would only contain dog (not because dogs are superior to cats, which they are, but) because the closing parenthesis is considered to end the ENUM tag, which is incorrect.

This is fixed by ignoring the contents of value comments on a given line (i.e. anything after // within the ENUM(...) declaration).

@KevSlashNull
KevSlashNull requested a review from abice as a code owner May 2, 2026 21:11
@KevSlashNull
KevSlashNull force-pushed the kev-ignore-paren branch 3 times, most recently from 81a5e78 to 687944a Compare May 2, 2026 21:40

@LarsArtmann LarsArtmann left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM 👍

@abice

abice commented Jul 8, 2026

Copy link
Copy Markdown
Owner

@KevSlashNull mind making sure the commits are verified? I think that's blocking me from approving the checks to run.

This fixes a bug where the enum declaration parser respects closing
parenthesis (to close the `ENUM(` with a `)`) if they are in a value
comment.

For example, the following enum declaration parses incorrectly in
the latest version:

    ENUM(
      dog, // dog :)
      cat, // cat :3
    )

The resulting enum would only contain `dog` because the closing
parenthesis is considered to end the `ENUM` tag, which is incorrect.

This is fixed by ignoring the contents of value comments on a given line
(i.e. anything after `//` within the `ENUM(...)` declaration).
@KevSlashNull

Copy link
Copy Markdown
Contributor Author

ahh i didn't notice that. thanks @abice, i signed the commit.

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 92.67% (+0.008%) from 92.662% — KevSlashNull:kev-ignore-paren into abice:master

@abice
abice merged commit 9b3b21d into abice:master Jul 9, 2026
6 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.

4 participants