Skip to content

Conversation

@develatter
Copy link
Contributor

Summary
Add support for the underscore character in the pattern parser's name production so identifiers like thread_id parse correctly.

Root cause
The parser validated identifier characters using only is_alphanumeric(), which rejects _. That caused parse errors for names containing underscores.

Changes

  • Accept ch == '_' as a valid name character in src/encode/pattern/parser.rs.
  • Update/add tests for identifiers such as thread_id.

Testing
All updated tests pass locally.

Related to #431

@develatter develatter mentioned this pull request Nov 11, 2025
@estk
Copy link
Owner

estk commented Nov 14, 2025

Excellent work @develatter, and thanks so much for this. Looks like there is a lint change that you'll need to make. Also it looks like i need to decide what to do with indexmap/min rustc version. Once I figure that out I'll have you rebase on my changes.

Thanks again!

@develatter
Copy link
Contributor Author

Hello @estk ! I made the lint change, should I make the PR now or wait for you to tell me to do it with your changes rebased on?

Add support for the '_' character in the parser's "name" production so identifiers
like "thread_id" parse correctly. This updates the pattern parser to treat
underscore as a valid name character.

Changes:
- Modified src/encode/pattern/parser.rs to accept '_' in names.
- Updated/added tests related to thread_id and name parsing.

No breaking API changes. Related to estk#431.
@estk estk force-pushed the fix-issue-431-thread-id branch from d19bf5f to 33a1d2d Compare November 15, 2025 06:06
@estk estk enabled auto-merge (rebase) November 15, 2025 06:08
@estk estk merged commit 47a25f6 into estk:main Nov 15, 2025
13 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.

2 participants