Skip to content

fix: ignore parenthesis in value comments#311

Open
KevSlashNull wants to merge 1 commit intoabice:masterfrom
KevSlashNull:kev-ignore-paren
Open

fix: ignore parenthesis in value comments#311
KevSlashNull wants to merge 1 commit intoabice:masterfrom
KevSlashNull:kev-ignore-paren

Conversation

@KevSlashNull
Copy link
Copy Markdown

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 2 times, most recently from bdcec66 to 81a5e78 Compare May 2, 2026 21:39
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).
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.

1 participant